nextcloud-libraries / nextcloud-libraries/nextcloud-vue
Respecting users language when formatting dates
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 246
- Forks
- 99
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 103
Description
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
- Resulted is
- Then (with proposed change)
- Resulted is
Montag, März 2, 2026
- Resulted is
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
- uses
- use
Background
Review comment https://github.com/nextcloud-libraries/nextcloud-vue/pull/8644#issuecomment-5103248212
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the NcDateTimePicker component, which uses date-fns, and NcDateTime through useFormatTime, which uses Intl.DateTime. Trace how each receives the user's locale and language, then verify both preserve locale-based date formatting while translating month and weekday names with the language. Use the German-language, English-locale example as the completion check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, internationalization, localization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100