From d648f7990f6012a22a6d9f861b8b5b6ebdbb4de9 Mon Sep 17 00:00:00 2001 From: Avior Date: Mon, 9 Dec 2019 14:14:19 +0100 Subject: [PATCH] Update default attr Signed-off-by: Avior --- src/attributes/DefaultAttribute.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/attributes/DefaultAttribute.ts b/src/attributes/DefaultAttribute.ts index 28639d8..e7513e4 100644 --- a/src/attributes/DefaultAttribute.ts +++ b/src/attributes/DefaultAttribute.ts @@ -36,12 +36,12 @@ extends AbstractAttribute { return } - let attrVal = this.input.element.getAttribute("data-default") + let attrVal = this.input.element.getAttribute("data-default") || undefined // if element has a date,time,week type let type = this.input.element.getAttribute("type") || "" if (type === "date" || type === "time" || type === "week") { - this.input.setValue(attrVal !== "" && attrVal !== null ? new Date(attrVal): new Date()) + this.input.setValue(attrVal !== "" && attrVal !== undefined ? new Date(attrVal): new Date()) return }