fuzzyworld

when-am-i / commit

starting to add calendar data

359276b3f7e9ffa6cb27aa7c48a58fc7ed5a6806 · Pavel Safronov · 2026-03-19 23:46:21 -0700 · parents 273e7c06e1a9

starting to add calendar data
 .vscode/settings.json          |  5 ++++
 README.md                      | 62 +++++++++++++++++++++++++++++++++++++++++-
 src/data/calendars/SCHEMA.json | 21 ++++++++++++++
 src/data/calendars/SCHEMA.md   | 28 +++++++++++++++++++
 src/data/calendars/boston.json | 54 ++++++++++++++++++++++++++++++++++++
 5 files changed, 169 insertions(+), 1 deletion(-)

diff --git a/.vscode/settings.json b/.vscode/settings.json
index 3fc4e9d..c09699c 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,5 +1,10 @@
 {
+    "json.schemaDownload.trustedDomains": {
+        "https://raw.githubusercontent.com/DavidAnson/markdownlint/": true
+    },
     "cSpell.words": [
+        "Flaticon",
+        "Icongeek",
         "latlng"
     ]
 }
\ No newline at end of file
diff --git a/README.md b/README.md
index 285e640..62adb87 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,66 @@ Imagine you're a time traveler who ends up in a random place and time in history
 - `src/assets/` — App images and static assets
 - `public/` — Static files served at root
 
+## Contributing Calendar Data
+
+Calendar region and era data is stored as flat JSON files in `src/data/calendars/`.
+Each file describes a region (using GeoJSON geometry) and its calendar eras over time.
+
+### Example: `src/data/calendars/boston.json`
+
+```json
+{
+   "region": {
+      "name": "Boston Area",
+      "geo": {
+         "type": "Polygon",
+         "coordinates": [
+            [
+               [-71.1912, 42.2279],
+               [-71.1912, 42.3967],
+               [-70.9860, 42.3967],
+               [-70.9860, 42.2279],
+               [-71.1912, 42.2279]
+            ]
+         ]
+      }
+   },
+   "eras": [
+      {
+         "name": "Common Era (AD)",
+         "start": "1750-01-01",
+         "end": null,
+         "calendar": "Gregorian",
+         "description": "Used after British colonization.",
+         "sources": [
+            "https://en.wikipedia.org/wiki/Gregorian_calendar"
+         ]
+      },
+      {
+         "name": "Pre-Colonial",
+         "start": null,
+         "end": "1750-01-01",
+         "calendar": "Algonquian lunar calendar",
+         "description": "Used by indigenous peoples before colonization.",
+         "sources": [
+            "https://en.wikipedia.org/wiki/Algonquian_peoples"
+         ]
+      }
+   ]
+}
+```
+
+### Schema
+
+See `src/data/calendars/SCHEMA.json` for the schema and field documentation.
+
+### How to contribute
+
+- Add or edit files in `src/data/calendars/` via pull request.
+- Use [geojson.io](https://geojson.io/) or similar tools to draw and export region polygons.
+- Include sources/references for each era.
+- The build process will validate and compile all data for use in the app.
+
 ## License
 
 MIT
@@ -56,4 +116,4 @@ MIT
 
 - Map tiles and data: [OpenStreetMap](https://www.openstreetmap.org/)
 - Map library: [Leaflet](https://leafletjs.com/)
-- Calendar icon: Calendar icons created by Icongeek26 - Flaticon (https://www.flaticon.com/free-icons/calendar)
\ No newline at end of file
+- Calendar icon: [Calendar icons created by Icongeek26 - Flaticon](https://www.flaticon.com/free-icons/calendar)
diff --git a/src/data/calendars/SCHEMA.json b/src/data/calendars/SCHEMA.json
new file mode 100644
index 0000000..d5e9b0a
--- /dev/null
+++ b/src/data/calendars/SCHEMA.json
@@ -0,0 +1,21 @@
+{
+    "region": {
+        "name": "string (required)",
+        "geo": {
+            "type": "Polygon|MultiPolygon|Point|...",
+            "coordinates": "GeoJSON coordinates array"
+        }
+    },
+    "eras": [
+        {
+            "name": "string (required)",
+            "start": "YYYY-MM-DD|null (start date, null for earliest)",
+            "end": "YYYY-MM-DD|null (end date, null for present)",
+            "calendar": "string (calendar system name)",
+            "description": "string (optional)",
+            "sources": [
+                "string (URL or citation)"
+            ]
+        }
+    ]
+}
\ No newline at end of file
diff --git a/src/data/calendars/SCHEMA.md b/src/data/calendars/SCHEMA.md
new file mode 100644
index 0000000..a511bf7
--- /dev/null
+++ b/src/data/calendars/SCHEMA.md
@@ -0,0 +1,28 @@
+# Calendar Region/Era Schema for WhatYearIsIt
+
+Place JSON files in `src/data/calendars/`.
+Each file describes a region and its calendar eras.
+
+## Schema
+
+```json
+{
+  "region": {
+    "name": "string (required)",
+    "geo": {
+      "type": "Polygon|MultiPolygon|Point|...",
+      "coordinates": "GeoJSON coordinates array"
+    }
+  },
+  "eras": [
+    {
+      "name": "string (required)",
+      "start": "YYYY-MM-DD|null (start date, null for earliest)",
+      "end": "YYYY-MM-DD|null (end date, null for present)",
+      "calendar": "string (calendar system name)",
+      "description": "string (optional)",
+      "sources": ["string (URL or citation)"]
+    }
+  ]
+}
+```
diff --git a/src/data/calendars/boston.json b/src/data/calendars/boston.json
new file mode 100644
index 0000000..98af870
--- /dev/null
+++ b/src/data/calendars/boston.json
@@ -0,0 +1,54 @@
+{
+    "region": {
+        "name": "Boston Area",
+        "geo": {
+            "type": "Polygon",
+            "coordinates": [
+                [
+                    [
+                        -71.1912,
+                        42.2279
+                    ],
+                    [
+                        -71.1912,
+                        42.3967
+                    ],
+                    [
+                        -70.9860,
+                        42.3967
+                    ],
+                    [
+                        -70.9860,
+                        42.2279
+                    ],
+                    [
+                        -71.1912,
+                        42.2279
+                    ]
+                ]
+            ]
+        }
+    },
+    "eras": [
+        {
+            "name": "Common Era (AD)",
+            "start": "1750-01-01",
+            "end": null,
+            "calendar": "Gregorian",
+            "description": "Used after British colonization.",
+            "sources": [
+                "https://en.wikipedia.org/wiki/Gregorian_calendar"
+            ]
+        },
+        {
+            "name": "Pre-Colonial",
+            "start": null,
+            "end": "1750-01-01",
+            "calendar": "Algonquian lunar calendar",
+            "description": "Used by indigenous peoples before colonization.",
+            "sources": [
+                "https://en.wikipedia.org/wiki/Algonquian_peoples"
+            ]
+        }
+    ]
+}
\ No newline at end of file