[fix] datepicker defaults to now
This commit is contained in:
parent
69fac8f5e9
commit
2cae554596
1 changed files with 7 additions and 3 deletions
|
|
@ -547,9 +547,13 @@ frappe.ui.form.ControlTime = frappe.ui.form.ControlData.extend({
|
|||
|
||||
frappe.ui.form.ControlDatetime = frappe.ui.form.ControlDate.extend({
|
||||
set_datepicker: function() {
|
||||
this.datepicker_options.timeFormat = "HH:mm:ss";
|
||||
this.datepicker_options.dateFormat =
|
||||
(frappe.boot.sysdefaults.date_format || 'yy-mm-dd').replace('yyyy','yy');
|
||||
var now = new Date();
|
||||
$.extend(this.datepicker_options, {
|
||||
"timeFormat": "HH:mm:ss",
|
||||
"dateFormat": (frappe.boot.sysdefaults.date_format || 'yy-mm-dd').replace('yyyy','yy'),
|
||||
"hour": now.getHours(),
|
||||
"minute": now.getMinutes()
|
||||
});
|
||||
|
||||
this.$input.datetimepicker(this.datepicker_options);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue