Browse Source

Merge 6cb33c664b into dff1d64a13

pull/685/merge
Stephan Rozendaal 5 years ago
committed by GitHub
parent
commit
e996e25398
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      web_widget_datepicker_options/static/src/js/datepicker.js

32
web_widget_datepicker_options/static/src/js/datepicker.js

@ -24,35 +24,19 @@ odoo.define('web_widget_datepicker_options', function (require) {
var core = require('web.core');
var DateTimeWidget = require('web.datepicker').DateTimeWidget;
var DateWidget = require('web.datepicker').DateWidget;
DateTimeWidget.include({
start: function(parent, options) {
this._super.apply(this, arguments);
var self = this;
if (this.__parentedParent.options.datepicker) {
var options = this.__parentedParent.options.datepicker;
$.each(options, function(value, key) {
self.options[value] = key;
self.picker[value] = key;
self.picker.options[value] = key;
});
}
},
});
DateWidget.include({
start: function(parent, options) {
init: function(parent, options) {
this._super.apply(this, arguments);
var self = this;
if (this.__parentedParent.options.datepicker) {
var options = this.__parentedParent.options.datepicker;
$.each(options, function(value, key) {
self.options[value] = key;
self.picker[value] = key;
self.picker.options[value] = key;
});
if (self.__parentedParent.options instanceof Object) {
if (self.__parentedParent.options.datepicker instanceof Object) {
var options = this.__parentedParent.options.datepicker;
$.each(options, function(value, key) {
self.options[value] = key;
});
}
}
},
});

Loading…
Cancel
Save