backdrop-contrib / fullcalendar_views

Views style plugin to render all sorts of date fields as event calendar with FullCalendar
https://backdropcms.org/project/fullcalendar_views
GNU General Public License v2.0
2 stars 4 forks source link

Support date string values in addition to timestamps #42

Closed indigoxela closed 2 months ago

indigoxela commented 3 months ago

When creating this module, my assumption was, that views date fields only support timestamps (like node->created), but that's actually not true.

It also supports conversion from date strings.

https://github.com/backdrop/backdrop/blob/1.x/core/modules/views/handlers/views_handler_field_date.inc#L74

So this module should handle them, too.

Otherwise one might end up with Warning: A non-numeric value encountered in FullcalendarViewsStyleCalendar->renderRow(), as we try to multiply a string then.

https://github.com/backdrop-contrib/fullcalendar_views/blob/1.x-1.x/views/fullcalendar_views_style_calendar.inc#L364

Funny, that I even mention the handler in the comment there, but didn't realize the strtotime() in its render function. :wink: