# m3e/day

# Types

## Day

opaque </>

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

    pub opaque type Day

# Values

## default

</>

    pub const default: Day

## from_string

</>

    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.

## new

</>

    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.

## to_string

</>

    pub fn to_string(d: Day) -> String

## with_day

</>

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

✨