#duration #time #calendar #time-parser #containing #respecting #compatible

calendar-duration

A library containing a calendar respecting time duration

1 stable release

1.0.0 Sep 19, 2023

#380 in Date and time

Download history 34/week @ 2024-03-14 18/week @ 2024-03-21 29/week @ 2024-03-28 20/week @ 2024-04-04 15/week @ 2024-04-11 28/week @ 2024-04-18 31/week @ 2024-04-25 10/week @ 2024-05-02 11/week @ 2024-05-09 1/week @ 2024-05-16 10/week @ 2024-05-23 11/week @ 2024-05-30 10/week @ 2024-06-06 56/week @ 2024-06-13 48/week @ 2024-06-20 16/week @ 2024-06-27

131 downloads per month

MPL-2.0 license

16KB
319 lines

calendar-duration

Crates.io docs.rs GitHub

A Rust library containing a calendar respecting duration that is compatible with the time crate. Supports parsing and displaying to/from strings. Also supports addition and subtraction with OffsetDateTime.

Usage

Add the following dependency:

calendar-duration = "<latest version>"

See documentation for details.

Time string syntax

  • y for years
  • mon for months
  • w for weeks
  • d for days
  • h for hours
  • m for minutes
  • s for seconds

The string can be prefixed with - for negative durations.

Examples

  • 1y3mon4d
  • -3w4m5s

Dependencies

~740KB
~13K SLoC