17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 3483 Views |
-
Re: Dates showing as 1969! Please help!

9 October 2008 at 4:33pm Last edited: 9 October 2008 4:36pm
You might find Date as a field name is a clash with a mysql reserved word.
try using
"PostDate" => "Date"
$fields->addFieldToTab('Root.Content.Main', new CalendarDateField(PostDate, 'Date'), 'Content');
the do a flush and see if it works.. remember to change the $Date to $PostDate in your template.
-
Re: Dates showing as 1969! Please help!

9 October 2008 at 6:34pm
It looks all good to me. Anyways, try
instead ofnew CalendarDateField('Date')
and populate the default using the following code:new CalendarDateField('Date', 'Date')
public function populateDefaults(){
parent::populateDefaults();
$this->Date = date("Y-m-d H:i:s",time());
}
| 3483 Views | ||
| Go to Top |

