when-am-i / commit
feat: add China, India, Japan, Thailand, Ethiopia calendar regions
src/data/calendars/china.json | 42 +++++++++++++++++++++++++++++++ src/data/calendars/ethiopia.json | 39 +++++++++++++++++++++++++++++ src/data/calendars/india.json | 43 ++++++++++++++++++++++++++++++++ src/data/calendars/japan.json | 53 ++++++++++++++++++++++++++++++++++++++++ src/data/calendars/thailand.json | 39 +++++++++++++++++++++++++++++ 5 files changed, 216 insertions(+) diff --git a/src/data/calendars/china.json b/src/data/calendars/china.json new file mode 100644 index 0000000..e159a25 --- /dev/null +++ b/src/data/calendars/china.json @@ -0,0 +1,42 @@ +{ + "region": { + "name": "China (historic heartland)", + "geo": { + "type": "Polygon", + "coordinates": [ + [ + [100.0, 22.0], + [110.0, 21.0], + [118.0, 24.0], + [122.0, 31.0], + [122.0, 40.0], + [125.0, 45.0], + [120.0, 45.0], + [110.0, 42.0], + [100.0, 42.0], + [90.0, 43.0], + [80.0, 44.0], + [80.0, 38.0], + [90.0, 33.0], + [98.0, 27.0], + [100.0, 22.0] + ] + ] + } + }, + "eras": [ + { + "name": "Traditional Chinese calendar", + "start": null, + "end": null, + "calendar": "Chinese sexagenary cycle", + "usedBy": "the Chinese", + "description": "For most of recorded history China reckoned dates with a lunisolar calendar and named years by the sexagenary (gānzhī) cycle — a repeating 60-year sequence pairing ten Heavenly Stems with twelve Earthly Branches, which also maps onto five elements and the twelve zodiac animals — alongside regnal-era (niánhào) year counts under each emperor. The Gregorian calendar was adopted for civil use after the founding of the Republic in 1912, but the traditional calendar still governs festivals such as Chinese New Year, so this answer remains live. Year boundaries fall at Chinese New Year (late January–February), which the app approximates with the Gregorian year.", + "sources": [ + "https://en.wikipedia.org/wiki/Chinese_calendar", + "https://en.wikipedia.org/wiki/Sexagenary_cycle", + "https://en.wikipedia.org/wiki/Chinese_zodiac" + ] + } + ] +} diff --git a/src/data/calendars/ethiopia.json b/src/data/calendars/ethiopia.json new file mode 100644 index 0000000..3c51ea8 --- /dev/null +++ b/src/data/calendars/ethiopia.json @@ -0,0 +1,39 @@ +{ + "region": { + "name": "Ethiopia", + "geo": { + "type": "Polygon", + "coordinates": [ + [ + [33.0, 8.0], + [35.0, 5.0], + [38.0, 4.0], + [41.5, 4.5], + [44.5, 5.5], + [47.5, 8.0], + [46.5, 11.0], + [43.0, 12.0], + [40.0, 14.5], + [37.0, 14.0], + [35.0, 12.0], + [33.5, 11.0], + [33.0, 8.0] + ] + ] + } + }, + "eras": [ + { + "name": "Ethiopian calendar (Amete Mihret)", + "start": null, + "end": null, + "calendar": "Ethiopian", + "usedBy": "Ethiopians", + "description": "Ethiopia keeps its own solar calendar, the Amete Mihret (\"Year of Mercy\") reckoning, as the official civil calendar to this day. It has twelve 30-day months plus a short 13th month (Pagume) of 5 or 6 days, and its epoch sits about seven to eight years behind the Gregorian calendar, so a Gregorian year overlaps two Ethiopian ones; the new year falls in September. A date in early 2000 CE, for example, lies in Ethiopian year 1992.", + "sources": [ + "https://en.wikipedia.org/wiki/Ethiopian_calendar", + "https://en.wikipedia.org/wiki/Ge%CA%BDez_calendar" + ] + } + ] +} diff --git a/src/data/calendars/india.json b/src/data/calendars/india.json new file mode 100644 index 0000000..b0f38b0 --- /dev/null +++ b/src/data/calendars/india.json @@ -0,0 +1,43 @@ +{ + "region": { + "name": "India", + "geo": { + "type": "Polygon", + "coordinates": [ + [ + [68.0, 24.0], + [70.0, 28.0], + [74.0, 32.0], + [78.0, 33.0], + [81.0, 30.0], + [88.0, 27.0], + [92.0, 28.0], + [89.0, 22.0], + [87.0, 21.0], + [83.0, 17.0], + [80.0, 13.0], + [77.0, 8.0], + [74.0, 13.0], + [73.0, 18.0], + [70.0, 21.0], + [68.0, 24.0] + ] + ] + } + }, + "eras": [ + { + "name": "Saka era", + "start": "0078-03-22", + "end": null, + "calendar": "Indian", + "usedBy": "much of India (the national civil calendar)", + "description": "India has long used many calendars — Vikram Samvat, regional lunisolar calendars, and others — but the Saka era is the most pan-Indian. Counting from 78 CE, it appears in inscriptions and almanacs across the subcontinent for nearly two millennia, and in 1957 the reformed Saka calendar (the Indian National Calendar) was adopted as the country's official civil calendar alongside the Gregorian. Its year begins near the spring equinox; Saka year 1947 began in March 2025.", + "sources": [ + "https://en.wikipedia.org/wiki/Indian_national_calendar", + "https://en.wikipedia.org/wiki/Saka_era", + "https://en.wikipedia.org/wiki/Hindu_calendar" + ] + } + ] +} diff --git a/src/data/calendars/japan.json b/src/data/calendars/japan.json new file mode 100644 index 0000000..ea0ef95 --- /dev/null +++ b/src/data/calendars/japan.json @@ -0,0 +1,53 @@ +{ + "region": { + "name": "Japan", + "geo": { + "type": "Polygon", + "coordinates": [ + [ + [129.5, 31.0], + [132.0, 31.5], + [135.0, 33.5], + [140.0, 35.0], + [141.0, 38.0], + [142.0, 41.0], + [145.5, 43.5], + [144.0, 44.5], + [140.0, 42.0], + [138.0, 37.0], + [136.0, 35.5], + [133.0, 34.0], + [130.5, 33.0], + [129.5, 31.0] + ] + ] + } + }, + "eras": [ + { + "name": "Lunisolar calendar (pre-1873)", + "start": null, + "end": "1873-01-01", + "calendar": "Japanese lunisolar calendar", + "usedBy": "the Japanese", + "description": "Before 1873 Japan used a Chinese-derived lunisolar calendar, with years named by regnal eras (nengō) under the reigning emperor and by the sexagenary cycle. Because months followed the moon and were periodically intercalated, there is no continuous numbered year to convert to here.", + "sources": [ + "https://en.wikipedia.org/wiki/Japanese_calendar", + "https://en.wikipedia.org/wiki/Japanese_era_name" + ] + }, + { + "name": "Imperial era (nengō)", + "start": "1873-01-01", + "end": null, + "calendar": "Japanese", + "usedBy": "the Japanese", + "description": "In 1873 Japan adopted the Gregorian solar calendar for day-to-day dates but kept counting years by the imperial era name (nengō) of the reigning emperor — Meiji, Taishō, Shōwa, Heisei, and since 2019 Reiwa — which remains in official and everyday use alongside the Western year. Reiwa 1 corresponds to 2019.", + "sources": [ + "https://en.wikipedia.org/wiki/Japanese_era_name", + "https://en.wikipedia.org/wiki/Reiwa_era", + "https://en.wikipedia.org/wiki/Japanese_calendar" + ] + } + ] +} diff --git a/src/data/calendars/thailand.json b/src/data/calendars/thailand.json new file mode 100644 index 0000000..e14f3b8 --- /dev/null +++ b/src/data/calendars/thailand.json @@ -0,0 +1,39 @@ +{ + "region": { + "name": "Thailand", + "geo": { + "type": "Polygon", + "coordinates": [ + [ + [98.5, 8.0], + [100.0, 6.5], + [101.5, 6.7], + [103.0, 6.5], + [102.5, 12.5], + [105.5, 14.5], + [105.0, 18.0], + [101.0, 20.5], + [98.0, 18.5], + [97.5, 15.0], + [99.0, 11.0], + [98.5, 8.0] + ] + ] + } + }, + "eras": [ + { + "name": "Buddhist Era", + "start": null, + "end": null, + "calendar": "Buddhist", + "usedBy": "Thai people and Theravāda Buddhists", + "description": "Thailand counts years in the Buddhist Era (BE), reckoned from the traditional date of the Buddha's parinirvāṇa, so the Thai year runs 543 years ahead of the Gregorian one (2024 CE = 2567 BE). It is the official civil calendar of Thailand; since a 1888 reform and a 1941 new-year change the months and year start follow the solar/Gregorian scheme, while the year count stays in the Buddhist Era. Similar Buddhist Era counts are used across Theravāda Southeast Asia.", + "sources": [ + "https://en.wikipedia.org/wiki/Buddhist_calendar", + "https://en.wikipedia.org/wiki/Thai_solar_calendar", + "https://en.wikipedia.org/wiki/Buddhist_Era" + ] + } + ] +}