Skip to content

Use defaultTimezone, when a time is already set. #343

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

Merged
merged 2 commits into from
Mar 23, 2012

Conversation

apepper
Copy link
Contributor

@apepper apepper commented Mar 23, 2012

  • New config field 'defaulTimezone'.

apepper added 2 commits March 23, 2012 10:13
* New config field 'defaulTimezone'.
…ings).

* Only do this, when using the localTimezone.
@apepper
Copy link
Contributor Author

apepper commented Mar 23, 2012

Also added daylight saving check, when date is change.

@trentrichardson
Copy link
Owner

Just asking to understand where this is coming from. I personally haven't worked with timezone's much, other users have contributed most of that part.

Earlier this week when I merged your changes I also added a this._defaults.timezone and set it to null. (not to be confused with this.timezone, which is the current stored value) Would that work? When it's null it will try to pull from browser, but if you pass in a timezone it will default to that.

Just curious, I don't mind merging if this is needed.

@apepper
Copy link
Contributor Author

apepper commented Mar 23, 2012

There are two cases:

  1. when no time is set so far - use the timezone of the browser
  2. when a time is already there, but no timezone is given - use the defaultTimezone.

When using this._defaults.timezone this will work for already present time sets without timezones. But if not time is given so far, it will also be used, because so far the check for local time is, if no timezone is set.

With this patch you can have both: a fixed timezone for all dates (using this._defaults.timezone) and a "preset" timezone for dates, that do not provide a timezone.

trentrichardson added a commit that referenced this pull request Mar 23, 2012
Use defaultTimezone, when a time is already set.
@trentrichardson trentrichardson merged commit 64ada98 into trentrichardson:dev Mar 23, 2012
@sayap
Copy link

sayap commented Mar 29, 2013

I am trying to make a local change so that clicking on "Now" would set the time to be the current time in the picker's timezone (if one is set), and this defaultTimezone option makes things really confusing. Consider that we don't have defaultHour, defaultMinute, etc, I am not too sure what does it bring to the table, especially with "+0000" being the default.

when a time is already there, but no timezone is given

Well, if the picker's timeFormat expects a timezone, the backend should just fill in a value with timezone. I don't think the frontend should worry about that.

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

Successfully merging this pull request may close these issues.

3 participants