tempo/month_year

Functions

pub fn compare(a: MonthYear, to b: MonthYear) -> Order
pub fn days_of(my: MonthYear) -> Int
pub fn next(month: MonthYear) -> MonthYear

Returns the next month in the civil calendar.

Example

tempo.MonthYear(tempo.Jan, 2024)
|> month_year.next
// -> tempo.MonthYear(tempo.Feb, 2024)
tempo.MonthYear(tempo.Dec, 2024)
|> month_year.next
// -> tempo.MonthYear(tempo.Jan, 2025)
pub fn prior(my: MonthYear) -> MonthYear

Returns the previous month in the civil calendar.

Example

tempo.MonthYear(tempo.Jan, 2024)
|> month_year.prior
// -> tempo.MonthYear(tempo.Dec, 2023)
tempo.MonthYear(tempo.Feb, 2024)
|> month_year.prior
// -> tempo.MonthYear(tempo.Jan, 2024)
pub fn to_int(my: MonthYear) -> Int
Search Document