Closed ghost closed 7 years ago
Good point. Im not sure about the exact behviour. I would clear the value instead. I will fix that in a timely manner
(which means 1-2 weeks, since I need to finish a super-urgent project first)
I ended up using the following, as the dates being passed in were not true Date
objects:
writeValue(value: Date): void {
if (value != null) {
this._renderer.setElementProperty(this._elementRef.nativeElement, 'valueAsDate', new Date(value));
}
}
If it becomes necessary for my project, I'll do more work to check that the input value resolves to a valid Date
before attempting to set it.
closed by #5
Thanks! v0.0.2 is available on NPM. Please report any errors, if required.
My init value was null and writeValue failed.
i wrote if(value != null) this._renderer.setElementProperty(this._elementRef.nativeElement, 'valueAsDate', value);