Hi, I need a timestamp value in my formControl and trying to implement it with your great useValueAsDate directive. (Thanks!!!)
I actually have updated writeValue() to update value in the view like this:
writeValue(value: number): void {
if (!value) {
this._renderer.setElementProperty(this._elementRef.nativeElement, 'value', null);
return;
}
this._renderer.setElementProperty(this._elementRef.nativeElement, 'valueAsDate', this.convertFromTimestamp(value));
}
convertFromTimestamp(value: number): Date {
return new Date(value);
}
but how to convert date value from input to model?
I realize that registerOnChange() should be updated, but how?
Does anybody have an ideas?
Hi, I need a timestamp value in my formControl and trying to implement it with your great useValueAsDate directive. (Thanks!!!) I actually have updated writeValue() to update value in the view like this:
but how to convert date value from input to model? I realize that registerOnChange() should be updated, but how? Does anybody have an ideas?