Skip to content

Change date-time formatting to respect user date format preference #24935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

larsjuhw
Copy link

@larsjuhw larsjuhw commented Apr 5, 2025

Proposed change

Make non-numeric date formatting consistent with the user's date format preference.

Fixes #22900

As the issue describes, the user setting for date format is not adhered to in non-numeric date representations. Since the setting does not specify that it only applies to numeric representations, this seems unintended.

This change makes written representations also follow the preference by using formatToParts to construct the appropriate output strings, just like formatDateNumeric already did.

Setting in /profile/general:
image

Result in a history graph:
image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

In /profile/general, set "Language" to English and "Date format" to Year-Month-Day to see an example.

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

@larsjuhw larsjuhw marked this pull request as ready for review April 5, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date format is not respected
1 participant