-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(dateFilter): ignore era format specifier "G" #10543
fix(dateFilter): ignore era format specifier "G" #10543
Conversation
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 era is part of Google closure, if we are adding the token |
Google closure does not indicate which calendar a locale uses so we can't
|
Google closure uses Gregorian calendar for all locales, if they do not, it is a bug |
Google closure is using the Gregorian calendar, but using the same logic, |
I am not sure what you are suggesting. The problem, as I see it, is that some locales do not use the Gregorian calendar and so they use different logic to specify the current era. For instance, in Thailand they use the Buddhist Era (B.E.), which is 543 years greater than Anno Domimi (A.D.) Since the Google Closure data does include Era characters but doesn't include the calendar then it is not possible to infer the era that should be displayed for a given date. I think that what you are assuming is that the logic for computing the era is the same for all locales, in which case we would have been able to generate locale specific date strings that include the era. But this is not the case. |
what I am saying is that Now, about the remark on months, all the current built-in locales include the months names for the Gregorian calendar and for the Gregorian calendar only. I see no issue is adding the era name as it is adding information that should only be used to calculate the era on a date using the Gregorian calendar. Just like the months information, this is only good to know the month names in the Gregorian calendar. The Buddhist calendar month names are not the same as Gregorian calendar months names, and this does not prevent us from adding the months names to the locales |
OK, I take it back - I didn't realise that the Thai era names in the Google Closure library are actually just translations of BC and AD. So indeed we should include the era data in our locale files. |
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 #10503