Skip to content
pubscout

general_datetime

5.0.1, released 10 days ago by an unverified publisher

Chronology library for Gregorian, Persian, Hebrew, Chinese and Umm al‑Qura calendars with Flutter date‑picker adapters.

WASM-ready
$ flutter pub add general_datetime
Source repository

What it does

Provides date‑time classes for multiple calendar systems, conversion to/from native DateTime, and JSON storage. Includes Material picker delegates for Flutter to select dates in those calendars.

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

Use it when

  • Need support for non‑Gregorian calendars in a Flutter app
  • Require strict civil‑date contracts and calendar‑aware arithmetic
  • Want ready‑made Material date‑picker adapters for Persian, Hebrew, Chinese or Hijri

Skip it when

  • Only Gregorian dates are needed
  • Project size must stay minimal and you cannot add a large dependency

Strengths

  • Wide range of calendar systems with validated bounds
  • Flutter adapters integrate directly with Material pickers
  • Exact instant preservation across calendars
  • Comprehensive documentation and migration guides

Weaknesses

  • Adds a sizable dependency for apps that need only simple date handling
  • Limited to Dart/Flutter; no pure JavaScript support

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

Add `general_datetime: ^5.0.1` to pubspec, run `flutter pub get`, and import the library and delegate packages as shown in the README.

import 'package:general_datetime/general_datetime.dart';

void main(){
  final native=DateTime.utc(2024,3,20,12,34,56,789,123);
  final persian=PersianDateTime.fromDateTime(native);
  print(persian.toIso8601String()); // 1403-01-01T12:34:56.789123Z
}

Alternatives

Packages that do the same job and could replace general_datetime.

  • clock

    Provides a lightweight abstraction for obtaining the current time without calendar system extensions