Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

fix(calendar, datepicker): fix issues with GMT+X timezones #12004

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

Splaktar
Copy link
Contributor

PR Checklist

Please check that your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added or this is not a bug fix / enhancement
  • Docs have been added, updated, or were not required

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

When local timezone is GMT+X, (i.e. +5:00) using ng-model-options to specify the timezone causes the previous day to be selected.

Issue Number:
Fixes #12000

What is the new behavior?

  • fix issues with GMT+X timezones by avoiding timezone conversions when local timezone is GMT+x. We let the existing utilities for converting dates to midnight handle things since the date doesn't need to change in those cases, just the hours.
  • simplify $$mdDateUtil.removeLocalTzAndReparseDate()

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

We don't have the capability to change the device's timezone between tests.

@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Aug 28, 2020
@Splaktar Splaktar self-assigned this Aug 28, 2020
@Splaktar Splaktar added this to the 1.2.1 milestone Aug 28, 2020
@Splaktar Splaktar added i18n: localization This issue is related to internationalization P2: required Issues that must be fixed. type: bug pr: merge ready This PR is ready for a caretaker to review labels Aug 28, 2020
@Splaktar Splaktar requested a review from wagnermaciel August 31, 2020 17:47
Copy link
Contributor

@wagnermaciel wagnermaciel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

- simplify `$$mdDateUtil.removeLocalTzAndReparseDate()`

Fixes #12000
@Splaktar Splaktar force-pushed the datepicker-fix-gmt+tz-issues-in-master branch from 247fccd to 640946c Compare August 31, 2020 18:31
@Splaktar Splaktar added the pr: lgtm This PR has been approved by the reviewer label Aug 31, 2020
@Splaktar Splaktar merged commit 90d24cf into master Aug 31, 2020
@Splaktar Splaktar deleted the datepicker-fix-gmt+tz-issues-in-master branch August 31, 2020 18:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ i18n: localization This issue is related to internationalization P2: required Issues that must be fixed. pr: lgtm This PR has been approved by the reviewer pr: merge ready This PR is ready for a caretaker to review type: bug
Projects
None yet
3 participants