[rt-users] Date search results in ISO

Stephen Turner sturner at MIT.EDU
Thu Nov 10 13:42:00 EST 2005


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