Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

angular-i18n has wrong dateformat in Thai. #10503

Closed
sixteenevils opened this issue Dec 17, 2014 · 3 comments
Closed

angular-i18n has wrong dateformat in Thai. #10503

sixteenevils opened this issue Dec 17, 2014 · 3 comments

Comments

@sixteenevils
Copy link

The fulldate format in angular-locale_th-th.js and angular-locale_th.js are wrong.
Current value is "fullDate": "EEEE\u0e17\u0e35\u0e48 d MMMM G y",

Example :

{{landingViewModel.bookingInfo.checkIn | date : 'fullDate'}}

It will generate a date like this "วันพุธที่ 17 ธันวาคม G 2014",
which the G letter should be "พ.ศ." if year is 2557 Buddhist Era (BE)
and for A.D. 2014 it should be "ค.ศ."
or you can remove the G letter it will correct as well.

@petebacondarwin
Copy link
Contributor

I think that the G should be g.
No I was wrong, we just don't seem to handle the era...

@petebacondarwin
Copy link
Contributor

OK, so I took a look at this.

First of all, we do not extract the ERA information from the Google Closure data.

But even if we did , the problem is that although the names of the eras are available in the Google Closure data they do not provide the logic for choosing which era to display; it is locale dependent.

As a compromise, and inline with the last comment by @sixteenevils, I propose that we just ignore the G specifier in our date filter.

Is this acceptable?

Does anyone have a better idea?

This should be solved better as part of @chirayuk's i18n work...

petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Dec 21, 2014

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
The era format specifier is not supported in our locale code and is being
passed through as the letter G in some long date formats, such as Thai (th-th).

It is not straightforward to provide locale specific era formatting since
the logic is calendar (locale) specific and not provided by the Google
closure library.

This commit simply ignores the G in format strings until we can work out
a better strategy for dealing with eras.

Closes angular#10503
@petebacondarwin petebacondarwin added this to the 1.3.9 milestone Dec 21, 2014
@petebacondarwin petebacondarwin self-assigned this Dec 21, 2014
@lvarayut
Copy link

lvarayut commented Jan 2, 2015

Would it be possible to change year format from AD to BE? It might be very useful for a lot of people if there is an option in date filter to choose an era format. So that, you could apply some logic for choosing the right era to display, either "พ.ศ." or "ค.ศ.".

petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Mar 6, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This implementation is limited to displaying AD years correctly only, since
there is no agreed standard on how to represent dates before 1 AD.

Closes angular#10503
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Mar 11, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This implementation is limited to displaying AD years correctly only, since
there is no agreed standard on how to represent dates before 1 AD.

Closes angular#10503
Closes angular#11266
petebacondarwin added a commit to petebacondarwin/angular.js that referenced this issue Mar 11, 2015
This implementation is limited to displaying AD years correctly only, since
there is no agreed standard on how to represent dates before 1 AD.

Closes angular#10503
Closes angular#11266
petebacondarwin added a commit that referenced this issue Mar 11, 2015
This implementation is limited to displaying only AD (CE) years correctly,
since we do not support the `u` style year format that can be used to represent
dates before 1 AD.

Closes #10503
Closes #11266
netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
This implementation is limited to displaying only AD (CE) years correctly,
since we do not support the `u` style year format that can be used to represent
dates before 1 AD.

Closes angular#10503
Closes angular#11266
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.