Month

The built-in type Month represents months.

It has the following definition:

type Month
  | January | February | March
  | April | May | June
  | July | August | September
  | October | November | December

toInt : Month -> Int

Returns the month value for the given month.

Examples

val jan = Month::toInt January
//      = 1

val aug = Month::toInt August
//      = 8

firstDayOfMonth : Boolean -> Month -> Int

Returns the day-of-year of the 1st of the given month. The boolean argument flags whether the year is a leap year or not.

Examples

val firstOfAugustLeapYear = Month::firstDayOfMonth True August
//                        = 214

val firstOfAugustNonLeapYear = Month::firstDayOfMonth False August
//                           = 213

firstMonthOfQuarter : Month -> Month

Returns the first month of the quarter containing the given month.

Examples

val jan = Month::firstMonthOfQuarter March
//      = January

val apr = Month::firstMonthOfQuarter May
//      = April