1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//---------------------------------------------------------------------------------------------------- Use
use crate::;
//---------------------------------------------------------------------------------------------------- Use
/// If `year` is a leap year
///
/// Works with any year within `i128` unlike [`Year::is_leap`]
///
/// ```rust
/// # use nichi::*;
/// assert!(is_leap(2020));
/// assert!(is_leap(2024));
/// assert!(!is_leap(2019));
/// assert!(!is_leap(2023));
/// ```
///
/// ## Algorithm
/// <https://howardhinnant.github.io/date_algorithms.html#is_leap>
pub const
/// Get the last day of a month
///
/// Works with any year within `i128` unlike [`Year::days_in_month`]
///
/// A negative `year` represents BCE years, e.g, `-1` is `1 BCE`.
///
/// ```rust
/// # use nichi::*;
/// // Last day of January of 2000 was the 31st.
/// assert_eq!(
/// days_in_month(2000, Month::January),
/// DaysInMonth::ThirtyOne,
/// );
///
/// // Last day of February of 2020 was the 29th.
/// assert_eq!(
/// days_in_month(2020, Month::February),
/// DaysInMonth::TwentyNine,
/// );
/// ```
///
/// ## Algorithm
/// <https://howardhinnant.github.io/date_algorithms.html#last_day_of_month>
pub const