-
Notifications
You must be signed in to change notification settings - Fork 6.7k
min-date attribute does not disable the day prior to the given min-date #3437
Comments
If you use the date format you specified (MM/dd/yyyy - 01/02/2000) or bind to an actual date it works as expected. |
That's not noted in the documentation. I referred to the sample code snippet. I'll change that and report on the result. Changing my min-date/max-date to 01/01/2000 and 12/31/2099 worked as you described. However, I was not able to infer this from the documentation (2000-01-01 is the same thing as 01/01/2000, after all.) Would it be appropriate to open a different ticket to request that information be made clearer in the documentation? |
Let's give others a chance to comment, I'm not sure if that's the intended behavior or not. |
Actually, there is a bug here, if the input is a string, we're not parsing it with the format specified. I would've expected that this would be resolved by changing the format to Plunker with reproduction: |
I think my PR #3606 will cover this one. It considers the format when parsing the min-date and max-date. |
Can reproduce here. This looks like potentially a timezone bug because of the manual string conversion into a date object. |
* toISOString -> toJSON (equivalent) * date.setYear fix * fix test to capture date-format mismatch edge case in angular-ui#3437
Much of this boils down to how javascript interprets the
|
BREAKING CHANGE: only display formats or altInputFormats are valid for literal dates Closes angular-ui#3437
BREAKING CHANGE: only display formats or altInputFormats are valid for literal dates Closes angular-ui#3437
Reproduction Plunker can be found here
Steps to Reproduce:
In the reproduction plunker, observe that '2000-01-02' is pre-set as the min-date for the datepicker.
Click the text field to open the calendar
Navigate to January 2000
Observe that 1/1/2000 is selectable
Observed Results:
1/1/2000 is selectable, with a min-date of 1/2/2000.
Expected Results:
1/1/2000 should not be selectable, with a min-date of 1/2/2000.
The text was updated successfully, but these errors were encountered: