From 445a48c54ad87184425c5f460de262b31c1f0cae Mon Sep 17 00:00:00 2001 From: Martin Jagodic Date: Tue, 30 Jan 2024 16:13:28 +0100 Subject: [PATCH] fix: change datetime widget value format (#7072) - from 12-hour to 24-hour format - replace moment references in the docs #7066 Co-authored-by: Anze Demsar --- packages/decap-cms-widget-datetime/src/DateTimeControl.js | 2 +- website/content/docs/widgets/datetime.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/decap-cms-widget-datetime/src/DateTimeControl.js b/packages/decap-cms-widget-datetime/src/DateTimeControl.js index edff14f8d647..bd1c22b3a544 100644 --- a/packages/decap-cms-widget-datetime/src/DateTimeControl.js +++ b/packages/decap-cms-widget-datetime/src/DateTimeControl.js @@ -119,7 +119,7 @@ export default class DateTimeControl extends React.Component { this.handleChange(dayjs(e.target.value))} onFocus={setActiveStyle} onBlur={setInactiveStyle} diff --git a/website/content/docs/widgets/datetime.md b/website/content/docs/widgets/datetime.md index 5ab6c5eb242c..1b0386a5f7b7 100644 --- a/website/content/docs/widgets/datetime.md +++ b/website/content/docs/widgets/datetime.md @@ -7,12 +7,12 @@ The datetime widget translates a datetime picker to a datetime string. - **Name:** `datetime` - **UI:** datetime picker -- **Data type:** Moment.js-formatted datetime string +- **Data type:** [Day.js](https://day.js.org/)-formatted datetime string - **Options:** - `default`: accepts a datetime string, or an empty string to accept blank input; otherwise defaults to current datetime - - `format`: sets storage format; accepts Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/); defaults to raw Date object (if supported by output format) - - `date_format`: sets date display format in UI; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format. - - `time_format`: sets time display format in UI; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format, `false` hides time-picker. + - `format`: sets storage format; accepts [Day.js formats](https://day.js.org/docs/en/display/format); defaults to ISO8601 (if supported by output format) + - `date_format`: sets date display format in UI; boolean or [Day.js formats](https://day.js.org/docs/en/display/format). If `true` use default locale format. + - `time_format`: sets time display format in UI; boolean or [Day.js formats](https://day.js.org/docs/en/display/format). If `true` use default locale format, `false` hides time-picker. - `picker_utc`: _(default: `false`)_ when set to `true`, the datetime picker will display times in UTC. When `false`, the datetime picker will display times in the user's local timezone. When using date-only formats, it can be helpful to set this to `true` so users in all timezones will see the same date in the datetime picker. - **Example:** ```yaml