js-sdk-calendar
Simple calendar utilities.
library
$ isFirstWeekdate : Date -> Boolean // true if it is in first week. $ isLastWeekdate : Date -> Boolean // true if it is in last week. $ monthRanges : Number, e : Number, f : Number -> b -> // Returns a range of days from 's' start and 'e' end.// For each day apply function 'f'.//// Note: 's' and 'e' are not checked if they are actually in the month.// Use `rangeInMonth` to validate those values. $ rangeInMonthd : Date, s : Number, e : Number, f : Number -> b -> // Returns a range of days from 's' start and 'e' end.// Use date 'd' to check if 'e' don't pass the last day of the month,// if it does, return the last day. $ beginOfMonthd : Date -> Date // Returns the first day as 'Date' using date 'd'. $ endOfMonthd : Date -> Date // Returns the last day as 'Date' using date 'd'. $ beginOfDayd : Date -> Date // Returns the begin of day as 'Date' using date 'd'. $ endOfDayd : Date -> Date // Returns the end of day as 'Date' using date 'd'. $ beginOfNextMonthd : Date -> Date // Returns the first day of the next month of 'd' as 'Date'. $ endOfPreviosMonthd : Date -> Date // Returns the last day of the previous month of 'd' as 'Date'. $ firstWeekOfMonthd : Date, f : Number -> b -> // Returns an 'Array' of days of the first week of 'd'.// For each day apply function 'f'. $ firstWeekOfNextMonthd : Date, f : Number -> b -> // Returns an 'Array' of days of the first week of the next month of 'd'.// For each day apply function 'f'. $ lastWeekOfMonthd : Date, f : Number -> b -> // Returns an 'Array' of days of the last week of 'd'.// For each day apply function 'f'. $ lastWeekOfPreviousMonthd : Date, f : Number -> b -> // Returns an 'Array' of days of the last week of the previous month of 'd'.// For each day apply function 'f'. $ weekImpld : Date, f : Number -> b -> // Generic version of the function to generate a week calendar.//// Note: Blank spaces of the 'Array' are all 'null' and 'f' is not applied// to them. $ weekd : Date -> // Generate a list of days from the week of date. = weeknew Date2017, 0, 1 == weekImplnew Date2017, 0, 1, identity $ weekCImpld : Date, f : Number, Number, Number -> b -> // Generic function to generate a continuous week calendar of 'd'.// This function will fill the blank spaces of the week// with the next or previous week if needed.// Apply 'f' to each day. This function will receive the 'year', 'month' and 'day'. $ weekCd : Date -> // Generate a list of days of the week.// This function will fill the blank spaces of the week// with the next or previous week if needed. = weekCnew Date2017, 0, 1 == weekCImplnew Date2017, 0, 1, $ monthImpld : Date, f : Number -> b : // Generic version of the function to generate a month calendar.//// Note: Blank spaces of the 'Array' are all 'null' and 'f' is not applied// to them. $ monthdate : Date -> // Generate a list of weeks of (list of lists). = monthnew Date2017, 0, 1 == monthImplnew Date2017, 0, 1, identity $ monthCImpld : Date, f : Number, Number, Number -> b -> // Generic function to generate a continuous month calendar of 'd'.// This function will fill the blank spaces of the week// with the next or previous week if needed.// Apply 'f' to each day. This function will receive the 'year', 'month' and 'day'. $ monthCd : Date -> // Generate a list of week of days of the month.// This function will fill the blank spaces of the week// with the next or previous week if needed. = monthCnew Date2017, 0, 1 == monthCImplnew Date2017, 0, 1,
license
See license.md
or visit Unlicense.