Re: [ltli] thai buddhist calendar using the solar (#23)

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

GitHub Notification of comment by aphillips
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Tuesday, 29 September 2020 17:21:04 UTC