Updated DateInput to support a string

This commit is contained in:
Florian Bouillon 2019-10-08 17:37:50 +02:00
parent a9d86f6cae
commit 835a2747e8
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -8,7 +8,10 @@ import FMInput from "../FMInput"
*/
export default class FMDateInput extends FMInput {
setValue(value: Date) {
setValue(value: Date|string) {
if (typeof(value) == "string") {
value = new Date(value)
}
this.element.valueAsDate = value
}