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

thai buddhist calendar using the solar #23

Open
himorin opened this issue Sep 29, 2020 · 1 comment
Open

thai buddhist calendar using the solar #23

himorin opened this issue Sep 29, 2020 · 1 comment
Assignees

Comments

@himorin
Copy link

himorin commented Sep 29, 2020

In Example 1, th-u-ca-buddhist is used, but in contrast to the upper line, we might be better to mention about th-u-ca-buddhist-nu-thai (but not th-u-ca-buddhist-nu-latn =~ th-u-ca-buddhist) for the lunar but not the solar?

note: I'm actually not sure whether ca-buddhist should be mapped to the solar or the lunar by default.... (in ja, should be the lunar??)

@aphillips aphillips self-assigned this Sep 29, 2020
@aphillips
Copy link
Contributor

Thanks @himorin

The outputs shown here are from ICU/CLDR. The Thai Buddhist calendar is basically a Gregorian calendar with the year changed. This also describes the Japanese calendar.

ICU implements the Chinese and Dangi calendars as lunisolar (and obviously the Islamic calendar is lunar based). Since LTLI isn't about calendars per-se, I didn't really explore this topic in depth. Maybe more time should be spent on it.

For what it's worth, here's my code:

    private static void variousCalendarShenanigans() {
        String[] locales = { "th-u-ca-gregory", "th-u-ca-buddhist", "ja-u-ca-japanese",
                "ja-u-ca-gregory", "ja-u-ca-buddhist", "ar-u-ca-islamic", "en-u-ca-islamic", "en-u-ca-gregory"
        };
        for (String locale : locales) {
            ULocale uloc = ULocale.forLanguageTag(locale);
            DateFormat df = DateFormat.getPatternInstance("yyyyMMMd", uloc);
            System.out.println(String.format("%s: %s", locale, df.format(new Date())));
        }
    }

And here's the output:

International Components for Unicode for Java 67.1

Implementation Version: 67.1
Unicode Data Version:   13.0
CLDR Data Version:      37.0
Time Zone Data Version: 2019c
---

th-u-ca-gregory: 29 ก.ย. 2020
th-u-ca-buddhist: 29 ก.ย. 2563
ja-u-ca-japanese: 令和2年9月29日
ja-u-ca-gregory: 2020年9月29日
ja-u-ca-buddhist: 仏暦2563年9月29日
ar-u-ca-islamic: ١٢ صفر ١٤٤٢ هـ
en-u-ca-islamic: Saf. 12, 1442 AH
en-u-ca-gregory: Sep 29, 2020

aphillips added a commit that referenced this issue Oct 9, 2020
Address #23 (calendar examples)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants