adius / vectual / TimeUtils.Core

Date core.

Info

monthToInt : Time.Month -> Basics.Int

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

intToMonth : Basics.Int -> Time.Month

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

daysInMonth : Basics.Int -> Time.Month -> Basics.Int

Return days in month for year month.

monthList : List Time.Month

List of months in order from Jan to Dec.

daysInNextMonth : Time.Posix -> Basics.Int

Return days in next calendar month.

daysInPrevMonth : Time.Posix -> Basics.Int

Return days in next calendar month.

daysInMonthDate : Time.Posix -> Basics.Int

Days in month for given date.

isLeapYear : Basics.Int -> Basics.Bool

Return True if Year is a leap year.

isLeapYearDate : Time.Posix -> Basics.Bool

Return True if Year of Date is a leap year.

yearToDayLength : Basics.Int -> Basics.Int

Return number of days in a year.

isoDayOfWeek : Time.Weekday -> Basics.Int

Return the Iso DayOfWeek Monday 1, to Sunday 7.

Utility

toFirstOfMonth : Time.Posix -> Time.Posix

Return date of first day of month.

firstOfNextMonthDate : Time.Posix -> Time.Posix

Return first of next month date.

lastOfMonthDate : Time.Posix -> Time.Posix

Return date of last day of month.

lastOfPrevMonthDate : Time.Posix -> Time.Posix

Return last of previous month date.

daysBackToStartOfWeek : Time.Weekday -> Time.Weekday -> Basics.Int

Return number of days back to start of week day.

First parameter Weekday - is current day of week. Second parameter Weekday - is start day of week.

Conversion

fromTime : Basics.Int -> Time.Posix

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

Iteration Utility

nextDay : Time.Weekday -> Time.Weekday

Return next day in calendar sequence.

prevDay : Time.Weekday -> Time.Weekday

Return previous day in calendar sequence.

nextMonth : Time.Month -> Time.Month

Return next month in calendar sequence.

prevMonth : Time.Month -> Time.Month

Return previous month in calendar sequence.

Date constants

epochDateStr : String

Epoch starting point for tick 0.

Date constants

ticksAMillisecond : Basics.Int

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

ticksASecond : Basics.Int

Ticks in a second.

ticksAMinute : Basics.Int

Ticks in a minute.

ticksAnHour : Basics.Int

Ticks in an hour.

ticksADay : Basics.Int

Ticks in a day.

ticksAWeek : Basics.Int

Ticks in a week.