回答編集履歴
1
formatter
answer
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
```js
|
7
7
|
const options = { weekday: 'short', month: 'numeric', day: 'numeric' };
|
8
|
-
const
|
8
|
+
const formatter = new Intl.DateTimeFormat('ja-JP-u-ca-japanese', options);
|
9
9
|
|
10
10
|
let chkday = new Date();
|
11
11
|
const nextMonth = chkday.getMonth() + 1; // ※ 1月は 0
|
@@ -13,7 +13,7 @@
|
|
13
13
|
for (let day = 1; day <= 31; day++) {
|
14
14
|
chkday.setDate(day);
|
15
15
|
if (chkday.getMonth() > nextMonth) break;
|
16
|
-
document.write(
|
16
|
+
document.write(formatter.format(chkday) + "<br />");
|
17
17
|
}
|
18
18
|
|
19
19
|
```
|