Could you support JSON value?
Closed this issue · 2 comments
ivancas84 commented
Material Angular Datepicker supports JSON values. It is easy to initialize directly from the database. Could you incorporate initialization through a JSON Date value?
For example: when you call:
this.control.setValue("2020-09-25T19:00:00-03:00")
you get:
ERROR TypeError: value.setSeconds is not a function
at MatTimepickerDirective.writeValue (mat-timepicker.js:917)
IliaIdakiev commented
@ivancas84 The control expects a Date object and providing a string won't work. You will need to do:
this.control.setValue(new Date("2020-09-25T19:00:00-03:00"));
ivancas84 commented
Ah ok. It's simple. Thanks!