use-year 0.0.1

Primitive calendar year helpers
Documentation
  • Coverage
  • 8.33%
    1 out of 12 items documented1 out of 11 items with examples
  • Size
  • Source code size: 4.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 381.67 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 26s 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 calendar year helpers.

These helpers keep leap-year and year-boundary calculations explicit.

Examples

use use_year::{CalendarYear, first_day_of_year, last_day_of_year};

let year = CalendarYear::new(2024);

assert!(year.is_leap_year());
assert_eq!(year.days_in_year(), 366);
assert_eq!(first_day_of_year(2024).unwrap().month(), 1);
assert_eq!(last_day_of_year(2024).unwrap().day(), 31);