year-helper

Crates.ioyear-helper
lib.rsyear-helper
version0.2.1
sourcesrc
created_at2022-12-27 12:28:37.280652
updated_at2023-01-06 13:25:39.116322
descriptionThis library provides some useful functions to deal with years.
homepagehttps://magiclen.org/year-helper
repositoryhttps://github.com/magiclen/year-helper
max_upload_size
id746186
size5,739
Magic Len (Ron Li) (magiclen)

documentation

README

Year Helper

CI

This library provides some useful functions to deal with years.

Usage

let year = 2020;
let month = 2;

let leap_year = year_helper::is_leap_year(year);

let days_in_month = year_helper::get_days_in_month(year, month);
let days_in_year = year_helper::get_days_in_year(year);

// or use the following functions if the year has been determined whether it is a leap year
let days_in_month = year_helper::get_days_in_month_2(leap_year, month);
let days_in_year = year_helper::get_days_in_year_2(leap_year);

Crates.io

https://crates.io/crates/year-helper

Documentation

https://docs.rs/year-helper

License

MIT

Commit count: 6

cargo fmt