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

feat(calendar): support specifying timezone in ng-model-options #11906

Merged
merged 1 commit into from
May 15, 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?

[ ] Bugfix
[x] 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?

For a case like

<md-calendar ng-model="calendarDate" ng-model-options="{timezone: 'UTC'}"></md-calendar>

A binding like {{calendarDate|date:"dd/MMMM/yyyy HH:mm Z":"UTC"}} should give you a midnight-aligned date in the UTC timezone. However, it does not. This is inconsistent with the md-datepicker.

Issue Number:
Fixes #10431

What is the new behavior?

  • support specifying timezone in ng-model-options
  • remove calls to focusAfterAppend.focus() from both monthBody and yearBody
    • as these were breaking initial scrolling in day mode and selection in month mode
  • fix cases where functions were being called with string or timestamp arguments
    • when they only accepted Date arguments
  • add event types when calling $setViewValue()
  • rename CalendarCtrl.focus() to CalendarCtrl.focusDate() to be more clear
    • and to avoid conflicts when analyzing code
  • fix a number of JSDoc issues with types
  • remove special initialization code from Calendar

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This issue and fix are blocking a related issue regarding the integration of md-datepicker and md-calendar: #10598

@Splaktar Splaktar self-assigned this May 12, 2020
@googlebot googlebot added the cla: yes PR author has signed Google's CLA: https://opensource.google.com/docs/cla/ label May 12, 2020
@Splaktar Splaktar added this to the 1.1.23 milestone May 12, 2020
@Splaktar Splaktar added P2: required Issues that must be fixed. needs: review This PR is waiting on review from the team labels May 12, 2020
@Splaktar Splaktar requested a review from mmalerba May 12, 2020 00:57
@Splaktar Splaktar added i18n: localization This issue is related to internationalization type: enhancement ux: integration labels May 12, 2020
@Splaktar Splaktar requested a review from crisbeto May 12, 2020 01:00
- remove calls to `focusAfterAppend.focus()` from both monthBody and yearBody
  - as these were breaking initial scrolling in day mode and selection in month mode
- fix cases where functions were being called with string or timestamp arguments
  - when they only accepted `Date` arguments
- add event types when calling `$setViewValue()`
- rename `CalendarCtrl.focus()` to `CalendarCtrl.focusDate()` to be more clear
  - and to avoid conflicts when analyzing code
- fix a number of JSDoc issues with types
- remove special initialization code from Calendar
  - it was working around #8585, which is now fixed

Fixes #10431
@Splaktar Splaktar force-pushed the calendar-ng-model-options branch from 3f16d33 to ad2d394 Compare May 12, 2020 01:26
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

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

LGTM

@Splaktar Splaktar added pr: lgtm This PR has been approved by the reviewer pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team labels May 15, 2020
@Splaktar Splaktar merged commit 2a01746 into master May 15, 2020
@Splaktar Splaktar deleted the calendar-ng-model-options branch May 15, 2020 18:45
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: enhancement ux: integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

calendar: doesn't handle timezone from ng-model-options
3 participants