JavaScript

Intl.Locale.prototype.calendars プロパティ


編集:2023.01.10 by T.A.

[Edge]。→

Intl.Locale に対応している歴の種類の文字列の配列で返します。

構文
Intl.Locale.calendars
Intl.Locale Intl.Locale

文字列の配列。→Intl.DateTimeFormat():calendar

DA=new Intl.Locale('ja-JP');  //日本語の日本国。
D=DA.calendars;  //=[object]:gregory,japanese
	//0=[string]:gregory
	//1=[string]:japanese
DA=new Intl.Locale('ja');  //日本語。
D=DA.calendars;  //=[object]:gregory,japanese
	//0=[string]:gregory
	//1=[string]:japanese
DA=new Intl.Locale('ar-EG');  //アラビア語のエジプト国。
D=DA.calendars;  //=[object]:gregory,coptic,islamic,islamic-civil,islamic-tbla
	//0=[string]:gregory
	//1=[string]:coptic
	//2=[string]:islamic
	//3=[string]:islamic-civil
	//4=[string]:islamic-tbla

DA=new Intl.Locale('en');  //英語。
D=DA.calendars;  //=[object]:gregory
	//0=[string]:gregory
DA=new Intl.Locale('en', {calendar:'japanese'});  //英語、歴指定。
D=DA.calendars;  //=[object]:japanese
	//0=[string]:japanese

Intl.Locale()言語タグ


テスト