fix: Handle empty value of datetime control

This commit is contained in:
Suraj Shetty 2024-01-08 17:19:40 +05:30
parent 076687bdbf
commit 64e37ec046

View file

@ -16,7 +16,7 @@ frappe.ui.form.ControlDatetime = class ControlDatetime extends frappe.ui.form.Co
}
get_start_date() {
this.value = this.value == null ? undefined : this.value;
this.value = this.value == null || this.value == "" ? undefined : this.value;
let value = frappe.datetime.convert_to_user_tz(this.value);
return frappe.datetime.str_to_obj(value);
}