[Typo3-dev] BE extension: date display conversion d-m-Y <==> unix seconds

Rainer (Rene) Suthoelder t3 at boswel-remove-me.de
Tue Feb 22 22:27:03 CET 2005


hi!
perhaps someone of you can give a hint to solve this:

i have to debug a BE extension that is to display dates gathered from 
another table.

now, when i want to display these db records (i.e. dates) in the BE 
extension as a list, instead of the date formated like this d-m-Y H:i:s i 
get the Unix time in seconds like this 1108249200. if i take this value and 
convert it, it gives indeed 13-02-2005 00:00:00.

i thought that the "eval" => "date" would take care of that conversion, but 
obviously, it doesn't.

===============
ext_tables.php:

$TCA["tx_mytest_exeptions"] = Array (
 "ctrl" => Array (
  "title" => "LLL:EXT:my_test/locallang_db.php:tx_mytest_exeptions",
  "label" => "mydate",
  "tstamp" => "tstamp",
  "crdate" => "crdate",
  "cruser_id" => "cruser_id",
  "readOnly" => 1,
  "dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
  "iconfile" => 
t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_mytest_events_x.gif",
 ),
 "feInterface" => Array (
  "fe_admin_fieldList" => "hidden, mydate",
 )
);
===============
tca.php:

$TCA["tx_my_test_exeptions"] = Array (
 "ctrl" => $TCA["tx_my_test_exeptions"]["ctrl"],
 "interface" => Array (
  "showRecordFieldList" => ""
 ),
 "feInterface" => $TCA["tx_my_test_exeptions"]["feInterface"],
 "columns" => Array (
  "event" => Array (
   "exclude" => 0,
   "label" => "LLL:EXT:mytest/locallang_db.php:tx_my_test_exeptions.event",
   "config" => Array (
    "type" => "select",
    "foreign_table" => "tx_my_test_events",
    "foreign_table_where" => "ORDER BY tx_my_test_events.uid",
    "size" => 1,
    "minitems" => 0,
    "maxitems" => 1,
   )

  ),
  "mydate" => Array (
  "exclude" => 0,
  "label" => 
"LLL:EXT:mytest/locallang_db.php:tx_my_test_exeptions.exeptdate",
  "config" => Array (
   "type" => "input",
   "size" => "8",
   "max" => "20",
   "eval" => "date",
   "checkbox" => "0",
   "default" => "0"
   )
  ),
===============

so: is there a way to have the mydate value pre/post-processed before being 
sent to the BE screen?

thanks,

rainer






More information about the TYPO3-dev mailing list