Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date calculation fails on win32 machines #152

Open
bitwolfe opened this issue Mar 1, 2014 · 0 comments
Open

Date calculation fails on win32 machines #152

bitwolfe opened this issue Mar 1, 2014 · 0 comments

Comments

@bitwolfe
Copy link

bitwolfe commented Mar 1, 2014

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants