finds.dev

mojombo/chronic

Chronic is a pure Ruby natural language date parser.

View on GitHubHomepage ↗

★ 3,259RubyMITupdated Sep 2023

// the take

Chronic is a Ruby gem that turns English date phrases into Time objects. It's been around since the mid-2000s and handles an impressively wide range of natural language inputs — from 'tomorrow' to '3rd wednesday in november' to ISO 8601 timestamps. The intended audience is Rails developers who need to parse user-entered date strings without writing their own grammar.

The breadth of recognized patterns is genuinely impressive for a rule-based parser — relative expressions, ordinals, seasons, and ambiguous time resolution via :context all work without an LLM or heavy dependency. The :guess => false option returning a Span instead of a point-in-time is a thoughtful API choice that most similar libraries don't bother with. Pure Ruby with no native extensions means it installs anywhere. The test suite has granular files per repeater type, which is how you catch regressions in a grammar this complex.

Last meaningful activity was years before the 2023 commit date — the repo is effectively in maintenance mode with the original author (mojombo, Tom Preston-Werner) long since moved on. Internationalization is nonexistent: input must be English, and there's no path to extend it for other locales. The Time class ceiling is a real limitation — dates before 1970 or past the platform's time_t range silently return nil with no diagnostic. For anything beyond simple Rails form inputs, you'll hit edge cases that require monkey-patching or forking, since the grammar is hardcoded in the handler/repeater hierarchy rather than being data-driven or extensible.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
3,259
Forks
451
Language
Ruby
License
MIT
Last commit
28 Sep 2023

// nearby

If chronic isn't quite it.

All repos →