JohannesHoppe / angular-date-value-accessor

Home of the Angular DateValueAccessor for <input type="date">
http://johanneshoppe.github.io/angular-date-value-accessor/
MIT License
78 stars 19 forks source link

allow type time and datetime-local #15

Closed La-source closed 3 years ago

La-source commented 4 years ago

Hello,

I wanted to use the directive on a datetime-local type input unfortunately I got the error:

InvalidStateError: Failed to set the 'valueAsDate' property on 'HTMLInputElement': This input element does not support Date values.

Whereas this input is quite a date type input. It will be very useful to be able to bear it.

JohannesHoppe commented 4 years ago

Can you provide a full example on stackblitz?

La-source commented 4 years ago

https://stackblitz.com/edit/angular-cfkhwi

I work with Google Chrome (version 79) to test the stackblitz link I use edge to confirm access and I see that on Edge it works well ...

JohannesHoppe commented 4 years ago

source: https://medium.com/@jonrimmer/fun-with-input-type-datetime-local-291bc29fac3c

As stated, datetime-local is not designed to have a valueAsDate property. The support of datetime-local is definitely not a functionality I need. But if you find a nice other solution, I would be happy to merge it.

JohannesHoppe commented 3 years ago

reactive-works-local

The latest version finally ships with support for timezone / local dates! The new accessor is called LocalDateValueAccessor. Read more at:

https://github.com/JohannesHoppe/angular-date-value-accessor/releases/tag/v.1.2.0