-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add custom timezone support to moment localizer #2406
base: master
Are you sure you want to change the base?
Conversation
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.
I like the track you're on, but unfortunately this will not work. It assumes that all users of Big Calendar, using moment
, are also using moment-timezone
. Many implementations only use moment
without timezone support, so initializing a date with moment.tz()
will fail for them, as they don't have the necessary dependencies to extend moment
.
A better option might be to
- If
timezone
is passed as an argument, then - test if
moment.tz
is a thing, and - if not, log a console error, but gracefully ignore, and use
moment()
on it's own
I changed according to your review @cutterbl |
@ariel22411 One final request here is to add an example to the documentation, in using the |
sorry for the delay, now its okay? @cutterbl |
We've been using this for months, and it has been working great. But now we are having issues on the calendar week view for dates on the week of dst, where the time gutter is off by 1 hour. Please let us know if anyone experienced this issue, and has a fix or workaround @samopus1io @canopus1io |
here are a couple code sandbox examples: there are two localizer versions to compare here (moment-tz is the localizer in this PR, moment-tz modified is with one tweak that seems to fix the gutter time labels) |
@ariel22411 thoughts on this change? (only seems to be different when DST shift is not included in displayed time range for the week) |
The next problem is the DST slots time: (see if you can help me with that) @cutterbl |
Add a custom timezone to moment localizer
#2400