From 71334b13bd31c7f5a0c1704584b28274785f95e3 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 4 Jun 2018 11:35:02 +0100 Subject: [IMP] web: Expose datepicker configuration to view declarations The lower-level widget itself supports passing options to the underlying datepicker library. However this is not exposed to higher-level view declaration. With this patch, one can declare a field in a view such as: ```xml ``` That option would land in the widget and disable those weekdays. Documentation has been updated accordingly. Closes #25044. --- addons/web/static/src/js/fields/basic_fields.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/fields/basic_fields.js') diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index ac8ad02b24a..ba4169d2617 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -468,7 +468,13 @@ var FieldDate = InputField.extend({ * @private */ _makeDatePicker: function () { - return new datepicker.DateWidget(this, {defaultDate: this.value}); + return new datepicker.DateWidget( + this, + _.defaults( + this.nodeOptions.datepicker || {}, + {defaultDate: this.value} + ) + ); }, /** -- cgit v1.2.3