Skip to content

Commit 7be1f08

Browse files
authored
Merge pull request #11878 from brambrink/ufc/2212-date-clarify-reference-date
Date Picker improve reference date documentation
2 parents a0ed9cb + b7e3ae1 commit 7be1f08

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

‎content/en/docs/refguide/modeling/pages/input-widgets/date-picker.md‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,20 @@ The possible values for date format are shown below:
6363

6464
If you choose **Custom** as the date format (see above), this property determines how the value is formatted. The custom date format is a string that allows for any combination of symbols found in the table below. Any punctuation will be rendered literally.
6565

66-
{{% alert color="info" %}}
67-
When using `yyyy` custom format and typing `yy` in the date picker widget, the century guessing by proximity follows the rule of **50/50**. Specifically, it adjusts dates to be within 50 years before and 50 years after the time the date format instance is created:
68-
69-
* `24` {{< icon name="arrow-narrow-right" >}} `2024`
70-
* `75` {{< icon name="arrow-narrow-right" >}} `1975`
71-
{{% /alert %}}
66+
Custom date formats, as well as date handling in general, are tricky technologies with real business ramifications. Be aware of the following behaviors when using this widget:
67+
68+
* When the custom date format uses `yyyy`, the date picker also accepts a two-digit year (`yy`).
69+
* The date picker uses a reference date for parsing partial date inputs (for example `mm/dd` or `yy/mm/dd`) into complete date inputs `yyyy/mm/dd`. The reference date is the date from the value already in the field. If the field is empty, the current date is the reference date.
70+
* For two-digit year input, the date picker chooses the century that places the entered year closest to the reference year. If two years are equally close, it chooses the earlier year.
71+
* For example, with `2026` as the reference year (if the field previously contained a date in `1970`, entering `24` results in `1924`):
72+
* `24` {{< icon name="arrow-narrow-right" >}} `2024`
73+
* `75` {{< icon name="arrow-narrow-right" >}} `2075`
74+
* `76` {{< icon name="arrow-narrow-right" >}} `1976`
75+
* `97` {{< icon name="arrow-narrow-right" >}} `1997`
76+
* Even though a date picker with a custom date format is editable, the calendar drop-down button will only be shown if the custom format represents a full date (that is, the year [`y`–`yyyy`], month [`M`–`MMMM`], and day of month [`d`–`dd`] tokens are all present in the custom format).
7277

7378
{{% snippet file="/static/_includes/refguide/custom-date-format-tokens.md" %}}
7479

75-
{{% alert color="info" %}}
76-
Even though a date picker with a custom date format is editable, the calendar drop-down button will only be shown if the custom format represents a full date (that is, the year [`y`-`yyyy`], month [`M`-`MMMM`], and day of month [`d`-`dd`] tokens are all present in the custom format).
77-
{{% /alert %}}
78-
7980
#### Placeholder Text
8081

8182
The placeholder text is shown if the date value is empty. It can be used to give the end-user a hint as to the expected format.

0 commit comments

Comments
 (0)