From e166211a664e5c1f16fe55e42730096ac17c756c Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 25 Feb 2022 11:29:36 -0700 Subject: [PATCH] Fix required dates always failed as empty --- api/js/etemplate/Et2Date/Et2Date.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Date/Et2Date.ts b/api/js/etemplate/Et2Date/Et2Date.ts index 30866d3f83..e1dc771c98 100644 --- a/api/js/etemplate/Et2Date/Et2Date.ts +++ b/api/js/etemplate/Et2Date/Et2Date.ts @@ -337,7 +337,9 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl { if(!value || value == 0 || value == "0") { - value = ''; + value = ""; + this.modelValue = ""; + return; } // Handle timezone offset, flatpickr uses local time let date = new Date(value); @@ -350,6 +352,7 @@ export class Et2Date extends Et2InputWidget(FormControlMixin(ValidateMixin(LitFl { this.setDate(formatDate); } + this.modelValue = formatDate.toISOString(); } getValue()