mirror of
https://github.com/dzeiocom/FormManager.git
synced 2025-06-23 15:59:21 +00:00
Update default attr
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
@ -36,12 +36,12 @@ extends AbstractAttribute {
|
|||||||
return
|
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
|
// if element has a date,time,week type
|
||||||
let type = this.input.element.getAttribute("type") || ""
|
let type = this.input.element.getAttribute("type") || ""
|
||||||
if (type === "date" || type === "time" || type === "week") {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user