Skip to content

feat: Allow date format preference in user interface settings#29321

Draft
webalexeu wants to merge 1 commit intoevcc-io:masterfrom
webalexeu:fix/date-format
Draft

feat: Allow date format preference in user interface settings#29321
webalexeu wants to merge 1 commit intoevcc-io:masterfrom
webalexeu:fix/date-format

Conversation

@webalexeu
Copy link
Copy Markdown
Contributor

@webalexeu webalexeu commented Apr 21, 2026

Adds a date format dropdown in User Interface settings with four options:

  • Auto: locale-native ordering (existing behavior, unchanged)
  • DD/MM/YYYY: day-first ordering
  • MM/DD/YYYY: month-first ordering
  • YYYY-MM-DD: ISO ordering

Month and weekday names always follow the UI locale regardless of the chosen ordering. The setting is persisted to localStorage.

fixes #21910

@webalexeu
Copy link
Copy Markdown
Contributor Author

Proposed improvement for #21910

@webalexeu webalexeu marked this pull request as draft April 21, 2026 20:55
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • In formatNumericDate, the ymd branch uses Intl.DateTimeFormat with only { month: 'numeric', day: 'numeric' }, so the year is never included; if you intend YYYY-MM-DD as per the comment, you likely need to construct that explicitly (similar to formatDayMonth) instead of relying on the en-CA locale.
  • The dateFormat setting is treated as a free-form string in multiple places; consider introducing a shared union type or enum (e.g. '' | 'dmy' | 'mdy' | 'ymd') to constrain and validate values across settings.ts, units.ts, and the formatter mixin.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `formatNumericDate`, the `ymd` branch uses `Intl.DateTimeFormat` with only `{ month: 'numeric', day: 'numeric' }`, so the year is never included; if you intend `YYYY-MM-DD` as per the comment, you likely need to construct that explicitly (similar to `formatDayMonth`) instead of relying on the en-CA locale.
- The `dateFormat` setting is treated as a free-form `string` in multiple places; consider introducing a shared union type or enum (e.g. `'' | 'dmy' | 'mdy' | 'ymd'`) to constrain and validate values across `settings.ts`, `units.ts`, and the formatter mixin.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Adds a date format dropdown in User Interface settings with four options:
- Auto: locale-native ordering (existing behavior, unchanged)
- DD/MM/YYYY: day-first ordering
- MM/DD/YYYY: month-first ordering
- YYYY-MM-DD: ISO ordering

Month and weekday names always follow the UI locale regardless of the
chosen ordering. The setting is persisted to localStorage via the
DateFormat union type ('' | 'dmy' | 'mdy' | 'ymd') shared across
settings, units and formatter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@andig andig added the ux User experience/ interface label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ux User experience/ interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Date format and 12/24 setting

2 participants