[rt-users] Formatting a Due column on ticket listings

Fran Fabrizio fran at cis.uab.edu
Sun Mar 7 22:04:10 EST 2004


Seeing that the TimeLeft column wasn't functional on my ticket listings 
(always has a value of 0 whether or not the ticket has a due date), I 
decided to try to replace this column with the value of the Due column.  I 
got the basic idea working, but I would like to clean up the column a 
bit.  How would I make the template output something more like

March 7, 2004

instead of

2004-04-04 06:00:00

I figure there's two places this could be done: in the SQL call itself, and 
in the template via some formatting function.  I'm assuming (perhaps 
wrongly but some simple greps seemed to indicate this) that the SQL is 
generated dynamically in some abstraction layer and that it would be easier 
to do this in the template.  A scan of the Mason docs did not produce any 
sort of function reference (I've never looked at Mason before - I assume 
like other template systems that there's a set of standard functions 
provided to the templates, some of which are usually suitable for 
formatting dates).

So, what approach should I take here?  As an aside, I would also like this 
to not display anything if there's no real due date - right now it displays 
the default 1970 date even though the db schema indicates that this column 
should default to NULL.

Also, this is still sort of a hack - I would really like to have it say "3 
days left", but since it appears that the TimeLeft functionality is not 
working (RT 3.0.9), I'm not sure how hard this would be to implement.  I 
would have to do something like Due - now() and get the result in 
days.  Again, without access to the SQL layer, I wouldn't know where to 
look for this.  Approaches to take for this also appreciated.

Thanks,
Fran

PS - Is much of the RT2 Hacker's Guide still applicable to RT3?



Fran Fabrizio
Senior Systems Analyst
Department of Computer and Information Sciences
University of Alabama - Birmingham
fran at cis.uab.edu
(205) 934-0653 


More information about the rt-users mailing list