format timestamp in 'headerFields'
Hello,
I have some headerFields that I display very well. My only problem is that I have a unixtimestamp that I whant to display as hour and minutes (like 13:05), but my_timestamp is displayed as "unixtimestamp" so just an integer.
How and where can I format "my_timestamp" to Date? It is normally simple like
Code:
date("H:m",$my_timestamp)
but I don't know where to write this code. I try to use "group_callback"(http://www.typolight.org/callbacks.html) but it will be working only in version 2.8 of Typolight !
Code:
// List
'list' => array
(
'sorting' => array
(
'mode' => 4,
'fields' => array('is_ok'),
'headerFields' => array('my_description', 'my_timestamp''),
'flag' => 5,
'panelLayout' => 'sort,search,limit',
'child_record_callback' => array('tl_test', 'list_test')
),
Thanks for help
Re: format timestamp in 'headerFields'
There was a ticket about this. I'm sorry for you but you will need to update to 2.8 anyway because it'll be fixed as from 2.8 on only...:)
Ticket: http://dev.typolight.org/issues/show/1540
Revision: http://dev.typolight.org/repositories/r ... olight/169
Re: format timestamp in 'headerFields'
This is easily fixed. Just add an entry into your ['fields'] array for 'tstamp'. You can specify the eval option to be date formatted and also the label to be used. Just DO NOT specify the inputType, otherwise it can become editable with a control. That's all you need. TL will take the value and format it using your spec. You can do this with any field you haven't actually allowed for editing, e.g. PID, ID, etc...
Re: format timestamp in 'headerFields'
yes we ask the modification for 2.8, it is ok now!
ticket closed
Re: format timestamp in 'headerFields'
yes, but my description works for installations pre-2.8 as well.
Re: format timestamp in 'headerFields'