Please refer to this link:
- https://stackoverflow.com/a/49732675/1592107
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local
- http://plnkr.co/edit/9fy5Zt?p=preview
As per HTML5, you can use input type="datetime-local"
instead of input type="date"
.
It will allow the [(ngModel)]
directive to read and write value from input control.
Note: If the date string contains 'Z' then to implement above solution, you need to trim the 'Z' character from date.