A DatoCMS plugin for entering historical or partial dates where some components (year, month, day) may be unknown.
Standard date fields require a complete date. When documenting historical events, artworks, archaeological finds, or any record with uncertain dating, editors often know only the year, or the year and month. Condates solves this by providing a conditional date editor that adapts to what the editor actually knows.
ctx.disabled)The field stores a JSON string with the following structure:
{"year": 1492, "month": 10, "day": 12, "era": "CE", "circa": false}{"year": 44, "month": null, "day": null, "era": "BCE", "circa": true}{"year": 2024, "month": 3, "day": null, "era": "CE", "circa": false}null| Key | Type | Description |
|---|---|---|
year | integer | null | Year value (minimum 1) |
month | integer | null | Month (1-12), requires year |
day | integer | null | Day (1-28/29/30/31), requires month |
era | "CE" | "BCE" | null | Era indicator, requires year, defaults to CE |
circa | boolean | null | Whether the date is approximate, requires year |
All components except year are conditional — they are only set when their parent component is present. Clearing a parent cascades: clearing year resets everything to null; clearing month resets day to null.
The JSON value is queryable via GraphQL as a string. Date construction and formatting is left to the frontend consumer.
npm run dev # Start dev servernpm run build # TypeScript check + production buildnpm run preview # Preview production build