Browse Source

[FIX] web_widget_timepicker: fix show current time when choose 0:00

pull/1274/head
JonathanOsAlc 6 years ago
parent
commit
0d0f21315a
  1. 4
      web_widget_timepicker/static/src/js/web_widget_timepicker.js

4
web_widget_timepicker/static/src/js/web_widget_timepicker.js

@ -25,7 +25,7 @@ odoo.define('web_widget_timepicker', function (require) {
setValue: function (value) { setValue: function (value) {
this.set({'value': value}); this.set({'value': value});
var formatted_value = value ? this._formatClient(value) : null;
var formatted_value = this._formatClient(value) || value;
this.$input.val(formatted_value); this.$input.val(formatted_value);
if (this.picker) { if (this.picker) {
var fdate = new moment(formatted_value, this.options.format); var fdate = new moment(formatted_value, this.options.format);
@ -36,7 +36,7 @@ odoo.define('web_widget_timepicker', function (require) {
getValue: function () { getValue: function () {
var value = this.get('value'); var value = this.get('value');
return value ? this._formatClient(value) : null;
return this._formatClient(value) || value;
}, },
changeDatetime: function () { changeDatetime: function () {

Loading…
Cancel
Save