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

[BUG] Input[date|time|datetime-local] min & max attributes ignore ngModelOptions timezone #16342

Closed
1 of 3 tasks
Swiftwork opened this issue Nov 23, 2017 · 2 comments
Closed
1 of 3 tasks

Comments

@Swiftwork
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • other

Current behavior:

Using ngModelOptions developers can set timezone for input[date|time|datetime-local] for parsers and formatters. However this does not affect min and max validation.
https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1475
https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1486
Parsers and formatters take timezone into account.
https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1445

Expected / new behavior:

Take timezone into account when validating minimum and maximum date spans.

Minimal reproduction of the problem with instructions:

Select 2013-12-31 if you aren't on UTC it should be invalid.
https://plnkr.co/edit/i88I219Wke77tdUSA3XF?p=preview

AngularJS version: 1.6.6

Browser: [all]

@Narretz
Copy link
Contributor

Narretz commented Nov 23, 2017

This has been reported before: #11221

Let's keep this issue because it's more succinct.

@Narretz
Copy link
Contributor

Narretz commented Nov 23, 2017

I've updated your demo to make it a bit easier to see - https://plnkr.co/edit/zHwbOVw5uI1f8xl9a7RY?p=preview
If you have timezone: UTC and a UTC date, then max should not be true, but in the demo it is.

m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 5, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 6, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 6, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 6, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 6, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 6, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 7, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Jan 7, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Feb 3, 2018
m-amr added a commit to m-amr/angular.js that referenced this issue Mar 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants