npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

datocms-plugin-conditional-dates

v0.1.0

Published

Allow editors to enter historical/partial dates where year, month, and/or day may be unknown

Readme

Condates — Conditional Dates for DatoCMS

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.

Features

  • Partial dates — enter just a year, year + month, or a full date
  • Cascading controls — month unlocks only after year is set; day unlocks only after month is set
  • Era support — CE (Common Era) or BCE (Before Common Era)
  • Circa flag — mark a date as approximate
  • Leap-year validation — day options adjust to the correct number of days for the selected month and year
  • Workflow-aware — all controls respect DatoCMS field locking (ctx.disabled)

Setup

  1. Install the plugin on your DatoCMS project
  2. Create a JSON field on your model
  3. In the field's Presentation tab, select Conditional Date as the field editor

Output

The field stores a JSON string with the following structure:

Full date

{"year": 1492, "month": 10, "day": 12, "era": "CE", "circa": false}

Year only (approximate)

{"year": 44, "month": null, "day": null, "era": "BCE", "circa": true}

Year and month

{"year": 2024, "month": 3, "day": null, "era": "CE", "circa": false}

Empty field

null

Field reference

| 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.

Development

npm run dev       # Start dev server
npm run build     # TypeScript check + production build
npm run preview   # Preview production build