-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix: deprecated strftime with IntlDateFormatter #35
Conversation
Thanks! Is this intentionally still a draft? |
I'm not really familiar with php, so I assumed there would be things that can be improved. Also, I was rushing a little and did not check what the GitHub draft feature is actually used for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! Do you use this already on a site somewhere (and everything works)?
I noticed that some changes replaced the old tab indentation with spaces. Could you please change the indentation back to tabs?
I use it on https://hog-neppendorf.de |
The date and time fields of the data structure are assumed to be stored including the respective timezone. Hence, when creating the Unix timestamp from the fields the timezone must be respected, so the IntlDateFormatter can format the string correctly. Instead of strtotime() it is now using the DateTime constructor with a timezone (from date_default_timezone_get()) as argument. Alternatively, one could store the beginTimestamp directly as DateTime(Immutable) object.
… integers. Getters still give the Unix timestamp for backward compatibility.
7ebffca
to
2949dd3
Compare
The right timezone seems to be already used implicitly, so it must not be applied additionally.
Hey @mzur do you think that this PR is ready to be merged? |
@rmeister Does everything work for you now? |
Yes, looks good so far :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
A little band-aid for the deprecation of strftime.