m3e/day

Types

Day represents a day of the month, aligned with the ISO 8601 standard.

pub opaque type Day

Values

pub const default: Day
pub fn from_string(
  dd: String,
  mm: String,
  yy: String,
) -> Result(Day, String)

from_string parses a day from a string in the format “DD”. This constructor takes a day, month, and year as separate strings and returns a Result. It requires the day, month, and year to prevent an invalid day from being created, for example the 29th February in a Leap Year, or the 32nd day of a month.

pub fn new(day: Int, m: Int, y: Int) -> Result(Day, String)

new creates a Day value from a day, month, and year. This constructor takes a day, a Month, and a Year and returns a Result. It requires the day, month, and year to prevent an invalid day from being created, for example the 29th February in a Leap Year, or the 32nd day of a month.

pub fn to_string(d: Day) -> String
pub fn with_day(d: Day, day: Int) -> Result(Day, String)
Search Document