I have some problems with time fields (and tried different solutions, perhaps messing everything).
To avoid showing 01-01-1970 when the field is NULL, i entered, in the application delegate class for the table :
- Code: Select all
function data_intervento__display(&$record){
if ($record->val('data_intervento') == NULL){
return "";
}
else {
return date('d-m-Y', strtotime($record->strval('data_intervento')));
}
}
and everything (in list and details views) works well.
switching to the edit view i had some problems: the date was always on the format Y-m-d; so i changed the setting in fields.ini for the widget:
- Code: Select all
[data_intervento]
widget:type=calendar
widget:ifFormat = %d-%m-%Y
but now i get a messy situation:
- when i enter the day with the calendar the field space is formatted good. (it lacks the red square, though, and it's a required field)
for example if i enter the date of today, the field gets filled with 04-09-2012
-when i click on save, the field shows 2012-09-04.
this would be acceptable (not a great issue, come on), but..
if i now click on the calendar widget, it shows the date 05-03-2010 as a preselected date. mmmhhh.
if i comment out the calendar widget in fields.ini this strange calendar behaviour disappears, but of course i would get, in the edit view, the format Y-m-d.
any suggestions, ideas on why this happens? i really can't get a clear view of the situation
Thanks,
Paolo