rluiten/elm-date-extra/7.2.0

NOTE: this package is not compatible with Elm 0.19.1

Date.Extra.Core

Date core.

Info

monthToInt : Month -> Int

Return month as integer. Jan = 1 to Dec = 12.

intToMonth : Int -> Month

Return integer as month. Jan <= 1 Feb == 2 up to Dec > 11.

daysInMonth : Int -> Month -> Int

Return days in month for year month.

monthList : List Month

List of months in order from Jan to Dec.

daysInNextMonth : Date -> Int

Return days in next calendar month.

daysInPrevMonth : Date -> Int

Return days in previous calendar month.

daysInMonthDate : Date -> Int

Days in month for given date.

isLeapYear : Int -> Bool

Return True if Year is a leap year.

isLeapYearDate : Date -> Bool

Return True if Year of Date is a leap year.

yearToDayLength : Int -> Int

Return number of days in a year.

isoDayOfWeek : Day -> Int

Return the Iso DayOfWeek Monday 1, to Sunday 7.

Utility

toFirstOfMonth : Date -> Date

Return date of first of month.

firstOfNextMonthDate : Date -> Date

Return first of next month date.

lastOfMonthDate : Date -> Date

Resturn date of last day of month.

lastOfPrevMonthDate : Date -> Date

Return last of previous month date.

daysBackToStartOfWeek : Day -> Day -> Int

Days back to start of week day.

Conversion

fromTime : Int -> Date

Convenience fromTime as time ticks are Elm Ints in this library.

toTime : Date -> Int

Convenience toTime as time ticks are Elm Ints in this library.

Iteration Utility

nextDay : Day -> Day

Return next day in calendar sequence.

prevDay : Day -> Day

Return previous day in calendar sequence.

nextMonth : Month -> Month

Return next month in calendar sequence.

prevMonth : Month -> Month

Return previous month in calendar sequence.

Date constants

epochDateStr : String

Epoch starting point for tick 0.

Date constants

Ticks in a millisecond. (this is 1 on Win 7 in Chrome)

Ticks in a second.

Ticks in a minute.

Ticks in an hour.

ticksADay : Int

Ticks in a day.

Ticks in a week.

Copyright (c) 2016 Robin Luiten