use-date 0.0.1

Primitive calendar date helpers
Documentation
  • Coverage
  • 6.67%
    1 out of 15 items documented1 out of 13 items with examples
  • Size
  • Source code size: 7.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 411.59 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-calendar
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Primitive proleptic Gregorian date helpers.

These helpers keep calendar dates explicit and deterministic without adding timezone handling.

Examples

use use_date::{CalendarDate, add_days, day_of_year, days_between, is_valid_date};

let leap_day = CalendarDate::new(2024, 2, 29).unwrap();
let next_day = add_days(leap_day, 1);

assert!(is_valid_date(2024, 2, 29));
assert_eq!(day_of_year(2024, 2, 29).unwrap(), 60);
assert_eq!(next_day, CalendarDate::new(2024, 3, 1).unwrap());
assert_eq!(days_between(leap_day, next_day), 1);