Skip to content
pubscout

day

1.1.0, released 8 weeks ago by an unverified publisher

A Dart date library inspired by Day.js with a chainable and immutable API.

WASM-ready
$ flutter pub add day
Source repository

What it does

Day.dart provides a wrapper around Dart's DateTime class, offering a chainable API similar to Day.js. It includes formatting, parsing helpers, i18n support, and a plugin system for extended functionality like relative times.

AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You prefer the Day.js API style over standard DateTime manipulation.
  • You need robust date formatting and internationalization support.
  • You want chainable and immutable date operations.

Skip it when

  • You are using Dart SDK versions older than 3.0.0 (unless using version 0.8.0).
  • You only need basic built-in DateTime functions and want to avoid adding third-party dependencies.

Strengths

  • Familiar API for developers coming from JavaScript's Day.js.
  • Supports plugins and i18n locale maps.
  • Offers immutable date manipulation methods.

Weaknesses

  • Adds an external dependency for operations largely covered by core DateTime.
  • Methods like .add() and .subtract() return nullable values.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:day/day.dart';

void main() {
  final day = Day.now();
  print(day.format('YYYY-MM-DD HH:mm:ss'));
}

Alternatives

Packages that do the same job and could replace day.

  • dart_date

    Date manipulation library providing DateTime extensions and an Interval object.

  • const_date_time

    A drop-in replacement for Dart's DateTime class with const constructors.

  • in_date_utils

    Utility functions for modifying, checking, comparing, and generating DateTime instances.

  • time_plus

    Extensions for DateTime and Duration to easily add, convert, and work with time in Dart.

Works with

Packages commonly used together with day: ones it builds on, ones built on it, and its own family.