1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
---
title: Intl.Locale.prototype.calendar
slug: Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar
tags:
- Internationalization
- JavaScript
- Property
- Prototype
- Reference
- プロパティ
- 国際化
translation_of: Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar
---
<div>{{JSRef}}</div>
<p><strong><code>Intl.Locale.prototype.calendar</code></strong> プロパティは、 <code>Locale</code> で使用される暦の種類を返すアクセサープロパティです。</p>
<h2 id="Description" name="Description">解説</h2>
<p><code>calendar</code> プロパティは <code>Locale</code> の一部、 <code>Locale</code> の暦を示す部分を返します。世界の大部分はグレゴリオ暦を使用していますが、世界各地で使用されている地域暦もいくつかあります。以下の表に、有効な Unicode 暦キー文字列をすべて示します。</p>
<h3 id="Unicode_calendar_keys" name="Unicode_calendar_keys">Unicode 暦キー</h3>
<table class="standard-table">
<caption>Unicode 暦キー</caption>
<thead>
<tr>
<th scope="col">Calendar key (name)</th>
<th scope="col">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>buddhist</code></td>
<td>タイの仏教暦</td>
</tr>
<tr>
<td><code>chinese</code></td>
<td>古来の中国の暦</td>
</tr>
<tr>
<td><code>coptic</code></td>
<td>コプト暦</td>
</tr>
<tr>
<td><code>dangi</code></td>
<td>古来の韓国の暦</td>
</tr>
<tr>
<td><code>ethioaa</code></td>
<td>Ethiopic calendar, Amete Alem (epoch approx. 5493 B.C.E)</td>
</tr>
<tr>
<td><code>ethiopic</code></td>
<td>Ethiopic calendar, Amete Mihret (epoch approx, 8 C.E.)</td>
</tr>
<tr>
<td><code>gregory</code></td>
<td>グレゴリオ暦</td>
</tr>
<tr>
<td><code>hebrew</code></td>
<td>古来のヘブライ暦</td>
</tr>
<tr>
<td><code>indian</code></td>
<td>インド暦</td>
</tr>
<tr>
<td><code>islamic</code></td>
<td>イスラム暦</td>
</tr>
<tr>
<td><code>islamic-umalqura</code></td>
<td>Islamic calendar, Umm al-Qura</td>
</tr>
<tr>
<td><code>islamic-tbla</code></td>
<td>Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - astronomical epoch)</td>
</tr>
<tr>
<td><code>islamic-civil</code></td>
<td>Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - civil epoch)</td>
</tr>
<tr>
<td><code>islamic-rgsa</code></td>
<td>Islamic calendar, Saudi Arabia sighting</td>
</tr>
<tr>
<td><code>iso8601</code></td>
<td>ISO カレンダー (ISO 8601 カレンダーの曜日規則を使用したグレゴリオ暦)</td>
</tr>
<tr>
<td><code>japanese</code></td>
<td>日本の皇紀</td>
</tr>
<tr>
<td><code>persian</code></td>
<td>ペルシャ暦</td>
</tr>
<tr>
<td><code>roc</code></td>
<td>中華民国暦</td>
</tr>
<tr>
<td>
<div class="blockIndicator warning"><code>islamicc</code> 暦は非推奨です。 <code>islamic-civil</code> を使用してください。</div>
<p><code>islamicc</code></p>
</td>
<td>Civil (algorithmic) Arabic calendar</td>
</tr>
</tbody>
</table>
<h2 id="Examples" name="Examples">例</h2>
<h3 id="Adding_a_calendar_in_the_Locale_string" name="Adding_a_calendar_in_the_Locale_string">ロケール文字列へのカレンダーの追加</h3>
<p>暦は、ロケールキーの「拡張キー」に該当します。これらのキーは、ロケールに関するデータを追加するもので、拡張子 <code>-u</code> を使用してロケール識別子に追加します。したがって、 {{jsxref("Locale/Locale", "Intl.Locale")}} コンストラクターに渡される初期のロケール識別子文字列に暦の種類を追加することができます。暦の種類を追加するには、まず文字列に <code>-u</code> 拡張を追加します。次に、暦の種類を追加することを示すために <code>-ca</code> 拡張を追加します。最後に、暦を文字列に追加します。</p>
<pre class="brush: js">let frBuddhist = new Intl.Locale("fr-FR-u-ca-buddhist");
console.log(frBuddhist.calendar); // "buddhist" と表示</pre>
<h3 id="Adding_a_calendar_with_a_configuration_object" name="Adding_a_calendar_with_a_configuration_object">構成オブジェクトによる暦の追加</h3>
<p>{{jsxref("Locale/Locale", "Intl.Locale")}} コンストラクターには、オプションで構成オブジェクトの引数があり、カレンダーを含めた拡張の種類を渡すために使用することができます。構成オブジェクトの <code>calendar</code> プロパティを望みの暦の値に設定し、コンストラクターに渡します。</p>
<pre class="brush: js">let frBuddhist = new Intl.Locale("fr-FR", {calendar: "buddhist"});
console.log(frBuddhist.calendar); // "buddhist" と表示
</pre>
<h2 id="Specifications" name="Specifications">仕様書</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様書</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('ES Int Draft', '#sec-Intl.Locale.prototype.calendar')}}</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<div>{{Compat("javascript.builtins.Intl.Locale.calendar")}}</div>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{jsxref("Locale", "Intl.Locale")}}</li>
<li><a href="https://www.unicode.org/reports/tr35/#UnicodeCalendarIdentifier">Unicode 暦識別子</a></li>
</ul>
|