[rt-users] Date search results in ISO

Roy El-Hames rfh at pipex.net
Fri Nov 11 07:05:06 EST 2005


Thanks Stephen that did the trick for me -much easier than I originaly 
thought ..
in addition I modified
/opt/rt3/local/html/Search/Elements/BuildFormatString
Adding the CreatedISO within "my @fields"
 
Roy

Stephen Turner wrote:

> At Thursday 11/10/2005 01:32 PM, Roy El-Hames wrote:
>
>> Hi;
>>
>> Is there any straight simple way to convert (or get) Date fields in 
>> searches to be in yyyy-mm-dd (same as stored in database) or 
>> dd-mm-yyyy instead of day name of month etc .. ie I would like 
>> 10:30:23 10/11/2005 or 10:30:23 2005/11/10  instead of Thu Nov 1o 
>> 10:30:23 2005
>> or ist possible to import it to excel in that format..
>>
>> rt-3.4.4 , mod_perl2,apache2
>>
>> Thanks;
>
>
> We added a callback to do this for the Created date. Our formats are 
> mm/dd/yy and ISO. The callback file name is 
> Callbacks/xxx/Elements/RT__Ticket/ColumnMap/ColumnMap
>
> We didn't tweak the UI yet, so the only way to use these in our setup 
> is to go to the advanced search screen and type CreatedShort or 
> CreatedISO in the lower box that lists the result columns.
>
> Steve
>
>
> <%ARGS>
> $COLUMN_MAP => undef
> </%ARGS>
>
> <%init>
> $COLUMN_MAP->{'CreatedShort'} = {
>         title     => 'Created',
>         attribute => 'Created',
>         value     => sub {
>             my ($date, $time) = split(' ', $_[0]->CreatedObj->ISO);
>             my ($y, $m, $d) = split ('-', $date);
>
>             return "$m/$d/$y";
>         }
>     };
> $COLUMN_MAP->{'CreatedISO'} = {
>         title     => 'Created',
>         attribute => 'Created',
>         value     => sub { return $_[0]->CreatedObj->ISO }
>     };
>
> </%init> 
>




More information about the rt-users mailing list