chrono_dart
2.0.2, released 2 years ago by g-30.dev
Natural language date parser for Dart that extracts dates from text.
What it does
Chrono parses English date expressions in strings and returns DateTime objects along with their positions. It supports relative terms like today, tomorrow, and ranges such as "17 Aug 2013 – 19 Aug 2013".
AI-written summary of version 2.0.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- Parsing dates in chat or messaging apps
- Extracting event dates from user input
- Converting natural language dates to DateTime for scheduling
Skip it when
- Non‑English text
- Highly ambiguous or custom date formats not covered by the parser
Strengths
- Handles a wide variety of English date/time formats
- Simple API: Chrono.parseDate and Chrono.parse
- Null‑safety and recent maintenance
- No external dependencies beyond Dart SDK
Weaknesses
- Only English supported
- Limited timezone handling (defaults to UTC)
- No built‑in unit tests for custom patterns
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add dependency in pubspec and import package; no build_runner or permissions required
import 'package:chrono_dart/chrono_dart.dart' show Chrono;
final result = Chrono.parseDate('An appointment on Sep 12');
print(result); // 2023-09-12 12:00:00.000ZAlternatives
Packages that do the same job and could replace chrono_dart.
- asn1lib
Encodes and decodes ASN.1 objects using BER byte encoding in Dart.
85Compare - dart_date
Date manipulation library providing DateTime extensions and an Interval object.
63Compare - basics
Provides extension methods for core Dart types like String, Iterable, and DateTime.
50Compare - date_time_format
Format Dart DateTime objects using standard date/time notations or relative time offsets.
50Compare
Works with
Packages commonly used together with chrono_dart: ones it builds on, ones built on it, and its own family.