codefog / contao-haste

Haste is a collection of tools and classes to ease working with Contao
http://codefog.pl/extension/haste.html
MIT License
43 stars 24 forks source link

Saving Event startTime / endTime correct #111

Closed SGehle closed 7 years ago

SGehle commented 7 years ago

There is a problem with an event, using $objForm->bindModel(). The Date of the Timestamp for startTime / endTime is 01/01/1970 instead of startTime / endTime Date. My workaround:

if($objEvent->startTime) { $objEvent->startTime = strtotime(date('Y-m-d', $objEvent->startDate). " ".date('H:i', $objEvent->startTime)); }

qzminski commented 7 years ago

That is not a bug but a special way the Contao handles the event date saving, so it is correct to use custom code here. https://github.com/contao/core/blob/master/system/modules/calendar/dca/tl_calendar_events.php#L849