PackageTrack
Sign in Get early access

iso_duration_parser

A package which parses ISO 8061 Duration (PnYnMnDTnHnMnS format).

1.1.1 9.1K downloads/mo #3061 most downloaded on pub.dev mzdm/iso_duration_parser

What this package is like to depend on

Last release 5 years ago

no release in 18 months

Ships fairly regularly

a new release about every 3 weeks

Nearly every release is documented

notes for 5 of 5 stable releases

Nothing withdrawn

no release was ever pulled

5 years old

5 releases · first in 2021

0 releases in the last 12 months

see the full history below

Release timeline

5 releases · Feb 2021 to Jun 2021
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 5
  1. 1.1.1 16 Jun 2021
    Release notes

    1.1.1

    • Constructor is now const.
    • Updated docs & README.
    • Updated tests.
    • Updated CI.
    Open source →
    Release notes
    • Constructor is now const.
    • Updated docs & README.
    • Updated tests.
    • Updated CI.
    Open source →
  2. 1.1.0 06 Apr 2021
    Release notes

    1.1.0

    • withDate now handles and supports UTC DateTime.
    • format now supports years, months, weeks and days as well.
    • Added inverse method which makes IsoDuration positive if it is negative and vice versa.
    • Updated README.
    Open source →
    Release notes
    • withDate now handles and supports UTC DateTime.
    • format now supports years, months, weeks and days as well.
    • Added inverse method which makes IsoDuration positive if it is negative and vice versa.
    • Updated README.
    Open source →
  3. 1.0.0 14 Mar 2021
    Release notes
    • Added toIso method which returns ISO 8601 Duration format from the IsoDuration object.
    • Added withDate method which adds/subtracts IsoDuration from a DateTime
    final isoDur = IsoDuration.parse('PT12H');
    final dateTime = DateTime(2021, 1, 20, 8); // 2021-01-20 08:00:00.000
    isoDur.withDate(dateTime); // 2021-01-20 20:00:00.000
    • Added format method which formats IsoDuration to specified String format
    final durFormat = IsoDuration.parse('PT4H5M');
    durFormat.format('See you in {hh}h {m}m'); // See you in 04h 5m
    • Other added methods: isAfter, isBefore, isAtSameMomentAs, isPrecise, hasDecimals, copyWith
    • Added a possibility to parse negative durations. Minus operator is allowed only before the literal P. An example:
    -P1DT15H
    
    • Bug fixes.
    • Updated dependencies.
    Open source →
    Release notes
    • Added toIso method which returns ISO 8601 Duration format from the IsoDuration object.
    • Added withDate method which adds/subtracts IsoDuration from a DateTime
    final isoDur = IsoDuration.parse('PT12H');
    final dateTime = DateTime(2021, 1, 20, 8); // 2021-01-20 08:00:00.000
    isoDur.withDate(dateTime); // 2021-01-20 20:00:00.000
    
    • Added format method which formats IsoDuration to specified String format
    final durFormat = IsoDuration.parse('PT4H5M');
    durFormat.format('See you in {hh}h {m}m'); // See you in 04h 5m
    
    • Other added methods: isAfter, isBefore, isAtSameMomentAs, isPrecise, hasDecimals, copyWith
    • Added a possibility to parse negative durations. Minus operator is allowed only before the literal P. An example:
    -P1DT15H
    
    • Bug fixes.
    • Updated dependencies.
    Open source →
  4. 0.2.0 26 Feb 2021
    Release notes
    • Added toSeconds method for calculating total sum of all individual parts.
    • Improved pub.dev score.
    • Renamed properties of IsoDuration to differentiate from the Dart's Duration.
    Open source →
    Release notes
    • Added toSeconds method for calculating total sum of all individual parts.
    • Improved pub.dev score.
    • Renamed properties of IsoDuration to differentiate from the Dart's Duration.
    Open source →
  5. 0.1.0 25 Feb 2021
    Release notes
    • Initial release.
    Open source →
    Release notes
    • Initial release.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive