js-sdk-calendar
Simple calendar utilities.
library
$ isFirstWeek(date : Date) -> Boolean
$ isLastWeek(date : Date) -> Boolean
$ monthRange(s : Number, e : Number, f : Number -> b) -> [b]
$ rangeInMonth(d : Date, s : Number, e : Number, f : Number -> b) -> [b]
$ beginOfMonth(d : Date) -> Date
$ endOfMonth(d : Date) -> Date
$ beginOfDay(d : Date) -> Date
$ endOfDay(d : Date) -> Date
$ beginOfNextMonth(d : Date) -> Date
$ endOfPreviosMonth(d : Date) -> Date
$ firstWeekOfMonth(d : Date, f : Number -> b) -> [b]
$ firstWeekOfNextMonth(d : Date, f : Number -> b) -> [b]
$ lastWeekOfMonth(d : Date, f : Number -> b) -> [b]
$ lastWeekOfPreviousMonth(d : Date, f : Number -> b) -> [b]
$ weekImpl(d : Date, f : Number -> b) -> [b]
$ week(d : Date) -> [Number]
= week(new Date(2017, 0, 1)) == weekImpl(new Date(2017, 0, 1), identity)
$ weekCImpl(d : Date, f : (Number, Number, Number) -> b) -> [b]
$ weekC(d : Date) -> [Number]
= weekC(new Date(2017, 0, 1)) == weekCImpl(new Date(2017, 0, 1), (y, m, d) => [y, m, d])
$ monthImpl(d : Date, f : Number -> b) : [[b]]
$ month(date : Date) -> [[Number]]
= month(new Date(2017, 0, 1)) == monthImpl(new Date(2017, 0, 1), identity)
$ monthCImpl(d : Date, f : (Number, Number, Number) -> b) -> [[b]]
$ monthC(d : Date) -> [[Number]]
= monthC(new Date(2017, 0, 1)) == monthCImpl(new Date(2017, 0, 1), (y, m, d) => [y, m, d])
license
See license.md
or visit Unlicense.