Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件

このスライドはSlidevで作られており、以下のレポジトリで公開しています
https://github.com/riya-amemiya/amemiya_riya_slide_data/tree/main/temporal_calendar

アニメーション付きはこちらから
https://riya-amemiya.github.io/amemiya_riya_slide_data/temporal_calendar/

Avatar for Riya Amemiya

Riya Amemiya

October 19, 2026

More Decks by Riya Amemiya

Other Decks in Technology

Transcript

  1. 自己紹介 西 悠太 (Nishi Yuta) 21歳(重要、important) V8 Contributor Platform Engineer

    at Dinii Inc. TSKaigi Staff TypeScriptが好きです V8にパッチを送るのも好きです あと野球も好きです @riya-amemiya
  2. Temporalが対応している主な暦 calendarId 暦 iso8601 拡張ISO 8601暦(デフォルト) gregory グレゴリオ暦 buddhist 仏滅紀元(タイなど)

    japanese 日本の和暦(令和、平成など) chinese 中国暦(旧暦) dangi 韓国の旧暦 hebrew ヘブライ暦(ユダヤ暦) islamic-umalqura / islamic-civil / islamic-tbla イスラム暦(ヒジュラ暦) indian インド国定暦 coptic コプト暦 ethiopic / ethioaa エチオピア暦
  3. 暦の元になる3つの周期 何で決まるか 長さ 1日 地球の自転 約24 時間 1 か月 新月から次の新月まで(朔望月)

    約29.53059 日 1年 春分から次の春分まで(太陽年) 約365.24219 日 どれもほかの周期の整数倍にならない
  4. 1年と月の満ち欠け 13か月だと1年を18.66日超える 太陽年 朔望月 1 2 3 4 5 6

    7 経過 383 日 新月から新月まで 13 回 1年の終わりまで 0.00 日 8 9 10 11 12 13
  5. 暦の3つの種類 合わせるもの 季節(太陽暦) calendarId iso8601 、 gregory 、 buddhist 、

    japanese 、 indian 、 coptic 、 ethiopic 、 ethioaa 月の満ち欠け(太陰 暦) islamic-umalqura 、 islamic-civil 、 islamic-tbla 両方(太陰太陽暦) chinese 、 dangi 、 hebrew
  6. グレゴリオ暦が生まれた背景 1582年10月 日 月 火 水 木 金 土 1

    2 3 4 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 前のユリウス暦は4年に1回うるう年で、太陽年より約11分長い 128年で1日ずれて、1582年には春分が3月11日ごろまで早まった 復活祭の日付を決める春分を、ニカイア公会議が決めた3月21日に戻す改暦 10月4日の次の日を10月15日にして、10日を消した
  7. グレゴリオ暦 年 4 で割り切れる 100 で割り切れる 400 で割り切れる 判定 2024

    ◦ × × うるう年 1900 ◦ ◦ × 平年 2000 ◦ ◦ ◦ うるう年 1582年にローマ教皇グレゴリウス13世が定めた太陽暦 400年に97回うるう年を入れて、平均すると1年は365.2425日 iso8601 と gregory はどちらもこのグレゴリオ暦
  8. インド国定暦 1 月 日数 30か31 2 3 31 4 31

    5 31 6 31 7 31 8 30 サカ紀元を使う太陽暦 西暦から78を引いた年で数える 新年は3月22日で、うるう年だけ3月21日 9 30 10 30 30 11 30 12 30
  9. コプト暦とエチオピア暦 月 1 2 3 4 5 6 7 8

    9 10 11 12 13 日数 30 30 30 30 30 30 30 30 30 30 30 30 5か6 どちらも新年は9月11日、年によって9月12日 元年はコプト暦が西暦284年、エチオピア暦が西暦8年
  10. イスラム暦の計算方法 calendarId 決め方 islamic-umalqura サウジアラビアが行政で使う方式 islamic-civil 30 年に11 回うるう年を入れる表で計算し、金曜日を元年の初日にする islamic-tbla

    islamic-civil と同じ表で、木曜日を元年の初日にする 多くのイスラム教国では日没後に三日月が見えた日から月を始める だから実際の日付は地域で変わる
  11. ヘブライ暦 年目 1 2 3 4 5 6 7 8

    9 10 11 12 13 14 15 16 17 18 19 月の数 12 12 13 12 12 13 12 13 12 12 13 12 12 13 12 12 13 12 13 月を満ち欠けに合わせる太陰太陽暦 新年は秋で、グレゴリオ暦の9月か10月 うるう年は5番目の月のあとにうるう月を足して13か月 19年の6939.60日と235か月の6939.69日がほぼ同じ 19年たつと日付と季節がまた合う
  12. 和暦が生まれた背景 1872年12月30日 1872年12月31日 1873年1月1日 明治 5 年 12 月 1

    日 明治 5 年 12 月 2 日 明治 6 年 1 月 1 日 日本も明治5年までは太陰太陽暦の天保暦を使っていた 明治5年12月3日を明治6年1月1日にして、太陽暦に切り替えた 改暦の布告から切り替えまで、わずか3週間ほど 年を数える元号は645年の大化のころから使われ始めた 明治からは天皇1代につき元号は1つ
  13. 和暦 1989年1月7日まで 1989年1月8日から 2019年4月30日まで 2019年5月1日から 昭和 64 年 平成元年 平成

    31 年 令和元年 月日はグレゴリオ暦と同じ 年は元号で数える 元号法では皇位の継承があったときだけ元号を改める
  14. 2026年10月5日をそれぞれの暦で表す Temporal.PlainDate.from("2026-10-05").withCalendar(calendarId) calendarId 年月日 gregory 2026年10月5日 buddhist 2569年10月5日 indian 1948年7月13日

    coptic 1743年1月25日 ethiopic 2019年1月25日 islamic-umalqura 1448年4月24日 chinese 2026年8月25日 dangi 2026年8月25日 hebrew 5787年1月24日 japanese 令和8年10月5日
  15. PlainDate の中身 > const d = Temporal.PlainDate.from("2026-10-05") > const h

    = d.withCalendar("hebrew") > [h.year, h.month, h.day] [ 5787, 1, 24 ] > Temporal.PlainDate.compare(d, h) 0 PlainDate が持つのはISO 8601の年月日と暦の2つ year や month はISO 8601の年月日から暦に従って計算する
  16. month と monthCode 5786年 5787年 1 2 3 4 5

    6 7 8 9 10 11 12 M01 M02 M03 M04 M05 M06 M07 M08 M09 M10 M11 M12 1 2 3 4 5 6 7 8 9 10 11 12 13 M01 M02 M03 M04 M05 M05L M06 M07 M08 M09 M10 M11 M12 5786年は平年、5787年はうるう年 5787年は6番目がうるう月で、 M06 の月は7番目にずれる month が同じ6でも別の月 monthCode は同じ月ならどの年でも同じで、うるう月は M05L
  17. うるう月の1年後 > const d = Temporal.PlainDate.from({ calendar: "hebrew", year: 5787,

    monthCode: "M05L", day: 1 }) > d.add({ years: 1 }).monthCode 'M06' > d.add({ years: 1 }, { overflow: "reject" }) Uncaught RangeError 5788年は平年なので M05L の月がない 既定の "constrain" では M06 に丸める
  18. 参考資料 Temporal: tc39.es/proposal-temporal Intl era and monthCode: tc39.es/proposal-intl-era-monthcode Wirfs-Brock, Eich:

    JavaScript: The First 20 Years Oracle: java.util.Date British Astronomical Association: Astronomical & physical constants NASA: Eclipses and the Moon's Orbit Inter gravissimas: Wikisource Royal Society of Thailand: Thai calendar eras CSIR: History of Calendar Coptic Orthodox Church: Diocletian and the Coptic calendar
  19. 参考資料 Dar al-Ifta: The Hijra and the Islamic Calendar Quran.com:

    9:37 CLDR: Islamic Calendar Types 香港天文台: 二十四節氣 Hong Kong Observatory: Gregorian-Lunar Calendar Conversion Table My Jewish Learning: The Jewish Leap Year Explained Peninei Halakha: The History of the Sanctification of the Moon Sefaria: Mishneh Torah, Sanctification of the New Month 6:3 国立天文台 暦Wiki: 元号、明治改暦 e-Gov法令検索: 元号法