fix: parse Today default value for date docfield

Co-authored-by: Sahil Khan <sahilkhan28297@gmail.com>
This commit is contained in:
Himanshu 2021-05-07 12:03:58 +05:30 committed by GitHub
parent 2b758a61b4
commit e737e2ea52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,9 +13,11 @@ frappe.ui.form.ControlDate = frappe.ui.form.ControlData.extend({
this._super(value);
if (this.timepicker_only) return;
if (!this.datepicker) return;
if(!value) {
if (!value) {
this.datepicker.clear();
return;
} else if (value === "Today") {
value = this.get_now_date();
}
let should_refresh = this.last_value && this.last_value !== value;