fix: validation in date range while parsing

This commit is contained in:
Shariq Ansari 2022-06-14 18:40:36 +05:30
parent e5bc96d4d8
commit 4bc544bb0b

View file

@ -41,9 +41,10 @@ frappe.ui.form.ControlDateRange = class ControlDateRange extends frappe.ui.form.
this.set_mandatory && this.set_mandatory(value);
}
parse(value) {
if (!value || (value && !value.includes('to'))) return value;
// replace the separator (which can be in user language) with comma
const to = __('{0} to {1}').replace('{0}', '').replace('{1}', '');
value = value.replace(to, ',');
value = value && value.replace(to, ',');
if(value && value.includes(',')) {
var vals = value.split(',');