Skip to content

Respecting users language when formatting dates #8930

Description

@odzhychko

When formatting dates the users locale setting is used but not the language.

Proposed change

Keep using users locale to determine date formats.
But use the users language for translating the words (month and weekday names) in the formatted date.

Example

  • Given
    • User language "German"
    • User locale "English"
    • Date '2026-03-02'
  • When
  • Formatting date equivalent to Intl.DateTimeFormat(.., { dateStyle: 'full'})
  • Then (currently)
    • Resulted is Monday, March 2, 2026
  • Then (with proposed change)
    • Resulted is Montag, März 2, 2026

Note the result is not 'Montag, 2. März 2026' which would be the German format for { dateStyle: 'full'}.
Montag, März 2, 2026 is still the English format but with German words.

Affect components

  • NcDateTimePicker
    • uses date-fns for formatting
  • NcDateTime
    • use useFormatTime
      • uses Intl.DateTime

Background

Review comment #8644 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    designDesign, UX, interface and interaction designdiscussionNeed advices, opinions or ideas on this topicenhancementNew feature or requestfeature: datepickerRelated to the date/time picker componentl10nLocalization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions