summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_reference.rst
diff options
context:
space:
mode:
authorJairo Llopis <yajo.sk8@gmail.com>2018-06-04 11:35:02 +0100
committerThibault Delavallée <tde@odoo.com>2018-06-13 14:53:11 +0200
commit71334b13bd31c7f5a0c1704584b28274785f95e3 (patch)
tree8ff26f26dd5180d1a6c4504701a881cdd8f37b24 /doc/reference/javascript_reference.rst
parent4d3debe2c328248a6c1643b278bd8170b2f016c0 (diff)
[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 <field name="datefield" options='{"daysOfWeekDisabled": [0, 6]}'/> ``` That option would land in the widget and disable those weekdays. Documentation has been updated accordingly. Closes #25044.
Diffstat (limited to 'doc/reference/javascript_reference.rst')
-rw-r--r--doc/reference/javascript_reference.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst
index b77aa9f5612..3c782ed00a8 100644
--- a/doc/reference/javascript_reference.rst
+++ b/doc/reference/javascript_reference.rst
@@ -1329,11 +1329,27 @@ order.
- Supported field types: *date*, *datetime*
+ Options:
+
+ - datepicker: extra settings for the datepicker_ widget.
+
+ .. code-block:: xml
+
+ <field name="datefield" options='{"datepicker": {"daysOfWeekDisabled": [0, 6]}}'/>
+
- datetime (FieldDateTime)
This is the default field type for fields of type *datetime*.
- Supported field types: *date*, *datetime*
+ Options:
+
+ - datepicker: extra settings for the datepicker_ widget.
+
+ .. code-block:: xml
+
+ <field name="datefield" options='{"datepicker": {"daysOfWeekDisabled": [0, 6]}}'/>
+
- monetary (FieldMonetary)
This is the default field type for fields of type 'monetary'. It is used to
display a currency. If there is a currency fields given in option, it will
@@ -1814,4 +1830,6 @@ Relational fields
.. _event delegation:
http://api.jquery.com/delegate/
+.. _datepicker: https://github.com/Eonasdan/bootstrap-datetimepicker
+
.. _deferred: http://api.jquery.com/category/deferred-object/