dart_date
1.5.3, released 2 years ago by xantiagoma.com
Date manipulation library providing DateTime extensions and an Interval object.
What it does
Adds comprehensive extension methods, getters, and static tools to Dart's DateTime class inspired by date-fns. It also includes an Interval object for handling date ranges and time manipulations.
AI-written summary of version 1.5.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to easily manipulate, format, or compare DateTime objects in Dart.
- You want interval calculations and check if dates fall within ranges.
Skip it when
- You prefer built-in DateTime methods without extension pollution.
- You need advanced custom calendar UI widgets (use package picker instead).
Strengths
- Very rich set of DateTime extension methods and properties.
- Includes convenient Interval class for range operations.
- Supports timeago and intl formatting utilities out of the box.
Weaknesses
- Has breaking changes in recent major versions.
- Extends standard types which may cause naming collisions.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
No special native setup or configuration required.
final en_Format = DateTime.now().format('MMMM dd y, h:mm:ss a');
print("EN (Format): $en_Format");
print("Yesterday: " + (Date.today - Duration(days: 1)).toString());Alternatives
Packages that do the same job and could replace dart_date.
- sugar
Standard library extension for date-times, timezones, collections, and monads.
68Compare - dart_helper_utils
Dart extensions and helpers for maps, strings, collections, dates, async, and intl formatting.
80Compare - super_dates
Type-safe Dart DateTime API extensions separating dates, local date-times, and UTC date-times.
57Compare - extension_utils
Dart and Flutter extension library for strings, collections, dates, numbers, and colors.
74Compare
Works with
Packages commonly used together with dart_date: ones it builds on, ones built on it, and its own family.