@@ -667,6 +667,9 @@ Char (`char`)
667
667
Date (`date `)
668
668
This is the default field type for fields of type `date `. It consists of a text
669
669
box and a date picker.
670
+ The field will show the date in a readable format like this: `Dec 19, 1997 `.
671
+ The year will be hidden if it's the current one. When editing the field, the numeric format
672
+ will be shown. This format corresponds to the one set in the current language.
670
673
671
674
- Supported field types: `date `
672
675
@@ -680,17 +683,26 @@ Date (`date`)
680
683
681
684
<field name =" datefield" options =" {'min_date': 'today', 'max_date': '2023-12-31'}" />
682
685
683
- - warn_future: displays a warning if the value is in the future (based on today).
686
+ - ` warn_future ` : displays a warning if the value is in the future (based on today).
684
687
685
688
.. code-block :: xml
686
689
687
690
<field name =" datefield" options =" {'warn_future': true}" />
688
691
692
+ - `numeric `: when set to true, it shows the date in the format set on the current language.
693
+ (default: `false `).
694
+
695
+ .. code-block :: xml
696
+
697
+ <field name =" datefield" options =" {'numeric': true}" />
698
+
689
699
.. _reference/javascript_reference/datetime_field :
690
700
691
701
Date & Time (`datetime `)
692
702
This is the default field type for fields of type `datetime `. The values are always
693
- in the client's timezone.
703
+ in the client's timezone. The displayed format has the same behaviour as the date
704
+ field, see :ref: `Date Field <reference/javascript_reference/date_field >` description.
705
+ The readable format looks like this: `Dec 19, 1997, 10:45 AM `.
694
706
695
707
- Supported field types: `datetime `
696
708
@@ -706,13 +718,13 @@ Date & Time (`datetime`)
706
718
707
719
<field name =" datetimefield" options =" {'rounding': 10}" />
708
720
709
- - `show_seconds `: when set to false , it hides the seconds from the datetime field.
710
- The field will still accept datetime values, but the seconds will be hidden in
711
- the UI (default: `true `).
721
+ - `show_seconds `: when set to true , it shows the seconds from the datetime field.
722
+ The field will still accept datetime values, but the seconds will be shown in
723
+ the UI (default: `false `).
712
724
713
725
.. code-block :: xml
714
726
715
- <field name =" datetimefield" widget =" datetime" options =" {'show_seconds': false }" />
727
+ <field name =" datetimefield" widget =" datetime" options =" {'show_seconds': true }" />
716
728
717
729
- `show_time `: when set to false, it hides the time part from the datetime field.
718
730
The field will still accept datetime values, but the time part will be hidden in
@@ -722,6 +734,14 @@ Date & Time (`datetime`)
722
734
723
735
<field name =" datetimefield" widget =" datetime" options =" {'show_time': false}" />
724
736
737
+ - `show_date `: when set to false, it hides the date part from the datetime field.
738
+ The field will still accept datetime values, but the date part will be hidden in
739
+ the UI (default: `true `).
740
+
741
+ .. code-block :: xml
742
+
743
+ <field name =" datetimefield" widget =" datetime" options =" {'show_date': false}" />
744
+
725
745
Date Range (`daterange `)
726
746
This widget allows the user to select start and end date from a single picker.
727
747
0 commit comments