Skip to content
pubscout

datify

1.2.0, released 8 weeks ago by mitryp.com.ua

Extracts dates in various formats from raw strings.

WASM-ready
$ flutter pub add datify
Source repository

What it does

Parses strings to extract dates using flexible formats, supporting digit-only dates, ISO 8601 timestamps, and alphanumeric dates in multiple languages. It allows configuring custom splitters and month localizations.

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

Use it when

  • You need to parse unstructured user input containing dates.
  • You are dealing with mixed date formats across different languages.

Skip it when

  • You only need to parse strict, standardized date formats where DateTime.parse is sufficient.

Strengths

  • Supports multiple languages and custom month localizations.
  • Handles flexible date formats and splitters out of the box.
  • Good performance with cached regular expressions and lookup tables.

Weaknesses

  • Limited built-in month name languages by default (English, Ukrainian, Russian).
  • Incomplete or non-existent dates evaluate their DateTime getter to null.

Setup

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

void main() {
  final datify = Datify.parse('20th of January, 2021');

  print(datify.date); // 2021-01-20 00:00:00.000
  print(datify.result); // DatifyResult{year: 2021, month: 1, day: 20}
}

Alternatives

Packages that do the same job and could replace datify.

  • string_scanner

    A class for parsing strings using a sequence of patterns.

  • validators2

    String validation and sanitization for Dart.

  • any_date

    Parse strings in any format or language into DateTime objects, respecting ISO and RFC standards.

  • jiffy

    Parse, manipulate, query, and format dates and times in Dart and Flutter.