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

UK Dates #7

Closed
martin-css opened this issue Feb 14, 2017 · 7 comments
Closed

UK Dates #7

martin-css opened this issue Feb 14, 2017 · 7 comments

Comments

@martin-css
Copy link

The en_GB locale has incorrect date formatting. The UK uses the DD/MM/YYYY format as per most of Europe, not the US style MM/DD/YYYY format.

I had a very quick look at the unicode CLDR but didn't see exactly where this was specified for individual dialects. I would be surprised if this was wrong as a US date format often causes complaints from users. I did find other auto generated data has the correct format, e.g. https://github.com/unicode-cldr/cldr-dates-full/blob/master/main/en-GB/ca-gregorian.json

Hence I was wondering if this was a code generation issue?

@deankarn
Copy link
Contributor

Hey @martin-css

Thanks for reporting, I'm using the XML CLDR data downloaded from the CLDR site here and I know the CLDR data still isn't perfect.

It is very possible that I have made a parsing mistake as well though; I will check this out ASAP and keep you apprised of my progress.

If you could provide any or all locales you know the format is I correct, that would help 😄

Even if the CLDR data is incorrect I am able to override anything needed during the generation phase, just need to know the details.

@deankarn
Copy link
Contributor

UPDATE: so when no data, in this case DateFormats for the gregorian calendar, exist in the XML as is the case for en_GB I fallback to the base language/locale which would be en and that has the MM/DD/YYYY information.

Obviously this isn't 100% correct and I will endevor to find out the correct way to do this; in the meantime if there are any formats you need updating right away I am more than willing to add the exceptions.

@deankarn
Copy link
Contributor

UPDATE 2: I was already looking at converting this to use the JSON CLDR information, this issue is the perfect reason to implement it.

Will keep apprised.

@martin-css
Copy link
Author

Thanks for the updates. I had a look at the Unicode CLDR site, they have a page on the rules for English inheritance.

I think this is the underlying issue. en_GB should be inheriting from en_001 instead of en. This is why the JSON CLDR was correct but not the locale in this project.

Hopefully it should just be a case of updating the inheritance rules in the code generation to match this table.

@deankarn
Copy link
Contributor

Thanks @martin-css that's definitely the solution! 👍

I will add the English Inheritance cross reference to the code generation and that will solve the problem 😄

I have a few interviews today, but will try to squeeze this in.

P.S. I will still probably eventually convert the code generation to use the new JSON rules, just so I can avoid issues like this in the future and avoid new issues as rules change.

@martin-css
Copy link
Author

Thanks.

Good luck with the interviews 👍

deankarn added a commit that referenced this issue Feb 15, 2017
- old logic fell back to base locale when data could not be found; no it attempts to find via inheritance cross reference.

Closes #7
@deankarn
Copy link
Contributor

Hey @martin-css this has been corrected in Release 0.11.1

thanks for all your help!

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

No branches or pull requests

2 participants