CharlesMx / mxCalendar

mxCalendar for ModX WCMS. Full event management with categories, repeating events, event list and calendar views.
http://www.charlesmx.com
18 stars 23 forks source link

Date calculation fails on win32 machines #152

Open bitwolfe opened 10 years ago

bitwolfe commented 10 years ago

Date calculation fails on windows because strftime("%u") is unsupported.

For example getEventCalendarDateRange() fails to calculate $startDOW and returns false.

Something like the below would work to be cross-platform. But I honestly haven't done enough testing to tell if that's a good solution, especially on unix. Seems weird to give a numeric value to strftime() though :/

$startDOW = strftime((($w = date("w", $mStartDate)) ? $w + 1 : 7), strtotime($mStartDate));

Seems to output the right date range on Windows however. (Well, with Monday as the first day of the week)