fix: validation in date range while parsing
This commit is contained in:
parent
e5bc96d4d8
commit
4bc544bb0b
1 changed files with 2 additions and 1 deletions
|
|
@ -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(',');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue