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

fix(datepicker): null model with timezone throws exception #12027

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

Splaktar
Copy link
Contributor

@Splaktar Splaktar commented Oct 5, 2020

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?

  • we don't verify that the model value is not null or undefined before accessing
    .getTimezoneOffset() and this causes an exception to be thrown in those cases

Issue Number:
Fixes #12025

What is the new behavior?

  • verify that the model value is not null or undefined before accessing
    .getTimezoneOffset()

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

- verify that the model value is not null or undefined before accessing
  `.getTimezoneOffset()`

Fixes #12025
@Splaktar Splaktar added this to the 1.2.2 milestone Oct 5, 2020
@Splaktar Splaktar self-assigned this Oct 5, 2020
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label Oct 5, 2020
@Splaktar Splaktar added P2: required Issues that must be fixed. type: bug i18n: localization This issue is related to internationalization labels Oct 5, 2020
@Splaktar Splaktar requested a review from annieyw October 5, 2020 18:38
@Splaktar Splaktar added the pr: lgtm This PR has been approved by the reviewer label Oct 5, 2020
@Splaktar Splaktar merged commit 7856883 into master Oct 5, 2020
@Splaktar Splaktar deleted the daatepicker-null-model-timezone branch October 5, 2020 18:47
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 type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datepicker: When initializing a datepicker with an empty value and timezone set in in ng-model-options an exception is thrown
3 participants