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

ngModelOptions for date input using min attribute #11221

Closed
LRFalk01 opened this issue Mar 2, 2015 · 8 comments
Closed

ngModelOptions for date input using min attribute #11221

LRFalk01 opened this issue Mar 2, 2015 · 8 comments

Comments

@LRFalk01
Copy link

LRFalk01 commented Mar 2, 2015

I am running into an issue, and I am not sure if it is expected behavior or not. I would expect the min attribute on a date input to adjust to UTC when ngModelOptions is set for that, but it is not doing it. Below of a Plunker that outlines what I am talking about.

http://embed.plnkr.co/IjCPztKVsbERDJaNO160/preview

@LRFalk01
Copy link
Author

LRFalk01 commented Mar 3, 2015

I think this is probably an issue with the min and max validators not using the convertTimezoneToLocal function on value if timezone is set. (If the min and max attributes are supposed to adjust to the timezone in ngModelOptions.)

function createDateInputType(type, regexp, parseDate, format) {

@Narretz
Copy link
Contributor

Narretz commented Mar 22, 2015

@shahata can you take a look at this? Thanks!

@Narretz Narretz added this to the Ice Box milestone Mar 22, 2015
@shahata shahata self-assigned this Mar 23, 2015
@shahata
Copy link
Contributor

shahata commented Mar 23, 2015

Yeah, I'll take a look probably tomorrow

@SSARCandy
Copy link

is it still an issue?
I try the demo code but can't find out where is wrong?

@LRFalk01
Copy link
Author

Top input is invalid because min attribute sees the date as before the acceptable min date. The min/max attributes are not respecting ngModelOptions' timezone setting.

@SSARCandy
Copy link

I see.
I cannot find out wrong just because i'm at UTC +8
thanks !

@LRFalk01
Copy link
Author

Ohh. Yeah. I should have demo'd a max issue as well to cover both sides of UTC. Sorry.

@Narretz
Copy link
Contributor

Narretz commented Nov 23, 2017

Duplicate of #16342

@Narretz Narretz closed this as completed Nov 23, 2017
@Narretz Narretz marked this as a duplicate of #16342 Nov 23, 2017
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

4 participants