diff --git a/CHANGELOG.md b/CHANGELOG.md
index 83ccef7e38..4845c35800 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -162,6 +162,8 @@ for the list of changes made since `v2.0.0-alpha.1`.
- [New `roundToNearestMinutes` function](https://github.com/date-fns/date-fns/pull/928). Kudos to [@xkizer](https://github.com/xkizer).
+- Added new function `fromUnixTime`
+
### Changed
- **BREAKING**: new format string API for `format` function
diff --git a/src/esm/fp/index.js b/src/esm/fp/index.js
index 080c08961f..30ca3946d7 100644
--- a/src/esm/fp/index.js
+++ b/src/esm/fp/index.js
@@ -1,300 +1,562 @@
// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.
-export {default as addDays} from './addDays/index.js'
-export {default as addDaysWithOptions} from './addDaysWithOptions/index.js'
-export {default as addHours} from './addHours/index.js'
-export {default as addHoursWithOptions} from './addHoursWithOptions/index.js'
-export {default as addISOWeekYears} from './addISOWeekYears/index.js'
-export {default as addISOWeekYearsWithOptions} from './addISOWeekYearsWithOptions/index.js'
-export {default as addMilliseconds} from './addMilliseconds/index.js'
-export {default as addMillisecondsWithOptions} from './addMillisecondsWithOptions/index.js'
-export {default as addMinutes} from './addMinutes/index.js'
-export {default as addMinutesWithOptions} from './addMinutesWithOptions/index.js'
-export {default as addMonths} from './addMonths/index.js'
-export {default as addMonthsWithOptions} from './addMonthsWithOptions/index.js'
-export {default as addQuarters} from './addQuarters/index.js'
-export {default as addQuartersWithOptions} from './addQuartersWithOptions/index.js'
-export {default as addSeconds} from './addSeconds/index.js'
-export {default as addSecondsWithOptions} from './addSecondsWithOptions/index.js'
-export {default as addWeeks} from './addWeeks/index.js'
-export {default as addWeeksWithOptions} from './addWeeksWithOptions/index.js'
-export {default as addYears} from './addYears/index.js'
-export {default as addYearsWithOptions} from './addYearsWithOptions/index.js'
-export {default as areIntervalsOverlapping} from './areIntervalsOverlapping/index.js'
-export {default as areIntervalsOverlappingWithOptions} from './areIntervalsOverlappingWithOptions/index.js'
-export {default as closestIndexTo} from './closestIndexTo/index.js'
-export {default as closestIndexToWithOptions} from './closestIndexToWithOptions/index.js'
-export {default as closestTo} from './closestTo/index.js'
-export {default as closestToWithOptions} from './closestToWithOptions/index.js'
-export {default as compareAsc} from './compareAsc/index.js'
-export {default as compareAscWithOptions} from './compareAscWithOptions/index.js'
-export {default as compareDesc} from './compareDesc/index.js'
-export {default as compareDescWithOptions} from './compareDescWithOptions/index.js'
-export {default as differenceInCalendarDays} from './differenceInCalendarDays/index.js'
-export {default as differenceInCalendarDaysWithOptions} from './differenceInCalendarDaysWithOptions/index.js'
-export {default as differenceInCalendarISOWeekYears} from './differenceInCalendarISOWeekYears/index.js'
-export {default as differenceInCalendarISOWeekYearsWithOptions} from './differenceInCalendarISOWeekYearsWithOptions/index.js'
-export {default as differenceInCalendarISOWeeks} from './differenceInCalendarISOWeeks/index.js'
-export {default as differenceInCalendarISOWeeksWithOptions} from './differenceInCalendarISOWeeksWithOptions/index.js'
-export {default as differenceInCalendarMonths} from './differenceInCalendarMonths/index.js'
-export {default as differenceInCalendarMonthsWithOptions} from './differenceInCalendarMonthsWithOptions/index.js'
-export {default as differenceInCalendarQuarters} from './differenceInCalendarQuarters/index.js'
-export {default as differenceInCalendarQuartersWithOptions} from './differenceInCalendarQuartersWithOptions/index.js'
-export {default as differenceInCalendarWeeks} from './differenceInCalendarWeeks/index.js'
-export {default as differenceInCalendarWeeksWithOptions} from './differenceInCalendarWeeksWithOptions/index.js'
-export {default as differenceInCalendarYears} from './differenceInCalendarYears/index.js'
-export {default as differenceInCalendarYearsWithOptions} from './differenceInCalendarYearsWithOptions/index.js'
-export {default as differenceInDays} from './differenceInDays/index.js'
-export {default as differenceInDaysWithOptions} from './differenceInDaysWithOptions/index.js'
-export {default as differenceInHours} from './differenceInHours/index.js'
-export {default as differenceInHoursWithOptions} from './differenceInHoursWithOptions/index.js'
-export {default as differenceInISOWeekYears} from './differenceInISOWeekYears/index.js'
-export {default as differenceInISOWeekYearsWithOptions} from './differenceInISOWeekYearsWithOptions/index.js'
-export {default as differenceInMilliseconds} from './differenceInMilliseconds/index.js'
-export {default as differenceInMillisecondsWithOptions} from './differenceInMillisecondsWithOptions/index.js'
-export {default as differenceInMinutes} from './differenceInMinutes/index.js'
-export {default as differenceInMinutesWithOptions} from './differenceInMinutesWithOptions/index.js'
-export {default as differenceInMonths} from './differenceInMonths/index.js'
-export {default as differenceInMonthsWithOptions} from './differenceInMonthsWithOptions/index.js'
-export {default as differenceInQuarters} from './differenceInQuarters/index.js'
-export {default as differenceInQuartersWithOptions} from './differenceInQuartersWithOptions/index.js'
-export {default as differenceInSeconds} from './differenceInSeconds/index.js'
-export {default as differenceInSecondsWithOptions} from './differenceInSecondsWithOptions/index.js'
-export {default as differenceInWeeks} from './differenceInWeeks/index.js'
-export {default as differenceInWeeksWithOptions} from './differenceInWeeksWithOptions/index.js'
-export {default as differenceInYears} from './differenceInYears/index.js'
-export {default as differenceInYearsWithOptions} from './differenceInYearsWithOptions/index.js'
-export {default as eachDayOfInterval} from './eachDayOfInterval/index.js'
-export {default as eachDayOfIntervalWithOptions} from './eachDayOfIntervalWithOptions/index.js'
-export {default as eachWeekOfInterval} from './eachWeekOfInterval/index.js'
-export {default as eachWeekOfIntervalWithOptions} from './eachWeekOfIntervalWithOptions/index.js'
-export {default as endOfDay} from './endOfDay/index.js'
-export {default as endOfDayWithOptions} from './endOfDayWithOptions/index.js'
-export {default as endOfDecade} from './endOfDecade/index.js'
-export {default as endOfDecadeWithOptions} from './endOfDecadeWithOptions/index.js'
-export {default as endOfHour} from './endOfHour/index.js'
-export {default as endOfHourWithOptions} from './endOfHourWithOptions/index.js'
-export {default as endOfISOWeek} from './endOfISOWeek/index.js'
-export {default as endOfISOWeekWithOptions} from './endOfISOWeekWithOptions/index.js'
-export {default as endOfISOWeekYear} from './endOfISOWeekYear/index.js'
-export {default as endOfISOWeekYearWithOptions} from './endOfISOWeekYearWithOptions/index.js'
-export {default as endOfMinute} from './endOfMinute/index.js'
-export {default as endOfMinuteWithOptions} from './endOfMinuteWithOptions/index.js'
-export {default as endOfMonth} from './endOfMonth/index.js'
-export {default as endOfMonthWithOptions} from './endOfMonthWithOptions/index.js'
-export {default as endOfQuarter} from './endOfQuarter/index.js'
-export {default as endOfQuarterWithOptions} from './endOfQuarterWithOptions/index.js'
-export {default as endOfSecond} from './endOfSecond/index.js'
-export {default as endOfSecondWithOptions} from './endOfSecondWithOptions/index.js'
-export {default as endOfWeek} from './endOfWeek/index.js'
-export {default as endOfWeekWithOptions} from './endOfWeekWithOptions/index.js'
-export {default as endOfYear} from './endOfYear/index.js'
-export {default as endOfYearWithOptions} from './endOfYearWithOptions/index.js'
-export {default as format} from './format/index.js'
-export {default as formatDistance} from './formatDistance/index.js'
-export {default as formatDistanceStrict} from './formatDistanceStrict/index.js'
-export {default as formatDistanceStrictWithOptions} from './formatDistanceStrictWithOptions/index.js'
-export {default as formatDistanceWithOptions} from './formatDistanceWithOptions/index.js'
-export {default as formatRelative} from './formatRelative/index.js'
-export {default as formatRelativeWithOptions} from './formatRelativeWithOptions/index.js'
-export {default as formatWithOptions} from './formatWithOptions/index.js'
-export {default as getDate} from './getDate/index.js'
-export {default as getDateWithOptions} from './getDateWithOptions/index.js'
-export {default as getDay} from './getDay/index.js'
-export {default as getDayOfYear} from './getDayOfYear/index.js'
-export {default as getDayOfYearWithOptions} from './getDayOfYearWithOptions/index.js'
-export {default as getDayWithOptions} from './getDayWithOptions/index.js'
-export {default as getDaysInMonth} from './getDaysInMonth/index.js'
-export {default as getDaysInMonthWithOptions} from './getDaysInMonthWithOptions/index.js'
-export {default as getDaysInYear} from './getDaysInYear/index.js'
-export {default as getDaysInYearWithOptions} from './getDaysInYearWithOptions/index.js'
-export {default as getDecade} from './getDecade/index.js'
-export {default as getDecadeWithOptions} from './getDecadeWithOptions/index.js'
-export {default as getHours} from './getHours/index.js'
-export {default as getHoursWithOptions} from './getHoursWithOptions/index.js'
-export {default as getISODay} from './getISODay/index.js'
-export {default as getISODayWithOptions} from './getISODayWithOptions/index.js'
-export {default as getISOWeek} from './getISOWeek/index.js'
-export {default as getISOWeekWithOptions} from './getISOWeekWithOptions/index.js'
-export {default as getISOWeekYear} from './getISOWeekYear/index.js'
-export {default as getISOWeekYearWithOptions} from './getISOWeekYearWithOptions/index.js'
-export {default as getISOWeeksInYear} from './getISOWeeksInYear/index.js'
-export {default as getISOWeeksInYearWithOptions} from './getISOWeeksInYearWithOptions/index.js'
-export {default as getMilliseconds} from './getMilliseconds/index.js'
-export {default as getMillisecondsWithOptions} from './getMillisecondsWithOptions/index.js'
-export {default as getMinutes} from './getMinutes/index.js'
-export {default as getMinutesWithOptions} from './getMinutesWithOptions/index.js'
-export {default as getMonth} from './getMonth/index.js'
-export {default as getMonthWithOptions} from './getMonthWithOptions/index.js'
-export {default as getOverlappingDaysInIntervals} from './getOverlappingDaysInIntervals/index.js'
-export {default as getOverlappingDaysInIntervalsWithOptions} from './getOverlappingDaysInIntervalsWithOptions/index.js'
-export {default as getQuarter} from './getQuarter/index.js'
-export {default as getQuarterWithOptions} from './getQuarterWithOptions/index.js'
-export {default as getSeconds} from './getSeconds/index.js'
-export {default as getSecondsWithOptions} from './getSecondsWithOptions/index.js'
-export {default as getTime} from './getTime/index.js'
-export {default as getTimeWithOptions} from './getTimeWithOptions/index.js'
-export {default as getUnixTime} from './getUnixTime/index.js'
-export {default as getUnixTimeWithOptions} from './getUnixTimeWithOptions/index.js'
-export {default as getWeek} from './getWeek/index.js'
-export {default as getWeekOfMonth} from './getWeekOfMonth/index.js'
-export {default as getWeekOfMonthWithOptions} from './getWeekOfMonthWithOptions/index.js'
-export {default as getWeekWithOptions} from './getWeekWithOptions/index.js'
-export {default as getWeekYear} from './getWeekYear/index.js'
-export {default as getWeekYearWithOptions} from './getWeekYearWithOptions/index.js'
-export {default as getWeeksInMonth} from './getWeeksInMonth/index.js'
-export {default as getWeeksInMonthWithOptions} from './getWeeksInMonthWithOptions/index.js'
-export {default as getYear} from './getYear/index.js'
-export {default as getYearWithOptions} from './getYearWithOptions/index.js'
-export {default as isAfter} from './isAfter/index.js'
-export {default as isAfterWithOptions} from './isAfterWithOptions/index.js'
-export {default as isBefore} from './isBefore/index.js'
-export {default as isBeforeWithOptions} from './isBeforeWithOptions/index.js'
-export {default as isDate} from './isDate/index.js'
-export {default as isDateWithOptions} from './isDateWithOptions/index.js'
-export {default as isEqual} from './isEqual/index.js'
-export {default as isEqualWithOptions} from './isEqualWithOptions/index.js'
-export {default as isFirstDayOfMonth} from './isFirstDayOfMonth/index.js'
-export {default as isFirstDayOfMonthWithOptions} from './isFirstDayOfMonthWithOptions/index.js'
-export {default as isFriday} from './isFriday/index.js'
-export {default as isFridayWithOptions} from './isFridayWithOptions/index.js'
-export {default as isLastDayOfMonth} from './isLastDayOfMonth/index.js'
-export {default as isLastDayOfMonthWithOptions} from './isLastDayOfMonthWithOptions/index.js'
-export {default as isLeapYear} from './isLeapYear/index.js'
-export {default as isLeapYearWithOptions} from './isLeapYearWithOptions/index.js'
-export {default as isMonday} from './isMonday/index.js'
-export {default as isMondayWithOptions} from './isMondayWithOptions/index.js'
-export {default as isSameDay} from './isSameDay/index.js'
-export {default as isSameDayWithOptions} from './isSameDayWithOptions/index.js'
-export {default as isSameHour} from './isSameHour/index.js'
-export {default as isSameHourWithOptions} from './isSameHourWithOptions/index.js'
-export {default as isSameISOWeek} from './isSameISOWeek/index.js'
-export {default as isSameISOWeekWithOptions} from './isSameISOWeekWithOptions/index.js'
-export {default as isSameISOWeekYear} from './isSameISOWeekYear/index.js'
-export {default as isSameISOWeekYearWithOptions} from './isSameISOWeekYearWithOptions/index.js'
-export {default as isSameMinute} from './isSameMinute/index.js'
-export {default as isSameMinuteWithOptions} from './isSameMinuteWithOptions/index.js'
-export {default as isSameMonth} from './isSameMonth/index.js'
-export {default as isSameMonthWithOptions} from './isSameMonthWithOptions/index.js'
-export {default as isSameQuarter} from './isSameQuarter/index.js'
-export {default as isSameQuarterWithOptions} from './isSameQuarterWithOptions/index.js'
-export {default as isSameSecond} from './isSameSecond/index.js'
-export {default as isSameSecondWithOptions} from './isSameSecondWithOptions/index.js'
-export {default as isSameWeek} from './isSameWeek/index.js'
-export {default as isSameWeekWithOptions} from './isSameWeekWithOptions/index.js'
-export {default as isSameYear} from './isSameYear/index.js'
-export {default as isSameYearWithOptions} from './isSameYearWithOptions/index.js'
-export {default as isSaturday} from './isSaturday/index.js'
-export {default as isSaturdayWithOptions} from './isSaturdayWithOptions/index.js'
-export {default as isSunday} from './isSunday/index.js'
-export {default as isSundayWithOptions} from './isSundayWithOptions/index.js'
-export {default as isThursday} from './isThursday/index.js'
-export {default as isThursdayWithOptions} from './isThursdayWithOptions/index.js'
-export {default as isTuesday} from './isTuesday/index.js'
-export {default as isTuesdayWithOptions} from './isTuesdayWithOptions/index.js'
-export {default as isValid} from './isValid/index.js'
-export {default as isValidWithOptions} from './isValidWithOptions/index.js'
-export {default as isWednesday} from './isWednesday/index.js'
-export {default as isWednesdayWithOptions} from './isWednesdayWithOptions/index.js'
-export {default as isWeekend} from './isWeekend/index.js'
-export {default as isWeekendWithOptions} from './isWeekendWithOptions/index.js'
-export {default as isWithinInterval} from './isWithinInterval/index.js'
-export {default as isWithinIntervalWithOptions} from './isWithinIntervalWithOptions/index.js'
-export {default as lastDayOfDecade} from './lastDayOfDecade/index.js'
-export {default as lastDayOfDecadeWithOptions} from './lastDayOfDecadeWithOptions/index.js'
-export {default as lastDayOfISOWeek} from './lastDayOfISOWeek/index.js'
-export {default as lastDayOfISOWeekWithOptions} from './lastDayOfISOWeekWithOptions/index.js'
-export {default as lastDayOfISOWeekYear} from './lastDayOfISOWeekYear/index.js'
-export {default as lastDayOfISOWeekYearWithOptions} from './lastDayOfISOWeekYearWithOptions/index.js'
-export {default as lastDayOfMonth} from './lastDayOfMonth/index.js'
-export {default as lastDayOfMonthWithOptions} from './lastDayOfMonthWithOptions/index.js'
-export {default as lastDayOfQuarter} from './lastDayOfQuarter/index.js'
-export {default as lastDayOfQuarterWithOptions} from './lastDayOfQuarterWithOptions/index.js'
-export {default as lastDayOfWeek} from './lastDayOfWeek/index.js'
-export {default as lastDayOfWeekWithOptions} from './lastDayOfWeekWithOptions/index.js'
-export {default as lastDayOfYear} from './lastDayOfYear/index.js'
-export {default as lastDayOfYearWithOptions} from './lastDayOfYearWithOptions/index.js'
-export {default as max} from './max/index.js'
-export {default as maxWithOptions} from './maxWithOptions/index.js'
-export {default as min} from './min/index.js'
-export {default as minWithOptions} from './minWithOptions/index.js'
-export {default as parse} from './parse/index.js'
-export {default as parseWithOptions} from './parseWithOptions/index.js'
-export {default as roundToNearestMinutes} from './roundToNearestMinutes/index.js'
-export {default as roundToNearestMinutesWithOptions} from './roundToNearestMinutesWithOptions/index.js'
-export {default as setDate} from './setDate/index.js'
-export {default as setDateWithOptions} from './setDateWithOptions/index.js'
-export {default as setDay} from './setDay/index.js'
-export {default as setDayOfYear} from './setDayOfYear/index.js'
-export {default as setDayOfYearWithOptions} from './setDayOfYearWithOptions/index.js'
-export {default as setDayWithOptions} from './setDayWithOptions/index.js'
-export {default as setHours} from './setHours/index.js'
-export {default as setHoursWithOptions} from './setHoursWithOptions/index.js'
-export {default as setISODay} from './setISODay/index.js'
-export {default as setISODayWithOptions} from './setISODayWithOptions/index.js'
-export {default as setISOWeek} from './setISOWeek/index.js'
-export {default as setISOWeekWithOptions} from './setISOWeekWithOptions/index.js'
-export {default as setISOWeekYear} from './setISOWeekYear/index.js'
-export {default as setISOWeekYearWithOptions} from './setISOWeekYearWithOptions/index.js'
-export {default as setMilliseconds} from './setMilliseconds/index.js'
-export {default as setMillisecondsWithOptions} from './setMillisecondsWithOptions/index.js'
-export {default as setMinutes} from './setMinutes/index.js'
-export {default as setMinutesWithOptions} from './setMinutesWithOptions/index.js'
-export {default as setMonth} from './setMonth/index.js'
-export {default as setMonthWithOptions} from './setMonthWithOptions/index.js'
-export {default as setQuarter} from './setQuarter/index.js'
-export {default as setQuarterWithOptions} from './setQuarterWithOptions/index.js'
-export {default as setSeconds} from './setSeconds/index.js'
-export {default as setSecondsWithOptions} from './setSecondsWithOptions/index.js'
-export {default as setWeek} from './setWeek/index.js'
-export {default as setWeekWithOptions} from './setWeekWithOptions/index.js'
-export {default as setWeekYear} from './setWeekYear/index.js'
-export {default as setWeekYearWithOptions} from './setWeekYearWithOptions/index.js'
-export {default as setYear} from './setYear/index.js'
-export {default as setYearWithOptions} from './setYearWithOptions/index.js'
-export {default as startOfDay} from './startOfDay/index.js'
-export {default as startOfDayWithOptions} from './startOfDayWithOptions/index.js'
-export {default as startOfDecade} from './startOfDecade/index.js'
-export {default as startOfDecadeWithOptions} from './startOfDecadeWithOptions/index.js'
-export {default as startOfHour} from './startOfHour/index.js'
-export {default as startOfHourWithOptions} from './startOfHourWithOptions/index.js'
-export {default as startOfISOWeek} from './startOfISOWeek/index.js'
-export {default as startOfISOWeekWithOptions} from './startOfISOWeekWithOptions/index.js'
-export {default as startOfISOWeekYear} from './startOfISOWeekYear/index.js'
-export {default as startOfISOWeekYearWithOptions} from './startOfISOWeekYearWithOptions/index.js'
-export {default as startOfMinute} from './startOfMinute/index.js'
-export {default as startOfMinuteWithOptions} from './startOfMinuteWithOptions/index.js'
-export {default as startOfMonth} from './startOfMonth/index.js'
-export {default as startOfMonthWithOptions} from './startOfMonthWithOptions/index.js'
-export {default as startOfQuarter} from './startOfQuarter/index.js'
-export {default as startOfQuarterWithOptions} from './startOfQuarterWithOptions/index.js'
-export {default as startOfSecond} from './startOfSecond/index.js'
-export {default as startOfSecondWithOptions} from './startOfSecondWithOptions/index.js'
-export {default as startOfWeek} from './startOfWeek/index.js'
-export {default as startOfWeekWithOptions} from './startOfWeekWithOptions/index.js'
-export {default as startOfWeekYear} from './startOfWeekYear/index.js'
-export {default as startOfWeekYearWithOptions} from './startOfWeekYearWithOptions/index.js'
-export {default as startOfYear} from './startOfYear/index.js'
-export {default as startOfYearWithOptions} from './startOfYearWithOptions/index.js'
-export {default as subDays} from './subDays/index.js'
-export {default as subDaysWithOptions} from './subDaysWithOptions/index.js'
-export {default as subHours} from './subHours/index.js'
-export {default as subHoursWithOptions} from './subHoursWithOptions/index.js'
-export {default as subISOWeekYears} from './subISOWeekYears/index.js'
-export {default as subISOWeekYearsWithOptions} from './subISOWeekYearsWithOptions/index.js'
-export {default as subMilliseconds} from './subMilliseconds/index.js'
-export {default as subMillisecondsWithOptions} from './subMillisecondsWithOptions/index.js'
-export {default as subMinutes} from './subMinutes/index.js'
-export {default as subMinutesWithOptions} from './subMinutesWithOptions/index.js'
-export {default as subMonths} from './subMonths/index.js'
-export {default as subMonthsWithOptions} from './subMonthsWithOptions/index.js'
-export {default as subQuarters} from './subQuarters/index.js'
-export {default as subQuartersWithOptions} from './subQuartersWithOptions/index.js'
-export {default as subSeconds} from './subSeconds/index.js'
-export {default as subSecondsWithOptions} from './subSecondsWithOptions/index.js'
-export {default as subWeeks} from './subWeeks/index.js'
-export {default as subWeeksWithOptions} from './subWeeksWithOptions/index.js'
-export {default as subYears} from './subYears/index.js'
-export {default as subYearsWithOptions} from './subYearsWithOptions/index.js'
-export {default as toDate} from './toDate/index.js'
-export {default as toDateWithOptions} from './toDateWithOptions/index.js'
+export { default as addDays } from './addDays/index.js'
+export { default as addDaysWithOptions } from './addDaysWithOptions/index.js'
+export { default as addHours } from './addHours/index.js'
+export { default as addHoursWithOptions } from './addHoursWithOptions/index.js'
+export { default as addISOWeekYears } from './addISOWeekYears/index.js'
+export {
+ default as addISOWeekYearsWithOptions
+} from './addISOWeekYearsWithOptions/index.js'
+export { default as addMilliseconds } from './addMilliseconds/index.js'
+export {
+ default as addMillisecondsWithOptions
+} from './addMillisecondsWithOptions/index.js'
+export { default as addMinutes } from './addMinutes/index.js'
+export {
+ default as addMinutesWithOptions
+} from './addMinutesWithOptions/index.js'
+export { default as addMonths } from './addMonths/index.js'
+export {
+ default as addMonthsWithOptions
+} from './addMonthsWithOptions/index.js'
+export { default as addQuarters } from './addQuarters/index.js'
+export {
+ default as addQuartersWithOptions
+} from './addQuartersWithOptions/index.js'
+export { default as addSeconds } from './addSeconds/index.js'
+export {
+ default as addSecondsWithOptions
+} from './addSecondsWithOptions/index.js'
+export { default as addWeeks } from './addWeeks/index.js'
+export { default as addWeeksWithOptions } from './addWeeksWithOptions/index.js'
+export { default as addYears } from './addYears/index.js'
+export { default as addYearsWithOptions } from './addYearsWithOptions/index.js'
+export {
+ default as areIntervalsOverlapping
+} from './areIntervalsOverlapping/index.js'
+export {
+ default as areIntervalsOverlappingWithOptions
+} from './areIntervalsOverlappingWithOptions/index.js'
+export { default as closestIndexTo } from './closestIndexTo/index.js'
+export {
+ default as closestIndexToWithOptions
+} from './closestIndexToWithOptions/index.js'
+export { default as closestTo } from './closestTo/index.js'
+export {
+ default as closestToWithOptions
+} from './closestToWithOptions/index.js'
+export { default as compareAsc } from './compareAsc/index.js'
+export {
+ default as compareAscWithOptions
+} from './compareAscWithOptions/index.js'
+export { default as compareDesc } from './compareDesc/index.js'
+export {
+ default as compareDescWithOptions
+} from './compareDescWithOptions/index.js'
+export {
+ default as differenceInCalendarDays
+} from './differenceInCalendarDays/index.js'
+export {
+ default as differenceInCalendarDaysWithOptions
+} from './differenceInCalendarDaysWithOptions/index.js'
+export {
+ default as differenceInCalendarISOWeekYears
+} from './differenceInCalendarISOWeekYears/index.js'
+export {
+ default as differenceInCalendarISOWeekYearsWithOptions
+} from './differenceInCalendarISOWeekYearsWithOptions/index.js'
+export {
+ default as differenceInCalendarISOWeeks
+} from './differenceInCalendarISOWeeks/index.js'
+export {
+ default as differenceInCalendarISOWeeksWithOptions
+} from './differenceInCalendarISOWeeksWithOptions/index.js'
+export {
+ default as differenceInCalendarMonths
+} from './differenceInCalendarMonths/index.js'
+export {
+ default as differenceInCalendarMonthsWithOptions
+} from './differenceInCalendarMonthsWithOptions/index.js'
+export {
+ default as differenceInCalendarQuarters
+} from './differenceInCalendarQuarters/index.js'
+export {
+ default as differenceInCalendarQuartersWithOptions
+} from './differenceInCalendarQuartersWithOptions/index.js'
+export {
+ default as differenceInCalendarWeeks
+} from './differenceInCalendarWeeks/index.js'
+export {
+ default as differenceInCalendarWeeksWithOptions
+} from './differenceInCalendarWeeksWithOptions/index.js'
+export {
+ default as differenceInCalendarYears
+} from './differenceInCalendarYears/index.js'
+export {
+ default as differenceInCalendarYearsWithOptions
+} from './differenceInCalendarYearsWithOptions/index.js'
+export { default as differenceInDays } from './differenceInDays/index.js'
+export {
+ default as differenceInDaysWithOptions
+} from './differenceInDaysWithOptions/index.js'
+export { default as differenceInHours } from './differenceInHours/index.js'
+export {
+ default as differenceInHoursWithOptions
+} from './differenceInHoursWithOptions/index.js'
+export {
+ default as differenceInISOWeekYears
+} from './differenceInISOWeekYears/index.js'
+export {
+ default as differenceInISOWeekYearsWithOptions
+} from './differenceInISOWeekYearsWithOptions/index.js'
+export {
+ default as differenceInMilliseconds
+} from './differenceInMilliseconds/index.js'
+export {
+ default as differenceInMillisecondsWithOptions
+} from './differenceInMillisecondsWithOptions/index.js'
+export { default as differenceInMinutes } from './differenceInMinutes/index.js'
+export {
+ default as differenceInMinutesWithOptions
+} from './differenceInMinutesWithOptions/index.js'
+export { default as differenceInMonths } from './differenceInMonths/index.js'
+export {
+ default as differenceInMonthsWithOptions
+} from './differenceInMonthsWithOptions/index.js'
+export {
+ default as differenceInQuarters
+} from './differenceInQuarters/index.js'
+export {
+ default as differenceInQuartersWithOptions
+} from './differenceInQuartersWithOptions/index.js'
+export { default as differenceInSeconds } from './differenceInSeconds/index.js'
+export {
+ default as differenceInSecondsWithOptions
+} from './differenceInSecondsWithOptions/index.js'
+export { default as differenceInWeeks } from './differenceInWeeks/index.js'
+export {
+ default as differenceInWeeksWithOptions
+} from './differenceInWeeksWithOptions/index.js'
+export { default as differenceInYears } from './differenceInYears/index.js'
+export {
+ default as differenceInYearsWithOptions
+} from './differenceInYearsWithOptions/index.js'
+export { default as eachDayOfInterval } from './eachDayOfInterval/index.js'
+export {
+ default as eachDayOfIntervalWithOptions
+} from './eachDayOfIntervalWithOptions/index.js'
+export { default as eachWeekOfInterval } from './eachWeekOfInterval/index.js'
+export {
+ default as eachWeekOfIntervalWithOptions
+} from './eachWeekOfIntervalWithOptions/index.js'
+export { default as endOfDay } from './endOfDay/index.js'
+export { default as endOfDayWithOptions } from './endOfDayWithOptions/index.js'
+export { default as endOfDecade } from './endOfDecade/index.js'
+export {
+ default as endOfDecadeWithOptions
+} from './endOfDecadeWithOptions/index.js'
+export { default as endOfHour } from './endOfHour/index.js'
+export {
+ default as endOfHourWithOptions
+} from './endOfHourWithOptions/index.js'
+export { default as endOfISOWeek } from './endOfISOWeek/index.js'
+export {
+ default as endOfISOWeekWithOptions
+} from './endOfISOWeekWithOptions/index.js'
+export { default as endOfISOWeekYear } from './endOfISOWeekYear/index.js'
+export {
+ default as endOfISOWeekYearWithOptions
+} from './endOfISOWeekYearWithOptions/index.js'
+export { default as endOfMinute } from './endOfMinute/index.js'
+export {
+ default as endOfMinuteWithOptions
+} from './endOfMinuteWithOptions/index.js'
+export { default as endOfMonth } from './endOfMonth/index.js'
+export {
+ default as endOfMonthWithOptions
+} from './endOfMonthWithOptions/index.js'
+export { default as endOfQuarter } from './endOfQuarter/index.js'
+export {
+ default as endOfQuarterWithOptions
+} from './endOfQuarterWithOptions/index.js'
+export { default as endOfSecond } from './endOfSecond/index.js'
+export {
+ default as endOfSecondWithOptions
+} from './endOfSecondWithOptions/index.js'
+export { default as endOfWeek } from './endOfWeek/index.js'
+export {
+ default as endOfWeekWithOptions
+} from './endOfWeekWithOptions/index.js'
+export { default as endOfYear } from './endOfYear/index.js'
+export {
+ default as endOfYearWithOptions
+} from './endOfYearWithOptions/index.js'
+export { default as format } from './format/index.js'
+export { default as formatDistance } from './formatDistance/index.js'
+export {
+ default as formatDistanceStrict
+} from './formatDistanceStrict/index.js'
+export {
+ default as formatDistanceStrictWithOptions
+} from './formatDistanceStrictWithOptions/index.js'
+export {
+ default as formatDistanceWithOptions
+} from './formatDistanceWithOptions/index.js'
+export { default as formatRelative } from './formatRelative/index.js'
+export {
+ default as formatRelativeWithOptions
+} from './formatRelativeWithOptions/index.js'
+export { default as formatWithOptions } from './formatWithOptions/index.js'
+export { default as fromUnixTime } from './fromUnixTime/index.js'
+export {
+ default as fromUnixTimeWithOptions
+} from './fromUnixTimeWithOptions/index.js'
+export { default as getDate } from './getDate/index.js'
+export { default as getDateWithOptions } from './getDateWithOptions/index.js'
+export { default as getDay } from './getDay/index.js'
+export { default as getDayOfYear } from './getDayOfYear/index.js'
+export {
+ default as getDayOfYearWithOptions
+} from './getDayOfYearWithOptions/index.js'
+export { default as getDayWithOptions } from './getDayWithOptions/index.js'
+export { default as getDaysInMonth } from './getDaysInMonth/index.js'
+export {
+ default as getDaysInMonthWithOptions
+} from './getDaysInMonthWithOptions/index.js'
+export { default as getDaysInYear } from './getDaysInYear/index.js'
+export {
+ default as getDaysInYearWithOptions
+} from './getDaysInYearWithOptions/index.js'
+export { default as getDecade } from './getDecade/index.js'
+export {
+ default as getDecadeWithOptions
+} from './getDecadeWithOptions/index.js'
+export { default as getHours } from './getHours/index.js'
+export { default as getHoursWithOptions } from './getHoursWithOptions/index.js'
+export { default as getISODay } from './getISODay/index.js'
+export {
+ default as getISODayWithOptions
+} from './getISODayWithOptions/index.js'
+export { default as getISOWeek } from './getISOWeek/index.js'
+export {
+ default as getISOWeekWithOptions
+} from './getISOWeekWithOptions/index.js'
+export { default as getISOWeekYear } from './getISOWeekYear/index.js'
+export {
+ default as getISOWeekYearWithOptions
+} from './getISOWeekYearWithOptions/index.js'
+export { default as getISOWeeksInYear } from './getISOWeeksInYear/index.js'
+export {
+ default as getISOWeeksInYearWithOptions
+} from './getISOWeeksInYearWithOptions/index.js'
+export { default as getMilliseconds } from './getMilliseconds/index.js'
+export {
+ default as getMillisecondsWithOptions
+} from './getMillisecondsWithOptions/index.js'
+export { default as getMinutes } from './getMinutes/index.js'
+export {
+ default as getMinutesWithOptions
+} from './getMinutesWithOptions/index.js'
+export { default as getMonth } from './getMonth/index.js'
+export { default as getMonthWithOptions } from './getMonthWithOptions/index.js'
+export {
+ default as getOverlappingDaysInIntervals
+} from './getOverlappingDaysInIntervals/index.js'
+export {
+ default as getOverlappingDaysInIntervalsWithOptions
+} from './getOverlappingDaysInIntervalsWithOptions/index.js'
+export { default as getQuarter } from './getQuarter/index.js'
+export {
+ default as getQuarterWithOptions
+} from './getQuarterWithOptions/index.js'
+export { default as getSeconds } from './getSeconds/index.js'
+export {
+ default as getSecondsWithOptions
+} from './getSecondsWithOptions/index.js'
+export { default as getTime } from './getTime/index.js'
+export { default as getTimeWithOptions } from './getTimeWithOptions/index.js'
+export { default as getUnixTime } from './getUnixTime/index.js'
+export {
+ default as getUnixTimeWithOptions
+} from './getUnixTimeWithOptions/index.js'
+export { default as getWeek } from './getWeek/index.js'
+export { default as getWeekOfMonth } from './getWeekOfMonth/index.js'
+export {
+ default as getWeekOfMonthWithOptions
+} from './getWeekOfMonthWithOptions/index.js'
+export { default as getWeekWithOptions } from './getWeekWithOptions/index.js'
+export { default as getWeekYear } from './getWeekYear/index.js'
+export {
+ default as getWeekYearWithOptions
+} from './getWeekYearWithOptions/index.js'
+export { default as getWeeksInMonth } from './getWeeksInMonth/index.js'
+export {
+ default as getWeeksInMonthWithOptions
+} from './getWeeksInMonthWithOptions/index.js'
+export { default as getYear } from './getYear/index.js'
+export { default as getYearWithOptions } from './getYearWithOptions/index.js'
+export { default as isAfter } from './isAfter/index.js'
+export { default as isAfterWithOptions } from './isAfterWithOptions/index.js'
+export { default as isBefore } from './isBefore/index.js'
+export { default as isBeforeWithOptions } from './isBeforeWithOptions/index.js'
+export { default as isDate } from './isDate/index.js'
+export { default as isDateWithOptions } from './isDateWithOptions/index.js'
+export { default as isEqual } from './isEqual/index.js'
+export { default as isEqualWithOptions } from './isEqualWithOptions/index.js'
+export { default as isFirstDayOfMonth } from './isFirstDayOfMonth/index.js'
+export {
+ default as isFirstDayOfMonthWithOptions
+} from './isFirstDayOfMonthWithOptions/index.js'
+export { default as isFriday } from './isFriday/index.js'
+export { default as isFridayWithOptions } from './isFridayWithOptions/index.js'
+export { default as isLastDayOfMonth } from './isLastDayOfMonth/index.js'
+export {
+ default as isLastDayOfMonthWithOptions
+} from './isLastDayOfMonthWithOptions/index.js'
+export { default as isLeapYear } from './isLeapYear/index.js'
+export {
+ default as isLeapYearWithOptions
+} from './isLeapYearWithOptions/index.js'
+export { default as isMonday } from './isMonday/index.js'
+export { default as isMondayWithOptions } from './isMondayWithOptions/index.js'
+export { default as isSameDay } from './isSameDay/index.js'
+export {
+ default as isSameDayWithOptions
+} from './isSameDayWithOptions/index.js'
+export { default as isSameHour } from './isSameHour/index.js'
+export {
+ default as isSameHourWithOptions
+} from './isSameHourWithOptions/index.js'
+export { default as isSameISOWeek } from './isSameISOWeek/index.js'
+export {
+ default as isSameISOWeekWithOptions
+} from './isSameISOWeekWithOptions/index.js'
+export { default as isSameISOWeekYear } from './isSameISOWeekYear/index.js'
+export {
+ default as isSameISOWeekYearWithOptions
+} from './isSameISOWeekYearWithOptions/index.js'
+export { default as isSameMinute } from './isSameMinute/index.js'
+export {
+ default as isSameMinuteWithOptions
+} from './isSameMinuteWithOptions/index.js'
+export { default as isSameMonth } from './isSameMonth/index.js'
+export {
+ default as isSameMonthWithOptions
+} from './isSameMonthWithOptions/index.js'
+export { default as isSameQuarter } from './isSameQuarter/index.js'
+export {
+ default as isSameQuarterWithOptions
+} from './isSameQuarterWithOptions/index.js'
+export { default as isSameSecond } from './isSameSecond/index.js'
+export {
+ default as isSameSecondWithOptions
+} from './isSameSecondWithOptions/index.js'
+export { default as isSameWeek } from './isSameWeek/index.js'
+export {
+ default as isSameWeekWithOptions
+} from './isSameWeekWithOptions/index.js'
+export { default as isSameYear } from './isSameYear/index.js'
+export {
+ default as isSameYearWithOptions
+} from './isSameYearWithOptions/index.js'
+export { default as isSaturday } from './isSaturday/index.js'
+export {
+ default as isSaturdayWithOptions
+} from './isSaturdayWithOptions/index.js'
+export { default as isSunday } from './isSunday/index.js'
+export { default as isSundayWithOptions } from './isSundayWithOptions/index.js'
+export { default as isThursday } from './isThursday/index.js'
+export {
+ default as isThursdayWithOptions
+} from './isThursdayWithOptions/index.js'
+export { default as isTuesday } from './isTuesday/index.js'
+export {
+ default as isTuesdayWithOptions
+} from './isTuesdayWithOptions/index.js'
+export { default as isValid } from './isValid/index.js'
+export { default as isValidWithOptions } from './isValidWithOptions/index.js'
+export { default as isWednesday } from './isWednesday/index.js'
+export {
+ default as isWednesdayWithOptions
+} from './isWednesdayWithOptions/index.js'
+export { default as isWeekend } from './isWeekend/index.js'
+export {
+ default as isWeekendWithOptions
+} from './isWeekendWithOptions/index.js'
+export { default as isWithinInterval } from './isWithinInterval/index.js'
+export {
+ default as isWithinIntervalWithOptions
+} from './isWithinIntervalWithOptions/index.js'
+export { default as lastDayOfDecade } from './lastDayOfDecade/index.js'
+export {
+ default as lastDayOfDecadeWithOptions
+} from './lastDayOfDecadeWithOptions/index.js'
+export { default as lastDayOfISOWeek } from './lastDayOfISOWeek/index.js'
+export {
+ default as lastDayOfISOWeekWithOptions
+} from './lastDayOfISOWeekWithOptions/index.js'
+export {
+ default as lastDayOfISOWeekYear
+} from './lastDayOfISOWeekYear/index.js'
+export {
+ default as lastDayOfISOWeekYearWithOptions
+} from './lastDayOfISOWeekYearWithOptions/index.js'
+export { default as lastDayOfMonth } from './lastDayOfMonth/index.js'
+export {
+ default as lastDayOfMonthWithOptions
+} from './lastDayOfMonthWithOptions/index.js'
+export { default as lastDayOfQuarter } from './lastDayOfQuarter/index.js'
+export {
+ default as lastDayOfQuarterWithOptions
+} from './lastDayOfQuarterWithOptions/index.js'
+export { default as lastDayOfWeek } from './lastDayOfWeek/index.js'
+export {
+ default as lastDayOfWeekWithOptions
+} from './lastDayOfWeekWithOptions/index.js'
+export { default as lastDayOfYear } from './lastDayOfYear/index.js'
+export {
+ default as lastDayOfYearWithOptions
+} from './lastDayOfYearWithOptions/index.js'
+export { default as max } from './max/index.js'
+export { default as maxWithOptions } from './maxWithOptions/index.js'
+export { default as min } from './min/index.js'
+export { default as minWithOptions } from './minWithOptions/index.js'
+export { default as parse } from './parse/index.js'
+export { default as parseWithOptions } from './parseWithOptions/index.js'
+export {
+ default as roundToNearestMinutes
+} from './roundToNearestMinutes/index.js'
+export {
+ default as roundToNearestMinutesWithOptions
+} from './roundToNearestMinutesWithOptions/index.js'
+export { default as setDate } from './setDate/index.js'
+export { default as setDateWithOptions } from './setDateWithOptions/index.js'
+export { default as setDay } from './setDay/index.js'
+export { default as setDayOfYear } from './setDayOfYear/index.js'
+export {
+ default as setDayOfYearWithOptions
+} from './setDayOfYearWithOptions/index.js'
+export { default as setDayWithOptions } from './setDayWithOptions/index.js'
+export { default as setHours } from './setHours/index.js'
+export { default as setHoursWithOptions } from './setHoursWithOptions/index.js'
+export { default as setISODay } from './setISODay/index.js'
+export {
+ default as setISODayWithOptions
+} from './setISODayWithOptions/index.js'
+export { default as setISOWeek } from './setISOWeek/index.js'
+export {
+ default as setISOWeekWithOptions
+} from './setISOWeekWithOptions/index.js'
+export { default as setISOWeekYear } from './setISOWeekYear/index.js'
+export {
+ default as setISOWeekYearWithOptions
+} from './setISOWeekYearWithOptions/index.js'
+export { default as setMilliseconds } from './setMilliseconds/index.js'
+export {
+ default as setMillisecondsWithOptions
+} from './setMillisecondsWithOptions/index.js'
+export { default as setMinutes } from './setMinutes/index.js'
+export {
+ default as setMinutesWithOptions
+} from './setMinutesWithOptions/index.js'
+export { default as setMonth } from './setMonth/index.js'
+export { default as setMonthWithOptions } from './setMonthWithOptions/index.js'
+export { default as setQuarter } from './setQuarter/index.js'
+export {
+ default as setQuarterWithOptions
+} from './setQuarterWithOptions/index.js'
+export { default as setSeconds } from './setSeconds/index.js'
+export {
+ default as setSecondsWithOptions
+} from './setSecondsWithOptions/index.js'
+export { default as setWeek } from './setWeek/index.js'
+export { default as setWeekWithOptions } from './setWeekWithOptions/index.js'
+export { default as setWeekYear } from './setWeekYear/index.js'
+export {
+ default as setWeekYearWithOptions
+} from './setWeekYearWithOptions/index.js'
+export { default as setYear } from './setYear/index.js'
+export { default as setYearWithOptions } from './setYearWithOptions/index.js'
+export { default as startOfDay } from './startOfDay/index.js'
+export {
+ default as startOfDayWithOptions
+} from './startOfDayWithOptions/index.js'
+export { default as startOfDecade } from './startOfDecade/index.js'
+export {
+ default as startOfDecadeWithOptions
+} from './startOfDecadeWithOptions/index.js'
+export { default as startOfHour } from './startOfHour/index.js'
+export {
+ default as startOfHourWithOptions
+} from './startOfHourWithOptions/index.js'
+export { default as startOfISOWeek } from './startOfISOWeek/index.js'
+export {
+ default as startOfISOWeekWithOptions
+} from './startOfISOWeekWithOptions/index.js'
+export { default as startOfISOWeekYear } from './startOfISOWeekYear/index.js'
+export {
+ default as startOfISOWeekYearWithOptions
+} from './startOfISOWeekYearWithOptions/index.js'
+export { default as startOfMinute } from './startOfMinute/index.js'
+export {
+ default as startOfMinuteWithOptions
+} from './startOfMinuteWithOptions/index.js'
+export { default as startOfMonth } from './startOfMonth/index.js'
+export {
+ default as startOfMonthWithOptions
+} from './startOfMonthWithOptions/index.js'
+export { default as startOfQuarter } from './startOfQuarter/index.js'
+export {
+ default as startOfQuarterWithOptions
+} from './startOfQuarterWithOptions/index.js'
+export { default as startOfSecond } from './startOfSecond/index.js'
+export {
+ default as startOfSecondWithOptions
+} from './startOfSecondWithOptions/index.js'
+export { default as startOfWeek } from './startOfWeek/index.js'
+export {
+ default as startOfWeekWithOptions
+} from './startOfWeekWithOptions/index.js'
+export { default as startOfWeekYear } from './startOfWeekYear/index.js'
+export {
+ default as startOfWeekYearWithOptions
+} from './startOfWeekYearWithOptions/index.js'
+export { default as startOfYear } from './startOfYear/index.js'
+export {
+ default as startOfYearWithOptions
+} from './startOfYearWithOptions/index.js'
+export { default as subDays } from './subDays/index.js'
+export { default as subDaysWithOptions } from './subDaysWithOptions/index.js'
+export { default as subHours } from './subHours/index.js'
+export { default as subHoursWithOptions } from './subHoursWithOptions/index.js'
+export { default as subISOWeekYears } from './subISOWeekYears/index.js'
+export {
+ default as subISOWeekYearsWithOptions
+} from './subISOWeekYearsWithOptions/index.js'
+export { default as subMilliseconds } from './subMilliseconds/index.js'
+export {
+ default as subMillisecondsWithOptions
+} from './subMillisecondsWithOptions/index.js'
+export { default as subMinutes } from './subMinutes/index.js'
+export {
+ default as subMinutesWithOptions
+} from './subMinutesWithOptions/index.js'
+export { default as subMonths } from './subMonths/index.js'
+export {
+ default as subMonthsWithOptions
+} from './subMonthsWithOptions/index.js'
+export { default as subQuarters } from './subQuarters/index.js'
+export {
+ default as subQuartersWithOptions
+} from './subQuartersWithOptions/index.js'
+export { default as subSeconds } from './subSeconds/index.js'
+export {
+ default as subSecondsWithOptions
+} from './subSecondsWithOptions/index.js'
+export { default as subWeeks } from './subWeeks/index.js'
+export { default as subWeeksWithOptions } from './subWeeksWithOptions/index.js'
+export { default as subYears } from './subYears/index.js'
+export { default as subYearsWithOptions } from './subYearsWithOptions/index.js'
+export { default as toDate } from './toDate/index.js'
+export { default as toDateWithOptions } from './toDateWithOptions/index.js'
diff --git a/src/esm/index.js b/src/esm/index.js
index c37a5c7445..80a45a8d76 100644
--- a/src/esm/index.js
+++ b/src/esm/index.js
@@ -1,151 +1,182 @@
// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.
-export {default as addDays} from './addDays/index.js'
-export {default as addHours} from './addHours/index.js'
-export {default as addISOWeekYears} from './addISOWeekYears/index.js'
-export {default as addMilliseconds} from './addMilliseconds/index.js'
-export {default as addMinutes} from './addMinutes/index.js'
-export {default as addMonths} from './addMonths/index.js'
-export {default as addQuarters} from './addQuarters/index.js'
-export {default as addSeconds} from './addSeconds/index.js'
-export {default as addWeeks} from './addWeeks/index.js'
-export {default as addYears} from './addYears/index.js'
-export {default as areIntervalsOverlapping} from './areIntervalsOverlapping/index.js'
-export {default as closestIndexTo} from './closestIndexTo/index.js'
-export {default as closestTo} from './closestTo/index.js'
-export {default as compareAsc} from './compareAsc/index.js'
-export {default as compareDesc} from './compareDesc/index.js'
-export {default as differenceInCalendarDays} from './differenceInCalendarDays/index.js'
-export {default as differenceInCalendarISOWeekYears} from './differenceInCalendarISOWeekYears/index.js'
-export {default as differenceInCalendarISOWeeks} from './differenceInCalendarISOWeeks/index.js'
-export {default as differenceInCalendarMonths} from './differenceInCalendarMonths/index.js'
-export {default as differenceInCalendarQuarters} from './differenceInCalendarQuarters/index.js'
-export {default as differenceInCalendarWeeks} from './differenceInCalendarWeeks/index.js'
-export {default as differenceInCalendarYears} from './differenceInCalendarYears/index.js'
-export {default as differenceInDays} from './differenceInDays/index.js'
-export {default as differenceInHours} from './differenceInHours/index.js'
-export {default as differenceInISOWeekYears} from './differenceInISOWeekYears/index.js'
-export {default as differenceInMilliseconds} from './differenceInMilliseconds/index.js'
-export {default as differenceInMinutes} from './differenceInMinutes/index.js'
-export {default as differenceInMonths} from './differenceInMonths/index.js'
-export {default as differenceInQuarters} from './differenceInQuarters/index.js'
-export {default as differenceInSeconds} from './differenceInSeconds/index.js'
-export {default as differenceInWeeks} from './differenceInWeeks/index.js'
-export {default as differenceInYears} from './differenceInYears/index.js'
-export {default as eachDayOfInterval} from './eachDayOfInterval/index.js'
-export {default as eachWeekOfInterval} from './eachWeekOfInterval/index.js'
-export {default as endOfDay} from './endOfDay/index.js'
-export {default as endOfDecade} from './endOfDecade/index.js'
-export {default as endOfHour} from './endOfHour/index.js'
-export {default as endOfISOWeek} from './endOfISOWeek/index.js'
-export {default as endOfISOWeekYear} from './endOfISOWeekYear/index.js'
-export {default as endOfMinute} from './endOfMinute/index.js'
-export {default as endOfMonth} from './endOfMonth/index.js'
-export {default as endOfQuarter} from './endOfQuarter/index.js'
-export {default as endOfSecond} from './endOfSecond/index.js'
-export {default as endOfWeek} from './endOfWeek/index.js'
-export {default as endOfYear} from './endOfYear/index.js'
-export {default as format} from './format/index.js'
-export {default as formatDistance} from './formatDistance/index.js'
-export {default as formatDistanceStrict} from './formatDistanceStrict/index.js'
-export {default as formatRelative} from './formatRelative/index.js'
-export {default as getDate} from './getDate/index.js'
-export {default as getDay} from './getDay/index.js'
-export {default as getDayOfYear} from './getDayOfYear/index.js'
-export {default as getDaysInMonth} from './getDaysInMonth/index.js'
-export {default as getDaysInYear} from './getDaysInYear/index.js'
-export {default as getDecade} from './getDecade/index.js'
-export {default as getHours} from './getHours/index.js'
-export {default as getISODay} from './getISODay/index.js'
-export {default as getISOWeek} from './getISOWeek/index.js'
-export {default as getISOWeekYear} from './getISOWeekYear/index.js'
-export {default as getISOWeeksInYear} from './getISOWeeksInYear/index.js'
-export {default as getMilliseconds} from './getMilliseconds/index.js'
-export {default as getMinutes} from './getMinutes/index.js'
-export {default as getMonth} from './getMonth/index.js'
-export {default as getOverlappingDaysInIntervals} from './getOverlappingDaysInIntervals/index.js'
-export {default as getQuarter} from './getQuarter/index.js'
-export {default as getSeconds} from './getSeconds/index.js'
-export {default as getTime} from './getTime/index.js'
-export {default as getUnixTime} from './getUnixTime/index.js'
-export {default as getWeek} from './getWeek/index.js'
-export {default as getWeekOfMonth} from './getWeekOfMonth/index.js'
-export {default as getWeekYear} from './getWeekYear/index.js'
-export {default as getWeeksInMonth} from './getWeeksInMonth/index.js'
-export {default as getYear} from './getYear/index.js'
-export {default as isAfter} from './isAfter/index.js'
-export {default as isBefore} from './isBefore/index.js'
-export {default as isDate} from './isDate/index.js'
-export {default as isEqual} from './isEqual/index.js'
-export {default as isFirstDayOfMonth} from './isFirstDayOfMonth/index.js'
-export {default as isFriday} from './isFriday/index.js'
-export {default as isLastDayOfMonth} from './isLastDayOfMonth/index.js'
-export {default as isLeapYear} from './isLeapYear/index.js'
-export {default as isMonday} from './isMonday/index.js'
-export {default as isSameDay} from './isSameDay/index.js'
-export {default as isSameHour} from './isSameHour/index.js'
-export {default as isSameISOWeek} from './isSameISOWeek/index.js'
-export {default as isSameISOWeekYear} from './isSameISOWeekYear/index.js'
-export {default as isSameMinute} from './isSameMinute/index.js'
-export {default as isSameMonth} from './isSameMonth/index.js'
-export {default as isSameQuarter} from './isSameQuarter/index.js'
-export {default as isSameSecond} from './isSameSecond/index.js'
-export {default as isSameWeek} from './isSameWeek/index.js'
-export {default as isSameYear} from './isSameYear/index.js'
-export {default as isSaturday} from './isSaturday/index.js'
-export {default as isSunday} from './isSunday/index.js'
-export {default as isThursday} from './isThursday/index.js'
-export {default as isTuesday} from './isTuesday/index.js'
-export {default as isValid} from './isValid/index.js'
-export {default as isWednesday} from './isWednesday/index.js'
-export {default as isWeekend} from './isWeekend/index.js'
-export {default as isWithinInterval} from './isWithinInterval/index.js'
-export {default as lastDayOfDecade} from './lastDayOfDecade/index.js'
-export {default as lastDayOfISOWeek} from './lastDayOfISOWeek/index.js'
-export {default as lastDayOfISOWeekYear} from './lastDayOfISOWeekYear/index.js'
-export {default as lastDayOfMonth} from './lastDayOfMonth/index.js'
-export {default as lastDayOfQuarter} from './lastDayOfQuarter/index.js'
-export {default as lastDayOfWeek} from './lastDayOfWeek/index.js'
-export {default as lastDayOfYear} from './lastDayOfYear/index.js'
-export {default as max} from './max/index.js'
-export {default as min} from './min/index.js'
-export {default as parse} from './parse/index.js'
-export {default as roundToNearestMinutes} from './roundToNearestMinutes/index.js'
-export {default as setDate} from './setDate/index.js'
-export {default as setDay} from './setDay/index.js'
-export {default as setDayOfYear} from './setDayOfYear/index.js'
-export {default as setHours} from './setHours/index.js'
-export {default as setISODay} from './setISODay/index.js'
-export {default as setISOWeek} from './setISOWeek/index.js'
-export {default as setISOWeekYear} from './setISOWeekYear/index.js'
-export {default as setMilliseconds} from './setMilliseconds/index.js'
-export {default as setMinutes} from './setMinutes/index.js'
-export {default as setMonth} from './setMonth/index.js'
-export {default as setQuarter} from './setQuarter/index.js'
-export {default as setSeconds} from './setSeconds/index.js'
-export {default as setWeek} from './setWeek/index.js'
-export {default as setWeekYear} from './setWeekYear/index.js'
-export {default as setYear} from './setYear/index.js'
-export {default as startOfDay} from './startOfDay/index.js'
-export {default as startOfDecade} from './startOfDecade/index.js'
-export {default as startOfHour} from './startOfHour/index.js'
-export {default as startOfISOWeek} from './startOfISOWeek/index.js'
-export {default as startOfISOWeekYear} from './startOfISOWeekYear/index.js'
-export {default as startOfMinute} from './startOfMinute/index.js'
-export {default as startOfMonth} from './startOfMonth/index.js'
-export {default as startOfQuarter} from './startOfQuarter/index.js'
-export {default as startOfSecond} from './startOfSecond/index.js'
-export {default as startOfWeek} from './startOfWeek/index.js'
-export {default as startOfWeekYear} from './startOfWeekYear/index.js'
-export {default as startOfYear} from './startOfYear/index.js'
-export {default as subDays} from './subDays/index.js'
-export {default as subHours} from './subHours/index.js'
-export {default as subISOWeekYears} from './subISOWeekYears/index.js'
-export {default as subMilliseconds} from './subMilliseconds/index.js'
-export {default as subMinutes} from './subMinutes/index.js'
-export {default as subMonths} from './subMonths/index.js'
-export {default as subQuarters} from './subQuarters/index.js'
-export {default as subSeconds} from './subSeconds/index.js'
-export {default as subWeeks} from './subWeeks/index.js'
-export {default as subYears} from './subYears/index.js'
-export {default as toDate} from './toDate/index.js'
+export { default as addDays } from './addDays/index.js'
+export { default as addHours } from './addHours/index.js'
+export { default as addISOWeekYears } from './addISOWeekYears/index.js'
+export { default as addMilliseconds } from './addMilliseconds/index.js'
+export { default as addMinutes } from './addMinutes/index.js'
+export { default as addMonths } from './addMonths/index.js'
+export { default as addQuarters } from './addQuarters/index.js'
+export { default as addSeconds } from './addSeconds/index.js'
+export { default as addWeeks } from './addWeeks/index.js'
+export { default as addYears } from './addYears/index.js'
+export {
+ default as areIntervalsOverlapping
+} from './areIntervalsOverlapping/index.js'
+export { default as closestIndexTo } from './closestIndexTo/index.js'
+export { default as closestTo } from './closestTo/index.js'
+export { default as compareAsc } from './compareAsc/index.js'
+export { default as compareDesc } from './compareDesc/index.js'
+export {
+ default as differenceInCalendarDays
+} from './differenceInCalendarDays/index.js'
+export {
+ default as differenceInCalendarISOWeekYears
+} from './differenceInCalendarISOWeekYears/index.js'
+export {
+ default as differenceInCalendarISOWeeks
+} from './differenceInCalendarISOWeeks/index.js'
+export {
+ default as differenceInCalendarMonths
+} from './differenceInCalendarMonths/index.js'
+export {
+ default as differenceInCalendarQuarters
+} from './differenceInCalendarQuarters/index.js'
+export {
+ default as differenceInCalendarWeeks
+} from './differenceInCalendarWeeks/index.js'
+export {
+ default as differenceInCalendarYears
+} from './differenceInCalendarYears/index.js'
+export { default as differenceInDays } from './differenceInDays/index.js'
+export { default as differenceInHours } from './differenceInHours/index.js'
+export {
+ default as differenceInISOWeekYears
+} from './differenceInISOWeekYears/index.js'
+export {
+ default as differenceInMilliseconds
+} from './differenceInMilliseconds/index.js'
+export { default as differenceInMinutes } from './differenceInMinutes/index.js'
+export { default as differenceInMonths } from './differenceInMonths/index.js'
+export {
+ default as differenceInQuarters
+} from './differenceInQuarters/index.js'
+export { default as differenceInSeconds } from './differenceInSeconds/index.js'
+export { default as differenceInWeeks } from './differenceInWeeks/index.js'
+export { default as differenceInYears } from './differenceInYears/index.js'
+export { default as eachDayOfInterval } from './eachDayOfInterval/index.js'
+export { default as eachWeekOfInterval } from './eachWeekOfInterval/index.js'
+export { default as endOfDay } from './endOfDay/index.js'
+export { default as endOfDecade } from './endOfDecade/index.js'
+export { default as endOfHour } from './endOfHour/index.js'
+export { default as endOfISOWeek } from './endOfISOWeek/index.js'
+export { default as endOfISOWeekYear } from './endOfISOWeekYear/index.js'
+export { default as endOfMinute } from './endOfMinute/index.js'
+export { default as endOfMonth } from './endOfMonth/index.js'
+export { default as endOfQuarter } from './endOfQuarter/index.js'
+export { default as endOfSecond } from './endOfSecond/index.js'
+export { default as endOfWeek } from './endOfWeek/index.js'
+export { default as endOfYear } from './endOfYear/index.js'
+export { default as format } from './format/index.js'
+export { default as formatDistance } from './formatDistance/index.js'
+export {
+ default as formatDistanceStrict
+} from './formatDistanceStrict/index.js'
+export { default as formatRelative } from './formatRelative/index.js'
+export { default as fromUnixTime } from './fromUnixTime/index.js'
+export { default as getDate } from './getDate/index.js'
+export { default as getDay } from './getDay/index.js'
+export { default as getDayOfYear } from './getDayOfYear/index.js'
+export { default as getDaysInMonth } from './getDaysInMonth/index.js'
+export { default as getDaysInYear } from './getDaysInYear/index.js'
+export { default as getDecade } from './getDecade/index.js'
+export { default as getHours } from './getHours/index.js'
+export { default as getISODay } from './getISODay/index.js'
+export { default as getISOWeek } from './getISOWeek/index.js'
+export { default as getISOWeekYear } from './getISOWeekYear/index.js'
+export { default as getISOWeeksInYear } from './getISOWeeksInYear/index.js'
+export { default as getMilliseconds } from './getMilliseconds/index.js'
+export { default as getMinutes } from './getMinutes/index.js'
+export { default as getMonth } from './getMonth/index.js'
+export {
+ default as getOverlappingDaysInIntervals
+} from './getOverlappingDaysInIntervals/index.js'
+export { default as getQuarter } from './getQuarter/index.js'
+export { default as getSeconds } from './getSeconds/index.js'
+export { default as getTime } from './getTime/index.js'
+export { default as getUnixTime } from './getUnixTime/index.js'
+export { default as getWeek } from './getWeek/index.js'
+export { default as getWeekOfMonth } from './getWeekOfMonth/index.js'
+export { default as getWeekYear } from './getWeekYear/index.js'
+export { default as getWeeksInMonth } from './getWeeksInMonth/index.js'
+export { default as getYear } from './getYear/index.js'
+export { default as isAfter } from './isAfter/index.js'
+export { default as isBefore } from './isBefore/index.js'
+export { default as isDate } from './isDate/index.js'
+export { default as isEqual } from './isEqual/index.js'
+export { default as isFirstDayOfMonth } from './isFirstDayOfMonth/index.js'
+export { default as isFriday } from './isFriday/index.js'
+export { default as isLastDayOfMonth } from './isLastDayOfMonth/index.js'
+export { default as isLeapYear } from './isLeapYear/index.js'
+export { default as isMonday } from './isMonday/index.js'
+export { default as isSameDay } from './isSameDay/index.js'
+export { default as isSameHour } from './isSameHour/index.js'
+export { default as isSameISOWeek } from './isSameISOWeek/index.js'
+export { default as isSameISOWeekYear } from './isSameISOWeekYear/index.js'
+export { default as isSameMinute } from './isSameMinute/index.js'
+export { default as isSameMonth } from './isSameMonth/index.js'
+export { default as isSameQuarter } from './isSameQuarter/index.js'
+export { default as isSameSecond } from './isSameSecond/index.js'
+export { default as isSameWeek } from './isSameWeek/index.js'
+export { default as isSameYear } from './isSameYear/index.js'
+export { default as isSaturday } from './isSaturday/index.js'
+export { default as isSunday } from './isSunday/index.js'
+export { default as isThursday } from './isThursday/index.js'
+export { default as isTuesday } from './isTuesday/index.js'
+export { default as isValid } from './isValid/index.js'
+export { default as isWednesday } from './isWednesday/index.js'
+export { default as isWeekend } from './isWeekend/index.js'
+export { default as isWithinInterval } from './isWithinInterval/index.js'
+export { default as lastDayOfDecade } from './lastDayOfDecade/index.js'
+export { default as lastDayOfISOWeek } from './lastDayOfISOWeek/index.js'
+export {
+ default as lastDayOfISOWeekYear
+} from './lastDayOfISOWeekYear/index.js'
+export { default as lastDayOfMonth } from './lastDayOfMonth/index.js'
+export { default as lastDayOfQuarter } from './lastDayOfQuarter/index.js'
+export { default as lastDayOfWeek } from './lastDayOfWeek/index.js'
+export { default as lastDayOfYear } from './lastDayOfYear/index.js'
+export { default as max } from './max/index.js'
+export { default as min } from './min/index.js'
+export { default as parse } from './parse/index.js'
+export {
+ default as roundToNearestMinutes
+} from './roundToNearestMinutes/index.js'
+export { default as setDate } from './setDate/index.js'
+export { default as setDay } from './setDay/index.js'
+export { default as setDayOfYear } from './setDayOfYear/index.js'
+export { default as setHours } from './setHours/index.js'
+export { default as setISODay } from './setISODay/index.js'
+export { default as setISOWeek } from './setISOWeek/index.js'
+export { default as setISOWeekYear } from './setISOWeekYear/index.js'
+export { default as setMilliseconds } from './setMilliseconds/index.js'
+export { default as setMinutes } from './setMinutes/index.js'
+export { default as setMonth } from './setMonth/index.js'
+export { default as setQuarter } from './setQuarter/index.js'
+export { default as setSeconds } from './setSeconds/index.js'
+export { default as setWeek } from './setWeek/index.js'
+export { default as setWeekYear } from './setWeekYear/index.js'
+export { default as setYear } from './setYear/index.js'
+export { default as startOfDay } from './startOfDay/index.js'
+export { default as startOfDecade } from './startOfDecade/index.js'
+export { default as startOfHour } from './startOfHour/index.js'
+export { default as startOfISOWeek } from './startOfISOWeek/index.js'
+export { default as startOfISOWeekYear } from './startOfISOWeekYear/index.js'
+export { default as startOfMinute } from './startOfMinute/index.js'
+export { default as startOfMonth } from './startOfMonth/index.js'
+export { default as startOfQuarter } from './startOfQuarter/index.js'
+export { default as startOfSecond } from './startOfSecond/index.js'
+export { default as startOfWeek } from './startOfWeek/index.js'
+export { default as startOfWeekYear } from './startOfWeekYear/index.js'
+export { default as startOfYear } from './startOfYear/index.js'
+export { default as subDays } from './subDays/index.js'
+export { default as subHours } from './subHours/index.js'
+export { default as subISOWeekYears } from './subISOWeekYears/index.js'
+export { default as subMilliseconds } from './subMilliseconds/index.js'
+export { default as subMinutes } from './subMinutes/index.js'
+export { default as subMonths } from './subMonths/index.js'
+export { default as subQuarters } from './subQuarters/index.js'
+export { default as subSeconds } from './subSeconds/index.js'
+export { default as subWeeks } from './subWeeks/index.js'
+export { default as subYears } from './subYears/index.js'
+export { default as toDate } from './toDate/index.js'
diff --git a/src/fp/fromUnixTime/index.d.ts b/src/fp/fromUnixTime/index.d.ts
new file mode 100644
index 0000000000..73626df13c
--- /dev/null
+++ b/src/fp/fromUnixTime/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import {fromUnixTime} from 'date-fns/fp'
+export = fromUnixTime
diff --git a/src/fp/fromUnixTime/index.js b/src/fp/fromUnixTime/index.js
new file mode 100644
index 0000000000..6c25748d99
--- /dev/null
+++ b/src/fp/fromUnixTime/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../fromUnixTime/index.js'
+import convertToFP from '../_lib/convertToFP/index.js'
+
+var fromUnixTime = convertToFP(fn, 1)
+
+export default fromUnixTime
diff --git a/src/fp/fromUnixTime/index.js.flow b/src/fp/fromUnixTime/index.js.flow
new file mode 100644
index 0000000000..49b7310b99
--- /dev/null
+++ b/src/fp/fromUnixTime/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+type Interval = {
+ start: Date | string | number,
+ end: Date | string | number
+}
+
+type Options = {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ additionalDigits?: 0 | 1 | 2,
+ locale?: Locale,
+ includeSeconds?: boolean,
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ awareOfUnicodeTokens?: boolean
+}
+
+type Locale = {
+ formatDistance: Function,
+ formatRelative: Function,
+ localize: {
+ ordinalNumber: Function,
+ era: Function,
+ quarter: Function,
+ month: Function,
+ day: Function,
+ dayPeriod: Function
+ },
+ formatLong: Object,
+ date: Function,
+ time: Function,
+ dateTime: Function,
+ match: {
+ ordinalNumber: Function,
+ era: Function,
+ quarter: Function,
+ month: Function,
+ day: Function,
+ dayPeriod: Function
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
+ }
+}
+
+type CurriedFn1 = (a: A) => R
+
+declare module.exports: CurriedFn1
diff --git a/src/fp/fromUnixTimeWithOptions/index.d.ts b/src/fp/fromUnixTimeWithOptions/index.d.ts
new file mode 100644
index 0000000000..6f8ca560b7
--- /dev/null
+++ b/src/fp/fromUnixTimeWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import {fromUnixTimeWithOptions} from 'date-fns/fp'
+export = fromUnixTimeWithOptions
diff --git a/src/fp/fromUnixTimeWithOptions/index.js b/src/fp/fromUnixTimeWithOptions/index.js
new file mode 100644
index 0000000000..36f1d713ea
--- /dev/null
+++ b/src/fp/fromUnixTimeWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../fromUnixTime/index.js'
+import convertToFP from '../_lib/convertToFP/index.js'
+
+var fromUnixTimeWithOptions = convertToFP(fn, 2)
+
+export default fromUnixTimeWithOptions
diff --git a/src/fp/fromUnixTimeWithOptions/index.js.flow b/src/fp/fromUnixTimeWithOptions/index.js.flow
new file mode 100644
index 0000000000..095248b392
--- /dev/null
+++ b/src/fp/fromUnixTimeWithOptions/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+type Interval = {
+ start: Date | string | number,
+ end: Date | string | number
+}
+
+type Options = {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ additionalDigits?: 0 | 1 | 2,
+ locale?: Locale,
+ includeSeconds?: boolean,
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ awareOfUnicodeTokens?: boolean
+}
+
+type Locale = {
+ formatDistance: Function,
+ formatRelative: Function,
+ localize: {
+ ordinalNumber: Function,
+ era: Function,
+ quarter: Function,
+ month: Function,
+ day: Function,
+ dayPeriod: Function
+ },
+ formatLong: Object,
+ date: Function,
+ time: Function,
+ dateTime: Function,
+ match: {
+ ordinalNumber: Function,
+ era: Function,
+ quarter: Function,
+ month: Function,
+ day: Function,
+ dayPeriod: Function
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
+ }
+}
+
+type CurriedFn1 = (a: A) => R
+
+type CurriedFn2 = (a: A) => CurriedFn1
+ | (a: A, b: B) => R
+
+declare module.exports: CurriedFn2
diff --git a/src/fp/index.js b/src/fp/index.js
index ec6d9687d3..f72c761f49 100644
--- a/src/fp/index.js
+++ b/src/fp/index.js
@@ -99,6 +99,8 @@ module.exports = {
formatRelative: require('./formatRelative/index.js'),
formatRelativeWithOptions: require('./formatRelativeWithOptions/index.js'),
formatWithOptions: require('./formatWithOptions/index.js'),
+ fromUnixTime: require('./fromUnixTime/index.js'),
+ fromUnixTimeWithOptions: require('./fromUnixTimeWithOptions/index.js'),
getDate: require('./getDate/index.js'),
getDateWithOptions: require('./getDateWithOptions/index.js'),
getDay: require('./getDay/index.js'),
diff --git a/src/fp/index.js.flow b/src/fp/index.js.flow
index 2437aab5af..f6e5e9e7fe 100644
--- a/src/fp/index.js.flow
+++ b/src/fp/index.js.flow
@@ -160,6 +160,8 @@ declare module.exports: {
formatRelative: CurriedFn2,
formatRelativeWithOptions: CurriedFn3,
formatWithOptions: CurriedFn3,
+ fromUnixTime: CurriedFn1,
+ fromUnixTimeWithOptions: CurriedFn2,
getDate: CurriedFn1,
getDateWithOptions: CurriedFn2,
getDay: CurriedFn1,
diff --git a/src/fp/test.js b/src/fp/test.js
index 7bec0f5b91..7ad2902d87 100644
--- a/src/fp/test.js
+++ b/src/fp/test.js
@@ -4,124 +4,152 @@
import assert from 'power-assert'
import fp from '.'
-describe('FP functions', function () {
- it('addDays', function () {
+describe('FP functions', function() {
+ it('addDays', function() {
var result = fp.addDays(10)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 11))
})
- it('addDaysWithOptions', function () {
+ it('addDaysWithOptions', function() {
var result = fp.addDaysWithOptions({})(10)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 11))
})
- it('addHours', function () {
+ it('addHours', function() {
var result = fp.addHours(2)(new Date(2014, 6 /* Jul */, 10, 23, 0))
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 11, 1, 0))
})
- it('addHoursWithOptions', function () {
- var result = fp.addHoursWithOptions({})(2)(new Date(2014, 6 /* Jul */, 10, 23, 0))
+ it('addHoursWithOptions', function() {
+ var result = fp.addHoursWithOptions({})(2)(
+ new Date(2014, 6 /* Jul */, 10, 23, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 11, 1, 0))
})
- it('addISOWeekYears', function () {
+ it('addISOWeekYears', function() {
var result = fp.addISOWeekYears(5)(new Date(2010, 6 /* Jul */, 2))
assert.deepEqual(result, new Date(2015, 5 /* Jun */, 26))
})
- it('addISOWeekYearsWithOptions', function () {
- var result = fp.addISOWeekYearsWithOptions({})(5)(new Date(2010, 6 /* Jul */, 2))
+ it('addISOWeekYearsWithOptions', function() {
+ var result = fp.addISOWeekYearsWithOptions({})(5)(
+ new Date(2010, 6 /* Jul */, 2)
+ )
assert.deepEqual(result, new Date(2015, 5 /* Jun */, 26))
})
- it('addMilliseconds', function () {
- var result = fp.addMilliseconds(750)(new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0))
+ it('addMilliseconds', function() {
+ var result = fp.addMilliseconds(750)(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 750))
})
- it('addMillisecondsWithOptions', function () {
- var result = fp.addMillisecondsWithOptions({})(750)(new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0))
+ it('addMillisecondsWithOptions', function() {
+ var result = fp.addMillisecondsWithOptions({})(750)(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 750))
})
- it('addMinutes', function () {
+ it('addMinutes', function() {
var result = fp.addMinutes(30)(new Date(2014, 6 /* Jul */, 10, 12, 0))
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 30))
})
- it('addMinutesWithOptions', function () {
- var result = fp.addMinutesWithOptions({})(30)(new Date(2014, 6 /* Jul */, 10, 12, 0))
+ it('addMinutesWithOptions', function() {
+ var result = fp.addMinutesWithOptions({})(30)(
+ new Date(2014, 6 /* Jul */, 10, 12, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 30))
})
- it('addMonths', function () {
+ it('addMonths', function() {
var result = fp.addMonths(5)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2015, 1 /* Feb */, 1))
})
- it('addMonthsWithOptions', function () {
+ it('addMonthsWithOptions', function() {
var result = fp.addMonthsWithOptions({})(5)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2015, 1 /* Feb */, 1))
})
- it('addQuarters', function () {
+ it('addQuarters', function() {
var result = fp.addQuarters(1)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1))
})
- it('addQuartersWithOptions', function () {
- var result = fp.addQuartersWithOptions({})(1)(new Date(2014, 8 /* Sep */, 1))
+ it('addQuartersWithOptions', function() {
+ var result = fp.addQuartersWithOptions({})(1)(
+ new Date(2014, 8 /* Sep */, 1)
+ )
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1))
})
- it('addSeconds', function () {
+ it('addSeconds', function() {
var result = fp.addSeconds(30)(new Date(2014, 6 /* Jul */, 10, 12, 45, 0))
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 30))
})
- it('addSecondsWithOptions', function () {
- var result = fp.addSecondsWithOptions({})(30)(new Date(2014, 6 /* Jul */, 10, 12, 45, 0))
+ it('addSecondsWithOptions', function() {
+ var result = fp.addSecondsWithOptions({})(30)(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 30))
})
- it('addWeeks', function () {
+ it('addWeeks', function() {
var result = fp.addWeeks(4)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 29))
})
- it('addWeeksWithOptions', function () {
+ it('addWeeksWithOptions', function() {
var result = fp.addWeeksWithOptions({})(4)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 29))
})
- it('addYears', function () {
+ it('addYears', function() {
var result = fp.addYears(5)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2019, 8 /* Sep */, 1))
})
- it('addYearsWithOptions', function () {
+ it('addYearsWithOptions', function() {
var result = fp.addYearsWithOptions({})(5)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2019, 8 /* Sep */, 1))
})
- it('areIntervalsOverlapping', function () {
- var leftInterval = {start: new Date(2016, 10, 10, 13, 0, 0), end: new Date(2016, 11, 3, 15, 0, 0)}
- var rightInterval = {start: new Date(2016, 10, 14), end: new Date(2016, 10, 14)}
+ it('areIntervalsOverlapping', function() {
+ var leftInterval = {
+ start: new Date(2016, 10, 10, 13, 0, 0),
+ end: new Date(2016, 11, 3, 15, 0, 0)
+ }
+ var rightInterval = {
+ start: new Date(2016, 10, 14),
+ end: new Date(2016, 10, 14)
+ }
var result = fp.areIntervalsOverlapping(rightInterval)(leftInterval)
assert(result === true)
})
- it('areIntervalsOverlappingWithOptions', function () {
- var leftInterval = {start: new Date(2016, 10, 10, 13, 0, 0), end: new Date(2016, 11, 3, 15, 0, 0)}
- var rightInterval = {start: new Date(2016, 10, 14), end: new Date(2016, 10, 14)}
+ it('areIntervalsOverlappingWithOptions', function() {
+ var leftInterval = {
+ start: new Date(2016, 10, 10, 13, 0, 0),
+ end: new Date(2016, 11, 3, 15, 0, 0)
+ }
+ var rightInterval = {
+ start: new Date(2016, 10, 14),
+ end: new Date(2016, 10, 14)
+ }
- var result = fp.areIntervalsOverlappingWithOptions({})(rightInterval)(leftInterval)
+ var result = fp.areIntervalsOverlappingWithOptions({})(rightInterval)(
+ leftInterval
+ )
assert(result === true)
})
- it('closestIndexTo', function () {
+ it('closestIndexTo', function() {
var date = new Date(2014, 6 /* Jul */, 2)
var result = fp.closestIndexTo([
new Date(2015, 7 /* Aug */, 31),
@@ -130,7 +158,7 @@ describe('FP functions', function () {
assert.equal(result, 0)
})
- it('closestIndexToWithOptions', function () {
+ it('closestIndexToWithOptions', function() {
var date = new Date(2014, 6 /* Jul */, 2)
var result = fp.closestIndexToWithOptions({})([
new Date(2015, 7 /* Aug */, 31),
@@ -139,7 +167,7 @@ describe('FP functions', function () {
assert.equal(result, 0)
})
- it('closestTo', function () {
+ it('closestTo', function() {
var date = new Date(2014, 6 /* Jul */, 2)
var result = fp.closestTo([
new Date(2015, 7 /* Aug */, 31),
@@ -148,7 +176,7 @@ describe('FP functions', function () {
assert.deepEqual(result, new Date(2015, 7 /* Aug */, 31))
})
- it('closestToWithOptions', function () {
+ it('closestToWithOptions', function() {
var date = new Date(2014, 6 /* Jul */, 2)
var result = fp.closestToWithOptions({})([
new Date(2015, 7 /* Aug */, 31),
@@ -157,334 +185,277 @@ describe('FP functions', function () {
assert.deepEqual(result, new Date(2015, 7 /* Aug */, 31))
})
- it('compareAsc', function () {
- var result = fp.compareAsc(new Date(1989, 6 /* Jul */, 10))(new Date(1987, 1 /* Feb */, 11))
+ it('compareAsc', function() {
+ var result = fp.compareAsc(new Date(1989, 6 /* Jul */, 10))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === -1)
})
- it('compareAscWithOptions', function () {
- var result = fp.compareAscWithOptions({})(new Date(1989, 6 /* Jul */, 10))(new Date(1987, 1 /* Feb */, 11))
+ it('compareAscWithOptions', function() {
+ var result = fp.compareAscWithOptions({})(new Date(1989, 6 /* Jul */, 10))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === -1)
})
- it('compareDesc', function () {
- var result = fp.compareDesc(new Date(1989, 6 /* Jul */, 10))(new Date(1987, 1 /* Feb */, 11))
+ it('compareDesc', function() {
+ var result = fp.compareDesc(new Date(1989, 6 /* Jul */, 10))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === 1)
})
- it('compareDescWithOptions', function () {
- var result = fp.compareDescWithOptions({})(new Date(1989, 6 /* Jul */, 10))(new Date(1987, 1 /* Feb */, 11))
+ it('compareDescWithOptions', function() {
+ var result = fp.compareDescWithOptions({})(new Date(1989, 6 /* Jul */, 10))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === 1)
})
- it('differenceInCalendarDays', function () {
+ it('differenceInCalendarDays', function() {
var result = fp.differenceInCalendarDays(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 366)
})
- it('differenceInCalendarDaysWithOptions', function () {
+ it('differenceInCalendarDaysWithOptions', function() {
var result = fp.differenceInCalendarDaysWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 366)
})
- it('differenceInCalendarISOWeeks', function () {
+ it('differenceInCalendarISOWeeks', function() {
var result = fp.differenceInCalendarISOWeeks(
new Date(2014, 5 /* Jun */, 29, 6, 0)
- )(
- new Date(2014, 6 /* Jul */, 8, 18, 0)
- )
+ )(new Date(2014, 6 /* Jul */, 8, 18, 0))
assert(result === 2)
})
- it('differenceInCalendarISOWeeksWithOptions', function () {
+ it('differenceInCalendarISOWeeksWithOptions', function() {
var result = fp.differenceInCalendarISOWeeksWithOptions({})(
new Date(2014, 5 /* Jun */, 29, 6, 0)
- )(
- new Date(2014, 6 /* Jul */, 8, 18, 0)
- )
+ )(new Date(2014, 6 /* Jul */, 8, 18, 0))
assert(result === 2)
})
- it('differenceInCalendarISOWeekYears', function () {
+ it('differenceInCalendarISOWeekYears', function() {
var result = fp.differenceInCalendarISOWeekYears(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 1)
})
- it('differenceInCalendarISOWeekYearsWithOptions', function () {
+ it('differenceInCalendarISOWeekYearsWithOptions', function() {
var result = fp.differenceInCalendarISOWeekYearsWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 1)
})
- it('differenceInCalendarMonths', function () {
+ it('differenceInCalendarMonths', function() {
var result = fp.differenceInCalendarMonths(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 12)
})
- it('differenceInCalendarMonthsWithOptions', function () {
+ it('differenceInCalendarMonthsWithOptions', function() {
var result = fp.differenceInCalendarMonthsWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 12)
})
- it('differenceInCalendarQuarters', function () {
+ it('differenceInCalendarQuarters', function() {
var result = fp.differenceInCalendarQuarters(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 4)
})
- it('differenceInCalendarQuartersWithOptions', function () {
+ it('differenceInCalendarQuartersWithOptions', function() {
var result = fp.differenceInCalendarQuartersWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 4)
})
- it('differenceInCalendarWeeks', function () {
+ it('differenceInCalendarWeeks', function() {
var result = fp.differenceInCalendarWeeks(
new Date(2014, 5 /* Jun */, 29, 6, 0)
- )(
- new Date(2014, 6 /* Jul */, 8, 18, 0)
- )
+ )(new Date(2014, 6 /* Jul */, 8, 18, 0))
assert(result === 1)
})
- it('differenceInCalendarWeeksWithOptions', function () {
- var result = fp.differenceInCalendarWeeksWithOptions({weekStartsOn: 1})(
+ it('differenceInCalendarWeeksWithOptions', function() {
+ var result = fp.differenceInCalendarWeeksWithOptions({ weekStartsOn: 1 })(
new Date(2014, 5 /* Jun */, 29, 6, 0)
- )(
- new Date(2014, 6 /* Jul */, 8, 18, 0)
- )
+ )(new Date(2014, 6 /* Jul */, 8, 18, 0))
assert(result === 2)
})
- it('differenceInCalendarYears', function () {
+ it('differenceInCalendarYears', function() {
var result = fp.differenceInCalendarYears(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 1)
})
- it('differenceInCalendarYearsWithOptions', function () {
+ it('differenceInCalendarYearsWithOptions', function() {
var result = fp.differenceInCalendarYearsWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 1)
})
- it('differenceInDays', function () {
- var result = fp.differenceInDays(
- new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
+ it('differenceInDays', function() {
+ var result = fp.differenceInDays(new Date(2011, 6 /* Jul */, 2, 6, 0))(
new Date(2012, 6 /* Jul */, 2, 18, 0)
)
assert(result === 366)
})
- it('differenceInDaysWithOptions', function () {
+ it('differenceInDaysWithOptions', function() {
var result = fp.differenceInDaysWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 366)
})
- it('differenceInHours', function () {
- var result = fp.differenceInHours(
- new Date(2014, 6 /* Jul */, 2, 6, 0)
- )(
+ it('differenceInHours', function() {
+ var result = fp.differenceInHours(new Date(2014, 6 /* Jul */, 2, 6, 0))(
new Date(2014, 6 /* Jul */, 2, 20, 0)
)
assert(result === 14)
})
- it('differenceInHoursWithOptions', function () {
+ it('differenceInHoursWithOptions', function() {
var result = fp.differenceInHoursWithOptions({})(
new Date(2014, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2014, 6 /* Jul */, 2, 20, 0)
- )
+ )(new Date(2014, 6 /* Jul */, 2, 20, 0))
assert(result === 14)
})
- it('differenceInISOWeekYears', function () {
+ it('differenceInISOWeekYears', function() {
var result = fp.differenceInISOWeekYears(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 1)
})
- it('differenceInISOWeekYearsWithOptions', function () {
+ it('differenceInISOWeekYearsWithOptions', function() {
var result = fp.differenceInISOWeekYearsWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 1)
})
- it('differenceInMilliseconds', function () {
+ it('differenceInMilliseconds', function() {
var result = fp.differenceInMilliseconds(
new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 600)
- )(
- new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 700)
- )
+ )(new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 700))
assert(result === 100)
})
- it('differenceInMillisecondsWithOptions', function () {
+ it('differenceInMillisecondsWithOptions', function() {
var result = fp.differenceInMillisecondsWithOptions({})(
new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 600)
- )(
- new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 700)
- )
+ )(new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 700))
assert(result === 100)
})
- it('differenceInMinutes', function () {
- var result = fp.differenceInMinutes(
- new Date(2014, 6 /* Jul */, 2, 12, 6)
- )(
+ it('differenceInMinutes', function() {
+ var result = fp.differenceInMinutes(new Date(2014, 6 /* Jul */, 2, 12, 6))(
new Date(2014, 6 /* Jul */, 2, 12, 20)
)
assert(result === 14)
})
- it('differenceInMinutesWithOptions', function () {
+ it('differenceInMinutesWithOptions', function() {
var result = fp.differenceInMinutesWithOptions({})(
new Date(2014, 6 /* Jul */, 2, 12, 6)
- )(
- new Date(2014, 6 /* Jul */, 2, 12, 20)
- )
+ )(new Date(2014, 6 /* Jul */, 2, 12, 20))
assert(result === 14)
})
- it('differenceInMonths', function () {
- var result = fp.differenceInMonths(
- new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
+ it('differenceInMonths', function() {
+ var result = fp.differenceInMonths(new Date(2011, 6 /* Jul */, 2, 6, 0))(
new Date(2012, 6 /* Jul */, 2, 18, 0)
)
assert(result === 12)
})
- it('differenceInMonthsWithOptions', function () {
+ it('differenceInMonthsWithOptions', function() {
var result = fp.differenceInMonthsWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 12)
})
- it('differenceInQuarters', function () {
- var result = fp.differenceInQuarters(
- new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
+ it('differenceInQuarters', function() {
+ var result = fp.differenceInQuarters(new Date(2011, 6 /* Jul */, 2, 6, 0))(
new Date(2012, 6 /* Jul */, 2, 18, 0)
)
assert(result === 4)
})
- it('differenceInQuartersWithOptions', function () {
+ it('differenceInQuartersWithOptions', function() {
var result = fp.differenceInQuartersWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 4)
})
- it('differenceInSeconds', function () {
+ it('differenceInSeconds', function() {
var result = fp.differenceInSeconds(
new Date(2014, 6 /* Jul */, 2, 12, 30, 6)
- )(
- new Date(2014, 6 /* Jul */, 2, 12, 30, 20)
- )
+ )(new Date(2014, 6 /* Jul */, 2, 12, 30, 20))
assert(result === 14)
})
- it('differenceInSecondsWithOptions', function () {
+ it('differenceInSecondsWithOptions', function() {
var result = fp.differenceInSecondsWithOptions({})(
new Date(2014, 6 /* Jul */, 2, 12, 30, 6)
- )(
- new Date(2014, 6 /* Jul */, 2, 12, 30, 20)
- )
+ )(new Date(2014, 6 /* Jul */, 2, 12, 30, 20))
assert(result === 14)
})
- it('differenceInWeeks', function () {
- var result = fp.differenceInWeeks(
- new Date(2014, 5 /* Jun */, 29, 6, 0)
- )(
+ it('differenceInWeeks', function() {
+ var result = fp.differenceInWeeks(new Date(2014, 5 /* Jun */, 29, 6, 0))(
new Date(2014, 6 /* Jul */, 8, 18, 0)
)
assert(result === 1)
})
- it('differenceInWeeksWithOptions', function () {
+ it('differenceInWeeksWithOptions', function() {
var result = fp.differenceInWeeksWithOptions({})(
new Date(2014, 5 /* Jun */, 29, 6, 0)
- )(
- new Date(2014, 6 /* Jul */, 8, 18, 0)
- )
+ )(new Date(2014, 6 /* Jul */, 8, 18, 0))
assert(result === 1)
})
- it('differenceInYears', function () {
- var result = fp.differenceInYears(
- new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
+ it('differenceInYears', function() {
+ var result = fp.differenceInYears(new Date(2011, 6 /* Jul */, 2, 6, 0))(
new Date(2012, 6 /* Jul */, 2, 18, 0)
)
assert(result === 1)
})
- it('differenceInYearsWithOptions', function () {
+ it('differenceInYearsWithOptions', function() {
var result = fp.differenceInYearsWithOptions({})(
new Date(2011, 6 /* Jul */, 2, 6, 0)
- )(
- new Date(2012, 6 /* Jul */, 2, 18, 0)
- )
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
assert(result === 1)
})
- it('eachDayOfInterval', function () {
- var interval = {start: new Date(2014, 9 /* Oct */, 6), end: new Date(2014, 9 /* Oct */, 12)}
+ it('eachDayOfInterval', function() {
+ var interval = {
+ start: new Date(2014, 9 /* Oct */, 6),
+ end: new Date(2014, 9 /* Oct */, 12)
+ }
var result = fp.eachDayOfInterval(interval)
assert.deepEqual(result, [
new Date(2014, 9 /* Oct */, 6),
@@ -497,8 +468,11 @@ describe('FP functions', function () {
])
})
- it('eachDayOfIntervalWithOptions', function () {
- var interval = {start: new Date(2014, 9 /* Oct */, 6), end: new Date(2014, 9 /* Oct */, 12)}
+ it('eachDayOfIntervalWithOptions', function() {
+ var interval = {
+ start: new Date(2014, 9 /* Oct */, 6),
+ end: new Date(2014, 9 /* Oct */, 12)
+ }
var result = fp.eachDayOfIntervalWithOptions({})(interval)
assert.deepEqual(result, [
new Date(2014, 9 /* Oct */, 6),
@@ -511,8 +485,11 @@ describe('FP functions', function () {
])
})
- it('eachWeekOfInterval', function () {
- var interval = {start: new Date(2014, 9 /* Oct */, 6), end: new Date(2014, 10 /* Nov */, 23)}
+ it('eachWeekOfInterval', function() {
+ var interval = {
+ start: new Date(2014, 9 /* Oct */, 6),
+ end: new Date(2014, 10 /* Nov */, 23)
+ }
var result = fp.eachWeekOfInterval(interval)
assert.deepEqual(result, [
new Date(2014, 9 /* Oct */, 5),
@@ -526,9 +503,12 @@ describe('FP functions', function () {
])
})
- it('eachWeekOfIntervalWithOptions', function () {
- var interval = {start: new Date(2014, 9 /* Oct */, 6), end: new Date(2014, 10 /* Nov */, 23)}
- var result = fp.eachWeekOfIntervalWithOptions({weekStartsOn: 2})(interval)
+ it('eachWeekOfIntervalWithOptions', function() {
+ var interval = {
+ start: new Date(2014, 9 /* Oct */, 6),
+ end: new Date(2014, 10 /* Nov */, 23)
+ }
+ var result = fp.eachWeekOfIntervalWithOptions({ weekStartsOn: 2 })(interval)
assert.deepEqual(result, [
new Date(2014, 8 /* Sep */, 30),
new Date(2014, 9 /* Oct */, 7),
@@ -541,1177 +521,1356 @@ describe('FP functions', function () {
])
})
- it('endOfDay', function () {
+ it('endOfDay', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfDay(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 23, 59, 59, 999))
})
- it('endOfDayWithOptions', function () {
+ it('endOfDayWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfDayWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 23, 59, 59, 999))
})
- it('endOfHour', function () {
+ it('endOfHour', function() {
var date = new Date(2014, 11, 1, 22, 15)
var result = fp.endOfHour(date)
assert.deepEqual(result, new Date(2014, 11, 1, 22, 59, 59, 999))
})
- it('endOfHourWithOptions', function () {
+ it('endOfHourWithOptions', function() {
var date = new Date(2014, 11, 1, 22, 15)
var result = fp.endOfHourWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 11, 1, 22, 59, 59, 999))
})
- it('endOfISOWeek', function () {
+ it('endOfISOWeek', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfISOWeek(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7, 23, 59, 59, 999))
})
- it('endOfISOWeekWithOptions', function () {
+ it('endOfISOWeekWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfISOWeekWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7, 23, 59, 59, 999))
})
- it('endOfISOWeekYear', function () {
+ it('endOfISOWeekYear', function() {
var result = fp.endOfISOWeekYear(new Date(2009, 0 /* Jan */, 1, 16, 0))
assert.deepEqual(result, new Date(2010, 0 /* Jan */, 3, 23, 59, 59, 999))
})
- it('endOfISOWeekYearWithOptions', function () {
- var result = fp.endOfISOWeekYearWithOptions({})(new Date(2009, 0 /* Jan */, 1, 16, 0))
+ it('endOfISOWeekYearWithOptions', function() {
+ var result = fp.endOfISOWeekYearWithOptions({})(
+ new Date(2009, 0 /* Jan */, 1, 16, 0)
+ )
assert.deepEqual(result, new Date(2010, 0 /* Jan */, 3, 23, 59, 59, 999))
})
- it('endOfMinute', function () {
+ it('endOfMinute', function() {
var date = new Date(2014, 11, 1, 22, 15)
var result = fp.endOfMinute(date)
assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 59, 999))
})
- it('endOfMinuteWithOptions', function () {
+ it('endOfMinuteWithOptions', function() {
var date = new Date(2014, 11, 1, 22, 15)
var result = fp.endOfMinuteWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 59, 999))
})
- it('endOfMonth', function () {
+ it('endOfMonth', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfMonth(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
})
- it('endOfMonthWithOptions', function () {
+ it('endOfMonthWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfMonthWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
})
- it('endOfQuarter', function () {
+ it('endOfQuarter', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfQuarter(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
})
- it('endOfQuarterWithOptions', function () {
+ it('endOfQuarterWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfQuarterWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
})
- it('endOfSecond', function () {
+ it('endOfSecond', function() {
var date = new Date(2014, 11, 1, 22, 15, 30)
var result = fp.endOfSecond(date)
assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 30, 999))
})
- it('endOfSecondWithOptions', function () {
+ it('endOfSecondWithOptions', function() {
var date = new Date(2014, 11, 1, 22, 15, 30)
var result = fp.endOfSecondWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 30, 999))
})
- it('endOfWeek', function () {
+ it('endOfWeek', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfWeek(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 6, 23, 59, 59, 999))
})
- it('endOfWeekWithOptions', function () {
+ it('endOfWeekWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfWeekWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 6, 23, 59, 59, 999))
})
- it('endOfYear', function () {
+ it('endOfYear', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfYear(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31, 23, 59, 59, 999))
})
- it('endOfYearWithOptions', function () {
+ it('endOfYearWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.endOfYearWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31, 23, 59, 59, 999))
})
- it('format', function () {
+ it('format', function() {
var date = new Date(2014, 3, 4).toISOString()
var result = fp.format('yyyy-MM-dd')(date)
assert(result === '2014-04-04')
})
- it('formatWithOptions', function () {
+ it('formatWithOptions', function() {
var date = new Date(2014, 3, 4).toISOString()
var result = fp.formatWithOptions({})('yyyy-MM-dd')(date)
assert(result === '2014-04-04')
})
- it('formatDistance', function () {
- var result = fp.formatDistance(
- new Date(1986, 3, 4, 10, 34, 50)
- )(
+ it('formatDistance', function() {
+ var result = fp.formatDistance(new Date(1986, 3, 4, 10, 34, 50))(
new Date(1986, 3, 4, 10, 32, 0)
)
assert(result === '3 minutes')
})
- it('formatDistanceWithOptions', function () {
- var result = fp.formatDistanceWithOptions({includeSeconds: true})(
+ it('formatDistanceWithOptions', function() {
+ var result = fp.formatDistanceWithOptions({ includeSeconds: true })(
new Date(1986, 3, 4, 10, 32, 3)
- )(
- new Date(1986, 3, 4, 10, 32, 0)
- )
+ )(new Date(1986, 3, 4, 10, 32, 0))
assert(result === 'less than 5 seconds')
})
- it('formatDistanceStrict', function () {
- var result = fp.formatDistanceStrict(
- new Date(1986, 3, 7, 10, 32, 0)
- )(
+ it('formatDistanceStrict', function() {
+ var result = fp.formatDistanceStrict(new Date(1986, 3, 7, 10, 32, 0))(
new Date(1986, 3, 4, 10, 32, 0)
)
assert(result === '3 days')
})
- it('formatDistanceStrictWithOptions', function () {
- var result = fp.formatDistanceStrictWithOptions({addSuffix: true})(
+ it('formatDistanceStrictWithOptions', function() {
+ var result = fp.formatDistanceStrictWithOptions({ addSuffix: true })(
new Date(1986, 3, 4, 10, 32, 0)
- )(
- new Date(1986, 3, 4, 11, 32, 0)
- )
+ )(new Date(1986, 3, 4, 11, 32, 0))
assert(result === 'in 1 hour')
})
- it('formatRelative', function () {
- var result = fp.formatRelative(new Date(1986, 3 /* Apr */, 4, 10, 32))(new Date(1986, 2 /* Mar */, 28, 16, 50))
+ it('formatRelative', function() {
+ var result = fp.formatRelative(new Date(1986, 3 /* Apr */, 4, 10, 32))(
+ new Date(1986, 2 /* Mar */, 28, 16, 50)
+ )
assert(result === '03/28/1986')
})
- it('formatRelativeWithOptions', function () {
- var result = fp.formatRelativeWithOptions({})(new Date(1986, 3 /* Apr */, 4, 10, 32))(new Date(1986, 2 /* Mar */, 28, 16, 50))
+ it('formatRelativeWithOptions', function() {
+ var result = fp.formatRelativeWithOptions({})(
+ new Date(1986, 3 /* Apr */, 4, 10, 32)
+ )(new Date(1986, 2 /* Mar */, 28, 16, 50))
assert(result === '03/28/1986')
})
- it('getDate', function () {
+ it('fromUnixTime', function() {
+ var result = fp.fromUnixTime(1330515499)
+ assert(result.getTime() === 1330515499000)
+ })
+
+ it('fromUnixTimeWithOptions', function() {
+ var result = fp.fromUnixTimeWithOptions({})(1330515499)
+ assert(result.getTime() === 1330515499000)
+ })
+
+ it('getDate', function() {
var result = fp.getDate(new Date(2012, 1 /* Feb */, 29))
assert(result === 29)
})
- it('getDateWithOptions', function () {
+ it('getDateWithOptions', function() {
var result = fp.getDateWithOptions({})(new Date(2012, 1 /* Feb */, 29))
assert(result === 29)
})
- it('getDay', function () {
+ it('getDay', function() {
var result = fp.getDay(new Date(2012, 1 /* Feb */, 29))
assert(result === 3)
})
- it('getDayWithOptions', function () {
+ it('getDayWithOptions', function() {
var result = fp.getDayWithOptions({})(new Date(2012, 1 /* Feb */, 29))
assert(result === 3)
})
- it('getDayOfYear', function () {
+ it('getDayOfYear', function() {
var result = fp.getDayOfYear(new Date(2014, 6 /* Jul */, 2))
assert(result === 183)
})
- it('getDayOfYearWithOptions', function () {
+ it('getDayOfYearWithOptions', function() {
var result = fp.getDayOfYearWithOptions({})(new Date(2014, 6 /* Jul */, 2))
assert(result === 183)
})
- it('getDaysInMonth', function () {
+ it('getDaysInMonth', function() {
var result = fp.getDaysInMonth(new Date(2100, 1 /* Feb */, 11))
assert(result === 28)
})
- it('getDaysInMonthWithOptions', function () {
- var result = fp.getDaysInMonthWithOptions({})(new Date(2100, 1 /* Feb */, 11))
+ it('getDaysInMonthWithOptions', function() {
+ var result = fp.getDaysInMonthWithOptions({})(
+ new Date(2100, 1 /* Feb */, 11)
+ )
assert(result === 28)
})
- it('getDaysInYear', function () {
+ it('getDaysInYear', function() {
var result = fp.getDaysInYear(new Date(2012, 6 /* Jul */, 2))
assert(result === 366)
})
- it('getDaysInYearWithOptions', function () {
+ it('getDaysInYearWithOptions', function() {
var result = fp.getDaysInYearWithOptions({})(new Date(2012, 6 /* Jul */, 2))
assert(result === 366)
})
- it('getHours', function () {
+ it('getHours', function() {
var result = fp.getHours(new Date(2012, 1 /* Feb */, 29, 11, 45))
assert(result === 11)
})
- it('getHoursWithOptions', function () {
- var result = fp.getHoursWithOptions({})(new Date(2012, 1 /* Feb */, 29, 11, 45))
+ it('getHoursWithOptions', function() {
+ var result = fp.getHoursWithOptions({})(
+ new Date(2012, 1 /* Feb */, 29, 11, 45)
+ )
assert(result === 11)
})
- it('getISODay', function () {
+ it('getISODay', function() {
var result = fp.getISODay(new Date(2012, 1 /* Feb */, 29))
assert(result === 3)
})
- it('getISODayWithOptions', function () {
+ it('getISODayWithOptions', function() {
var result = fp.getISODayWithOptions({})(new Date(2012, 1 /* Feb */, 29))
assert(result === 3)
})
- it('getISOWeek', function () {
+ it('getISOWeek', function() {
var result = fp.getISOWeek(new Date(2005, 0 /* Jan */, 2))
assert(result === 53)
})
- it('getISOWeekWithOptions', function () {
+ it('getISOWeekWithOptions', function() {
var result = fp.getISOWeekWithOptions({})(new Date(2005, 0 /* Jan */, 2))
assert(result === 53)
})
- it('getISOWeeksInYear', function () {
+ it('getISOWeeksInYear', function() {
var result = fp.getISOWeeksInYear(new Date(2015, 1 /* Feb */, 11))
assert(result === 53)
})
- it('getISOWeeksInYearWithOptions', function () {
- var result = fp.getISOWeeksInYearWithOptions({})(new Date(2015, 1 /* Feb */, 11))
+ it('getISOWeeksInYearWithOptions', function() {
+ var result = fp.getISOWeeksInYearWithOptions({})(
+ new Date(2015, 1 /* Feb */, 11)
+ )
assert(result === 53)
})
- it('getISOWeekYear', function () {
+ it('getISOWeekYear', function() {
var result = fp.getISOWeekYear(new Date(2007, 11 /* Dec */, 31))
assert(result === 2008)
})
- it('getISOWeekYearWithOptions', function () {
- var result = fp.getISOWeekYearWithOptions({})(new Date(2007, 11 /* Dec */, 31))
+ it('getISOWeekYearWithOptions', function() {
+ var result = fp.getISOWeekYearWithOptions({})(
+ new Date(2007, 11 /* Dec */, 31)
+ )
assert(result === 2008)
})
- it('getMilliseconds', function () {
- var result = fp.getMilliseconds(new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123))
+ it('getMilliseconds', function() {
+ var result = fp.getMilliseconds(
+ new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123)
+ )
assert(result === 123)
})
- it('getMillisecondsWithOptions', function () {
- var result = fp.getMillisecondsWithOptions({})(new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123))
+ it('getMillisecondsWithOptions', function() {
+ var result = fp.getMillisecondsWithOptions({})(
+ new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123)
+ )
assert(result === 123)
})
- it('getMinutes', function () {
+ it('getMinutes', function() {
var result = fp.getMinutes(new Date(2012, 1 /* Feb */, 29, 11, 45, 5))
assert(result === 45)
})
- it('getMinutesWithOptions', function () {
- var result = fp.getMinutesWithOptions({})(new Date(2012, 1 /* Feb */, 29, 11, 45, 5))
+ it('getMinutesWithOptions', function() {
+ var result = fp.getMinutesWithOptions({})(
+ new Date(2012, 1 /* Feb */, 29, 11, 45, 5)
+ )
assert(result === 45)
})
- it('getMonth', function () {
+ it('getMonth', function() {
var result = fp.getMonth(new Date(2012, 1 /* Feb */, 29))
assert(result === 1)
})
- it('getMonthWithOptions', function () {
+ it('getMonthWithOptions', function() {
var result = fp.getMonthWithOptions({})(new Date(2012, 1 /* Feb */, 29))
assert(result === 1)
})
- it('getOverlappingDaysInIntervals', function () {
- var leftInterval = {start: new Date(2016, 10, 10, 13, 0, 0), end: new Date(2016, 11, 3, 15, 0, 0)}
- var rightInterval = {start: new Date(2016, 10, 5), end: new Date(2016, 11, 15)}
- var numOverlappingDays = fp.getOverlappingDaysInIntervals(rightInterval)(leftInterval)
+ it('getOverlappingDaysInIntervals', function() {
+ var leftInterval = {
+ start: new Date(2016, 10, 10, 13, 0, 0),
+ end: new Date(2016, 11, 3, 15, 0, 0)
+ }
+ var rightInterval = {
+ start: new Date(2016, 10, 5),
+ end: new Date(2016, 11, 15)
+ }
+ var numOverlappingDays = fp.getOverlappingDaysInIntervals(rightInterval)(
+ leftInterval
+ )
assert(numOverlappingDays === 24)
})
- it('getOverlappingDaysInIntervalsWithOptions', function () {
- var leftInterval = {start: new Date(2016, 10, 10, 13, 0, 0), end: new Date(2016, 11, 3, 15, 0, 0)}
- var rightInterval = {start: new Date(2016, 10, 5), end: new Date(2016, 11, 15)}
- var numOverlappingDays = fp.getOverlappingDaysInIntervalsWithOptions({})(rightInterval)(leftInterval)
+ it('getOverlappingDaysInIntervalsWithOptions', function() {
+ var leftInterval = {
+ start: new Date(2016, 10, 10, 13, 0, 0),
+ end: new Date(2016, 11, 3, 15, 0, 0)
+ }
+ var rightInterval = {
+ start: new Date(2016, 10, 5),
+ end: new Date(2016, 11, 15)
+ }
+ var numOverlappingDays = fp.getOverlappingDaysInIntervalsWithOptions({})(
+ rightInterval
+ )(leftInterval)
assert(numOverlappingDays === 24)
})
- it('getQuarter', function () {
+ it('getQuarter', function() {
var result = fp.getQuarter(new Date(2014, 6 /* Jul */, 2))
assert(result === 3)
})
- it('getQuarterWithOptions', function () {
+ it('getQuarterWithOptions', function() {
var result = fp.getQuarterWithOptions({})(new Date(2014, 6 /* Jul */, 2))
assert(result === 3)
})
- it('getSeconds', function () {
+ it('getSeconds', function() {
var result = fp.getSeconds(new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123))
assert(result === 5)
})
- it('getSecondsWithOptions', function () {
- var result = fp.getSecondsWithOptions({})(new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123))
+ it('getSecondsWithOptions', function() {
+ var result = fp.getSecondsWithOptions({})(
+ new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123)
+ )
assert(result === 5)
})
- it('getTime', function () {
+ it('getTime', function() {
var timestamp = 1483228800000
var result = fp.getTime(new Date(timestamp))
assert(result === timestamp)
})
- it('getTimeWithOptions', function () {
+ it('getTimeWithOptions', function() {
var timestamp = 1483228800000
var result = fp.getTimeWithOptions({})(new Date(timestamp))
assert(result === timestamp)
})
- it('getWeek', function () {
+ it('getWeek', function() {
var result = fp.getWeek(new Date(2005, 0 /* Jan */, 2))
assert(result === 2)
})
- it('getWeekWithOptions', function () {
- var result = fp.getWeekWithOptions({weekStartsOn: 1, firstWeekContainsDate: 4})(new Date(2005, 0 /* Jan */, 2))
+ it('getWeekWithOptions', function() {
+ var result = fp.getWeekWithOptions({
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4
+ })(new Date(2005, 0 /* Jan */, 2))
assert(result === 53)
})
- it('getWeeksInMonth', function () {
+ it('getWeeksInMonth', function() {
var result = fp.getWeeksInMonth(new Date(2017, 3 /* Apr */, 8, 18, 0))
assert(result === 6)
})
- it('getWeeksInMonthWithOptions', function () {
- var result = fp.getWeeksInMonthWithOptions({})(new Date(2017, 3 /* Apr */, 8, 18, 0))
+ it('getWeeksInMonthWithOptions', function() {
+ var result = fp.getWeeksInMonthWithOptions({})(
+ new Date(2017, 3 /* Apr */, 8, 18, 0)
+ )
assert(result === 6)
})
- it('getWeekOfMonth', function () {
+ it('getWeekOfMonth', function() {
var result = fp.getWeekOfMonth(new Date(2017, 10 /* Nov */, 15))
assert(result === 3)
})
- it('getWeekOfMonthWithOptions', function () {
- var result = fp.getWeekOfMonthWithOptions({weekStartsOn: 1})(new Date(2017, 9 /* Oct */, 1))
+ it('getWeekOfMonthWithOptions', function() {
+ var result = fp.getWeekOfMonthWithOptions({ weekStartsOn: 1 })(
+ new Date(2017, 9 /* Oct */, 1)
+ )
assert(result === 1)
})
- it('getWeekYear', function () {
+ it('getWeekYear', function() {
var result = fp.getWeekYear(new Date(2004, 11 /* Dec */, 26))
assert(result === 2005)
})
- it('getWeekYearWithOptions', function () {
- var result = fp.getWeekYearWithOptions({weekStartsOn: 1, firstWeekContainsDate: 4})(new Date(2004, 11 /* Dec */, 26))
+ it('getWeekYearWithOptions', function() {
+ var result = fp.getWeekYearWithOptions({
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4
+ })(new Date(2004, 11 /* Dec */, 26))
assert(result === 2004)
})
- it('getYear', function () {
+ it('getYear', function() {
var result = fp.getYear(new Date(2014, 6 /* Jul */, 2))
assert(result === 2014)
})
- it('getYearWithOptions', function () {
+ it('getYearWithOptions', function() {
var result = fp.getYearWithOptions({})(new Date(2014, 6 /* Jul */, 2))
assert(result === 2014)
})
- it('isAfter', function () {
- var result = fp.isAfter(new Date(1987, 1 /* Feb */, 11))(new Date(1989, 6 /* Jul */, 10))
+ it('isAfter', function() {
+ var result = fp.isAfter(new Date(1987, 1 /* Feb */, 11))(
+ new Date(1989, 6 /* Jul */, 10)
+ )
assert(result === true)
})
- it('isAfterWithOptions', function () {
- var result = fp.isAfterWithOptions({})(new Date(1987, 1 /* Feb */, 11))(new Date(1989, 6 /* Jul */, 10))
+ it('isAfterWithOptions', function() {
+ var result = fp.isAfterWithOptions({})(new Date(1987, 1 /* Feb */, 11))(
+ new Date(1989, 6 /* Jul */, 10)
+ )
assert(result === true)
})
- it('isBefore', function () {
- var result = fp.isBefore(new Date(1989, 6 /* Jul */, 10))(new Date(1987, 1 /* Feb */, 11))
+ it('isBefore', function() {
+ var result = fp.isBefore(new Date(1989, 6 /* Jul */, 10))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === true)
})
- it('isBeforeWithOptions', function () {
- var result = fp.isBeforeWithOptions({})(new Date(1989, 6 /* Jul */, 10))(new Date(1987, 1 /* Feb */, 11))
+ it('isBeforeWithOptions', function() {
+ var result = fp.isBeforeWithOptions({})(new Date(1989, 6 /* Jul */, 10))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === true)
})
- it('isEqual', function () {
- var result = fp.isEqual(new Date(1987, 1 /* Feb */, 11))(new Date(1987, 1 /* Feb */, 11))
+ it('isEqual', function() {
+ var result = fp.isEqual(new Date(1987, 1 /* Feb */, 11))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === true)
})
- it('isEqualWithOptions', function () {
- var result = fp.isEqualWithOptions({})(new Date(1987, 1 /* Feb */, 11))(new Date(1987, 1 /* Feb */, 11))
+ it('isEqualWithOptions', function() {
+ var result = fp.isEqualWithOptions({})(new Date(1987, 1 /* Feb */, 11))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
assert(result === true)
})
- it('isFirstDayOfMonth', function () {
+ it('isFirstDayOfMonth', function() {
var result = fp.isFirstDayOfMonth(new Date(2014, 9 /* Oct */, 1))
assert(result === true)
})
- it('isFirstDayOfMonthWithOptions', function () {
- var result = fp.isFirstDayOfMonthWithOptions({})(new Date(2014, 9 /* Oct */, 1))
+ it('isFirstDayOfMonthWithOptions', function() {
+ var result = fp.isFirstDayOfMonthWithOptions({})(
+ new Date(2014, 9 /* Oct */, 1)
+ )
assert(result === true)
})
- it('isFriday', function () {
+ it('isFriday', function() {
var result = fp.isFriday(new Date(2014, 8 /* Sep */, 26))
assert(result === true)
})
- it('isFridayWithOptions', function () {
+ it('isFridayWithOptions', function() {
var result = fp.isFridayWithOptions({})(new Date(2014, 8 /* Sep */, 26))
assert(result === true)
})
- it('isLastDayOfMonth', function () {
+ it('isLastDayOfMonth', function() {
var result = fp.isLastDayOfMonth(new Date(2014, 9 /* Oct */, 31))
assert(result === true)
})
- it('isLastDayOfMonthWithOptions', function () {
- var result = fp.isLastDayOfMonthWithOptions({})(new Date(2014, 9 /* Oct */, 31))
+ it('isLastDayOfMonthWithOptions', function() {
+ var result = fp.isLastDayOfMonthWithOptions({})(
+ new Date(2014, 9 /* Oct */, 31)
+ )
assert(result === true)
})
- it('isLeapYear', function () {
+ it('isLeapYear', function() {
var result = fp.isLeapYear(new Date(2012, 6 /* Jul */, 2))
assert(result === true)
})
- it('isLeapYearWithOptions', function () {
+ it('isLeapYearWithOptions', function() {
var result = fp.isLeapYearWithOptions({})(new Date(2012, 6 /* Jul */, 2))
assert(result === true)
})
- it('isMonday', function () {
+ it('isMonday', function() {
var result = fp.isMonday(new Date(2014, 8 /* Sep */, 22))
assert(result === true)
})
- it('isMondayWithOptions', function () {
+ it('isMondayWithOptions', function() {
var result = fp.isMondayWithOptions({})(new Date(2014, 8 /* Sep */, 22))
assert(result === true)
})
- it('isSameDay', function () {
- var result = fp.isSameDay(new Date(2014, 8 /* Sep */, 4, 18, 0))(new Date(2014, 8 /* Sep */, 4, 6, 0))
+ it('isSameDay', function() {
+ var result = fp.isSameDay(new Date(2014, 8 /* Sep */, 4, 18, 0))(
+ new Date(2014, 8 /* Sep */, 4, 6, 0)
+ )
assert(result === true)
})
- it('isSameDayWithOptions', function () {
- var result = fp.isSameDayWithOptions({})(new Date(2014, 8 /* Sep */, 4, 18, 0))(new Date(2014, 8 /* Sep */, 4, 6, 0))
+ it('isSameDayWithOptions', function() {
+ var result = fp.isSameDayWithOptions({})(
+ new Date(2014, 8 /* Sep */, 4, 18, 0)
+ )(new Date(2014, 8 /* Sep */, 4, 6, 0))
assert(result === true)
})
- it('isSameHour', function () {
- var result = fp.isSameHour(new Date(2014, 8 /* Sep */, 4, 6, 30))(new Date(2014, 8 /* Sep */, 4, 6, 0))
+ it('isSameHour', function() {
+ var result = fp.isSameHour(new Date(2014, 8 /* Sep */, 4, 6, 30))(
+ new Date(2014, 8 /* Sep */, 4, 6, 0)
+ )
assert(result === true)
})
- it('isSameHourWithOptions', function () {
- var result = fp.isSameHourWithOptions({})(new Date(2014, 8 /* Sep */, 4, 6, 30))(new Date(2014, 8 /* Sep */, 4, 6, 0))
+ it('isSameHourWithOptions', function() {
+ var result = fp.isSameHourWithOptions({})(
+ new Date(2014, 8 /* Sep */, 4, 6, 30)
+ )(new Date(2014, 8 /* Sep */, 4, 6, 0))
assert(result === true)
})
- it('isSameISOWeek', function () {
- var result = fp.isSameISOWeek(new Date(2014, 8 /* Sep */, 7))(new Date(2014, 8 /* Sep */, 1))
+ it('isSameISOWeek', function() {
+ var result = fp.isSameISOWeek(new Date(2014, 8 /* Sep */, 7))(
+ new Date(2014, 8 /* Sep */, 1)
+ )
assert(result === true)
})
- it('isSameISOWeekWithOptions', function () {
- var result = fp.isSameISOWeekWithOptions({})(new Date(2014, 8 /* Sep */, 7))(new Date(2014, 8 /* Sep */, 1))
+ it('isSameISOWeekWithOptions', function() {
+ var result = fp.isSameISOWeekWithOptions({})(
+ new Date(2014, 8 /* Sep */, 7)
+ )(new Date(2014, 8 /* Sep */, 1))
assert(result === true)
})
- it('isSameISOWeekYear', function () {
- var result = fp.isSameISOWeekYear(new Date(2005, 0 /* Jan */, 2))(new Date(2003, 11 /* Dec */, 29))
+ it('isSameISOWeekYear', function() {
+ var result = fp.isSameISOWeekYear(new Date(2005, 0 /* Jan */, 2))(
+ new Date(2003, 11 /* Dec */, 29)
+ )
assert(result === true)
})
- it('isSameISOWeekYearWithOptions', function () {
- var result = fp.isSameISOWeekYearWithOptions({})(new Date(2005, 0 /* Jan */, 2))(new Date(2003, 11 /* Dec */, 29))
+ it('isSameISOWeekYearWithOptions', function() {
+ var result = fp.isSameISOWeekYearWithOptions({})(
+ new Date(2005, 0 /* Jan */, 2)
+ )(new Date(2003, 11 /* Dec */, 29))
assert(result === true)
})
- it('isSameMinute', function () {
- var result = fp.isSameMinute(new Date(2014, 8 /* Sep */, 4, 6, 30, 15))(new Date(2014, 8 /* Sep */, 4, 6, 30))
+ it('isSameMinute', function() {
+ var result = fp.isSameMinute(new Date(2014, 8 /* Sep */, 4, 6, 30, 15))(
+ new Date(2014, 8 /* Sep */, 4, 6, 30)
+ )
assert(result === true)
})
- it('isSameMinuteWithOptions', function () {
- var result = fp.isSameMinuteWithOptions({})(new Date(2014, 8 /* Sep */, 4, 6, 30, 15))(new Date(2014, 8 /* Sep */, 4, 6, 30))
+ it('isSameMinuteWithOptions', function() {
+ var result = fp.isSameMinuteWithOptions({})(
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 15)
+ )(new Date(2014, 8 /* Sep */, 4, 6, 30))
assert(result === true)
})
- it('isSameMonth', function () {
- var result = fp.isSameMonth(new Date(2014, 8 /* Sep */, 25))(new Date(2014, 8 /* Sep */, 2))
+ it('isSameMonth', function() {
+ var result = fp.isSameMonth(new Date(2014, 8 /* Sep */, 25))(
+ new Date(2014, 8 /* Sep */, 2)
+ )
assert(result === true)
})
- it('isSameMonthWithOptions', function () {
- var result = fp.isSameMonthWithOptions({})(new Date(2014, 8 /* Sep */, 25))(new Date(2014, 8 /* Sep */, 2))
+ it('isSameMonthWithOptions', function() {
+ var result = fp.isSameMonthWithOptions({})(new Date(2014, 8 /* Sep */, 25))(
+ new Date(2014, 8 /* Sep */, 2)
+ )
assert(result === true)
})
- it('isSameQuarter', function () {
- var result = fp.isSameQuarter(new Date(2014, 2 /* Mar */, 8))(new Date(2014, 0 /* Jan */, 1))
+ it('isSameQuarter', function() {
+ var result = fp.isSameQuarter(new Date(2014, 2 /* Mar */, 8))(
+ new Date(2014, 0 /* Jan */, 1)
+ )
assert(result === true)
})
- it('isSameQuarterWithOptions', function () {
- var result = fp.isSameQuarterWithOptions({})(new Date(2014, 2 /* Mar */, 8))(new Date(2014, 0 /* Jan */, 1))
+ it('isSameQuarterWithOptions', function() {
+ var result = fp.isSameQuarterWithOptions({})(
+ new Date(2014, 2 /* Mar */, 8)
+ )(new Date(2014, 0 /* Jan */, 1))
assert(result === true)
})
- it('isSameSecond', function () {
- var result = fp.isSameSecond(new Date(2014, 8 /* Sep */, 4, 6, 30, 15, 500))(new Date(2014, 8 /* Sep */, 4, 6, 30, 15))
+ it('isSameSecond', function() {
+ var result = fp.isSameSecond(
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 15, 500)
+ )(new Date(2014, 8 /* Sep */, 4, 6, 30, 15))
assert(result === true)
})
- it('isSameSecondWithOptions', function () {
- var result = fp.isSameSecondWithOptions({})(new Date(2014, 8 /* Sep */, 4, 6, 30, 15, 500))(new Date(2014, 8 /* Sep */, 4, 6, 30, 15))
+ it('isSameSecondWithOptions', function() {
+ var result = fp.isSameSecondWithOptions({})(
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 15, 500)
+ )(new Date(2014, 8 /* Sep */, 4, 6, 30, 15))
assert(result === true)
})
- it('isSameWeek', function () {
- var result = fp.isSameWeek(new Date(2014, 8 /* Sep */, 4))(new Date(2014, 7 /* Aug */, 31))
+ it('isSameWeek', function() {
+ var result = fp.isSameWeek(new Date(2014, 8 /* Sep */, 4))(
+ new Date(2014, 7 /* Aug */, 31)
+ )
assert(result === true)
})
- it('isSameWeekWithOptions', function () {
- var result = fp.isSameWeekWithOptions({weekStartsOn: 1})(new Date(2014, 8 /* Sep */, 4))(new Date(2014, 7 /* Aug */, 31))
+ it('isSameWeekWithOptions', function() {
+ var result = fp.isSameWeekWithOptions({ weekStartsOn: 1 })(
+ new Date(2014, 8 /* Sep */, 4)
+ )(new Date(2014, 7 /* Aug */, 31))
assert(result === false)
})
- it('isSameYear', function () {
- var result = fp.isSameYear(new Date(2014, 8 /* Sep */, 25))(new Date(2014, 8 /* Sep */, 2))
+ it('isSameYear', function() {
+ var result = fp.isSameYear(new Date(2014, 8 /* Sep */, 25))(
+ new Date(2014, 8 /* Sep */, 2)
+ )
assert(result === true)
})
- it('isSameYearWithOptions', function () {
- var result = fp.isSameYearWithOptions({})(new Date(2014, 8 /* Sep */, 25))(new Date(2014, 8 /* Sep */, 2))
+ it('isSameYearWithOptions', function() {
+ var result = fp.isSameYearWithOptions({})(new Date(2014, 8 /* Sep */, 25))(
+ new Date(2014, 8 /* Sep */, 2)
+ )
assert(result === true)
})
- it('isSaturday', function () {
+ it('isSaturday', function() {
var result = fp.isSaturday(new Date(2014, 8 /* Sep */, 27))
assert(result === true)
})
- it('isSaturdayWithOptions', function () {
+ it('isSaturdayWithOptions', function() {
var result = fp.isSaturdayWithOptions({})(new Date(2014, 8 /* Sep */, 27))
assert(result === true)
})
- it('isSunday', function () {
+ it('isSunday', function() {
var result = fp.isSunday(new Date(2014, 8 /* Sep */, 21))
assert(result === true)
})
- it('isSundayWithOptions', function () {
+ it('isSundayWithOptions', function() {
var result = fp.isSundayWithOptions({})(new Date(2014, 8 /* Sep */, 21))
assert(result === true)
})
- it('isThursday', function () {
+ it('isThursday', function() {
var result = fp.isThursday(new Date(2014, 8 /* Sep */, 25))
assert(result === true)
})
- it('isThursdayWithOptions', function () {
+ it('isThursdayWithOptions', function() {
var result = fp.isThursdayWithOptions({})(new Date(2014, 8 /* Sep */, 25))
assert(result === true)
})
- it('isTuesday', function () {
+ it('isTuesday', function() {
var result = fp.isTuesday(new Date(2014, 8 /* Sep */, 23))
assert(result === true)
})
- it('isTuesdayWithOptions', function () {
+ it('isTuesdayWithOptions', function() {
var result = fp.isTuesdayWithOptions({})(new Date(2014, 8 /* Sep */, 23))
assert(result === true)
})
- it('isValid', function () {
+ it('isValid', function() {
var result = fp.isValid(new Date())
assert(result === true)
})
- it('isValidWithOptions', function () {
+ it('isValidWithOptions', function() {
var result = fp.isValidWithOptions({})(new Date())
assert(result === true)
})
- it('isWednesday', function () {
+ it('isWednesday', function() {
var result = fp.isWednesday(new Date(2014, 8 /* Sep */, 24))
assert(result === true)
})
- it('isWednesdayWithOptions', function () {
+ it('isWednesdayWithOptions', function() {
var result = fp.isWednesdayWithOptions({})(new Date(2014, 8 /* Sep */, 24))
assert(result === true)
})
- it('isWeekend', function () {
+ it('isWeekend', function() {
var result = fp.isWeekend(new Date(2014, 9 /* Oct */, 5))
assert(result === true)
})
- it('isWeekendWithOptions', function () {
+ it('isWeekendWithOptions', function() {
var result = fp.isWeekendWithOptions({})(new Date(2014, 9 /* Oct */, 5))
assert(result === true)
})
- it('isWithinInterval', function () {
- var interval = {start: new Date(2014, 8 /* Sep */, 1), end: new Date(2014, 11 /* Dec */, 31)}
+ it('isWithinInterval', function() {
+ var interval = {
+ start: new Date(2014, 8 /* Sep */, 1),
+ end: new Date(2014, 11 /* Dec */, 31)
+ }
var result = fp.isWithinInterval(interval)(new Date(2014, 9 /* Oct */, 31))
assert(result === true)
})
- it('isWithinIntervalWithOptions', function () {
- var interval = {start: new Date(2014, 8 /* Sep */, 1), end: new Date(2014, 11 /* Dec */, 31)}
- var result = fp.isWithinIntervalWithOptions({})(interval)(new Date(2014, 9 /* Oct */, 31))
+ it('isWithinIntervalWithOptions', function() {
+ var interval = {
+ start: new Date(2014, 8 /* Sep */, 1),
+ end: new Date(2014, 11 /* Dec */, 31)
+ }
+ var result = fp.isWithinIntervalWithOptions({})(interval)(
+ new Date(2014, 9 /* Oct */, 31)
+ )
assert(result === true)
})
- it('lastDayOfISOWeek', function () {
+ it('lastDayOfISOWeek', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfISOWeek(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
})
- it('lastDayOfISOWeekWithOptions', function () {
+ it('lastDayOfISOWeekWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfISOWeekWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
})
- it('lastDayOfISOWeekYear', function () {
+ it('lastDayOfISOWeekYear', function() {
var result = fp.lastDayOfISOWeekYear(new Date(2009, 0 /* Jan */, 1, 16, 0))
assert.deepEqual(result, new Date(2010, 0 /* Jan */, 3))
})
- it('lastDayOfISOWeekYearWithOptions', function () {
- var result = fp.lastDayOfISOWeekYearWithOptions({})(new Date(2009, 0 /* Jan */, 1, 16, 0))
+ it('lastDayOfISOWeekYearWithOptions', function() {
+ var result = fp.lastDayOfISOWeekYearWithOptions({})(
+ new Date(2009, 0 /* Jan */, 1, 16, 0)
+ )
assert.deepEqual(result, new Date(2010, 0 /* Jan */, 3))
})
- it('lastDayOfMonth', function () {
+ it('lastDayOfMonth', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfMonth(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
})
- it('lastDayOfMonthWithOptions', function () {
+ it('lastDayOfMonthWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfMonthWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
})
- it('lastDayOfQuarter', function () {
+ it('lastDayOfQuarter', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfQuarter(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
})
- it('lastDayOfQuarterWithOptions', function () {
+ it('lastDayOfQuarterWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfQuarterWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
})
- it('lastDayOfWeek', function () {
+ it('lastDayOfWeek', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfWeek(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 6))
})
- it('lastDayOfWeekWithOptions', function () {
+ it('lastDayOfWeekWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
- var result = fp.lastDayOfWeekWithOptions({weekStartsOn: 1})(date)
+ var result = fp.lastDayOfWeekWithOptions({ weekStartsOn: 1 })(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
})
- it('lastDayOfYear', function () {
+ it('lastDayOfYear', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfYear(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31))
})
- it('lastDayOfYearWithOptions', function () {
+ it('lastDayOfYearWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.lastDayOfYearWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31))
})
- it('max', function () {
- var result = fp.max([new Date(1989, 6 /* Jul */, 10), new Date(1987, 1 /* Feb */, 11)])
+ it('max', function() {
+ var result = fp.max([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ ])
assert.deepEqual(result, new Date(1989, 6 /* Jul */, 10))
})
- it('maxWithOptions', function () {
- var result = fp.maxWithOptions({})([new Date(1989, 6 /* Jul */, 10), new Date(1987, 1 /* Feb */, 11)])
+ it('maxWithOptions', function() {
+ var result = fp.maxWithOptions({})([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ ])
assert.deepEqual(result, new Date(1989, 6 /* Jul */, 10))
})
- it('min', function () {
- var result = fp.min([new Date(1989, 6 /* Jul */, 10), new Date(1987, 1 /* Feb */, 11)])
+ it('min', function() {
+ var result = fp.min([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ ])
assert.deepEqual(result, new Date(1987, 1 /* Feb */, 11))
})
- it('minWithOptions', function () {
- var result = fp.minWithOptions([new Date(1989, 6 /* Jul */, 10), new Date(1987, 1 /* Feb */, 11)])
+ it('minWithOptions', function() {
+ var result = fp.minWithOptions([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ ])
assert.deepEqual(result, new Date(1987, 1 /* Feb */, 11))
})
- it('parse', function () {
+ it('parse', function() {
var baseDate = new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 900)
var result = fp.parse(baseDate)("yyyyMMdd'T'HHmmss")('20161105T040404')
assert.deepEqual(result, new Date(2016, 10 /* Nov */, 5, 4, 4, 4, 0))
})
- it('parseWithOptions', function () {
+ it('parseWithOptions', function() {
var baseDate = new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 900)
- var result = fp.parseWithOptions({})(baseDate)("yyyyMMdd'T'HHmmss")('20161105T040404')
+ var result = fp.parseWithOptions({})(baseDate)("yyyyMMdd'T'HHmmss")(
+ '20161105T040404'
+ )
assert.deepEqual(result, new Date(2016, 10 /* Nov */, 5, 4, 4, 4, 0))
})
- it('roundToNearestMinutes', function () {
- var result = fp.roundToNearestMinutes(5)(new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99))
+ it('roundToNearestMinutes', function() {
+ var result = fp.roundToNearestMinutes(5)(
+ new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 10))
- var result = fp.roundToNearestMinutes()(new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99))
+ var result = fp.roundToNearestMinutes()(
+ new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 11))
})
- it('roundToNearestMinutesWithOptions', function () {
- var result = fp.roundToNearestMinutesWithOptions({})(5)(new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99))
+ it('roundToNearestMinutesWithOptions', function() {
+ var result = fp.roundToNearestMinutesWithOptions({})(5)(
+ new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 10))
- var result = fp.roundToNearestMinutesWithOptions({})()(new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99))
+ var result = fp.roundToNearestMinutesWithOptions({})()(
+ new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 11))
})
- it('setDate', function () {
+ it('setDate', function() {
var result = fp.setDate(30)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
})
- it('setDateWithOptions', function () {
+ it('setDateWithOptions', function() {
var result = fp.setDateWithOptions({})(30)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
})
- it('setDay', function () {
+ it('setDay', function() {
var result = fp.setDay(0)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
})
- it('setDayWithOptions', function () {
- var result = fp.setDayWithOptions({weekStartsOn: 1})(0)(new Date(2014, 8 /* Sep */, 1))
+ it('setDayWithOptions', function() {
+ var result = fp.setDayWithOptions({ weekStartsOn: 1 })(0)(
+ new Date(2014, 8 /* Sep */, 1)
+ )
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
})
- it('setDayOfYear', function () {
+ it('setDayOfYear', function() {
var result = fp.setDayOfYear(2)(new Date(2014, 6 /* Jul */, 2))
assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
})
- it('setDayOfYearWithOptions', function () {
- var result = fp.setDayOfYearWithOptions({})(2)(new Date(2014, 6 /* Jul */, 2))
+ it('setDayOfYearWithOptions', function() {
+ var result = fp.setDayOfYearWithOptions({})(2)(
+ new Date(2014, 6 /* Jul */, 2)
+ )
assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
})
- it('setHours', function () {
+ it('setHours', function() {
var result = fp.setHours(4)(new Date(2014, 8 /* Sep */, 1, 11, 30))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 4, 30))
})
- it('setHoursWithOptions', function () {
- var result = fp.setHoursWithOptions({})(4)(new Date(2014, 8 /* Sep */, 1, 11, 30))
+ it('setHoursWithOptions', function() {
+ var result = fp.setHoursWithOptions({})(4)(
+ new Date(2014, 8 /* Sep */, 1, 11, 30)
+ )
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 4, 30))
})
- it('setISODay', function () {
+ it('setISODay', function() {
var result = fp.setISODay(3)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
})
- it('setISODayWithOptions', function () {
+ it('setISODayWithOptions', function() {
var result = fp.setISODayWithOptions({})(3)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
})
- it('setISOWeek', function () {
+ it('setISOWeek', function() {
var result = fp.setISOWeek(53)(new Date(2004, 7 /* Aug */, 7))
assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
})
- it('setISOWeekWithOptions', function () {
- var result = fp.setISOWeekWithOptions({})(53)(new Date(2004, 7 /* Aug */, 7))
+ it('setISOWeekWithOptions', function() {
+ var result = fp.setISOWeekWithOptions({})(53)(
+ new Date(2004, 7 /* Aug */, 7)
+ )
assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
})
- it('setISOWeekYear', function () {
+ it('setISOWeekYear', function() {
var result = fp.setISOWeekYear(2007)(new Date(2008, 11 /* Dec */, 29))
assert.deepEqual(result, new Date(2007, 0 /* Jan */, 1))
})
- it('setISOWeekYearWithOptions', function () {
- var result = fp.setISOWeekYearWithOptions({})(2007)(new Date(2008, 11 /* Dec */, 29))
+ it('setISOWeekYearWithOptions', function() {
+ var result = fp.setISOWeekYearWithOptions({})(2007)(
+ new Date(2008, 11 /* Dec */, 29)
+ )
assert.deepEqual(result, new Date(2007, 0 /* Jan */, 1))
})
- it('setMilliseconds', function () {
- var result = fp.setMilliseconds(300)(new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500))
+ it('setMilliseconds', function() {
+ var result = fp.setMilliseconds(300)(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500)
+ )
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 300))
})
- it('setMillisecondsWithOptions', function () {
- var result = fp.setMillisecondsWithOptions({})(300)(new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500))
+ it('setMillisecondsWithOptions', function() {
+ var result = fp.setMillisecondsWithOptions({})(300)(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500)
+ )
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 300))
})
- it('setMinutes', function () {
+ it('setMinutes', function() {
var result = fp.setMinutes(45)(new Date(2014, 8 /* Sep */, 1, 11, 30, 40))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 45, 40))
})
- it('setMinutesWithOptions', function () {
- var result = fp.setMinutesWithOptions({})(45)(new Date(2014, 8 /* Sep */, 1, 11, 30, 40))
+ it('setMinutesWithOptions', function() {
+ var result = fp.setMinutesWithOptions({})(45)(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40)
+ )
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 45, 40))
})
- it('setMonth', function () {
+ it('setMonth', function() {
var result = fp.setMonth(1)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 1 /* Feb */, 1))
})
- it('setMonthWithOptions', function () {
+ it('setMonthWithOptions', function() {
var result = fp.setMonthWithOptions({})(1)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 1 /* Feb */, 1))
})
- it('setQuarter', function () {
+ it('setQuarter', function() {
var result = fp.setQuarter(1)(new Date(2014, 6 /* Jul */, 2))
assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
})
- it('setQuarterWithOptions', function () {
+ it('setQuarterWithOptions', function() {
var result = fp.setQuarterWithOptions({})(1)(new Date(2014, 6 /* Jul */, 2))
assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
})
- it('setSeconds', function () {
- var result = fp.setSeconds(45)(new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500))
+ it('setSeconds', function() {
+ var result = fp.setSeconds(45)(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500)
+ )
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 45, 500))
})
- it('setSecondsWithOptions', function () {
- var result = fp.setSecondsWithOptions({})(45)(new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500))
+ it('setSecondsWithOptions', function() {
+ var result = fp.setSecondsWithOptions({})(45)(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500)
+ )
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 45, 500))
})
- it('setWeek', function () {
+ it('setWeek', function() {
var result = fp.setWeek(1)(new Date(2005, 0 /* Jan */, 2))
assert.deepEqual(result, new Date(2004, 11 /* Dec */, 26))
})
- it('setWeekWithOptions', function () {
- var result = fp.setWeekWithOptions({weekStartsOn: 1, firstWeekContainsDate: 4})(1)(new Date(2005, 0 /* Jan */, 2))
+ it('setWeekWithOptions', function() {
+ var result = fp.setWeekWithOptions({
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4
+ })(1)(new Date(2005, 0 /* Jan */, 2))
assert.deepEqual(result, new Date(2004, 0 /* Jan */, 4))
})
- it('setWeekYear', function () {
+ it('setWeekYear', function() {
var result = fp.setWeekYear(2004)(new Date(2010, 0 /* Jan */, 2))
assert.deepEqual(result, new Date(2004, 0 /* Jan */, 3))
})
- it('setWeekYearWithOptions', function () {
- var result = fp.setWeekYearWithOptions({weekStartsOn: 1, firstWeekContainsDate: 4})(2004)(new Date(2010, 0 /* Jan */, 2))
+ it('setWeekYearWithOptions', function() {
+ var result = fp.setWeekYearWithOptions({
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4
+ })(2004)(new Date(2010, 0 /* Jan */, 2))
assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
})
- it('setYear', function () {
+ it('setYear', function() {
var result = fp.setYear(2013)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2013, 8 /* Sep */, 1))
})
- it('setYearWithOptions', function () {
+ it('setYearWithOptions', function() {
var result = fp.setYearWithOptions({})(2013)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2013, 8 /* Sep */, 1))
})
- it('startOfDay', function () {
+ it('startOfDay', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfDay(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 0, 0, 0, 0))
})
- it('startOfDayWithOptions', function () {
+ it('startOfDayWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfDayWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 0, 0, 0, 0))
})
- it('startOfHour', function () {
+ it('startOfHour', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55)
var result = fp.startOfHour(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 11))
})
- it('startOfHourWithOptions', function () {
+ it('startOfHourWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55)
var result = fp.startOfHourWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 11))
})
- it('startOfISOWeek', function () {
+ it('startOfISOWeek', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfISOWeek(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
})
- it('startOfISOWeekWithOptions', function () {
+ it('startOfISOWeekWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfISOWeekWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
})
- it('startOfISOWeekYear', function () {
+ it('startOfISOWeekYear', function() {
var result = fp.startOfISOWeekYear(new Date(2009, 0 /* Jan */, 1, 16, 0))
assert.deepEqual(result, new Date(2008, 11 /* Dec */, 29, 0, 0, 0, 0))
})
- it('startOfISOWeekYearWithOptions', function () {
- var result = fp.startOfISOWeekYearWithOptions({})(new Date(2009, 0 /* Jan */, 1, 16, 0))
+ it('startOfISOWeekYearWithOptions', function() {
+ var result = fp.startOfISOWeekYearWithOptions({})(
+ new Date(2009, 0 /* Jan */, 1, 16, 0)
+ )
assert.deepEqual(result, new Date(2008, 11 /* Dec */, 29, 0, 0, 0, 0))
})
- it('startOfMinute', function () {
+ it('startOfMinute', function() {
var date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
var result = fp.startOfMinute(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15))
})
- it('startOfMinuteWithOptions', function () {
+ it('startOfMinuteWithOptions', function() {
var date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
var result = fp.startOfMinuteWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15))
})
- it('startOfMonth', function () {
+ it('startOfMonth', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfMonth(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
})
- it('startOfMonthWithOptions', function () {
+ it('startOfMonthWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfMonthWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
})
- it('startOfQuarter', function () {
+ it('startOfQuarter', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfQuarter(date)
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 1))
})
- it('startOfQuarterWithOptions', function () {
+ it('startOfQuarterWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfQuarterWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 1))
})
- it('startOfSecond', function () {
+ it('startOfSecond', function() {
var date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
var result = fp.startOfSecond(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15, 45))
})
- it('startOfSecondWithOptions', function () {
+ it('startOfSecondWithOptions', function() {
var date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
var result = fp.startOfSecondWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15, 45))
})
- it('startOfWeek', function () {
+ it('startOfWeek', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfWeek(date)
assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
})
- it('startOfWeekWithOptions', function () {
+ it('startOfWeekWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
- var result = fp.startOfWeekWithOptions({weekStartsOn: 1})(date)
+ var result = fp.startOfWeekWithOptions({ weekStartsOn: 1 })(date)
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
})
- it('startOfWeekYear', function () {
+ it('startOfWeekYear', function() {
var result = fp.startOfWeekYear(new Date(2005, 6 /* Jul */, 2))
assert.deepEqual(result, new Date(2004, 11 /* Dec */, 26, 0, 0, 0, 0))
})
- it('startOfWeekYearWithOptions', function () {
- var result = fp.startOfWeekYearWithOptions(
- {weekStartsOn: 1, firstWeekContainsDate: 4}
- )(
- new Date(2005, 6 /* Jul */, 2)
- )
+ it('startOfWeekYearWithOptions', function() {
+ var result = fp.startOfWeekYearWithOptions({
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4
+ })(new Date(2005, 6 /* Jul */, 2))
assert.deepEqual(result, new Date(2005, 0 /* Jan */, 3, 0, 0, 0, 0))
})
- it('startOfYear', function () {
+ it('startOfYear', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfYear(date)
assert.deepEqual(result, new Date(2014, 0 /* Jan */, 1, 0, 0, 0, 0))
})
- it('startOfYearWithOptions', function () {
+ it('startOfYearWithOptions', function() {
var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
var result = fp.startOfYearWithOptions({})(date)
assert.deepEqual(result, new Date(2014, 0 /* Jan */, 1, 0, 0, 0, 0))
})
- it('subDays', function () {
+ it('subDays', function() {
var result = fp.subDays(10)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 7 /* Aug */, 22))
})
- it('subDaysWithOptions', function () {
+ it('subDaysWithOptions', function() {
var result = fp.subDaysWithOptions({})(10)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 7 /* Aug */, 22))
})
- it('subHours', function () {
+ it('subHours', function() {
var result = fp.subHours(2)(new Date(2014, 6 /* Jul */, 11, 1, 0))
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 23, 0))
})
- it('subHoursWithOptions', function () {
- var result = fp.subHoursWithOptions({})(2)(new Date(2014, 6 /* Jul */, 11, 1, 0))
+ it('subHoursWithOptions', function() {
+ var result = fp.subHoursWithOptions({})(2)(
+ new Date(2014, 6 /* Jul */, 11, 1, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 23, 0))
})
- it('subISOWeekYears', function () {
+ it('subISOWeekYears', function() {
var result = fp.subISOWeekYears(5)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2009, 7 /* Aug */, 31))
})
- it('subISOWeekYearsWithOptions', function () {
- var result = fp.subISOWeekYearsWithOptions({})(5)(new Date(2014, 8 /* Sep */, 1))
+ it('subISOWeekYearsWithOptions', function() {
+ var result = fp.subISOWeekYearsWithOptions({})(5)(
+ new Date(2014, 8 /* Sep */, 1)
+ )
assert.deepEqual(result, new Date(2009, 7 /* Aug */, 31))
})
- it('subMilliseconds', function () {
- var result = fp.subMilliseconds(750)(new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0))
+ it('subMilliseconds', function() {
+ var result = fp.subMilliseconds(750)(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 29, 250))
})
- it('subMillisecondsWithOptions', function () {
- var result = fp.subMillisecondsWithOptions({})(750)(new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0))
+ it('subMillisecondsWithOptions', function() {
+ var result = fp.subMillisecondsWithOptions({})(750)(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 29, 250))
})
- it('subMinutes', function () {
+ it('subMinutes', function() {
var result = fp.subMinutes(30)(new Date(2014, 6 /* Jul */, 10, 12, 0))
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 11, 30))
})
- it('subMinutesWithOptions', function () {
- var result = fp.subMinutesWithOptions(30)(new Date(2014, 6 /* Jul */, 10, 12, 0))
+ it('subMinutesWithOptions', function() {
+ var result = fp.subMinutesWithOptions(30)(
+ new Date(2014, 6 /* Jul */, 10, 12, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 11, 30))
})
- it('subMonths', function () {
+ it('subMonths', function() {
var result = fp.subMonths(5)(new Date(2015, 1 /* Feb */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
})
- it('subMonthsWithOptions', function () {
+ it('subMonthsWithOptions', function() {
var result = fp.subMonthsWithOptions({})(5)(new Date(2015, 1 /* Feb */, 1))
assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
})
- it('subQuarters', function () {
+ it('subQuarters', function() {
var result = fp.subQuarters(3)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2013, 11 /* Dec */, 1))
})
- it('subQuartersWithOptions', function () {
- var result = fp.subQuartersWithOptions({})(3)(new Date(2014, 8 /* Sep */, 1))
+ it('subQuartersWithOptions', function() {
+ var result = fp.subQuartersWithOptions({})(3)(
+ new Date(2014, 8 /* Sep */, 1)
+ )
assert.deepEqual(result, new Date(2013, 11 /* Dec */, 1))
})
- it('subSeconds', function () {
+ it('subSeconds', function() {
var result = fp.subSeconds(30)(new Date(2014, 6 /* Jul */, 10, 12, 45, 0))
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 44, 30))
})
- it('subSecondsWithOptions', function () {
- var result = fp.subSecondsWithOptions({})(30)(new Date(2014, 6 /* Jul */, 10, 12, 45, 0))
+ it('subSecondsWithOptions', function() {
+ var result = fp.subSecondsWithOptions({})(30)(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 0)
+ )
assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 44, 30))
})
- it('subWeeks', function () {
+ it('subWeeks', function() {
var result = fp.subWeeks(4)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 7 /* Aug */, 4))
})
- it('subWeeksWithOptions', function () {
+ it('subWeeksWithOptions', function() {
var result = fp.subWeeksWithOptions({})(4)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2014, 7 /* Aug */, 4))
})
- it('subYears', function () {
+ it('subYears', function() {
var result = fp.subYears(5)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2009, 8 /* Sep */, 1))
})
- it('subYearsWithOptions', function () {
+ it('subYearsWithOptions', function() {
var result = fp.subYearsWithOptions({})(5)(new Date(2014, 8 /* Sep */, 1))
assert.deepEqual(result, new Date(2009, 8 /* Sep */, 1))
})
- it('toDate', function () {
+ it('toDate', function() {
var result = fp.toDate('2014-10-25T13:46:20+07:00')
assert.deepEqual(result, new Date('2014-10-25T13:46:20+07:00'))
})
- it('toDateWithOptions', function () {
- var result = fp.toDateWithOptions({additionalDigits: 0})('+12340702')
+ it('toDateWithOptions', function() {
+ var result = fp.toDateWithOptions({ additionalDigits: 0 })('+12340702')
assert.deepEqual(result, new Date(1234, 6 /* Jul */, 2))
})
})
diff --git a/src/fromUnixTime/index.d.ts b/src/fromUnixTime/index.d.ts
new file mode 100644
index 0000000000..05aa56347a
--- /dev/null
+++ b/src/fromUnixTime/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import {fromUnixTime} from 'date-fns'
+export = fromUnixTime
diff --git a/src/fromUnixTime/index.js b/src/fromUnixTime/index.js
new file mode 100644
index 0000000000..add1ce5abc
--- /dev/null
+++ b/src/fromUnixTime/index.js
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index.js'
+import toInteger from '../_lib/toInteger/index.js'
+
+/**
+ * @name fromUnixTime
+ * @category Timestamp Helpers
+ * @summary Create a date from a UNIX timestamp.
+ *
+ * @description
+ * Create a date from a UNIX timestamp.
+ *
+ * @param {Number} unixTime - the given UNIX timestamp
+ * @param {Options} [options] - the object with options. See [Options]{@link https://date-fns.org/docs/Options}
+ * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
+ * @returns {Date} the date
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
+ *
+ * @example
+ * // Create the date 29 February 2012 11:45:05:
+ * var result = fromUnixTime(1330515905)
+ * //=> 1330515905
+ */
+export default function fromUnixTime(dirtyUnixTime, dirtyOptions) {
+ if (arguments.length < 1) {
+ throw new TypeError(
+ '1 argument required, but only ' + arguments.length + ' present'
+ )
+ }
+
+ var unixTime = toInteger(dirtyUnixTime)
+
+ return toDate(unixTime * 1000, dirtyOptions)
+}
diff --git a/src/fromUnixTime/index.js.flow b/src/fromUnixTime/index.js.flow
new file mode 100644
index 0000000000..62c5e8682a
--- /dev/null
+++ b/src/fromUnixTime/index.js.flow
@@ -0,0 +1,53 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+type Interval = {
+ start: Date | string | number,
+ end: Date | string | number
+}
+
+type Options = {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ additionalDigits?: 0 | 1 | 2,
+ locale?: Locale,
+ includeSeconds?: boolean,
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ awareOfUnicodeTokens?: boolean
+}
+
+type Locale = {
+ formatDistance: Function,
+ formatRelative: Function,
+ localize: {
+ ordinalNumber: Function,
+ era: Function,
+ quarter: Function,
+ month: Function,
+ day: Function,
+ dayPeriod: Function
+ },
+ formatLong: Object,
+ date: Function,
+ time: Function,
+ dateTime: Function,
+ match: {
+ ordinalNumber: Function,
+ era: Function,
+ quarter: Function,
+ month: Function,
+ day: Function,
+ dayPeriod: Function
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
+ }
+}
+
+declare module.exports: (
+ unixTime: number,
+ options?: Options
+) => Date
diff --git a/src/fromUnixTime/test.js b/src/fromUnixTime/test.js
new file mode 100644
index 0000000000..70211cbfe5
--- /dev/null
+++ b/src/fromUnixTime/test.js
@@ -0,0 +1,28 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import fromUnixTime from '.'
+
+describe('fromUnixTime', function() {
+ it('returns the date derived from the given UNIX timestamp', function() {
+ var result = fromUnixTime(1330515499)
+ assert(result.getTime() === 1330515499000)
+ })
+
+ it('returns invalid if the given timestamp is invalid', function() {
+ var result = fromUnixTime(NaN)
+ assert(isNaN(result.getTime()))
+ })
+
+ it('throws `RangeError` if `options.additionalDigits` is not convertable to 0, 1, 2 or undefined', function() {
+ var timestamp = 1330515499
+ // $ExpectedMistake
+ var block = fromUnixTime.bind(null, timestamp, { additionalDigits: NaN })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(fromUnixTime.bind(null), TypeError)
+ })
+})
diff --git a/src/index.js b/src/index.js
index d0694efe4a..fc0ac58719 100644
--- a/src/index.js
+++ b/src/index.js
@@ -50,6 +50,7 @@ module.exports = {
formatDistance: require('./formatDistance/index.js'),
formatDistanceStrict: require('./formatDistanceStrict/index.js'),
formatRelative: require('./formatRelative/index.js'),
+ fromUnixTime: require('./fromUnixTime/index.js'),
getDate: require('./getDate/index.js'),
getDay: require('./getDay/index.js'),
getDayOfYear: require('./getDayOfYear/index.js'),
diff --git a/src/index.js.flow b/src/index.js.flow
index 95606b07f5..544d137f8d 100644
--- a/src/index.js.flow
+++ b/src/index.js.flow
@@ -329,6 +329,11 @@ declare module.exports: {
options?: Options
) => string,
+ fromUnixTime: (
+ unixTime: number,
+ options?: Options
+ ) => Date,
+
getDate: (
date: Date | string | number,
options?: Options
diff --git a/typings.d.ts b/typings.d.ts
index a1cce1a21a..1e90f2a99e 100644
--- a/typings.d.ts
+++ b/typings.d.ts
@@ -418,6 +418,12 @@ declare module 'date-fns' {
): string
namespace formatRelative {}
+ function fromUnixTime (
+ unixTime: number,
+ options?: Options
+ ): Date
+ namespace fromUnixTime {}
+
function getDate (
date: Date | string | number,
options?: Options
@@ -1307,6 +1313,11 @@ declare module 'date-fns/formatRelative' {
export = formatRelative
}
+declare module 'date-fns/fromUnixTime' {
+ import {fromUnixTime} from 'date-fns'
+ export = fromUnixTime
+}
+
declare module 'date-fns/getDate' {
import {getDate} from 'date-fns'
export = getDate
@@ -2052,6 +2063,11 @@ declare module 'date-fns/formatRelative/index' {
export = formatRelative
}
+declare module 'date-fns/fromUnixTime/index' {
+ import {fromUnixTime} from 'date-fns'
+ export = fromUnixTime
+}
+
declare module 'date-fns/getDate/index' {
import {getDate} from 'date-fns'
export = getDate
@@ -2797,6 +2813,11 @@ declare module 'date-fns/formatRelative/index.js' {
export = formatRelative
}
+declare module 'date-fns/fromUnixTime/index.js' {
+ import {fromUnixTime} from 'date-fns'
+ export = fromUnixTime
+}
+
declare module 'date-fns/getDate/index.js' {
import {getDate} from 'date-fns'
export = getDate
@@ -3594,6 +3615,12 @@ declare module 'date-fns/fp' {
const formatWithOptions: CurriedFn3
namespace formatWithOptions {}
+ const fromUnixTime: CurriedFn1
+ namespace fromUnixTime {}
+
+ const fromUnixTimeWithOptions: CurriedFn2
+ namespace fromUnixTimeWithOptions {}
+
const getDate: CurriedFn1
namespace getDate {}
@@ -4685,6 +4712,16 @@ declare module 'date-fns/fp/formatWithOptions' {
export = formatWithOptions
}
+declare module 'date-fns/fp/fromUnixTime' {
+ import {fromUnixTime} from 'date-fns/fp'
+ export = fromUnixTime
+}
+
+declare module 'date-fns/fp/fromUnixTimeWithOptions' {
+ import {fromUnixTimeWithOptions} from 'date-fns/fp'
+ export = fromUnixTimeWithOptions
+}
+
declare module 'date-fns/fp/getDate' {
import {getDate} from 'date-fns/fp'
export = getDate
@@ -6175,6 +6212,16 @@ declare module 'date-fns/fp/formatWithOptions/index' {
export = formatWithOptions
}
+declare module 'date-fns/fp/fromUnixTime/index' {
+ import {fromUnixTime} from 'date-fns/fp'
+ export = fromUnixTime
+}
+
+declare module 'date-fns/fp/fromUnixTimeWithOptions/index' {
+ import {fromUnixTimeWithOptions} from 'date-fns/fp'
+ export = fromUnixTimeWithOptions
+}
+
declare module 'date-fns/fp/getDate/index' {
import {getDate} from 'date-fns/fp'
export = getDate
@@ -7665,6 +7712,16 @@ declare module 'date-fns/fp/formatWithOptions/index.js' {
export = formatWithOptions
}
+declare module 'date-fns/fp/fromUnixTime/index.js' {
+ import {fromUnixTime} from 'date-fns/fp'
+ export = fromUnixTime
+}
+
+declare module 'date-fns/fp/fromUnixTimeWithOptions/index.js' {
+ import {fromUnixTimeWithOptions} from 'date-fns/fp'
+ export = fromUnixTimeWithOptions
+}
+
declare module 'date-fns/fp/getDate/index.js' {
import {getDate} from 'date-fns/fp'
export = getDate
@@ -8998,6 +9055,12 @@ declare module 'date-fns/esm' {
): string
namespace formatRelative {}
+ function fromUnixTime (
+ unixTime: number,
+ options?: Options
+ ): Date
+ namespace fromUnixTime {}
+
function getDate (
date: Date | string | number,
options?: Options
@@ -9887,6 +9950,11 @@ declare module 'date-fns/esm/formatRelative' {
export default formatRelative
}
+declare module 'date-fns/esm/fromUnixTime' {
+ import {fromUnixTime} from 'date-fns/esm'
+ export default fromUnixTime
+}
+
declare module 'date-fns/esm/getDate' {
import {getDate} from 'date-fns/esm'
export default getDate
@@ -10632,6 +10700,11 @@ declare module 'date-fns/esm/formatRelative/index' {
export default formatRelative
}
+declare module 'date-fns/esm/fromUnixTime/index' {
+ import {fromUnixTime} from 'date-fns/esm'
+ export default fromUnixTime
+}
+
declare module 'date-fns/esm/getDate/index' {
import {getDate} from 'date-fns/esm'
export default getDate
@@ -11377,6 +11450,11 @@ declare module 'date-fns/esm/formatRelative/index.js' {
export default formatRelative
}
+declare module 'date-fns/esm/fromUnixTime/index.js' {
+ import {fromUnixTime} from 'date-fns/esm'
+ export default fromUnixTime
+}
+
declare module 'date-fns/esm/getDate/index.js' {
import {getDate} from 'date-fns/esm'
export default getDate
@@ -12174,6 +12252,12 @@ declare module 'date-fns/esm/fp' {
const formatWithOptions: CurriedFn3
namespace formatWithOptions {}
+ const fromUnixTime: CurriedFn1
+ namespace fromUnixTime {}
+
+ const fromUnixTimeWithOptions: CurriedFn2
+ namespace fromUnixTimeWithOptions {}
+
const getDate: CurriedFn1
namespace getDate {}
@@ -13265,6 +13349,16 @@ declare module 'date-fns/esm/fp/formatWithOptions' {
export default formatWithOptions
}
+declare module 'date-fns/esm/fp/fromUnixTime' {
+ import {fromUnixTime} from 'date-fns/esm/fp'
+ export default fromUnixTime
+}
+
+declare module 'date-fns/esm/fp/fromUnixTimeWithOptions' {
+ import {fromUnixTimeWithOptions} from 'date-fns/esm/fp'
+ export default fromUnixTimeWithOptions
+}
+
declare module 'date-fns/esm/fp/getDate' {
import {getDate} from 'date-fns/esm/fp'
export default getDate
@@ -14755,6 +14849,16 @@ declare module 'date-fns/esm/fp/formatWithOptions/index' {
export default formatWithOptions
}
+declare module 'date-fns/esm/fp/fromUnixTime/index' {
+ import {fromUnixTime} from 'date-fns/esm/fp'
+ export default fromUnixTime
+}
+
+declare module 'date-fns/esm/fp/fromUnixTimeWithOptions/index' {
+ import {fromUnixTimeWithOptions} from 'date-fns/esm/fp'
+ export default fromUnixTimeWithOptions
+}
+
declare module 'date-fns/esm/fp/getDate/index' {
import {getDate} from 'date-fns/esm/fp'
export default getDate
@@ -16245,6 +16349,16 @@ declare module 'date-fns/esm/fp/formatWithOptions/index.js' {
export default formatWithOptions
}
+declare module 'date-fns/esm/fp/fromUnixTime/index.js' {
+ import {fromUnixTime} from 'date-fns/esm/fp'
+ export default fromUnixTime
+}
+
+declare module 'date-fns/esm/fp/fromUnixTimeWithOptions/index.js' {
+ import {fromUnixTimeWithOptions} from 'date-fns/esm/fp'
+ export default fromUnixTimeWithOptions
+}
+
declare module 'date-fns/esm/fp/getDate/index.js' {
import {getDate} from 'date-fns/esm/fp'
export default getDate
@@ -19373,6 +19487,11 @@ interface dateFns {
options?: Options
): string
+ fromUnixTime(
+ unixTime: number,
+ options?: Options
+ ): Date
+
getDate(
date: Date | string | number,
options?: Options