Test to see which calendars are supported, LDML r.24

Include the Unicode extension for setting the calendar in the locale, based on the latest trunk of LDML, which will become revision 24. Display the locale used, then format the date using that locale.

by David Storey

JavaScript

console.clear();

var date = new Date(),
    calendars = ["buddhist", "chinese", "coptic", "dangi", "ethioaa", "ethiopic-amete-alem", "ethiopic", "gregory", "hebrew", "indian", "islamic", "islamic-umalqura", "islamic-tbla", "islamicc", "islamic-civil", "islamic-rgsa", "iso8601", "japanese", "persian", "roc"];

for (var i = 0; i < calendars.length; i++) {
    var localeDate = new Intl.DateTimeFormat("en-GB-u-ca-" + calendars[i], date);
    console.log(localeDate.resolvedOptions().locale + ":\t\t" + localeDate.format());
}