Skip to content
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

Date Range locale override does not change format #6582

Open
1 task done
mohitkudi opened this issue Feb 13, 2024 · 3 comments
Open
1 task done

Date Range locale override does not change format #6582

mohitkudi opened this issue Feb 13, 2024 · 3 comments

Comments

@mohitkudi
Copy link

Description

I am using the date range locale override to change the region to "fr-CA" and the dateFnsLocale to "frCA". It does not change the date format to yyyy/mm/dd which would be the expected behaviour.

Reproduction

https://carbon.sage.com/?path=/docs/date-range--default-story

Steps to reproduce

No response

JIRA ticket numbers (Sage only)

No response

Suggested solution

the outputFormat needs to be modified.

Carbon version

125.6.0

Design tokens version

4.34.0

Relevant browsers

Chrome

Relevant OSs

Windows

Additional context

No response

Confidentiality

  • I confirm there is no confidential or commercially sensitive information included.
@mohitkudi mohitkudi added Bug triage Triage Required labels Feb 13, 2024
@edleeks87
Copy link
Contributor

@harpalsingh tagging you as I suspect we'll need someone in content/translations/UX to make a decision on this (and I only know you 😉). There's basically quite a bit of conjecture about what formats to use, the official format for Canadian locales is ISO but that's only used by the government etc. When we looked online at the time we saw that a lot of people said they input dates in the formats we've gone with (they were also what the legacy component used) but also looking online just now I see some sites suggesting yyyy/mm/dd is used.

I'm happy to be involved in any discussions if needed 👍

@Parsium
Copy link
Contributor

Parsium commented Feb 13, 2024

For triage, we are currently overriding the date format string internally to be dd/MM/yyyy, to account for the lack of standardisation as @edleeks87 mentioned:

const outputFormat = ["fr-CA", "en-ZA", "ar-EG"].includes(code)
    ? "dd/MM/yyyy"
    : format;

Link to override code.

@Parsium
Copy link
Contributor

Parsium commented Apr 30, 2024

@nicktitchmarsh @tomdavies73 is this something we can discuss as part of the ongoing localisation changes?

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

No branches or pull requests

3 participants