calendar-duration

Crates.iocalendar-duration
lib.rscalendar-duration
version1.0.0
sourcesrc
created_at2023-09-19 01:50:13.035131
updated_at2023-09-19 01:50:13.035131
descriptionA library containing a calendar respecting time duration.
homepage
repositoryhttps://github.com/brave-experiments/calendar-duration-rs
max_upload_size
id976426
size36,878
Ralph Giles (rillian)

documentation

README

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
Commit count: 14

cargo fmt