You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
datepicker: md-calendar panel should respect ng-model-options #10598
Details:
Click the down arrow or the calendar icon to see that the previous day is shown as selected in the calendar view rather than the specified day.
AngularJS Versions: *
AngularJS Version:1.6.4
AngularJS Material Version:1.1.3
Additional Information:
Browser Type: *Chrome
Browser Version: *57.0.2987.133
OS: *MacOS
Stack Traces:NA
Reacted by menya, SocVi100, Muhammad Hafiz Hasan, barmaley443, AndreaBarbasso, Rajath M S, Brady Isom, Brad Marshall, Michael Prentice, Philippe Dore and 4 more
I'm hitting the same error since I updated to v1.1.4 yesterday. This wasn't happening on v1.1.1 so it may be a regression... On my timezone the datepicker show one day less than the actual date. @topherfangio I remember that this bug was solved some months ago, maybe it's been a bad merge lately?
@rajathms unfortunately no. I have noticed that this only happens when the control is initialized. Once you select a date, then all behaves as expected. There's obviously still a bug here but I don't know why it only happens on init. This behavior is in the codepen I posted above.
A small hack worked for me, i went and comment one line in angular-material.js ( this.focusAfterAppend.focus(); )
under this function
/** Generate and append the content for this month to the directive element. */
CalendarMonthBodyCtrl.prototype.generateContent = function() {
var date = this.dateUtil.incrementMonths(this.calendarCtrl.firstRenderableDate, this.offset);
this.$element
.empty()
.append(this.buildCalendarForMonth(date));
if (this.focusAfterAppend) {
this.focusAfterAppend.classList.add(this.calendarCtrl.FOCUSED_DATE_CLASS);
// this.focusAfterAppend.focus();
this.focusAfterAppend = null;
}
};
which worked for me, but i don't suggest you to do the same
I'm waiting for community to fix this bug.
Thank you.
changed the title [-]md-datepicker highlights wrong date with timezone and initialized model[/-][+]md-datepicker: panel highlights wrong date with timezone and initialized model[/+]on Jan 5, 2018
I have a CodePen with 1.1.1 and it shows that both the datepicker's input and panel show the wrong date.
In my 1.1.5 CodePen the input displays the proper date (taking into account ng-model-options="{ timezone: 'utc' }"), but the datepicker panel does not account for the ng-model-options="{ timezone: 'utc' }" and shows the wrong date.
So this isn't a regression, it's just that the last enhancement didn't quite go far enough.
changed the title [-]md-datepicker: md-calendar panel should respect ng-model-options[/-][+]datepicker: md-calendar panel should respect ng-model-options[/+]on May 5, 2020
This is fixed in master. Please try out the fix (before we release it) via npm install https://github.com/angular/bower-material#master --save or updating your package.json with "angular-material": "git+ssh://git@github.com/angular/bower-material.git#master",.
If you find any issues, please report them via GitHub issues ASAP.
Activity
SocVi100 commentedon Apr 26, 2017
I'm hitting the same error since I updated to v1.1.4 yesterday. This wasn't happening on v1.1.1 so it may be a regression... On my timezone the datepicker show one day less than the actual date.
@topherfangio I remember that this bug was solved some months ago, maybe it's been a bad merge lately?
rajathms commentedon Jun 28, 2017
@ericsvendsen @SocVi100 Guys you found the solution or a work around for it.
same issue here, material version 1.1.4
ericsvendsen commentedon Jun 28, 2017
@rajathms unfortunately no. I have noticed that this only happens when the control is initialized. Once you select a date, then all behaves as expected. There's obviously still a bug here but I don't know why it only happens on init. This behavior is in the codepen I posted above.
Regardless, I ended up just creating my own Angular datepicker control since I develop a lot of apps that rely solely on UTC.
jaybee7 commentedon Jul 24, 2017
rajathms commentedon Jul 25, 2017
@jaybee7 hello, i took some inputs from @ericsvendsen
A small hack worked for me, i went and comment one line in angular-material.js (
this.focusAfterAppend.focus();)under this function
which worked for me, but i don't suggest you to do the same
I'm waiting for community to fix this bug.
Thank you.
SocVi100 commentedon Jan 4, 2018
[-]md-datepicker highlights wrong date with timezone and initialized model[/-][+]md-datepicker: panel highlights wrong date with timezone and initialized model[/+]Splaktar commentedon Jan 5, 2018
Splaktar commentedon Jan 5, 2018
Splaktar commentedon Jan 5, 2018
I have a CodePen with 1.1.1 and it shows that both the datepicker's input and panel show the wrong date.
In my 1.1.5 CodePen the input displays the proper date (taking into account
ng-model-options="{ timezone: 'utc' }"), but the datepicker panel does not account for theng-model-options="{ timezone: 'utc' }"and shows the wrong date.So this isn't a regression, it's just that the last enhancement didn't quite go far enough.
25 remaining items
[-]md-datepicker: md-calendar panel should respect ng-model-options[/-][+]datepicker: md-calendar panel should respect ng-model-options[/+]Splaktar commentedon Jun 8, 2020
This is no longer blocked, but we need to fix #11919 before digging into this.
fix(datepicker): support ng-model-options timezone w/ Moment
fix(datepicker): support ng-model-options timezone w/ Moment
fix(datepicker): support ng-model-options timezone w/ Moment
fix(datepicker): support ng-model-options timezone w/ Moment
fix(datepicker): support ng-model-options timezone w/ Moment
Splaktar commentedon Jun 29, 2020
This is fixed in
master. Please try out the fix (before we release it) vianpm install https://github.com/angular/bower-material#master --saveor updating yourpackage.jsonwith"angular-material": "git+ssh://git@github.com/angular/bower-material.git#master",.If you find any issues, please report them via GitHub issues ASAP.