[rt-users] Search Show Results

Stephen Turner sturner at MIT.EDU
Wed Mar 16 11:03:12 EST 2005


At Wednesday 3/16/2005 10:41 AM, Krasavin Andrey wrote:

>Now i have date format like "Wed Marth 16 18:48:14 2005". But i
>want format like "16 Marth 2005 18:48:14" Is it possible?


You can add your own date format by adding a callback - here's an example 
that enables a short date format (MM/DD/YYYY) and an ISO date format for 
Created:

This needs to go in a callback file named:

$RT_HOME/local/html/Callbacks/<site-specific-string>/Elements/RT__Ticket/ColumnMap/ColumnMap 



%# BEGIN callback file

<%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>

%# END callback file



Steve




More information about the rt-users mailing list