diff --git a/content/applications/studio/fields.rst b/content/applications/studio/fields.rst index 7814ff7c573..e9c76d622b1 100644 --- a/content/applications/studio/fields.rst +++ b/content/applications/studio/fields.rst @@ -190,8 +190,9 @@ Date (`date`) The :guilabel:`Date` field is used to select a date on a calendar. -- :guilabel:`Remaining Days`: the remaining number of days before the selected date is displayed - (e.g., *In 5 days*), based on the current date. This field should be set to :guilabel:`Read only`. +- :guilabel:`Relative Date`: expresses the field value in relation to the current date using + relative terms such as :guilabel:`Yesterday`, :guilabel:`Today`, :guilabel:`In 3 days`, + :guilabel:`2 months ago`, etc. This field should be set to :guilabel:`Read only`. .. example:: @@ -255,13 +256,6 @@ To add a date range: .. image:: fields/date-time-examples.png :alt: Examples of Date & Time fields with different widgets -Remaining Days (`remaining_days`) -********************************* - -The :guilabel:`Remaining Days` widget displays the remaining number of days before the selected date -(e.g., *In 5 days*), based on the current date and time. This field should be set to :guilabel:`Read -only`. - .. _studio/fields/simple-fields-checkbox: Checkbox (`boolean`) diff --git a/content/applications/studio/fields/date-examples.png b/content/applications/studio/fields/date-examples.png index 4afacc9ec6e..fcc23edc288 100644 Binary files a/content/applications/studio/fields/date-examples.png and b/content/applications/studio/fields/date-examples.png differ diff --git a/content/applications/studio/fields/date-time-examples.png b/content/applications/studio/fields/date-time-examples.png index d6b8bc72ba4..3a28105deb6 100644 Binary files a/content/applications/studio/fields/date-time-examples.png and b/content/applications/studio/fields/date-time-examples.png differ diff --git a/content/developer/reference/frontend/javascript_reference.rst b/content/developer/reference/frontend/javascript_reference.rst index 364f786f274..4c88206cf43 100644 --- a/content/developer/reference/frontend/javascript_reference.rst +++ b/content/developer/reference/frontend/javascript_reference.rst @@ -808,10 +808,18 @@ Date Range (`daterange`) -Remaining Days (`remaining_days`) +Relative Date (`relative_date`) This widget can be used on date and datetime fields. In readonly, it displays - the delta (in days) between the value of the field and today. The widget turns - into a regular date or datetime field in edit mode. + a human-readable relative calendar string computed from the difference between + the field value and today (e.g. *"yesterday"*, *"today"*, *"in 3 days"*, + *"next month"*). The exact format depends on the magnitude of the difference: + + - Within ±30 days: the unit is forced to *days* (e.g. *"in 5 days"*, *"3 days ago"*). + - Between 31 and 99 days: Luxon picks the most appropriate unit automatically + (e.g. *"next month"*, *"2 months ago"*). + - Beyond ±99 days: the widget falls back to the formatted date string. + + In edit mode the widget falls back to a regular date/datetime field. - Supported field types: `date`, `datetime`