justinmimbs/elm-date-extra/2.1.1

NOTE: this package is not compatible with Elm 0.19.1

Date.Extra.Facts

This module contains reference information that may be useful when working with dates, but it doesn't contain functions for working with the Date type directly.

Basics

isLeapYear : Int -> Bool
daysInMonth : Int -> Month -> Int
daysInMonth 2000 Feb -- 29
daysInMonth 2001 Feb -- 28
daysBeforeStartOfMonth : Int -> Month -> Int
daysBeforeStartOfMonth 2000 Mar -- 60
daysBeforeStartOfMonth 2001 Mar -- 59
months : List Month

An ordered list of Date.Month values.

Conversions

monthNumberFromMonth : Month -> Int
monthNumberFromMonth Jan -- 1
monthFromMonthNumber : Int -> Month
monthFromMonthNumber 1 -- Jan
weekdayNumberFromDayOfWeek Mon -- 1
dayOfWeekFromWeekdayNumber 1 -- Mon

Constants

Values for the number of milliseconds per date part. These are equivalent to the constants available in the Time core library, but typed as integers instead of floats.

msPerHour : Int
msPerDay : Int