-
Notifications
You must be signed in to change notification settings - Fork 3.4k
datepicker: min-date validation bug #11963
Comments
I am not able to reproduce this in a GMT-4 time zone at 6:30pm EDT. I could try changing my computer's time zone in order to test this, but I need to know what the local time is for you when you are able to reproduce this? |
Oh and for step 4, is that really two steps combined? I.e. select some other valid date, then reselect the min date again? |
The datepicker is malfunctioning on our personal app when local time is at midnight GMT+4. |
This is what I'm not clear on. Are these the steps for this step 4? 4a. Select another date However, I may be getting this wrong as it doesn't satisfy the "twice in a row" part of your description. |
No I mean twice in a row as in :
This is on the demo page. |
OK, that helps a lot thank you! I wasn't sure that I was doing it right, since I can't reproduce it. I think that we're going to have to change the calculation for all |
Hello, the 1.2.0 milestone seems a little big. As it is a regression from a fix done in the 1.1.24, in my opinion, it should be fixed in a 1.1.25 in order to finally have a 1.1 stable version. This issue is blocking the release of our product and we are not sure 1.2.0 will be stable enough because of its size. Can you please consider this possibility? |
Yes, I'll see about cherry picking this into a |
As an update, I investigated this a bit after setting my laptop to GMT+4. However, I was not able to come up with an acceptable solution in the time that I had. Then I had to get re-focused on the 1.2.0 release and RCs due to some scheduling priorities. I plan to revisit this after 1.2.0 final ships, with fixes being applied to both |
Hi, I looked deeper into the code and found that the problem we have is located in the method At the very first load of the page, the
As This completely mess up the component. The view value is If I replace this piece of code by:
Our component is working as expected. |
I don't understand the purpose of |
It appears that I can fix this by not doing the if (this.dateUtil.isValidDate(value) && timezone != null) {
this.date = this.dateUtil.removeLocalTzAndReparseDate(value);
} else {
this.date = value;
} |
That however, does not fix an issue where the stand-alone calendar and calender in a datepicker, when a date is clicked on (in a GMT+X timezone when using In this case, 6/19 is manually clicked upon in the stand-alone calendar and calender in the datepicker: In a GMT-X timezone, this works fine: But that appears to be a separate problem from this one, so I'll open a new issue. Update: #12000 opened for this issue. |
It supports custom date formatting with MomentJS (see #12006) in addition to fixing the date for GMT-X timezones when the date changes due to the timezone difference. |
Bug
In angular material 1.1.24, the datepicker directive sometimes invalidates a date if md-min-date is equal to selected date.
Demo and steps to reproduce the issue
Demo URL : https://material.angularjs.org/1.1.24/demo/datepicker#validations (Validations)
Detailed Reproduction Steps
Explain the expected behavior
md-min-date is supposed to be inclusive, so we expect 16/05/2020 to be always valid on 16/07/2020.
List the affected versions of AngularJS, Material, OS, and browsers
Add anything else we should know
We suspect method DateUtil.removeLocalTzAndReparseDate (introduced in commit) to be at the origin of the problem.
The text was updated successfully, but these errors were encountered: