summaryrefslogtreecommitdiff
path: root/date-fns/src
diff options
context:
space:
mode:
Diffstat (limited to 'date-fns/src')
-rw-r--r--date-fns/src/_lib/addLeadingZeros/index.js8
-rw-r--r--date-fns/src/_lib/assign/index.js17
-rw-r--r--date-fns/src/_lib/assign/test.js30
-rw-r--r--date-fns/src/_lib/cloneObject/index.js5
-rw-r--r--date-fns/src/_lib/cloneObject/test.js31
-rw-r--r--date-fns/src/_lib/format/formatters/index.js768
-rw-r--r--date-fns/src/_lib/format/lightFormatters/index.ts94
-rw-r--r--date-fns/src/_lib/format/longFormatters/index.js66
-rw-r--r--date-fns/src/_lib/getTimezoneOffsetInMilliseconds/index.js26
-rw-r--r--date-fns/src/_lib/getTimezoneOffsetInMilliseconds/test.js28
-rw-r--r--date-fns/src/_lib/getUTCDayOfYear/index.js18
-rw-r--r--date-fns/src/_lib/getUTCDayOfYear/test.js36
-rw-r--r--date-fns/src/_lib/getUTCISOWeek/index.js21
-rw-r--r--date-fns/src/_lib/getUTCISOWeek/test.js58
-rw-r--r--date-fns/src/_lib/getUTCISOWeekYear/index.js30
-rw-r--r--date-fns/src/_lib/getUTCISOWeekYear/test.js36
-rw-r--r--date-fns/src/_lib/getUTCWeek/index.js22
-rw-r--r--date-fns/src/_lib/getUTCWeek/test.js70
-rw-r--r--date-fns/src/_lib/getUTCWeekYear/index.js51
-rw-r--r--date-fns/src/_lib/getUTCWeekYear/test.js70
-rw-r--r--date-fns/src/_lib/isSameUTCWeek/index.js13
-rw-r--r--date-fns/src/_lib/isSameUTCWeek/test.js111
-rw-r--r--date-fns/src/_lib/protectedTokens/index.js30
-rw-r--r--date-fns/src/_lib/requiredArgs/index.ts12
-rw-r--r--date-fns/src/_lib/requiredArgs/test.js37
-rw-r--r--date-fns/src/_lib/setUTCDay/index.js38
-rw-r--r--date-fns/src/_lib/setUTCDay/test.js132
-rw-r--r--date-fns/src/_lib/setUTCISODay/index.js27
-rw-r--r--date-fns/src/_lib/setUTCISODay/test.js79
-rw-r--r--date-fns/src/_lib/setUTCISOWeek/index.js16
-rw-r--r--date-fns/src/_lib/setUTCISOWeek/test.js61
-rw-r--r--date-fns/src/_lib/setUTCWeek/index.js16
-rw-r--r--date-fns/src/_lib/setUTCWeek/test.js95
-rw-r--r--date-fns/src/_lib/startOfUTCISOWeek/index.js18
-rw-r--r--date-fns/src/_lib/startOfUTCISOWeek/test.js34
-rw-r--r--date-fns/src/_lib/startOfUTCISOWeekYear/index.js16
-rw-r--r--date-fns/src/_lib/startOfUTCISOWeekYear/test.js58
-rw-r--r--date-fns/src/_lib/startOfUTCWeek/index.js33
-rw-r--r--date-fns/src/_lib/startOfUTCWeek/test.js108
-rw-r--r--date-fns/src/_lib/startOfUTCWeekYear/index.js30
-rw-r--r--date-fns/src/_lib/startOfUTCWeekYear/test.js95
-rw-r--r--date-fns/src/_lib/test/index.ts1
-rw-r--r--date-fns/src/_lib/toInteger/index.ts13
-rw-r--r--date-fns/src/_lib/toInteger/test.js64
-rw-r--r--date-fns/src/add/benchmark.js25
-rw-r--r--date-fns/src/add/index.d.ts4
-rw-r--r--date-fns/src/add/index.js.flow52
-rw-r--r--date-fns/src/add/index.ts79
-rw-r--r--date-fns/src/add/test.ts99
-rw-r--r--date-fns/src/addBusinessDays/index.d.ts4
-rw-r--r--date-fns/src/addBusinessDays/index.js.flow52
-rw-r--r--date-fns/src/addBusinessDays/index.ts67
-rw-r--r--date-fns/src/addBusinessDays/test.ts95
-rw-r--r--date-fns/src/addDays/benchmark.js21
-rw-r--r--date-fns/src/addDays/index.d.ts4
-rw-r--r--date-fns/src/addDays/index.js.flow52
-rw-r--r--date-fns/src/addDays/index.ts44
-rw-r--r--date-fns/src/addDays/test.ts129
-rw-r--r--date-fns/src/addHours/benchmark.js21
-rw-r--r--date-fns/src/addHours/index.d.ts4
-rw-r--r--date-fns/src/addHours/index.js.flow52
-rw-r--r--date-fns/src/addHours/index.ts37
-rw-r--r--date-fns/src/addHours/test.ts54
-rw-r--r--date-fns/src/addISOWeekYears/benchmark.js15
-rw-r--r--date-fns/src/addISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/addISOWeekYears/index.js.flow52
-rw-r--r--date-fns/src/addISOWeekYears/index.ts43
-rw-r--r--date-fns/src/addISOWeekYears/test.ts64
-rw-r--r--date-fns/src/addMilliseconds/benchmark.js21
-rw-r--r--date-fns/src/addMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/addMilliseconds/index.js.flow52
-rw-r--r--date-fns/src/addMilliseconds/index.ts36
-rw-r--r--date-fns/src/addMilliseconds/test.ts80
-rw-r--r--date-fns/src/addMinutes/benchmark.js21
-rw-r--r--date-fns/src/addMinutes/index.d.ts4
-rw-r--r--date-fns/src/addMinutes/index.js.flow52
-rw-r--r--date-fns/src/addMinutes/index.ts37
-rw-r--r--date-fns/src/addMinutes/test.ts57
-rw-r--r--date-fns/src/addMonths/benchmark.js21
-rw-r--r--date-fns/src/addMonths/index.d.ts4
-rw-r--r--date-fns/src/addMonths/index.js.flow52
-rw-r--r--date-fns/src/addMonths/index.ts74
-rw-r--r--date-fns/src/addMonths/test.ts173
-rw-r--r--date-fns/src/addQuarters/benchmark.js21
-rw-r--r--date-fns/src/addQuarters/index.d.ts4
-rw-r--r--date-fns/src/addQuarters/index.js.flow52
-rw-r--r--date-fns/src/addQuarters/index.ts36
-rw-r--r--date-fns/src/addQuarters/test.ts70
-rw-r--r--date-fns/src/addSeconds/benchmark.js21
-rw-r--r--date-fns/src/addSeconds/index.d.ts4
-rw-r--r--date-fns/src/addSeconds/index.js.flow52
-rw-r--r--date-fns/src/addSeconds/index.ts35
-rw-r--r--date-fns/src/addSeconds/test.ts59
-rw-r--r--date-fns/src/addWeeks/benchmark.js21
-rw-r--r--date-fns/src/addWeeks/index.d.ts4
-rw-r--r--date-fns/src/addWeeks/index.js.flow52
-rw-r--r--date-fns/src/addWeeks/index.ts36
-rw-r--r--date-fns/src/addWeeks/test.ts53
-rw-r--r--date-fns/src/addYears/benchmark.js21
-rw-r--r--date-fns/src/addYears/index.d.ts4
-rw-r--r--date-fns/src/addYears/index.js.flow52
-rw-r--r--date-fns/src/addYears/index.ts35
-rw-r--r--date-fns/src/addYears/test.ts69
-rw-r--r--date-fns/src/areIntervalsOverlapping/index.d.ts4
-rw-r--r--date-fns/src/areIntervalsOverlapping/index.js.flow58
-rw-r--r--date-fns/src/areIntervalsOverlapping/index.ts117
-rw-r--r--date-fns/src/areIntervalsOverlapping/test.ts253
-rw-r--r--date-fns/src/closestIndexTo/benchmark.js19
-rw-r--r--date-fns/src/closestIndexTo/index.d.ts4
-rw-r--r--date-fns/src/closestIndexTo/index.js79
-rw-r--r--date-fns/src/closestIndexTo/index.js.flow55
-rw-r--r--date-fns/src/closestIndexTo/test.js102
-rw-r--r--date-fns/src/closestTo/benchmark.js19
-rw-r--r--date-fns/src/closestTo/index.d.ts4
-rw-r--r--date-fns/src/closestTo/index.js77
-rw-r--r--date-fns/src/closestTo/index.js.flow55
-rw-r--r--date-fns/src/closestTo/test.js112
-rw-r--r--date-fns/src/compareAsc/benchmark.js16
-rw-r--r--date-fns/src/compareAsc/index.d.ts4
-rw-r--r--date-fns/src/compareAsc/index.js.flow55
-rw-r--r--date-fns/src/compareAsc/index.ts59
-rw-r--r--date-fns/src/compareAsc/test.ts81
-rw-r--r--date-fns/src/compareDesc/benchmark.js16
-rw-r--r--date-fns/src/compareDesc/index.d.ts4
-rw-r--r--date-fns/src/compareDesc/index.js.flow55
-rw-r--r--date-fns/src/compareDesc/index.ts59
-rw-r--r--date-fns/src/compareDesc/test.ts80
-rw-r--r--date-fns/src/constants/index.d.ts2
-rw-r--r--date-fns/src/constants/index.js.flow4
-rw-r--r--date-fns/src/constants/index.ts119
-rw-r--r--date-fns/src/daysToWeeks/index.d.ts4
-rw-r--r--date-fns/src/daysToWeeks/index.js.flow52
-rw-r--r--date-fns/src/daysToWeeks/index.ts31
-rw-r--r--date-fns/src/daysToWeeks/test.ts21
-rw-r--r--date-fns/src/differenceInBusinessDays/index.d.ts4
-rw-r--r--date-fns/src/differenceInBusinessDays/index.js.flow55
-rw-r--r--date-fns/src/differenceInBusinessDays/index.ts62
-rw-r--r--date-fns/src/differenceInBusinessDays/test.ts141
-rw-r--r--date-fns/src/differenceInCalendarDays/benchmark.js16
-rw-r--r--date-fns/src/differenceInCalendarDays/index.d.ts4
-rw-r--r--date-fns/src/differenceInCalendarDays/index.js.flow55
-rw-r--r--date-fns/src/differenceInCalendarDays/index.ts59
-rw-r--r--date-fns/src/differenceInCalendarDays/test.ts215
-rw-r--r--date-fns/src/differenceInCalendarISOWeekYears/benchmark.js16
-rw-r--r--date-fns/src/differenceInCalendarISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/differenceInCalendarISOWeekYears/index.js.flow55
-rw-r--r--date-fns/src/differenceInCalendarISOWeekYears/index.ts43
-rw-r--r--date-fns/src/differenceInCalendarISOWeekYears/test.ts118
-rw-r--r--date-fns/src/differenceInCalendarISOWeeks/benchmark.js16
-rw-r--r--date-fns/src/differenceInCalendarISOWeeks/index.d.ts4
-rw-r--r--date-fns/src/differenceInCalendarISOWeeks/index.js.flow55
-rw-r--r--date-fns/src/differenceInCalendarISOWeeks/index.ts54
-rw-r--r--date-fns/src/differenceInCalendarISOWeeks/test.ts104
-rw-r--r--date-fns/src/differenceInCalendarMonths/benchmark.js16
-rw-r--r--date-fns/src/differenceInCalendarMonths/index.d.ts4
-rw-r--r--date-fns/src/differenceInCalendarMonths/index.js.flow55
-rw-r--r--date-fns/src/differenceInCalendarMonths/index.ts42
-rw-r--r--date-fns/src/differenceInCalendarMonths/test.ts104
-rw-r--r--date-fns/src/differenceInCalendarQuarters/benchmark.js16
-rw-r--r--date-fns/src/differenceInCalendarQuarters/index.d.ts4
-rw-r--r--date-fns/src/differenceInCalendarQuarters/index.js.flow55
-rw-r--r--date-fns/src/differenceInCalendarQuarters/index.ts43
-rw-r--r--date-fns/src/differenceInCalendarQuarters/test.ts104
-rw-r--r--date-fns/src/differenceInCalendarWeeks/benchmark.js16
-rw-r--r--date-fns/src/differenceInCalendarWeeks/index.d.ts4
-rw-r--r--date-fns/src/differenceInCalendarWeeks/index.js.flow59
-rw-r--r--date-fns/src/differenceInCalendarWeeks/index.ts67
-rw-r--r--date-fns/src/differenceInCalendarWeeks/test.ts164
-rw-r--r--date-fns/src/differenceInCalendarYears/benchmark.js16
-rw-r--r--date-fns/src/differenceInCalendarYears/index.d.ts4
-rw-r--r--date-fns/src/differenceInCalendarYears/index.js.flow55
-rw-r--r--date-fns/src/differenceInCalendarYears/index.ts39
-rw-r--r--date-fns/src/differenceInCalendarYears/test.ts105
-rw-r--r--date-fns/src/differenceInDays/benchmark.js23
-rw-r--r--date-fns/src/differenceInDays/index.d.ts4
-rw-r--r--date-fns/src/differenceInDays/index.js.flow55
-rw-r--r--date-fns/src/differenceInDays/index.ts104
-rw-r--r--date-fns/src/differenceInDays/test.ts214
-rw-r--r--date-fns/src/differenceInHours/benchmark.js23
-rw-r--r--date-fns/src/differenceInHours/index.d.ts4
-rw-r--r--date-fns/src/differenceInHours/index.js.flow55
-rw-r--r--date-fns/src/differenceInHours/index.ts38
-rw-r--r--date-fns/src/differenceInHours/test.ts107
-rw-r--r--date-fns/src/differenceInISOWeekYears/benchmark.js16
-rw-r--r--date-fns/src/differenceInISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/differenceInISOWeekYears/index.js.flow55
-rw-r--r--date-fns/src/differenceInISOWeekYears/index.ts63
-rw-r--r--date-fns/src/differenceInISOWeekYears/test.ts115
-rw-r--r--date-fns/src/differenceInMilliseconds/benchmark.js23
-rw-r--r--date-fns/src/differenceInMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/differenceInMilliseconds/index.js.flow55
-rw-r--r--date-fns/src/differenceInMilliseconds/index.ts39
-rw-r--r--date-fns/src/differenceInMilliseconds/test.ts70
-rw-r--r--date-fns/src/differenceInMinutes/benchmark.js23
-rw-r--r--date-fns/src/differenceInMinutes/index.d.ts4
-rw-r--r--date-fns/src/differenceInMinutes/index.js46
-rw-r--r--date-fns/src/differenceInMinutes/index.js.flow55
-rw-r--r--date-fns/src/differenceInMinutes/test.js105
-rw-r--r--date-fns/src/differenceInMonths/benchmark.js23
-rw-r--r--date-fns/src/differenceInMonths/index.d.ts4
-rw-r--r--date-fns/src/differenceInMonths/index.js.flow55
-rw-r--r--date-fns/src/differenceInMonths/index.ts72
-rw-r--r--date-fns/src/differenceInMonths/test.ts188
-rw-r--r--date-fns/src/differenceInQuarters/benchmark.js23
-rw-r--r--date-fns/src/differenceInQuarters/index.d.ts4
-rw-r--r--date-fns/src/differenceInQuarters/index.js.flow55
-rw-r--r--date-fns/src/differenceInQuarters/index.ts34
-rw-r--r--date-fns/src/differenceInQuarters/test.ts104
-rw-r--r--date-fns/src/differenceInSeconds/benchmark.js23
-rw-r--r--date-fns/src/differenceInSeconds/index.d.ts4
-rw-r--r--date-fns/src/differenceInSeconds/index.js.flow55
-rw-r--r--date-fns/src/differenceInSeconds/index.ts38
-rw-r--r--date-fns/src/differenceInSeconds/test.ts104
-rw-r--r--date-fns/src/differenceInWeeks/benchmark.js23
-rw-r--r--date-fns/src/differenceInWeeks/index.d.ts4
-rw-r--r--date-fns/src/differenceInWeeks/index.js.flow55
-rw-r--r--date-fns/src/differenceInWeeks/index.ts55
-rw-r--r--date-fns/src/differenceInWeeks/test.ts104
-rw-r--r--date-fns/src/differenceInYears/benchmark.js23
-rw-r--r--date-fns/src/differenceInYears/index.d.ts4
-rw-r--r--date-fns/src/differenceInYears/index.js.flow55
-rw-r--r--date-fns/src/differenceInYears/index.ts51
-rw-r--r--date-fns/src/differenceInYears/test.ts146
-rw-r--r--date-fns/src/eachDayOfInterval/benchmark.js16
-rw-r--r--date-fns/src/eachDayOfInterval/index.d.ts4
-rw-r--r--date-fns/src/eachDayOfInterval/index.js.flow57
-rw-r--r--date-fns/src/eachDayOfInterval/index.ts98
-rw-r--r--date-fns/src/eachDayOfInterval/test.ts137
-rw-r--r--date-fns/src/eachHourOfInterval/benchmark.js20
-rw-r--r--date-fns/src/eachHourOfInterval/index.d.ts4
-rw-r--r--date-fns/src/eachHourOfInterval/index.js.flow57
-rw-r--r--date-fns/src/eachHourOfInterval/index.ts69
-rw-r--r--date-fns/src/eachHourOfInterval/test.ts134
-rw-r--r--date-fns/src/eachMinuteOfInterval/benchmark.js20
-rw-r--r--date-fns/src/eachMinuteOfInterval/index.d.ts4
-rw-r--r--date-fns/src/eachMinuteOfInterval/index.js.flow57
-rw-r--r--date-fns/src/eachMinuteOfInterval/index.ts70
-rw-r--r--date-fns/src/eachMinuteOfInterval/test.ts99
-rw-r--r--date-fns/src/eachMonthOfInterval/index.d.ts4
-rw-r--r--date-fns/src/eachMonthOfInterval/index.js.flow52
-rw-r--r--date-fns/src/eachMonthOfInterval/index.ts59
-rw-r--r--date-fns/src/eachMonthOfInterval/test.ts120
-rw-r--r--date-fns/src/eachQuarterOfInterval/index.d.ts4
-rw-r--r--date-fns/src/eachQuarterOfInterval/index.js.flow52
-rw-r--r--date-fns/src/eachQuarterOfInterval/index.ts61
-rw-r--r--date-fns/src/eachQuarterOfInterval/test.ts108
-rw-r--r--date-fns/src/eachWeekOfInterval/benchmark.js16
-rw-r--r--date-fns/src/eachWeekOfInterval/index.d.ts4
-rw-r--r--date-fns/src/eachWeekOfInterval/index.js.flow58
-rw-r--r--date-fns/src/eachWeekOfInterval/index.ts84
-rw-r--r--date-fns/src/eachWeekOfInterval/test.ts145
-rwxr-xr-xdate-fns/src/eachWeekendOfInterval/benchmark.js16
-rw-r--r--date-fns/src/eachWeekendOfInterval/index.d.ts4
-rwxr-xr-xdate-fns/src/eachWeekendOfInterval/index.js.flow52
-rw-r--r--date-fns/src/eachWeekendOfInterval/index.ts47
-rw-r--r--date-fns/src/eachWeekendOfInterval/test.ts67
-rw-r--r--date-fns/src/eachWeekendOfMonth/benchmark.js15
-rw-r--r--date-fns/src/eachWeekendOfMonth/index.d.ts4
-rw-r--r--date-fns/src/eachWeekendOfMonth/index.js.flow52
-rw-r--r--date-fns/src/eachWeekendOfMonth/index.ts42
-rw-r--r--date-fns/src/eachWeekendOfMonth/test.ts31
-rw-r--r--date-fns/src/eachWeekendOfYear/benchmark.js14
-rw-r--r--date-fns/src/eachWeekendOfYear/index.d.ts4
-rw-r--r--date-fns/src/eachWeekendOfYear/index.js38
-rw-r--r--date-fns/src/eachWeekendOfYear/index.js.flow52
-rw-r--r--date-fns/src/eachWeekendOfYear/test.js24
-rw-r--r--date-fns/src/eachYearOfInterval/index.d.ts4
-rw-r--r--date-fns/src/eachYearOfInterval/index.js57
-rw-r--r--date-fns/src/eachYearOfInterval/index.js.flow52
-rw-r--r--date-fns/src/eachYearOfInterval/test.js105
-rw-r--r--date-fns/src/endOfDay/benchmark.js21
-rw-r--r--date-fns/src/endOfDay/index.d.ts4
-rw-r--r--date-fns/src/endOfDay/index.js.flow52
-rw-r--r--date-fns/src/endOfDay/index.ts32
-rw-r--r--date-fns/src/endOfDay/test.ts35
-rw-r--r--date-fns/src/endOfDecade/benchmark.js15
-rw-r--r--date-fns/src/endOfDecade/index.d.ts4
-rw-r--r--date-fns/src/endOfDecade/index.js.flow57
-rw-r--r--date-fns/src/endOfDecade/index.ts37
-rw-r--r--date-fns/src/endOfDecade/test.ts35
-rw-r--r--date-fns/src/endOfHour/benchmark.js21
-rw-r--r--date-fns/src/endOfHour/index.d.ts4
-rw-r--r--date-fns/src/endOfHour/index.js.flow52
-rw-r--r--date-fns/src/endOfHour/index.ts32
-rw-r--r--date-fns/src/endOfHour/test.ts34
-rw-r--r--date-fns/src/endOfISOWeek/benchmark.js21
-rw-r--r--date-fns/src/endOfISOWeek/index.d.ts4
-rw-r--r--date-fns/src/endOfISOWeek/index.js.flow52
-rw-r--r--date-fns/src/endOfISOWeek/index.ts32
-rw-r--r--date-fns/src/endOfISOWeek/test.ts35
-rw-r--r--date-fns/src/endOfISOWeekYear/benchmark.js15
-rw-r--r--date-fns/src/endOfISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/endOfISOWeekYear/index.js.flow52
-rw-r--r--date-fns/src/endOfISOWeekYear/index.ts45
-rw-r--r--date-fns/src/endOfISOWeekYear/test.ts46
-rw-r--r--date-fns/src/endOfMinute/benchmark.js21
-rw-r--r--date-fns/src/endOfMinute/index.d.ts4
-rw-r--r--date-fns/src/endOfMinute/index.js.flow52
-rw-r--r--date-fns/src/endOfMinute/index.ts32
-rw-r--r--date-fns/src/endOfMinute/test.ts34
-rw-r--r--date-fns/src/endOfMonth/benchmark.js21
-rw-r--r--date-fns/src/endOfMonth/index.d.ts4
-rw-r--r--date-fns/src/endOfMonth/index.js.flow52
-rw-r--r--date-fns/src/endOfMonth/index.ts34
-rw-r--r--date-fns/src/endOfMonth/test.ts52
-rw-r--r--date-fns/src/endOfQuarter/benchmark.js21
-rw-r--r--date-fns/src/endOfQuarter/index.d.ts4
-rw-r--r--date-fns/src/endOfQuarter/index.js.flow52
-rw-r--r--date-fns/src/endOfQuarter/index.ts35
-rw-r--r--date-fns/src/endOfQuarter/test.ts35
-rw-r--r--date-fns/src/endOfSecond/benchmark.js21
-rw-r--r--date-fns/src/endOfSecond/index.d.ts4
-rw-r--r--date-fns/src/endOfSecond/index.js.flow52
-rw-r--r--date-fns/src/endOfSecond/index.ts32
-rw-r--r--date-fns/src/endOfSecond/test.ts34
-rw-r--r--date-fns/src/endOfToday/benchmark.js9
-rw-r--r--date-fns/src/endOfToday/index.d.ts4
-rw-r--r--date-fns/src/endOfToday/index.js.flow52
-rw-r--r--date-fns/src/endOfToday/index.ts28
-rw-r--r--date-fns/src/endOfToday/test.ts24
-rw-r--r--date-fns/src/endOfTomorrow/benchmark.js9
-rw-r--r--date-fns/src/endOfTomorrow/index.d.ts4
-rw-r--r--date-fns/src/endOfTomorrow/index.js.flow52
-rw-r--r--date-fns/src/endOfTomorrow/index.ts34
-rw-r--r--date-fns/src/endOfTomorrow/test.ts34
-rw-r--r--date-fns/src/endOfWeek/benchmark.js21
-rw-r--r--date-fns/src/endOfWeek/index.d.ts4
-rw-r--r--date-fns/src/endOfWeek/index.js.flow58
-rw-r--r--date-fns/src/endOfWeek/index.ts67
-rw-r--r--date-fns/src/endOfWeek/test.ts144
-rw-r--r--date-fns/src/endOfYear/benchmark.js21
-rw-r--r--date-fns/src/endOfYear/index.d.ts4
-rw-r--r--date-fns/src/endOfYear/index.js.flow52
-rw-r--r--date-fns/src/endOfYear/index.ts34
-rw-r--r--date-fns/src/endOfYear/test.ts35
-rw-r--r--date-fns/src/endOfYesterday/benchmark.js9
-rw-r--r--date-fns/src/endOfYesterday/index.d.ts4
-rw-r--r--date-fns/src/endOfYesterday/index.js.flow52
-rw-r--r--date-fns/src/endOfYesterday/index.ts34
-rw-r--r--date-fns/src/endOfYesterday/test.ts34
-rw-r--r--date-fns/src/format/benchmark.js21
-rw-r--r--date-fns/src/format/index.d.ts4
-rw-r--r--date-fns/src/format/index.js471
-rw-r--r--date-fns/src/format/index.js.flow62
-rw-r--r--date-fns/src/format/test.js813
-rw-r--r--date-fns/src/formatDistance/benchmark.js23
-rw-r--r--date-fns/src/formatDistance/index.d.ts4
-rw-r--r--date-fns/src/formatDistance/index.js.flow60
-rw-r--r--date-fns/src/formatDistance/index.ts240
-rw-r--r--date-fns/src/formatDistance/test.ts299
-rw-r--r--date-fns/src/formatDistanceStrict/benchmark.js23
-rw-r--r--date-fns/src/formatDistanceStrict/index.d.ts4
-rw-r--r--date-fns/src/formatDistanceStrict/index.js.flow61
-rw-r--r--date-fns/src/formatDistanceStrict/index.ts283
-rw-r--r--date-fns/src/formatDistanceStrict/test.ts524
-rw-r--r--date-fns/src/formatDistanceToNow/benchmark.js25
-rw-r--r--date-fns/src/formatDistanceToNow/index.d.ts4
-rw-r--r--date-fns/src/formatDistanceToNow/index.js113
-rw-r--r--date-fns/src/formatDistanceToNow/index.js.flow59
-rw-r--r--date-fns/src/formatDistanceToNow/test.js232
-rw-r--r--date-fns/src/formatDistanceToNowStrict/benchmark.js25
-rw-r--r--date-fns/src/formatDistanceToNowStrict/index.d.ts4
-rw-r--r--date-fns/src/formatDistanceToNowStrict/index.js82
-rw-r--r--date-fns/src/formatDistanceToNowStrict/index.js.flow60
-rw-r--r--date-fns/src/formatDistanceToNowStrict/test.js422
-rw-r--r--date-fns/src/formatDuration/index.d.ts4
-rw-r--r--date-fns/src/formatDuration/index.js100
-rw-r--r--date-fns/src/formatDuration/index.js.flow60
-rw-r--r--date-fns/src/formatDuration/test.js80
-rw-r--r--date-fns/src/formatISO/index.d.ts4
-rw-r--r--date-fns/src/formatISO/index.js121
-rw-r--r--date-fns/src/formatISO/index.js.flow58
-rw-r--r--date-fns/src/formatISO/test.js122
-rw-r--r--date-fns/src/formatISO9075/index.d.ts4
-rw-r--r--date-fns/src/formatISO9075/index.js102
-rw-r--r--date-fns/src/formatISO9075/index.js.flow58
-rw-r--r--date-fns/src/formatISO9075/test.js90
-rw-r--r--date-fns/src/formatISODuration/index.d.ts4
-rw-r--r--date-fns/src/formatISODuration/index.js46
-rw-r--r--date-fns/src/formatISODuration/index.js.flow52
-rw-r--r--date-fns/src/formatISODuration/test.js78
-rw-r--r--date-fns/src/formatRFC3339/index.d.ts4
-rw-r--r--date-fns/src/formatRFC3339/index.js92
-rw-r--r--date-fns/src/formatRFC3339/index.js.flow57
-rw-r--r--date-fns/src/formatRFC3339/test.js81
-rw-r--r--date-fns/src/formatRFC7231/index.d.ts4
-rw-r--r--date-fns/src/formatRFC7231/index.js64
-rw-r--r--date-fns/src/formatRFC7231/index.js.flow52
-rw-r--r--date-fns/src/formatRFC7231/test.js25
-rw-r--r--date-fns/src/formatRelative/benchmark.js23
-rw-r--r--date-fns/src/formatRelative/index.d.ts4
-rw-r--r--date-fns/src/formatRelative/index.js.flow59
-rw-r--r--date-fns/src/formatRelative/index.ts98
-rw-r--r--date-fns/src/formatRelative/test.ts168
-rw-r--r--date-fns/src/fp/_lib/convertToFP/index.js12
-rw-r--r--date-fns/src/fp/_lib/convertToFP/test.js69
-rw-r--r--date-fns/src/fp/add/index.d.ts4
-rw-r--r--date-fns/src/fp/add/index.js8
-rw-r--r--date-fns/src/fp/add/index.js.flow58
-rw-r--r--date-fns/src/fp/addBusinessDays/index.d.ts4
-rw-r--r--date-fns/src/fp/addBusinessDays/index.js8
-rw-r--r--date-fns/src/fp/addBusinessDays/index.js.flow58
-rw-r--r--date-fns/src/fp/addDays/index.d.ts4
-rw-r--r--date-fns/src/fp/addDays/index.js8
-rw-r--r--date-fns/src/fp/addDays/index.js.flow58
-rw-r--r--date-fns/src/fp/addHours/index.d.ts4
-rw-r--r--date-fns/src/fp/addHours/index.js8
-rw-r--r--date-fns/src/fp/addHours/index.js.flow58
-rw-r--r--date-fns/src/fp/addISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/fp/addISOWeekYears/index.js8
-rw-r--r--date-fns/src/fp/addISOWeekYears/index.js.flow58
-rw-r--r--date-fns/src/fp/addMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/addMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/addMilliseconds/index.js.flow58
-rw-r--r--date-fns/src/fp/addMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/addMinutes/index.js8
-rw-r--r--date-fns/src/fp/addMinutes/index.js.flow58
-rw-r--r--date-fns/src/fp/addMonths/index.d.ts4
-rw-r--r--date-fns/src/fp/addMonths/index.js8
-rw-r--r--date-fns/src/fp/addMonths/index.js.flow58
-rw-r--r--date-fns/src/fp/addQuarters/index.d.ts4
-rw-r--r--date-fns/src/fp/addQuarters/index.js8
-rw-r--r--date-fns/src/fp/addQuarters/index.js.flow58
-rw-r--r--date-fns/src/fp/addSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/addSeconds/index.js8
-rw-r--r--date-fns/src/fp/addSeconds/index.js.flow58
-rw-r--r--date-fns/src/fp/addWeeks/index.d.ts4
-rw-r--r--date-fns/src/fp/addWeeks/index.js8
-rw-r--r--date-fns/src/fp/addWeeks/index.js.flow58
-rw-r--r--date-fns/src/fp/addYears/index.d.ts4
-rw-r--r--date-fns/src/fp/addYears/index.js8
-rw-r--r--date-fns/src/fp/addYears/index.js.flow58
-rw-r--r--date-fns/src/fp/areIntervalsOverlapping/index.d.ts4
-rw-r--r--date-fns/src/fp/areIntervalsOverlapping/index.js8
-rw-r--r--date-fns/src/fp/areIntervalsOverlapping/index.js.flow58
-rw-r--r--date-fns/src/fp/areIntervalsOverlappingWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js8
-rw-r--r--date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js.flow74
-rw-r--r--date-fns/src/fp/closestIndexTo/index.d.ts4
-rw-r--r--date-fns/src/fp/closestIndexTo/index.js8
-rw-r--r--date-fns/src/fp/closestIndexTo/index.js.flow58
-rw-r--r--date-fns/src/fp/closestTo/index.d.ts4
-rw-r--r--date-fns/src/fp/closestTo/index.js8
-rw-r--r--date-fns/src/fp/closestTo/index.js.flow58
-rw-r--r--date-fns/src/fp/compareAsc/index.d.ts4
-rw-r--r--date-fns/src/fp/compareAsc/index.js8
-rw-r--r--date-fns/src/fp/compareAsc/index.js.flow58
-rw-r--r--date-fns/src/fp/compareDesc/index.d.ts4
-rw-r--r--date-fns/src/fp/compareDesc/index.js8
-rw-r--r--date-fns/src/fp/compareDesc/index.js.flow58
-rw-r--r--date-fns/src/fp/daysToWeeks/index.d.ts4
-rw-r--r--date-fns/src/fp/daysToWeeks/index.js8
-rw-r--r--date-fns/src/fp/daysToWeeks/index.js.flow54
-rw-r--r--date-fns/src/fp/differenceInBusinessDays/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInBusinessDays/index.js8
-rw-r--r--date-fns/src/fp/differenceInBusinessDays/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInCalendarDays/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarDays/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarDays/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInCalendarISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarISOWeekYears/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarISOWeekYears/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInCalendarISOWeeks/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarISOWeeks/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarISOWeeks/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInCalendarMonths/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarMonths/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarMonths/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInCalendarQuarters/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarQuarters/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarQuarters/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInCalendarWeeks/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarWeeks/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarWeeks/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js.flow75
-rw-r--r--date-fns/src/fp/differenceInCalendarYears/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInCalendarYears/index.js8
-rw-r--r--date-fns/src/fp/differenceInCalendarYears/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInDays/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInDays/index.js8
-rw-r--r--date-fns/src/fp/differenceInDays/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInHours/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInHours/index.js8
-rw-r--r--date-fns/src/fp/differenceInHours/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInISOWeekYears/index.js8
-rw-r--r--date-fns/src/fp/differenceInISOWeekYears/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/differenceInMilliseconds/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInMinutes/index.js8
-rw-r--r--date-fns/src/fp/differenceInMinutes/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInMonths/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInMonths/index.js8
-rw-r--r--date-fns/src/fp/differenceInMonths/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInQuarters/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInQuarters/index.js8
-rw-r--r--date-fns/src/fp/differenceInQuarters/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInSeconds/index.js8
-rw-r--r--date-fns/src/fp/differenceInSeconds/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInWeeks/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInWeeks/index.js8
-rw-r--r--date-fns/src/fp/differenceInWeeks/index.js.flow58
-rw-r--r--date-fns/src/fp/differenceInYears/index.d.ts4
-rw-r--r--date-fns/src/fp/differenceInYears/index.js8
-rw-r--r--date-fns/src/fp/differenceInYears/index.js.flow58
-rw-r--r--date-fns/src/fp/eachDayOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachDayOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachDayOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/eachDayOfIntervalWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/eachDayOfIntervalWithOptions/index.js8
-rw-r--r--date-fns/src/fp/eachDayOfIntervalWithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/eachHourOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachHourOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachHourOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/eachHourOfIntervalWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/eachHourOfIntervalWithOptions/index.js8
-rw-r--r--date-fns/src/fp/eachHourOfIntervalWithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/eachMinuteOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachMinuteOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachMinuteOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js8
-rw-r--r--date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/eachMonthOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachMonthOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachMonthOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/eachQuarterOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachQuarterOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachQuarterOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/eachWeekOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachWeekOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachWeekOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/eachWeekOfIntervalWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js8
-rw-r--r--date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/eachWeekendOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachWeekendOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachWeekendOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/eachWeekendOfMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/eachWeekendOfMonth/index.js8
-rw-r--r--date-fns/src/fp/eachWeekendOfMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/eachWeekendOfYear/index.d.ts4
-rw-r--r--date-fns/src/fp/eachWeekendOfYear/index.js8
-rw-r--r--date-fns/src/fp/eachWeekendOfYear/index.js.flow54
-rw-r--r--date-fns/src/fp/eachYearOfInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/eachYearOfInterval/index.js8
-rw-r--r--date-fns/src/fp/eachYearOfInterval/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfDay/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfDay/index.js8
-rw-r--r--date-fns/src/fp/endOfDay/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfDecade/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfDecade/index.js8
-rw-r--r--date-fns/src/fp/endOfDecade/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfDecadeWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfDecadeWithOptions/index.js8
-rw-r--r--date-fns/src/fp/endOfDecadeWithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/endOfHour/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfHour/index.js8
-rw-r--r--date-fns/src/fp/endOfHour/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfISOWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfISOWeek/index.js8
-rw-r--r--date-fns/src/fp/endOfISOWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfISOWeekYear/index.js8
-rw-r--r--date-fns/src/fp/endOfISOWeekYear/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfMinute/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfMinute/index.js8
-rw-r--r--date-fns/src/fp/endOfMinute/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfMonth/index.js8
-rw-r--r--date-fns/src/fp/endOfMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfQuarter/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfQuarter/index.js8
-rw-r--r--date-fns/src/fp/endOfQuarter/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfSecond/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfSecond/index.js8
-rw-r--r--date-fns/src/fp/endOfSecond/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfWeek/index.js8
-rw-r--r--date-fns/src/fp/endOfWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/endOfWeekWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfWeekWithOptions/index.js8
-rw-r--r--date-fns/src/fp/endOfWeekWithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/endOfYear/index.d.ts4
-rw-r--r--date-fns/src/fp/endOfYear/index.js8
-rw-r--r--date-fns/src/fp/endOfYear/index.js.flow54
-rw-r--r--date-fns/src/fp/format/index.d.ts4
-rw-r--r--date-fns/src/fp/format/index.js8
-rw-r--r--date-fns/src/fp/format/index.js.flow58
-rw-r--r--date-fns/src/fp/formatDistance/index.d.ts4
-rw-r--r--date-fns/src/fp/formatDistance/index.js8
-rw-r--r--date-fns/src/fp/formatDistance/index.js.flow58
-rw-r--r--date-fns/src/fp/formatDistanceStrict/index.d.ts4
-rw-r--r--date-fns/src/fp/formatDistanceStrict/index.js8
-rw-r--r--date-fns/src/fp/formatDistanceStrict/index.js.flow58
-rw-r--r--date-fns/src/fp/formatDistanceStrictWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatDistanceStrictWithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatDistanceStrictWithOptions/index.js.flow77
-rw-r--r--date-fns/src/fp/formatDistanceWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatDistanceWithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatDistanceWithOptions/index.js.flow76
-rw-r--r--date-fns/src/fp/formatDuration/index.d.ts4
-rw-r--r--date-fns/src/fp/formatDuration/index.js8
-rw-r--r--date-fns/src/fp/formatDuration/index.js.flow54
-rw-r--r--date-fns/src/fp/formatDurationWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatDurationWithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatDurationWithOptions/index.js.flow67
-rw-r--r--date-fns/src/fp/formatISO/index.d.ts4
-rw-r--r--date-fns/src/fp/formatISO/index.js8
-rw-r--r--date-fns/src/fp/formatISO/index.js.flow54
-rw-r--r--date-fns/src/fp/formatISO9075/index.d.ts4
-rw-r--r--date-fns/src/fp/formatISO9075/index.js8
-rw-r--r--date-fns/src/fp/formatISO9075/index.js.flow54
-rw-r--r--date-fns/src/fp/formatISO9075WithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatISO9075WithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatISO9075WithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/formatISODuration/index.d.ts4
-rw-r--r--date-fns/src/fp/formatISODuration/index.js8
-rw-r--r--date-fns/src/fp/formatISODuration/index.js.flow54
-rw-r--r--date-fns/src/fp/formatISOWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatISOWithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatISOWithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/formatRFC3339/index.d.ts4
-rw-r--r--date-fns/src/fp/formatRFC3339/index.js8
-rw-r--r--date-fns/src/fp/formatRFC3339/index.js.flow54
-rw-r--r--date-fns/src/fp/formatRFC3339WithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatRFC3339WithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatRFC3339WithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/formatRFC7231/index.d.ts4
-rw-r--r--date-fns/src/fp/formatRFC7231/index.js8
-rw-r--r--date-fns/src/fp/formatRFC7231/index.js.flow54
-rw-r--r--date-fns/src/fp/formatRelative/index.d.ts4
-rw-r--r--date-fns/src/fp/formatRelative/index.js8
-rw-r--r--date-fns/src/fp/formatRelative/index.js.flow58
-rw-r--r--date-fns/src/fp/formatRelativeWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatRelativeWithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatRelativeWithOptions/index.js.flow75
-rw-r--r--date-fns/src/fp/formatWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/formatWithOptions/index.js8
-rw-r--r--date-fns/src/fp/formatWithOptions/index.js.flow78
-rw-r--r--date-fns/src/fp/fromUnixTime/index.d.ts4
-rw-r--r--date-fns/src/fp/fromUnixTime/index.js8
-rw-r--r--date-fns/src/fp/fromUnixTime/index.js.flow54
-rw-r--r--date-fns/src/fp/getDate/index.d.ts4
-rw-r--r--date-fns/src/fp/getDate/index.js8
-rw-r--r--date-fns/src/fp/getDate/index.js.flow54
-rw-r--r--date-fns/src/fp/getDay/index.d.ts4
-rw-r--r--date-fns/src/fp/getDay/index.js8
-rw-r--r--date-fns/src/fp/getDay/index.js.flow54
-rw-r--r--date-fns/src/fp/getDayOfYear/index.d.ts4
-rw-r--r--date-fns/src/fp/getDayOfYear/index.js8
-rw-r--r--date-fns/src/fp/getDayOfYear/index.js.flow54
-rw-r--r--date-fns/src/fp/getDaysInMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/getDaysInMonth/index.js8
-rw-r--r--date-fns/src/fp/getDaysInMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/getDaysInYear/index.d.ts4
-rw-r--r--date-fns/src/fp/getDaysInYear/index.js8
-rw-r--r--date-fns/src/fp/getDaysInYear/index.js.flow54
-rw-r--r--date-fns/src/fp/getDecade/index.d.ts4
-rw-r--r--date-fns/src/fp/getDecade/index.js8
-rw-r--r--date-fns/src/fp/getDecade/index.js.flow54
-rw-r--r--date-fns/src/fp/getHours/index.d.ts4
-rw-r--r--date-fns/src/fp/getHours/index.js8
-rw-r--r--date-fns/src/fp/getHours/index.js.flow54
-rw-r--r--date-fns/src/fp/getISODay/index.d.ts4
-rw-r--r--date-fns/src/fp/getISODay/index.js8
-rw-r--r--date-fns/src/fp/getISODay/index.js.flow54
-rw-r--r--date-fns/src/fp/getISOWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/getISOWeek/index.js8
-rw-r--r--date-fns/src/fp/getISOWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/getISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/getISOWeekYear/index.js8
-rw-r--r--date-fns/src/fp/getISOWeekYear/index.js.flow54
-rw-r--r--date-fns/src/fp/getISOWeeksInYear/index.d.ts4
-rw-r--r--date-fns/src/fp/getISOWeeksInYear/index.js8
-rw-r--r--date-fns/src/fp/getISOWeeksInYear/index.js.flow54
-rw-r--r--date-fns/src/fp/getMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/getMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/getMilliseconds/index.js.flow54
-rw-r--r--date-fns/src/fp/getMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/getMinutes/index.js8
-rw-r--r--date-fns/src/fp/getMinutes/index.js.flow54
-rw-r--r--date-fns/src/fp/getMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/getMonth/index.js8
-rw-r--r--date-fns/src/fp/getMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/getOverlappingDaysInIntervals/index.d.ts4
-rw-r--r--date-fns/src/fp/getOverlappingDaysInIntervals/index.js8
-rw-r--r--date-fns/src/fp/getOverlappingDaysInIntervals/index.js.flow58
-rw-r--r--date-fns/src/fp/getQuarter/index.d.ts4
-rw-r--r--date-fns/src/fp/getQuarter/index.js8
-rw-r--r--date-fns/src/fp/getQuarter/index.js.flow54
-rw-r--r--date-fns/src/fp/getSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/getSeconds/index.js8
-rw-r--r--date-fns/src/fp/getSeconds/index.js.flow54
-rw-r--r--date-fns/src/fp/getTime/index.d.ts4
-rw-r--r--date-fns/src/fp/getTime/index.js8
-rw-r--r--date-fns/src/fp/getTime/index.js.flow54
-rw-r--r--date-fns/src/fp/getUnixTime/index.d.ts4
-rw-r--r--date-fns/src/fp/getUnixTime/index.js8
-rw-r--r--date-fns/src/fp/getUnixTime/index.js.flow54
-rw-r--r--date-fns/src/fp/getWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeek/index.js8
-rw-r--r--date-fns/src/fp/getWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/getWeekOfMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeekOfMonth/index.js8
-rw-r--r--date-fns/src/fp/getWeekOfMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/getWeekOfMonthWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeekOfMonthWithOptions/index.js8
-rw-r--r--date-fns/src/fp/getWeekOfMonthWithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/getWeekWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeekWithOptions/index.js8
-rw-r--r--date-fns/src/fp/getWeekWithOptions/index.js.flow66
-rw-r--r--date-fns/src/fp/getWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeekYear/index.js8
-rw-r--r--date-fns/src/fp/getWeekYear/index.js.flow54
-rw-r--r--date-fns/src/fp/getWeekYearWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeekYearWithOptions/index.js8
-rw-r--r--date-fns/src/fp/getWeekYearWithOptions/index.js.flow66
-rw-r--r--date-fns/src/fp/getWeeksInMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeeksInMonth/index.js8
-rw-r--r--date-fns/src/fp/getWeeksInMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/getWeeksInMonthWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/getWeeksInMonthWithOptions/index.js8
-rw-r--r--date-fns/src/fp/getWeeksInMonthWithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/getYear/index.d.ts4
-rw-r--r--date-fns/src/fp/getYear/index.js8
-rw-r--r--date-fns/src/fp/getYear/index.js.flow54
-rw-r--r--date-fns/src/fp/hoursToMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/hoursToMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/hoursToMilliseconds/index.js.flow54
-rw-r--r--date-fns/src/fp/hoursToMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/hoursToMinutes/index.js8
-rw-r--r--date-fns/src/fp/hoursToMinutes/index.js.flow54
-rw-r--r--date-fns/src/fp/hoursToSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/hoursToSeconds/index.js8
-rw-r--r--date-fns/src/fp/hoursToSeconds/index.js.flow54
-rw-r--r--date-fns/src/fp/index.js241
-rw-r--r--date-fns/src/fp/index.js.flow625
-rw-r--r--date-fns/src/fp/intervalToDuration/index.d.ts4
-rw-r--r--date-fns/src/fp/intervalToDuration/index.js8
-rw-r--r--date-fns/src/fp/intervalToDuration/index.js.flow54
-rw-r--r--date-fns/src/fp/intlFormat/index.d.ts4
-rw-r--r--date-fns/src/fp/intlFormat/index.js8
-rw-r--r--date-fns/src/fp/intlFormat/index.js.flow88
-rw-r--r--date-fns/src/fp/isAfter/index.d.ts4
-rw-r--r--date-fns/src/fp/isAfter/index.js8
-rw-r--r--date-fns/src/fp/isAfter/index.js.flow58
-rw-r--r--date-fns/src/fp/isBefore/index.d.ts4
-rw-r--r--date-fns/src/fp/isBefore/index.js8
-rw-r--r--date-fns/src/fp/isBefore/index.js.flow58
-rw-r--r--date-fns/src/fp/isDate/index.d.ts4
-rw-r--r--date-fns/src/fp/isDate/index.js8
-rw-r--r--date-fns/src/fp/isDate/index.js.flow54
-rw-r--r--date-fns/src/fp/isEqual/index.d.ts4
-rw-r--r--date-fns/src/fp/isEqual/index.js8
-rw-r--r--date-fns/src/fp/isEqual/index.js.flow58
-rw-r--r--date-fns/src/fp/isExists/index.d.ts4
-rw-r--r--date-fns/src/fp/isExists/index.js8
-rw-r--r--date-fns/src/fp/isExists/index.js.flow67
-rw-r--r--date-fns/src/fp/isFirstDayOfMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/isFirstDayOfMonth/index.js8
-rw-r--r--date-fns/src/fp/isFirstDayOfMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/isFriday/index.d.ts4
-rw-r--r--date-fns/src/fp/isFriday/index.js8
-rw-r--r--date-fns/src/fp/isFriday/index.js.flow54
-rw-r--r--date-fns/src/fp/isLastDayOfMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/isLastDayOfMonth/index.js8
-rw-r--r--date-fns/src/fp/isLastDayOfMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/isLeapYear/index.d.ts4
-rw-r--r--date-fns/src/fp/isLeapYear/index.js8
-rw-r--r--date-fns/src/fp/isLeapYear/index.js.flow54
-rw-r--r--date-fns/src/fp/isMatch/index.d.ts4
-rw-r--r--date-fns/src/fp/isMatch/index.js8
-rw-r--r--date-fns/src/fp/isMatch/index.js.flow58
-rw-r--r--date-fns/src/fp/isMatchWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/isMatchWithOptions/index.js8
-rw-r--r--date-fns/src/fp/isMatchWithOptions/index.js.flow78
-rw-r--r--date-fns/src/fp/isMonday/index.d.ts4
-rw-r--r--date-fns/src/fp/isMonday/index.js8
-rw-r--r--date-fns/src/fp/isMonday/index.js.flow54
-rw-r--r--date-fns/src/fp/isSameDay/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameDay/index.js8
-rw-r--r--date-fns/src/fp/isSameDay/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameHour/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameHour/index.js8
-rw-r--r--date-fns/src/fp/isSameHour/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameISOWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameISOWeek/index.js8
-rw-r--r--date-fns/src/fp/isSameISOWeek/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameISOWeekYear/index.js8
-rw-r--r--date-fns/src/fp/isSameISOWeekYear/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameMinute/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameMinute/index.js8
-rw-r--r--date-fns/src/fp/isSameMinute/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameMonth/index.js8
-rw-r--r--date-fns/src/fp/isSameMonth/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameQuarter/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameQuarter/index.js8
-rw-r--r--date-fns/src/fp/isSameQuarter/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameSecond/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameSecond/index.js8
-rw-r--r--date-fns/src/fp/isSameSecond/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameWeek/index.js8
-rw-r--r--date-fns/src/fp/isSameWeek/index.js.flow58
-rw-r--r--date-fns/src/fp/isSameWeekWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameWeekWithOptions/index.js8
-rw-r--r--date-fns/src/fp/isSameWeekWithOptions/index.js.flow75
-rw-r--r--date-fns/src/fp/isSameYear/index.d.ts4
-rw-r--r--date-fns/src/fp/isSameYear/index.js8
-rw-r--r--date-fns/src/fp/isSameYear/index.js.flow58
-rw-r--r--date-fns/src/fp/isSaturday/index.d.ts4
-rw-r--r--date-fns/src/fp/isSaturday/index.js8
-rw-r--r--date-fns/src/fp/isSaturday/index.js.flow54
-rw-r--r--date-fns/src/fp/isSunday/index.d.ts4
-rw-r--r--date-fns/src/fp/isSunday/index.js8
-rw-r--r--date-fns/src/fp/isSunday/index.js.flow54
-rw-r--r--date-fns/src/fp/isThursday/index.d.ts4
-rw-r--r--date-fns/src/fp/isThursday/index.js8
-rw-r--r--date-fns/src/fp/isThursday/index.js.flow54
-rw-r--r--date-fns/src/fp/isTuesday/index.d.ts4
-rw-r--r--date-fns/src/fp/isTuesday/index.js8
-rw-r--r--date-fns/src/fp/isTuesday/index.js.flow54
-rw-r--r--date-fns/src/fp/isValid/index.d.ts4
-rw-r--r--date-fns/src/fp/isValid/index.js8
-rw-r--r--date-fns/src/fp/isValid/index.js.flow54
-rw-r--r--date-fns/src/fp/isWednesday/index.d.ts4
-rw-r--r--date-fns/src/fp/isWednesday/index.js8
-rw-r--r--date-fns/src/fp/isWednesday/index.js.flow54
-rw-r--r--date-fns/src/fp/isWeekend/index.d.ts4
-rw-r--r--date-fns/src/fp/isWeekend/index.js8
-rw-r--r--date-fns/src/fp/isWeekend/index.js.flow54
-rw-r--r--date-fns/src/fp/isWithinInterval/index.d.ts4
-rw-r--r--date-fns/src/fp/isWithinInterval/index.js8
-rw-r--r--date-fns/src/fp/isWithinInterval/index.js.flow58
-rw-r--r--date-fns/src/fp/lastDayOfDecade/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfDecade/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfDecade/index.js.flow54
-rw-r--r--date-fns/src/fp/lastDayOfISOWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfISOWeek/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfISOWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/lastDayOfISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfISOWeekYear/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfISOWeekYear/index.js.flow54
-rw-r--r--date-fns/src/fp/lastDayOfMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfMonth/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/lastDayOfQuarter/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfQuarter/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfQuarter/index.js.flow54
-rw-r--r--date-fns/src/fp/lastDayOfQuarterWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfQuarterWithOptions/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfQuarterWithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/lastDayOfWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfWeek/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/lastDayOfWeekWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfWeekWithOptions/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfWeekWithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/lastDayOfYear/index.d.ts4
-rw-r--r--date-fns/src/fp/lastDayOfYear/index.js8
-rw-r--r--date-fns/src/fp/lastDayOfYear/index.js.flow54
-rw-r--r--date-fns/src/fp/lightFormat/index.d.ts4
-rw-r--r--date-fns/src/fp/lightFormat/index.js8
-rw-r--r--date-fns/src/fp/lightFormat/index.js.flow58
-rw-r--r--date-fns/src/fp/max/index.d.ts4
-rw-r--r--date-fns/src/fp/max/index.js8
-rw-r--r--date-fns/src/fp/max/index.js.flow54
-rw-r--r--date-fns/src/fp/milliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/milliseconds/index.js8
-rw-r--r--date-fns/src/fp/milliseconds/index.js.flow54
-rw-r--r--date-fns/src/fp/millisecondsToHours/index.d.ts4
-rw-r--r--date-fns/src/fp/millisecondsToHours/index.js8
-rw-r--r--date-fns/src/fp/millisecondsToHours/index.js.flow54
-rw-r--r--date-fns/src/fp/millisecondsToMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/millisecondsToMinutes/index.js8
-rw-r--r--date-fns/src/fp/millisecondsToMinutes/index.js.flow54
-rw-r--r--date-fns/src/fp/millisecondsToSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/millisecondsToSeconds/index.js8
-rw-r--r--date-fns/src/fp/millisecondsToSeconds/index.js.flow54
-rw-r--r--date-fns/src/fp/min/index.d.ts4
-rw-r--r--date-fns/src/fp/min/index.js8
-rw-r--r--date-fns/src/fp/min/index.js.flow54
-rw-r--r--date-fns/src/fp/minutesToHours/index.d.ts4
-rw-r--r--date-fns/src/fp/minutesToHours/index.js8
-rw-r--r--date-fns/src/fp/minutesToHours/index.js.flow54
-rw-r--r--date-fns/src/fp/minutesToMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/minutesToMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/minutesToMilliseconds/index.js.flow54
-rw-r--r--date-fns/src/fp/minutesToSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/minutesToSeconds/index.js8
-rw-r--r--date-fns/src/fp/minutesToSeconds/index.js.flow54
-rw-r--r--date-fns/src/fp/monthsToQuarters/index.d.ts4
-rw-r--r--date-fns/src/fp/monthsToQuarters/index.js8
-rw-r--r--date-fns/src/fp/monthsToQuarters/index.js.flow54
-rw-r--r--date-fns/src/fp/monthsToYears/index.d.ts4
-rw-r--r--date-fns/src/fp/monthsToYears/index.js8
-rw-r--r--date-fns/src/fp/monthsToYears/index.js.flow54
-rw-r--r--date-fns/src/fp/nextDay/index.d.ts4
-rw-r--r--date-fns/src/fp/nextDay/index.js8
-rw-r--r--date-fns/src/fp/nextDay/index.js.flow58
-rw-r--r--date-fns/src/fp/nextFriday/index.d.ts4
-rw-r--r--date-fns/src/fp/nextFriday/index.js8
-rw-r--r--date-fns/src/fp/nextFriday/index.js.flow54
-rw-r--r--date-fns/src/fp/nextMonday/index.d.ts4
-rw-r--r--date-fns/src/fp/nextMonday/index.js8
-rw-r--r--date-fns/src/fp/nextMonday/index.js.flow54
-rw-r--r--date-fns/src/fp/nextSaturday/index.d.ts4
-rw-r--r--date-fns/src/fp/nextSaturday/index.js8
-rw-r--r--date-fns/src/fp/nextSaturday/index.js.flow54
-rw-r--r--date-fns/src/fp/nextSunday/index.d.ts4
-rw-r--r--date-fns/src/fp/nextSunday/index.js8
-rw-r--r--date-fns/src/fp/nextSunday/index.js.flow54
-rw-r--r--date-fns/src/fp/nextThursday/index.d.ts4
-rw-r--r--date-fns/src/fp/nextThursday/index.js8
-rw-r--r--date-fns/src/fp/nextThursday/index.js.flow54
-rw-r--r--date-fns/src/fp/nextTuesday/index.d.ts4
-rw-r--r--date-fns/src/fp/nextTuesday/index.js8
-rw-r--r--date-fns/src/fp/nextTuesday/index.js.flow54
-rw-r--r--date-fns/src/fp/nextWednesday/index.d.ts4
-rw-r--r--date-fns/src/fp/nextWednesday/index.js8
-rw-r--r--date-fns/src/fp/nextWednesday/index.js.flow54
-rw-r--r--date-fns/src/fp/parse/index.d.ts4
-rw-r--r--date-fns/src/fp/parse/index.js8
-rw-r--r--date-fns/src/fp/parse/index.js.flow67
-rw-r--r--date-fns/src/fp/parseISO/index.d.ts4
-rw-r--r--date-fns/src/fp/parseISO/index.js8
-rw-r--r--date-fns/src/fp/parseISO/index.js.flow54
-rw-r--r--date-fns/src/fp/parseISOWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/parseISOWithOptions/index.js8
-rw-r--r--date-fns/src/fp/parseISOWithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/parseJSON/index.d.ts4
-rw-r--r--date-fns/src/fp/parseJSON/index.js8
-rw-r--r--date-fns/src/fp/parseJSON/index.js.flow54
-rw-r--r--date-fns/src/fp/parseWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/parseWithOptions/index.js8
-rw-r--r--date-fns/src/fp/parseWithOptions/index.js.flow94
-rw-r--r--date-fns/src/fp/quartersToMonths/index.d.ts4
-rw-r--r--date-fns/src/fp/quartersToMonths/index.js8
-rw-r--r--date-fns/src/fp/quartersToMonths/index.js.flow54
-rw-r--r--date-fns/src/fp/quartersToYears/index.d.ts4
-rw-r--r--date-fns/src/fp/quartersToYears/index.js8
-rw-r--r--date-fns/src/fp/quartersToYears/index.js.flow54
-rw-r--r--date-fns/src/fp/roundToNearestMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/roundToNearestMinutes/index.js8
-rw-r--r--date-fns/src/fp/roundToNearestMinutes/index.js.flow54
-rw-r--r--date-fns/src/fp/roundToNearestMinutesWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/roundToNearestMinutesWithOptions/index.js8
-rw-r--r--date-fns/src/fp/roundToNearestMinutesWithOptions/index.js.flow64
-rw-r--r--date-fns/src/fp/secondsToHours/index.d.ts4
-rw-r--r--date-fns/src/fp/secondsToHours/index.js8
-rw-r--r--date-fns/src/fp/secondsToHours/index.js.flow54
-rw-r--r--date-fns/src/fp/secondsToMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/secondsToMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/secondsToMilliseconds/index.js.flow54
-rw-r--r--date-fns/src/fp/secondsToMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/secondsToMinutes/index.js8
-rw-r--r--date-fns/src/fp/secondsToMinutes/index.js.flow54
-rw-r--r--date-fns/src/fp/set/index.d.ts4
-rw-r--r--date-fns/src/fp/set/index.js8
-rw-r--r--date-fns/src/fp/set/index.js.flow70
-rw-r--r--date-fns/src/fp/setDate/index.d.ts4
-rw-r--r--date-fns/src/fp/setDate/index.js8
-rw-r--r--date-fns/src/fp/setDate/index.js.flow58
-rw-r--r--date-fns/src/fp/setDay/index.d.ts4
-rw-r--r--date-fns/src/fp/setDay/index.js8
-rw-r--r--date-fns/src/fp/setDay/index.js.flow58
-rw-r--r--date-fns/src/fp/setDayOfYear/index.d.ts4
-rw-r--r--date-fns/src/fp/setDayOfYear/index.js8
-rw-r--r--date-fns/src/fp/setDayOfYear/index.js.flow58
-rw-r--r--date-fns/src/fp/setDayWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/setDayWithOptions/index.js8
-rw-r--r--date-fns/src/fp/setDayWithOptions/index.js.flow75
-rw-r--r--date-fns/src/fp/setHours/index.d.ts4
-rw-r--r--date-fns/src/fp/setHours/index.js8
-rw-r--r--date-fns/src/fp/setHours/index.js.flow58
-rw-r--r--date-fns/src/fp/setISODay/index.d.ts4
-rw-r--r--date-fns/src/fp/setISODay/index.js8
-rw-r--r--date-fns/src/fp/setISODay/index.js.flow58
-rw-r--r--date-fns/src/fp/setISOWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/setISOWeek/index.js8
-rw-r--r--date-fns/src/fp/setISOWeek/index.js.flow58
-rw-r--r--date-fns/src/fp/setISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/setISOWeekYear/index.js8
-rw-r--r--date-fns/src/fp/setISOWeekYear/index.js.flow58
-rw-r--r--date-fns/src/fp/setMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/setMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/setMilliseconds/index.js.flow58
-rw-r--r--date-fns/src/fp/setMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/setMinutes/index.js8
-rw-r--r--date-fns/src/fp/setMinutes/index.js.flow58
-rw-r--r--date-fns/src/fp/setMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/setMonth/index.js8
-rw-r--r--date-fns/src/fp/setMonth/index.js.flow58
-rw-r--r--date-fns/src/fp/setQuarter/index.d.ts4
-rw-r--r--date-fns/src/fp/setQuarter/index.js8
-rw-r--r--date-fns/src/fp/setQuarter/index.js.flow58
-rw-r--r--date-fns/src/fp/setSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/setSeconds/index.js8
-rw-r--r--date-fns/src/fp/setSeconds/index.js.flow58
-rw-r--r--date-fns/src/fp/setWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/setWeek/index.js8
-rw-r--r--date-fns/src/fp/setWeek/index.js.flow58
-rw-r--r--date-fns/src/fp/setWeekWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/setWeekWithOptions/index.js8
-rw-r--r--date-fns/src/fp/setWeekWithOptions/index.js.flow76
-rw-r--r--date-fns/src/fp/setWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/setWeekYear/index.js8
-rw-r--r--date-fns/src/fp/setWeekYear/index.js.flow58
-rw-r--r--date-fns/src/fp/setWeekYearWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/setWeekYearWithOptions/index.js8
-rw-r--r--date-fns/src/fp/setWeekYearWithOptions/index.js.flow76
-rw-r--r--date-fns/src/fp/setYear/index.d.ts4
-rw-r--r--date-fns/src/fp/setYear/index.js8
-rw-r--r--date-fns/src/fp/setYear/index.js.flow58
-rw-r--r--date-fns/src/fp/startOfDay/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfDay/index.js8
-rw-r--r--date-fns/src/fp/startOfDay/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfDecade/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfDecade/index.js8
-rw-r--r--date-fns/src/fp/startOfDecade/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfHour/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfHour/index.js8
-rw-r--r--date-fns/src/fp/startOfHour/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfISOWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfISOWeek/index.js8
-rw-r--r--date-fns/src/fp/startOfISOWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfISOWeekYear/index.js8
-rw-r--r--date-fns/src/fp/startOfISOWeekYear/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfMinute/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfMinute/index.js8
-rw-r--r--date-fns/src/fp/startOfMinute/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfMonth/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfMonth/index.js8
-rw-r--r--date-fns/src/fp/startOfMonth/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfQuarter/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfQuarter/index.js8
-rw-r--r--date-fns/src/fp/startOfQuarter/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfSecond/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfSecond/index.js8
-rw-r--r--date-fns/src/fp/startOfSecond/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfWeek/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfWeek/index.js8
-rw-r--r--date-fns/src/fp/startOfWeek/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfWeekWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfWeekWithOptions/index.js8
-rw-r--r--date-fns/src/fp/startOfWeekWithOptions/index.js.flow65
-rw-r--r--date-fns/src/fp/startOfWeekYear/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfWeekYear/index.js8
-rw-r--r--date-fns/src/fp/startOfWeekYear/index.js.flow54
-rw-r--r--date-fns/src/fp/startOfWeekYearWithOptions/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfWeekYearWithOptions/index.js8
-rw-r--r--date-fns/src/fp/startOfWeekYearWithOptions/index.js.flow66
-rw-r--r--date-fns/src/fp/startOfYear/index.d.ts4
-rw-r--r--date-fns/src/fp/startOfYear/index.js8
-rw-r--r--date-fns/src/fp/startOfYear/index.js.flow54
-rw-r--r--date-fns/src/fp/sub/index.d.ts4
-rw-r--r--date-fns/src/fp/sub/index.js8
-rw-r--r--date-fns/src/fp/sub/index.js.flow58
-rw-r--r--date-fns/src/fp/subBusinessDays/index.d.ts4
-rw-r--r--date-fns/src/fp/subBusinessDays/index.js8
-rw-r--r--date-fns/src/fp/subBusinessDays/index.js.flow58
-rw-r--r--date-fns/src/fp/subDays/index.d.ts4
-rw-r--r--date-fns/src/fp/subDays/index.js8
-rw-r--r--date-fns/src/fp/subDays/index.js.flow58
-rw-r--r--date-fns/src/fp/subHours/index.d.ts4
-rw-r--r--date-fns/src/fp/subHours/index.js8
-rw-r--r--date-fns/src/fp/subHours/index.js.flow58
-rw-r--r--date-fns/src/fp/subISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/fp/subISOWeekYears/index.js8
-rw-r--r--date-fns/src/fp/subISOWeekYears/index.js.flow58
-rw-r--r--date-fns/src/fp/subMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/fp/subMilliseconds/index.js8
-rw-r--r--date-fns/src/fp/subMilliseconds/index.js.flow58
-rw-r--r--date-fns/src/fp/subMinutes/index.d.ts4
-rw-r--r--date-fns/src/fp/subMinutes/index.js8
-rw-r--r--date-fns/src/fp/subMinutes/index.js.flow58
-rw-r--r--date-fns/src/fp/subMonths/index.d.ts4
-rw-r--r--date-fns/src/fp/subMonths/index.js8
-rw-r--r--date-fns/src/fp/subMonths/index.js.flow58
-rw-r--r--date-fns/src/fp/subQuarters/index.d.ts4
-rw-r--r--date-fns/src/fp/subQuarters/index.js8
-rw-r--r--date-fns/src/fp/subQuarters/index.js.flow58
-rw-r--r--date-fns/src/fp/subSeconds/index.d.ts4
-rw-r--r--date-fns/src/fp/subSeconds/index.js8
-rw-r--r--date-fns/src/fp/subSeconds/index.js.flow58
-rw-r--r--date-fns/src/fp/subWeeks/index.d.ts4
-rw-r--r--date-fns/src/fp/subWeeks/index.js8
-rw-r--r--date-fns/src/fp/subWeeks/index.js.flow58
-rw-r--r--date-fns/src/fp/subYears/index.d.ts4
-rw-r--r--date-fns/src/fp/subYears/index.js8
-rw-r--r--date-fns/src/fp/subYears/index.js.flow58
-rw-r--r--date-fns/src/fp/test.js1045
-rw-r--r--date-fns/src/fp/toDate/index.d.ts4
-rw-r--r--date-fns/src/fp/toDate/index.js8
-rw-r--r--date-fns/src/fp/toDate/index.js.flow54
-rw-r--r--date-fns/src/fp/weeksToDays/index.d.ts4
-rw-r--r--date-fns/src/fp/weeksToDays/index.js8
-rw-r--r--date-fns/src/fp/weeksToDays/index.js.flow54
-rw-r--r--date-fns/src/fp/yearsToMonths/index.d.ts4
-rw-r--r--date-fns/src/fp/yearsToMonths/index.js8
-rw-r--r--date-fns/src/fp/yearsToMonths/index.js.flow54
-rw-r--r--date-fns/src/fp/yearsToQuarters/index.d.ts4
-rw-r--r--date-fns/src/fp/yearsToQuarters/index.js8
-rw-r--r--date-fns/src/fp/yearsToQuarters/index.js.flow54
-rw-r--r--date-fns/src/fromUnixTime/index.d.ts4
-rw-r--r--date-fns/src/fromUnixTime/index.js32
-rw-r--r--date-fns/src/fromUnixTime/index.js.flow52
-rw-r--r--date-fns/src/fromUnixTime/test.js21
-rw-r--r--date-fns/src/getDate/benchmark.js21
-rw-r--r--date-fns/src/getDate/index.d.ts4
-rw-r--r--date-fns/src/getDate/index.js.flow52
-rw-r--r--date-fns/src/getDate/index.ts31
-rw-r--r--date-fns/src/getDate/test.ts26
-rw-r--r--date-fns/src/getDay/benchmark.js21
-rw-r--r--date-fns/src/getDay/index.d.ts4
-rw-r--r--date-fns/src/getDay/index.js.flow52
-rw-r--r--date-fns/src/getDay/index.ts31
-rw-r--r--date-fns/src/getDay/test.ts26
-rw-r--r--date-fns/src/getDayOfYear/benchmark.js21
-rw-r--r--date-fns/src/getDayOfYear/index.d.ts4
-rw-r--r--date-fns/src/getDayOfYear/index.js.flow52
-rw-r--r--date-fns/src/getDayOfYear/index.ts34
-rw-r--r--date-fns/src/getDayOfYear/test.ts34
-rw-r--r--date-fns/src/getDaysInMonth/benchmark.js21
-rw-r--r--date-fns/src/getDaysInMonth/index.d.ts4
-rw-r--r--date-fns/src/getDaysInMonth/index.js.flow52
-rw-r--r--date-fns/src/getDaysInMonth/index.ts35
-rw-r--r--date-fns/src/getDaysInMonth/test.ts40
-rw-r--r--date-fns/src/getDaysInYear/benchmark.js15
-rw-r--r--date-fns/src/getDaysInYear/index.d.ts4
-rw-r--r--date-fns/src/getDaysInYear/index.js.flow52
-rw-r--r--date-fns/src/getDaysInYear/index.ts36
-rw-r--r--date-fns/src/getDaysInYear/test.ts42
-rw-r--r--date-fns/src/getDecade/benchmark.js21
-rw-r--r--date-fns/src/getDecade/index.d.ts4
-rw-r--r--date-fns/src/getDecade/index.js.flow52
-rw-r--r--date-fns/src/getDecade/index.ts32
-rw-r--r--date-fns/src/getDecade/test.ts26
-rw-r--r--date-fns/src/getHours/benchmark.js21
-rw-r--r--date-fns/src/getHours/index.d.ts4
-rw-r--r--date-fns/src/getHours/index.js.flow52
-rw-r--r--date-fns/src/getHours/index.ts31
-rw-r--r--date-fns/src/getHours/test.ts26
-rw-r--r--date-fns/src/getISODay/benchmark.js21
-rw-r--r--date-fns/src/getISODay/index.d.ts4
-rw-r--r--date-fns/src/getISODay/index.js.flow52
-rw-r--r--date-fns/src/getISODay/index.ts39
-rw-r--r--date-fns/src/getISODay/test.ts31
-rw-r--r--date-fns/src/getISOWeek/benchmark.js21
-rw-r--r--date-fns/src/getISOWeek/index.d.ts4
-rw-r--r--date-fns/src/getISOWeek/index.js.flow52
-rw-r--r--date-fns/src/getISOWeek/index.ts41
-rw-r--r--date-fns/src/getISOWeek/test.ts56
-rw-r--r--date-fns/src/getISOWeekYear/benchmark.js21
-rw-r--r--date-fns/src/getISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/getISOWeekYear/index.js.flow52
-rw-r--r--date-fns/src/getISOWeekYear/index.ts57
-rw-r--r--date-fns/src/getISOWeekYear/test.ts34
-rw-r--r--date-fns/src/getISOWeeksInYear/benchmark.js21
-rw-r--r--date-fns/src/getISOWeeksInYear/index.d.ts4
-rw-r--r--date-fns/src/getISOWeeksInYear/index.js.flow52
-rw-r--r--date-fns/src/getISOWeeksInYear/index.ts40
-rw-r--r--date-fns/src/getISOWeeksInYear/test.ts35
-rw-r--r--date-fns/src/getMilliseconds/benchmark.js21
-rw-r--r--date-fns/src/getMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/getMilliseconds/index.js.flow52
-rw-r--r--date-fns/src/getMilliseconds/index.ts31
-rw-r--r--date-fns/src/getMilliseconds/test.ts30
-rw-r--r--date-fns/src/getMinutes/benchmark.js21
-rw-r--r--date-fns/src/getMinutes/index.d.ts4
-rw-r--r--date-fns/src/getMinutes/index.js.flow52
-rw-r--r--date-fns/src/getMinutes/index.ts31
-rw-r--r--date-fns/src/getMinutes/test.ts26
-rw-r--r--date-fns/src/getMonth/benchmark.js21
-rw-r--r--date-fns/src/getMonth/index.d.ts4
-rw-r--r--date-fns/src/getMonth/index.js.flow52
-rw-r--r--date-fns/src/getMonth/index.ts31
-rw-r--r--date-fns/src/getMonth/test.ts26
-rw-r--r--date-fns/src/getOverlappingDaysInIntervals/index.d.ts4
-rw-r--r--date-fns/src/getOverlappingDaysInIntervals/index.js.flow55
-rw-r--r--date-fns/src/getOverlappingDaysInIntervals/index.ts106
-rw-r--r--date-fns/src/getOverlappingDaysInIntervals/test.ts240
-rw-r--r--date-fns/src/getQuarter/benchmark.js21
-rw-r--r--date-fns/src/getQuarter/index.d.ts4
-rw-r--r--date-fns/src/getQuarter/index.js.flow52
-rw-r--r--date-fns/src/getQuarter/index.ts31
-rw-r--r--date-fns/src/getQuarter/test.ts26
-rw-r--r--date-fns/src/getSeconds/benchmark.js21
-rw-r--r--date-fns/src/getSeconds/index.d.ts4
-rw-r--r--date-fns/src/getSeconds/index.js.flow52
-rw-r--r--date-fns/src/getSeconds/index.ts31
-rw-r--r--date-fns/src/getSeconds/test.ts28
-rw-r--r--date-fns/src/getTime/benchmark.js21
-rw-r--r--date-fns/src/getTime/index.d.ts4
-rw-r--r--date-fns/src/getTime/index.js.flow52
-rw-r--r--date-fns/src/getTime/index.ts31
-rw-r--r--date-fns/src/getTime/test.ts28
-rw-r--r--date-fns/src/getUnixTime/benchmark.js21
-rw-r--r--date-fns/src/getUnixTime/index.d.ts4
-rw-r--r--date-fns/src/getUnixTime/index.js.flow52
-rw-r--r--date-fns/src/getUnixTime/index.ts29
-rw-r--r--date-fns/src/getUnixTime/test.ts28
-rw-r--r--date-fns/src/getWeek/index.d.ts4
-rw-r--r--date-fns/src/getWeek/index.js.flow59
-rw-r--r--date-fns/src/getWeek/index.ts64
-rw-r--r--date-fns/src/getWeek/test.ts73
-rw-r--r--date-fns/src/getWeekOfMonth/benchmark.js15
-rw-r--r--date-fns/src/getWeekOfMonth/index.d.ts4
-rw-r--r--date-fns/src/getWeekOfMonth/index.js72
-rw-r--r--date-fns/src/getWeekOfMonth/index.js.flow58
-rw-r--r--date-fns/src/getWeekOfMonth/test.js84
-rw-r--r--date-fns/src/getWeekYear/index.d.ts4
-rw-r--r--date-fns/src/getWeekYear/index.js.flow59
-rw-r--r--date-fns/src/getWeekYear/index.ts98
-rw-r--r--date-fns/src/getWeekYear/test.ts75
-rw-r--r--date-fns/src/getWeeksInMonth/index.d.ts4
-rw-r--r--date-fns/src/getWeeksInMonth/index.js.flow58
-rw-r--r--date-fns/src/getWeeksInMonth/index.ts51
-rw-r--r--date-fns/src/getWeeksInMonth/test.ts71
-rw-r--r--date-fns/src/getYear/benchmark.js21
-rw-r--r--date-fns/src/getYear/index.d.ts4
-rw-r--r--date-fns/src/getYear/index.js.flow52
-rw-r--r--date-fns/src/getYear/index.ts31
-rw-r--r--date-fns/src/getYear/test.ts26
-rw-r--r--date-fns/src/hoursToMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/hoursToMilliseconds/index.js.flow52
-rw-r--r--date-fns/src/hoursToMilliseconds/index.ts25
-rw-r--r--date-fns/src/hoursToMilliseconds/test.ts20
-rw-r--r--date-fns/src/hoursToMinutes/index.d.ts4
-rw-r--r--date-fns/src/hoursToMinutes/index.js.flow52
-rw-r--r--date-fns/src/hoursToMinutes/index.ts25
-rw-r--r--date-fns/src/hoursToMinutes/test.ts20
-rw-r--r--date-fns/src/hoursToSeconds/index.d.ts4
-rw-r--r--date-fns/src/hoursToSeconds/index.js.flow52
-rw-r--r--date-fns/src/hoursToSeconds/index.ts25
-rw-r--r--date-fns/src/hoursToSeconds/test.ts20
-rw-r--r--date-fns/src/index.js230
-rw-r--r--date-fns/src/index.js.flow860
-rw-r--r--date-fns/src/intervalToDuration/index.d.ts4
-rw-r--r--date-fns/src/intervalToDuration/index.js.flow52
-rw-r--r--date-fns/src/intervalToDuration/index.ts81
-rw-r--r--date-fns/src/intervalToDuration/test.ts116
-rw-r--r--date-fns/src/intlFormat/index.d.ts4
-rw-r--r--date-fns/src/intlFormat/index.js.flow72
-rw-r--r--date-fns/src/intlFormat/index.ts116
-rw-r--r--date-fns/src/intlFormat/test.ts111
-rw-r--r--date-fns/src/isAfter/benchmark.js23
-rw-r--r--date-fns/src/isAfter/index.d.ts4
-rw-r--r--date-fns/src/isAfter/index.js.flow55
-rw-r--r--date-fns/src/isAfter/index.ts32
-rw-r--r--date-fns/src/isAfter/test.ts59
-rw-r--r--date-fns/src/isBefore/benchmark.js23
-rw-r--r--date-fns/src/isBefore/index.d.ts4
-rw-r--r--date-fns/src/isBefore/index.js.flow55
-rw-r--r--date-fns/src/isBefore/index.ts32
-rw-r--r--date-fns/src/isBefore/test.ts59
-rw-r--r--date-fns/src/isDate/index.d.ts4
-rw-r--r--date-fns/src/isDate/index.js.flow52
-rw-r--r--date-fns/src/isDate/index.ts47
-rw-r--r--date-fns/src/isDate/test.ts81
-rw-r--r--date-fns/src/isEqual/benchmark.js23
-rw-r--r--date-fns/src/isEqual/index.d.ts4
-rw-r--r--date-fns/src/isEqual/index.js.flow55
-rw-r--r--date-fns/src/isEqual/index.ts35
-rw-r--r--date-fns/src/isEqual/test.ts51
-rw-r--r--date-fns/src/isExists/benchmark.js21
-rw-r--r--date-fns/src/isExists/index.d.ts4
-rw-r--r--date-fns/src/isExists/index.js.flow52
-rw-r--r--date-fns/src/isExists/index.ts38
-rw-r--r--date-fns/src/isExists/test.ts21
-rw-r--r--date-fns/src/isFirstDayOfMonth/benchmark.js15
-rw-r--r--date-fns/src/isFirstDayOfMonth/index.d.ts4
-rw-r--r--date-fns/src/isFirstDayOfMonth/index.js.flow52
-rw-r--r--date-fns/src/isFirstDayOfMonth/index.ts29
-rw-r--r--date-fns/src/isFirstDayOfMonth/test.ts32
-rw-r--r--date-fns/src/isFriday/benchmark.js15
-rw-r--r--date-fns/src/isFriday/index.d.ts4
-rw-r--r--date-fns/src/isFriday/index.js.flow52
-rw-r--r--date-fns/src/isFriday/index.ts29
-rw-r--r--date-fns/src/isFriday/test.ts31
-rw-r--r--date-fns/src/isFuture/benchmark.js19
-rw-r--r--date-fns/src/isFuture/index.d.ts4
-rw-r--r--date-fns/src/isFuture/index.js.flow52
-rw-r--r--date-fns/src/isFuture/index.ts33
-rw-r--r--date-fns/src/isFuture/test.ts41
-rw-r--r--date-fns/src/isLastDayOfMonth/benchmark.js15
-rw-r--r--date-fns/src/isLastDayOfMonth/index.d.ts4
-rw-r--r--date-fns/src/isLastDayOfMonth/index.js.flow52
-rw-r--r--date-fns/src/isLastDayOfMonth/index.ts32
-rw-r--r--date-fns/src/isLastDayOfMonth/test.ts32
-rw-r--r--date-fns/src/isLeapYear/benchmark.js21
-rw-r--r--date-fns/src/isLeapYear/index.d.ts4
-rw-r--r--date-fns/src/isLeapYear/index.js.flow52
-rw-r--r--date-fns/src/isLeapYear/index.ts31
-rw-r--r--date-fns/src/isLeapYear/test.ts42
-rw-r--r--date-fns/src/isMatch/index.d.ts4
-rw-r--r--date-fns/src/isMatch/index.js300
-rw-r--r--date-fns/src/isMatch/index.js.flow62
-rw-r--r--date-fns/src/isMatch/test.js24
-rw-r--r--date-fns/src/isMonday/benchmark.js15
-rw-r--r--date-fns/src/isMonday/index.d.ts4
-rw-r--r--date-fns/src/isMonday/index.js.flow52
-rw-r--r--date-fns/src/isMonday/index.ts29
-rw-r--r--date-fns/src/isMonday/test.ts31
-rw-r--r--date-fns/src/isPast/benchmark.js19
-rw-r--r--date-fns/src/isPast/index.d.ts4
-rw-r--r--date-fns/src/isPast/index.js.flow52
-rw-r--r--date-fns/src/isPast/index.ts33
-rw-r--r--date-fns/src/isPast/test.ts42
-rw-r--r--date-fns/src/isSameDay/benchmark.js23
-rw-r--r--date-fns/src/isSameDay/index.d.ts4
-rw-r--r--date-fns/src/isSameDay/index.js.flow55
-rw-r--r--date-fns/src/isSameDay/index.ts33
-rw-r--r--date-fns/src/isSameDay/test.ts51
-rw-r--r--date-fns/src/isSameHour/benchmark.js23
-rw-r--r--date-fns/src/isSameHour/index.d.ts4
-rw-r--r--date-fns/src/isSameHour/index.js.flow55
-rw-r--r--date-fns/src/isSameHour/index.ts33
-rw-r--r--date-fns/src/isSameHour/test.ts51
-rw-r--r--date-fns/src/isSameISOWeek/benchmark.js16
-rw-r--r--date-fns/src/isSameISOWeek/index.d.ts4
-rw-r--r--date-fns/src/isSameISOWeek/index.js.flow55
-rw-r--r--date-fns/src/isSameISOWeek/index.ts32
-rw-r--r--date-fns/src/isSameISOWeek/test.ts51
-rw-r--r--date-fns/src/isSameISOWeekYear/benchmark.js16
-rw-r--r--date-fns/src/isSameISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/isSameISOWeekYear/index.js.flow55
-rw-r--r--date-fns/src/isSameISOWeekYear/index.ts40
-rw-r--r--date-fns/src/isSameISOWeekYear/test.ts68
-rw-r--r--date-fns/src/isSameMinute/benchmark.js23
-rw-r--r--date-fns/src/isSameMinute/index.d.ts4
-rw-r--r--date-fns/src/isSameMinute/index.js.flow55
-rw-r--r--date-fns/src/isSameMinute/index.ts37
-rw-r--r--date-fns/src/isSameMinute/test.ts51
-rw-r--r--date-fns/src/isSameMonth/benchmark.js23
-rw-r--r--date-fns/src/isSameMonth/index.d.ts4
-rw-r--r--date-fns/src/isSameMonth/index.js.flow55
-rw-r--r--date-fns/src/isSameMonth/index.ts35
-rw-r--r--date-fns/src/isSameMonth/test.ts51
-rw-r--r--date-fns/src/isSameQuarter/benchmark.js23
-rw-r--r--date-fns/src/isSameQuarter/index.d.ts4
-rw-r--r--date-fns/src/isSameQuarter/index.js.flow55
-rw-r--r--date-fns/src/isSameQuarter/index.ts33
-rw-r--r--date-fns/src/isSameQuarter/test.ts51
-rw-r--r--date-fns/src/isSameSecond/benchmark.js23
-rw-r--r--date-fns/src/isSameSecond/index.d.ts4
-rw-r--r--date-fns/src/isSameSecond/index.js.flow55
-rw-r--r--date-fns/src/isSameSecond/index.ts37
-rw-r--r--date-fns/src/isSameSecond/test.ts51
-rw-r--r--date-fns/src/isSameWeek/benchmark.js23
-rw-r--r--date-fns/src/isSameWeek/index.d.ts4
-rw-r--r--date-fns/src/isSameWeek/index.js.flow59
-rw-r--r--date-fns/src/isSameWeek/index.ts50
-rw-r--r--date-fns/src/isSameWeek/test.ts109
-rw-r--r--date-fns/src/isSameYear/benchmark.js23
-rw-r--r--date-fns/src/isSameYear/index.d.ts4
-rw-r--r--date-fns/src/isSameYear/index.js.flow55
-rw-r--r--date-fns/src/isSameYear/index.ts35
-rw-r--r--date-fns/src/isSameYear/test.ts51
-rw-r--r--date-fns/src/isSaturday/benchmark.js15
-rw-r--r--date-fns/src/isSaturday/index.d.ts4
-rw-r--r--date-fns/src/isSaturday/index.js.flow52
-rw-r--r--date-fns/src/isSaturday/index.ts29
-rw-r--r--date-fns/src/isSaturday/test.ts31
-rw-r--r--date-fns/src/isSunday/benchmark.js15
-rw-r--r--date-fns/src/isSunday/index.d.ts4
-rw-r--r--date-fns/src/isSunday/index.js.flow52
-rw-r--r--date-fns/src/isSunday/index.ts29
-rw-r--r--date-fns/src/isSunday/test.ts31
-rw-r--r--date-fns/src/isThisHour/benchmark.js20
-rw-r--r--date-fns/src/isThisHour/index.d.ts4
-rw-r--r--date-fns/src/isThisHour/index.js.flow52
-rw-r--r--date-fns/src/isThisHour/index.ts34
-rw-r--r--date-fns/src/isThisHour/test.ts39
-rw-r--r--date-fns/src/isThisISOWeek/benchmark.js20
-rw-r--r--date-fns/src/isThisISOWeek/index.d.ts4
-rw-r--r--date-fns/src/isThisISOWeek/index.js.flow52
-rw-r--r--date-fns/src/isThisISOWeek/index.ts36
-rw-r--r--date-fns/src/isThisISOWeek/test.ts36
-rw-r--r--date-fns/src/isThisMinute/benchmark.js20
-rw-r--r--date-fns/src/isThisMinute/index.d.ts4
-rw-r--r--date-fns/src/isThisMinute/index.js.flow52
-rw-r--r--date-fns/src/isThisMinute/index.ts35
-rw-r--r--date-fns/src/isThisMinute/test.ts39
-rw-r--r--date-fns/src/isThisMonth/benchmark.js20
-rw-r--r--date-fns/src/isThisMonth/index.d.ts4
-rw-r--r--date-fns/src/isThisMonth/index.js.flow52
-rw-r--r--date-fns/src/isThisMonth/index.ts34
-rw-r--r--date-fns/src/isThisMonth/test.ts37
-rw-r--r--date-fns/src/isThisQuarter/benchmark.js20
-rw-r--r--date-fns/src/isThisQuarter/index.d.ts4
-rw-r--r--date-fns/src/isThisQuarter/index.js.flow52
-rw-r--r--date-fns/src/isThisQuarter/index.ts33
-rw-r--r--date-fns/src/isThisQuarter/test.ts37
-rw-r--r--date-fns/src/isThisSecond/benchmark.js20
-rw-r--r--date-fns/src/isThisSecond/index.d.ts4
-rw-r--r--date-fns/src/isThisSecond/index.js.flow52
-rw-r--r--date-fns/src/isThisSecond/index.ts34
-rw-r--r--date-fns/src/isThisSecond/test.ts39
-rw-r--r--date-fns/src/isThisWeek/benchmark.js20
-rw-r--r--date-fns/src/isThisWeek/index.d.ts4
-rw-r--r--date-fns/src/isThisWeek/index.js.flow58
-rw-r--r--date-fns/src/isThisWeek/index.ts48
-rw-r--r--date-fns/src/isThisWeek/test.ts42
-rw-r--r--date-fns/src/isThisYear/benchmark.js19
-rw-r--r--date-fns/src/isThisYear/index.d.ts4
-rw-r--r--date-fns/src/isThisYear/index.js.flow52
-rw-r--r--date-fns/src/isThisYear/index.ts33
-rw-r--r--date-fns/src/isThisYear/test.ts37
-rw-r--r--date-fns/src/isThursday/benchmark.js15
-rw-r--r--date-fns/src/isThursday/index.d.ts4
-rw-r--r--date-fns/src/isThursday/index.js.flow52
-rw-r--r--date-fns/src/isThursday/index.ts29
-rw-r--r--date-fns/src/isThursday/test.ts31
-rw-r--r--date-fns/src/isToday/benchmark.js19
-rw-r--r--date-fns/src/isToday/index.d.ts4
-rw-r--r--date-fns/src/isToday/index.js.flow52
-rw-r--r--date-fns/src/isToday/index.ts33
-rw-r--r--date-fns/src/isToday/test.ts37
-rw-r--r--date-fns/src/isTomorrow/benchmark.js19
-rw-r--r--date-fns/src/isTomorrow/index.d.ts4
-rw-r--r--date-fns/src/isTomorrow/index.js.flow52
-rw-r--r--date-fns/src/isTomorrow/index.ts34
-rw-r--r--date-fns/src/isTomorrow/test.ts37
-rw-r--r--date-fns/src/isTuesday/benchmark.js15
-rw-r--r--date-fns/src/isTuesday/index.d.ts4
-rw-r--r--date-fns/src/isTuesday/index.js.flow52
-rw-r--r--date-fns/src/isTuesday/index.ts29
-rw-r--r--date-fns/src/isTuesday/test.ts31
-rw-r--r--date-fns/src/isValid/benchmark.js21
-rw-r--r--date-fns/src/isValid/index.d.ts4
-rw-r--r--date-fns/src/isValid/index.js66
-rw-r--r--date-fns/src/isValid/index.js.flow52
-rw-r--r--date-fns/src/isValid/test.js31
-rw-r--r--date-fns/src/isWednesday/benchmark.js15
-rw-r--r--date-fns/src/isWednesday/index.d.ts4
-rw-r--r--date-fns/src/isWednesday/index.js.flow52
-rw-r--r--date-fns/src/isWednesday/index.ts29
-rw-r--r--date-fns/src/isWednesday/test.ts31
-rw-r--r--date-fns/src/isWeekend/benchmark.js15
-rw-r--r--date-fns/src/isWeekend/index.d.ts4
-rw-r--r--date-fns/src/isWeekend/index.js.flow52
-rw-r--r--date-fns/src/isWeekend/index.ts31
-rw-r--r--date-fns/src/isWeekend/test.ts31
-rw-r--r--date-fns/src/isWithinInterval/benchmark.js25
-rw-r--r--date-fns/src/isWithinInterval/index.d.ts4
-rw-r--r--date-fns/src/isWithinInterval/index.js.flow52
-rw-r--r--date-fns/src/isWithinInterval/index.ts91
-rw-r--r--date-fns/src/isWithinInterval/test.ts104
-rw-r--r--date-fns/src/isYesterday/benchmark.js19
-rw-r--r--date-fns/src/isYesterday/index.d.ts4
-rw-r--r--date-fns/src/isYesterday/index.js.flow52
-rw-r--r--date-fns/src/isYesterday/index.ts34
-rw-r--r--date-fns/src/isYesterday/test.ts38
-rw-r--r--date-fns/src/lastDayOfDecade/benchmark.js15
-rw-r--r--date-fns/src/lastDayOfDecade/index.d.ts4
-rw-r--r--date-fns/src/lastDayOfDecade/index.js.flow52
-rw-r--r--date-fns/src/lastDayOfDecade/index.ts34
-rw-r--r--date-fns/src/lastDayOfDecade/test.ts34
-rw-r--r--date-fns/src/lastDayOfISOWeek/benchmark.js15
-rw-r--r--date-fns/src/lastDayOfISOWeek/index.d.ts4
-rw-r--r--date-fns/src/lastDayOfISOWeek/index.js.flow52
-rw-r--r--date-fns/src/lastDayOfISOWeek/index.ts32
-rw-r--r--date-fns/src/lastDayOfISOWeek/test.ts34
-rw-r--r--date-fns/src/lastDayOfISOWeekYear/benchmark.js15
-rw-r--r--date-fns/src/lastDayOfISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/lastDayOfISOWeekYear/index.js.flow52
-rw-r--r--date-fns/src/lastDayOfISOWeekYear/index.ts45
-rw-r--r--date-fns/src/lastDayOfISOWeekYear/test.ts45
-rw-r--r--date-fns/src/lastDayOfMonth/benchmark.js15
-rw-r--r--date-fns/src/lastDayOfMonth/index.d.ts4
-rw-r--r--date-fns/src/lastDayOfMonth/index.js.flow52
-rw-r--r--date-fns/src/lastDayOfMonth/index.ts34
-rw-r--r--date-fns/src/lastDayOfMonth/test.ts48
-rw-r--r--date-fns/src/lastDayOfQuarter/benchmark.js15
-rw-r--r--date-fns/src/lastDayOfQuarter/index.d.ts4
-rw-r--r--date-fns/src/lastDayOfQuarter/index.js.flow57
-rw-r--r--date-fns/src/lastDayOfQuarter/index.ts38
-rw-r--r--date-fns/src/lastDayOfQuarter/test.ts34
-rw-r--r--date-fns/src/lastDayOfWeek/benchmark.js15
-rw-r--r--date-fns/src/lastDayOfWeek/index.d.ts4
-rw-r--r--date-fns/src/lastDayOfWeek/index.js.flow58
-rw-r--r--date-fns/src/lastDayOfWeek/index.ts66
-rw-r--r--date-fns/src/lastDayOfWeek/test.ts111
-rw-r--r--date-fns/src/lastDayOfYear/benchmark.js15
-rw-r--r--date-fns/src/lastDayOfYear/index.d.ts4
-rw-r--r--date-fns/src/lastDayOfYear/index.js.flow52
-rw-r--r--date-fns/src/lastDayOfYear/index.ts34
-rw-r--r--date-fns/src/lastDayOfYear/test.ts34
-rw-r--r--date-fns/src/lightFormat/index.d.ts4
-rw-r--r--date-fns/src/lightFormat/index.js.flow52
-rw-r--r--date-fns/src/lightFormat/index.ts144
-rw-r--r--date-fns/src/lightFormat/test.ts158
-rw-r--r--date-fns/src/locale/_lib/buildFormatLongFn/index.js8
-rw-r--r--date-fns/src/locale/_lib/buildLocalizeFn/index.js23
-rw-r--r--date-fns/src/locale/_lib/buildMatchFn/index.js56
-rw-r--r--date-fns/src/locale/_lib/buildMatchPatternFn/index.js24
-rw-r--r--date-fns/src/locale/af/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/af/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/af/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/af/_lib/localize/index.js176
-rw-r--r--date-fns/src/locale/af/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/af/index.d.ts4
-rw-r--r--date-fns/src/locale/af/index.js28
-rw-r--r--date-fns/src/locale/af/index.js.flow35
-rw-r--r--date-fns/src/locale/af/snapshot.md304
-rw-r--r--date-fns/src/locale/ar-DZ/_lib/formatDistance/index.js135
-rw-r--r--date-fns/src/locale/ar-DZ/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ar-DZ/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ar-DZ/_lib/localize/index.js163
-rw-r--r--date-fns/src/locale/ar-DZ/_lib/match/index.js147
-rw-r--r--date-fns/src/locale/ar-DZ/index.d.ts4
-rw-r--r--date-fns/src/locale/ar-DZ/index.js29
-rw-r--r--date-fns/src/locale/ar-DZ/index.js.flow35
-rw-r--r--date-fns/src/locale/ar-DZ/snapshot.md304
-rw-r--r--date-fns/src/locale/ar-MA/_lib/formatDistance/index.js135
-rw-r--r--date-fns/src/locale/ar-MA/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ar-MA/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ar-MA/_lib/localize/index.js163
-rw-r--r--date-fns/src/locale/ar-MA/_lib/match/index.js146
-rw-r--r--date-fns/src/locale/ar-MA/index.d.ts4
-rw-r--r--date-fns/src/locale/ar-MA/index.js29
-rw-r--r--date-fns/src/locale/ar-MA/index.js.flow35
-rw-r--r--date-fns/src/locale/ar-MA/snapshot.md304
-rw-r--r--date-fns/src/locale/ar-SA/_lib/formatDistance/index.js135
-rw-r--r--date-fns/src/locale/ar-SA/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ar-SA/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ar-SA/_lib/localize/index.js163
-rw-r--r--date-fns/src/locale/ar-SA/_lib/match/index.js146
-rw-r--r--date-fns/src/locale/ar-SA/index.d.ts4
-rw-r--r--date-fns/src/locale/ar-SA/index.js28
-rw-r--r--date-fns/src/locale/ar-SA/index.js.flow35
-rw-r--r--date-fns/src/locale/ar-SA/snapshot.md304
-rw-r--r--date-fns/src/locale/ar/_lib/formatDistance/index.js91
-rw-r--r--date-fns/src/locale/ar/_lib/formatLong/index.js12
-rw-r--r--date-fns/src/locale/ar/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ar/_lib/localize/index.js71
-rw-r--r--date-fns/src/locale/ar/_lib/match/index.js60
-rw-r--r--date-fns/src/locale/ar/index.d.ts4
-rw-r--r--date-fns/src/locale/ar/index.js32
-rw-r--r--date-fns/src/locale/ar/index.js.flow35
-rw-r--r--date-fns/src/locale/az/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/az/_lib/formatLong/index.js39
-rw-r--r--date-fns/src/locale/az/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/az/_lib/localize/index.js194
-rw-r--r--date-fns/src/locale/az/_lib/match/index.js166
-rw-r--r--date-fns/src/locale/az/index.d.ts4
-rw-r--r--date-fns/src/locale/az/index.js28
-rw-r--r--date-fns/src/locale/az/index.js.flow35
-rw-r--r--date-fns/src/locale/az/snapshot.md304
-rw-r--r--date-fns/src/locale/be/_lib/formatDistance/index.js257
-rw-r--r--date-fns/src/locale/be/_lib/formatLong/index.js38
-rw-r--r--date-fns/src/locale/be/_lib/formatRelative/index.js82
-rw-r--r--date-fns/src/locale/be/_lib/localize/index.js227
-rw-r--r--date-fns/src/locale/be/_lib/match/index.js138
-rw-r--r--date-fns/src/locale/be/index.d.ts4
-rw-r--r--date-fns/src/locale/be/index.js29
-rw-r--r--date-fns/src/locale/be/index.js.flow35
-rw-r--r--date-fns/src/locale/be/snapshot.md304
-rw-r--r--date-fns/src/locale/bg/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/bg/_lib/formatLong/index.js38
-rw-r--r--date-fns/src/locale/bg/_lib/formatRelative/index.js88
-rw-r--r--date-fns/src/locale/bg/_lib/localize/index.js155
-rw-r--r--date-fns/src/locale/bg/_lib/match/index.js123
-rw-r--r--date-fns/src/locale/bg/index.d.ts4
-rw-r--r--date-fns/src/locale/bg/index.js29
-rw-r--r--date-fns/src/locale/bg/index.js.flow35
-rw-r--r--date-fns/src/locale/bg/snapshot.md304
-rw-r--r--date-fns/src/locale/bn/_lib/formatDistance/index.js106
-rw-r--r--date-fns/src/locale/bn/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/bn/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/bn/_lib/localize/index.js265
-rw-r--r--date-fns/src/locale/bn/_lib/match/index.js144
-rw-r--r--date-fns/src/locale/bn/index.d.ts4
-rw-r--r--date-fns/src/locale/bn/index.js29
-rw-r--r--date-fns/src/locale/bn/index.js.flow35
-rw-r--r--date-fns/src/locale/bn/snapshot.md304
-rw-r--r--date-fns/src/locale/ca/_lib/formatDistance/index.js116
-rw-r--r--date-fns/src/locale/ca/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ca/_lib/formatRelative/index.js24
-rw-r--r--date-fns/src/locale/ca/_lib/localize/index.js236
-rw-r--r--date-fns/src/locale/ca/_lib/match/index.js163
-rw-r--r--date-fns/src/locale/ca/index.d.ts4
-rw-r--r--date-fns/src/locale/ca/index.js31
-rw-r--r--date-fns/src/locale/ca/index.js.flow35
-rw-r--r--date-fns/src/locale/ca/snapshot.md304
-rw-r--r--date-fns/src/locale/cs/_lib/formatDistance/index.js318
-rw-r--r--date-fns/src/locale/cs/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/cs/_lib/formatRelative/index.js31
-rw-r--r--date-fns/src/locale/cs/_lib/localize/index.js192
-rw-r--r--date-fns/src/locale/cs/_lib/match/index.js139
-rw-r--r--date-fns/src/locale/cs/index.d.ts4
-rw-r--r--date-fns/src/locale/cs/index.js30
-rw-r--r--date-fns/src/locale/cs/index.js.flow35
-rw-r--r--date-fns/src/locale/cs/snapshot.md304
-rw-r--r--date-fns/src/locale/cy/_lib/formatDistance/index.js114
-rw-r--r--date-fns/src/locale/cy/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/cy/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/cy/_lib/localize/index.js204
-rw-r--r--date-fns/src/locale/cy/_lib/match/index.js147
-rw-r--r--date-fns/src/locale/cy/index.d.ts4
-rw-r--r--date-fns/src/locale/cy/index.js28
-rw-r--r--date-fns/src/locale/cy/index.js.flow35
-rw-r--r--date-fns/src/locale/cy/snapshot.md304
-rw-r--r--date-fns/src/locale/da/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/da/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/da/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/da/_lib/localize/index.js162
-rw-r--r--date-fns/src/locale/da/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/da/index.d.ts4
-rw-r--r--date-fns/src/locale/da/index.js31
-rw-r--r--date-fns/src/locale/da/index.js.flow35
-rw-r--r--date-fns/src/locale/da/snapshot.md304
-rw-r--r--date-fns/src/locale/de-AT/_lib/localize/index.js172
-rw-r--r--date-fns/src/locale/de-AT/index.d.ts4
-rw-r--r--date-fns/src/locale/de-AT/index.js29
-rw-r--r--date-fns/src/locale/de-AT/index.js.flow35
-rw-r--r--date-fns/src/locale/de-AT/snapshot.md304
-rw-r--r--date-fns/src/locale/de/_lib/formatDistance/index.js198
-rw-r--r--date-fns/src/locale/de/_lib/formatLong/index.js42
-rw-r--r--date-fns/src/locale/de/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/de/_lib/localize/index.js172
-rw-r--r--date-fns/src/locale/de/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/de/index.d.ts4
-rw-r--r--date-fns/src/locale/de/index.js32
-rw-r--r--date-fns/src/locale/de/index.js.flow35
-rw-r--r--date-fns/src/locale/de/snapshot.md304
-rw-r--r--date-fns/src/locale/el/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/el/_lib/formatLong/index.js39
-rw-r--r--date-fns/src/locale/el/_lib/formatRelative/index.js23
-rw-r--r--date-fns/src/locale/el/_lib/localize/index.js178
-rw-r--r--date-fns/src/locale/el/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/el/index.d.ts4
-rw-r--r--date-fns/src/locale/el/index.js29
-rw-r--r--date-fns/src/locale/el/index.js.flow35
-rw-r--r--date-fns/src/locale/el/snapshot.md304
-rw-r--r--date-fns/src/locale/en-AU/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/en-AU/index.d.ts4
-rw-r--r--date-fns/src/locale/en-AU/index.js28
-rw-r--r--date-fns/src/locale/en-AU/index.js.flow35
-rw-r--r--date-fns/src/locale/en-AU/snapshot.md304
-rw-r--r--date-fns/src/locale/en-CA/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/en-CA/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/en-CA/index.d.ts4
-rw-r--r--date-fns/src/locale/en-CA/index.js29
-rw-r--r--date-fns/src/locale/en-CA/index.js.flow35
-rw-r--r--date-fns/src/locale/en-CA/snapshot.md304
-rw-r--r--date-fns/src/locale/en-GB/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/en-GB/index.d.ts4
-rw-r--r--date-fns/src/locale/en-GB/index.js28
-rw-r--r--date-fns/src/locale/en-GB/index.js.flow35
-rw-r--r--date-fns/src/locale/en-GB/snapshot.md304
-rw-r--r--date-fns/src/locale/en-IN/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/en-IN/index.d.ts4
-rw-r--r--date-fns/src/locale/en-IN/index.js28
-rw-r--r--date-fns/src/locale/en-IN/index.js.flow35
-rw-r--r--date-fns/src/locale/en-IN/snapshot.md304
-rw-r--r--date-fns/src/locale/en-NZ/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/en-NZ/index.d.ts4
-rw-r--r--date-fns/src/locale/en-NZ/index.js28
-rw-r--r--date-fns/src/locale/en-NZ/index.js.flow35
-rw-r--r--date-fns/src/locale/en-NZ/snapshot.md304
-rw-r--r--date-fns/src/locale/en-US/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/en-US/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/en-US/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/en-US/_lib/localize/index.js192
-rw-r--r--date-fns/src/locale/en-US/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/en-US/index.d.ts4
-rw-r--r--date-fns/src/locale/en-US/index.js29
-rw-r--r--date-fns/src/locale/en-US/index.js.flow35
-rw-r--r--date-fns/src/locale/en-US/snapshot.md304
-rw-r--r--date-fns/src/locale/en-ZA/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/en-ZA/index.d.ts4
-rw-r--r--date-fns/src/locale/en-ZA/index.js28
-rw-r--r--date-fns/src/locale/en-ZA/index.js.flow35
-rw-r--r--date-fns/src/locale/en-ZA/snapshot.md304
-rw-r--r--date-fns/src/locale/eo/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/eo/_lib/formatLong/index.js38
-rw-r--r--date-fns/src/locale/eo/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/eo/_lib/localize/index.js124
-rw-r--r--date-fns/src/locale/eo/_lib/match/index.js138
-rw-r--r--date-fns/src/locale/eo/index.d.ts4
-rw-r--r--date-fns/src/locale/eo/index.js28
-rw-r--r--date-fns/src/locale/eo/index.js.flow35
-rw-r--r--date-fns/src/locale/eo/snapshot.md304
-rw-r--r--date-fns/src/locale/es/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/es/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/es/_lib/formatRelative/index.js24
-rw-r--r--date-fns/src/locale/es/_lib/localize/index.js166
-rw-r--r--date-fns/src/locale/es/_lib/match/index.js141
-rw-r--r--date-fns/src/locale/es/index.d.ts4
-rw-r--r--date-fns/src/locale/es/index.js32
-rw-r--r--date-fns/src/locale/es/index.js.flow35
-rw-r--r--date-fns/src/locale/es/snapshot.md304
-rw-r--r--date-fns/src/locale/et/_lib/formatDistance/index.js198
-rw-r--r--date-fns/src/locale/et/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/et/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/et/_lib/localize/index.js176
-rw-r--r--date-fns/src/locale/et/_lib/match/index.js139
-rw-r--r--date-fns/src/locale/et/index.d.ts4
-rw-r--r--date-fns/src/locale/et/index.js28
-rw-r--r--date-fns/src/locale/et/index.js.flow35
-rw-r--r--date-fns/src/locale/et/snapshot.md304
-rw-r--r--date-fns/src/locale/eu/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/eu/_lib/formatLong/index.js40
-rw-r--r--date-fns/src/locale/eu/_lib/formatRelative/index.js24
-rw-r--r--date-fns/src/locale/eu/_lib/localize/index.js167
-rw-r--r--date-fns/src/locale/eu/_lib/match/index.js159
-rw-r--r--date-fns/src/locale/eu/index.d.ts4
-rw-r--r--date-fns/src/locale/eu/index.js28
-rw-r--r--date-fns/src/locale/eu/index.js.flow35
-rw-r--r--date-fns/src/locale/eu/snapshot.md304
-rw-r--r--date-fns/src/locale/fa-IR/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/fa-IR/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/fa-IR/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/fa-IR/_lib/localize/index.js169
-rw-r--r--date-fns/src/locale/fa-IR/_lib/match/index.js146
-rw-r--r--date-fns/src/locale/fa-IR/index.d.ts4
-rw-r--r--date-fns/src/locale/fa-IR/index.js28
-rw-r--r--date-fns/src/locale/fa-IR/index.js.flow35
-rw-r--r--date-fns/src/locale/fa-IR/snapshot.md304
-rw-r--r--date-fns/src/locale/fi/_lib/formatDistance/index.js145
-rw-r--r--date-fns/src/locale/fi/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/fi/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/fi/_lib/localize/index.js147
-rw-r--r--date-fns/src/locale/fi/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/fi/index.d.ts4
-rw-r--r--date-fns/src/locale/fi/index.js30
-rw-r--r--date-fns/src/locale/fi/index.js.flow35
-rw-r--r--date-fns/src/locale/fi/snapshot.md304
-rw-r--r--date-fns/src/locale/fil/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/fil/_lib/formatLong/index.js12
-rw-r--r--date-fns/src/locale/fil/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/fil/_lib/localize/index.js83
-rw-r--r--date-fns/src/locale/fil/_lib/match/index.js60
-rw-r--r--date-fns/src/locale/fil/index.d.ts4
-rw-r--r--date-fns/src/locale/fil/index.js32
-rw-r--r--date-fns/src/locale/fil/index.js.flow35
-rw-r--r--date-fns/src/locale/fr-CA/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/fr-CA/index.d.ts4
-rw-r--r--date-fns/src/locale/fr-CA/index.js35
-rw-r--r--date-fns/src/locale/fr-CA/index.js.flow35
-rw-r--r--date-fns/src/locale/fr-CA/snapshot.md304
-rw-r--r--date-fns/src/locale/fr-CH/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/fr-CH/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/fr-CH/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/fr-CH/_lib/formatters/index.js17
-rw-r--r--date-fns/src/locale/fr-CH/_lib/localize/index.js155
-rw-r--r--date-fns/src/locale/fr-CH/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/fr-CH/index.d.ts4
-rw-r--r--date-fns/src/locale/fr-CH/index.js32
-rw-r--r--date-fns/src/locale/fr-CH/index.js.flow35
-rw-r--r--date-fns/src/locale/fr-CH/snapshot.md304
-rw-r--r--date-fns/src/locale/fr/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/fr/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/fr/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/fr/_lib/formatters/index.js17
-rw-r--r--date-fns/src/locale/fr/_lib/localize/index.js155
-rw-r--r--date-fns/src/locale/fr/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/fr/index.d.ts4
-rw-r--r--date-fns/src/locale/fr/index.js30
-rw-r--r--date-fns/src/locale/fr/index.js.flow35
-rw-r--r--date-fns/src/locale/fr/snapshot.md304
-rw-r--r--date-fns/src/locale/gd/_lib/formatDistance/index.js115
-rw-r--r--date-fns/src/locale/gd/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/gd/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/gd/_lib/localize/index.js200
-rw-r--r--date-fns/src/locale/gd/_lib/match/index.js138
-rw-r--r--date-fns/src/locale/gd/index.d.ts4
-rw-r--r--date-fns/src/locale/gd/index.js28
-rw-r--r--date-fns/src/locale/gd/index.js.flow35
-rw-r--r--date-fns/src/locale/gd/snapshot.md304
-rw-r--r--date-fns/src/locale/gl/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/gl/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/gl/_lib/formatRelative/index.js24
-rw-r--r--date-fns/src/locale/gl/_lib/localize/index.js158
-rw-r--r--date-fns/src/locale/gl/_lib/match/index.js141
-rw-r--r--date-fns/src/locale/gl/index.d.ts4
-rw-r--r--date-fns/src/locale/gl/index.js29
-rw-r--r--date-fns/src/locale/gl/index.js.flow35
-rw-r--r--date-fns/src/locale/gl/snapshot.md304
-rw-r--r--date-fns/src/locale/gu/_lib/formatDistance/index.js102
-rw-r--r--date-fns/src/locale/gu/_lib/formatLong/index.js42
-rw-r--r--date-fns/src/locale/gu/_lib/formatRelative/index.js14
-rw-r--r--date-fns/src/locale/gu/_lib/localize/index.js181
-rw-r--r--date-fns/src/locale/gu/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/gu/index.d.ts4
-rw-r--r--date-fns/src/locale/gu/index.js28
-rw-r--r--date-fns/src/locale/gu/index.js.flow35
-rw-r--r--date-fns/src/locale/gu/snapshot.md304
-rw-r--r--date-fns/src/locale/he/_lib/formatDistance/index.js131
-rw-r--r--date-fns/src/locale/he/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/he/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/he/_lib/localize/index.js209
-rw-r--r--date-fns/src/locale/he/_lib/match/index.js140
-rw-r--r--date-fns/src/locale/he/index.d.ts4
-rw-r--r--date-fns/src/locale/he/index.js28
-rw-r--r--date-fns/src/locale/he/index.js.flow35
-rw-r--r--date-fns/src/locale/he/snapshot.md304
-rw-r--r--date-fns/src/locale/hi/_lib/formatDistance/index.js106
-rw-r--r--date-fns/src/locale/hi/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/hi/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/hi/_lib/localize/index.js244
-rw-r--r--date-fns/src/locale/hi/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/hi/index.d.ts4
-rw-r--r--date-fns/src/locale/hi/index.js28
-rw-r--r--date-fns/src/locale/hi/index.js.flow35
-rw-r--r--date-fns/src/locale/hi/snapshot.md304
-rw-r--r--date-fns/src/locale/hr/_lib/formatDistance/index.js191
-rw-r--r--date-fns/src/locale/hr/_lib/formatLong/index.js39
-rw-r--r--date-fns/src/locale/hr/_lib/formatRelative/index.js44
-rw-r--r--date-fns/src/locale/hr/_lib/localize/index.js222
-rw-r--r--date-fns/src/locale/hr/_lib/match/index.js132
-rw-r--r--date-fns/src/locale/hr/index.d.ts4
-rw-r--r--date-fns/src/locale/hr/index.js30
-rw-r--r--date-fns/src/locale/hr/index.js.flow35
-rw-r--r--date-fns/src/locale/hr/snapshot.md304
-rw-r--r--date-fns/src/locale/ht/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/ht/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ht/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ht/_lib/formatters/index.js19
-rw-r--r--date-fns/src/locale/ht/_lib/localize/index.js147
-rw-r--r--date-fns/src/locale/ht/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/ht/index.d.ts4
-rw-r--r--date-fns/src/locale/ht/index.js30
-rw-r--r--date-fns/src/locale/ht/index.js.flow35
-rw-r--r--date-fns/src/locale/ht/snapshot.md304
-rw-r--r--date-fns/src/locale/hu/_lib/formatDistance/index.js92
-rw-r--r--date-fns/src/locale/hu/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/hu/_lib/formatRelative/index.js40
-rw-r--r--date-fns/src/locale/hu/_lib/localize/index.js140
-rw-r--r--date-fns/src/locale/hu/_lib/match/index.js138
-rw-r--r--date-fns/src/locale/hu/index.d.ts4
-rw-r--r--date-fns/src/locale/hu/index.js33
-rw-r--r--date-fns/src/locale/hu/index.js.flow35
-rw-r--r--date-fns/src/locale/hu/snapshot.md304
-rw-r--r--date-fns/src/locale/hy/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/hy/_lib/formatLong/index.js36
-rw-r--r--date-fns/src/locale/hy/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/hy/_lib/localize/index.js179
-rw-r--r--date-fns/src/locale/hy/_lib/match/index.js139
-rw-r--r--date-fns/src/locale/hy/index.d.ts4
-rw-r--r--date-fns/src/locale/hy/index.js29
-rw-r--r--date-fns/src/locale/hy/index.js.flow35
-rw-r--r--date-fns/src/locale/hy/snapshot.md304
-rw-r--r--date-fns/src/locale/id/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/id/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/id/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/id/_lib/localize/index.js169
-rw-r--r--date-fns/src/locale/id/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/id/index.d.ts4
-rw-r--r--date-fns/src/locale/id/index.js31
-rw-r--r--date-fns/src/locale/id/index.js.flow35
-rw-r--r--date-fns/src/locale/id/snapshot.md304
-rw-r--r--date-fns/src/locale/index.js82
-rw-r--r--date-fns/src/locale/index.js.flow118
-rw-r--r--date-fns/src/locale/is/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/is/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/is/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/is/_lib/localize/index.js167
-rw-r--r--date-fns/src/locale/is/_lib/match/index.js141
-rw-r--r--date-fns/src/locale/is/index.d.ts4
-rw-r--r--date-fns/src/locale/is/index.js29
-rw-r--r--date-fns/src/locale/is/index.js.flow35
-rw-r--r--date-fns/src/locale/is/snapshot.md304
-rw-r--r--date-fns/src/locale/it/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/it/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/it/_lib/formatRelative/index.js66
-rw-r--r--date-fns/src/locale/it/_lib/localize/index.js166
-rw-r--r--date-fns/src/locale/it/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/it/index.d.ts4
-rw-r--r--date-fns/src/locale/it/index.js30
-rw-r--r--date-fns/src/locale/it/index.js.flow35
-rw-r--r--date-fns/src/locale/it/snapshot.md304
-rw-r--r--date-fns/src/locale/ja/_lib/formatDistance/index.js116
-rw-r--r--date-fns/src/locale/ja/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ja/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ja/_lib/localize/index.js180
-rw-r--r--date-fns/src/locale/ja/_lib/match/index.js122
-rw-r--r--date-fns/src/locale/ja/index.d.ts4
-rw-r--r--date-fns/src/locale/ja/index.js32
-rw-r--r--date-fns/src/locale/ja/index.js.flow35
-rw-r--r--date-fns/src/locale/ja/snapshot.md304
-rw-r--r--date-fns/src/locale/ka/_lib/formatDistance/index.js114
-rw-r--r--date-fns/src/locale/ka/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ka/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ka/_lib/localize/index.js198
-rw-r--r--date-fns/src/locale/ka/_lib/match/index.js121
-rw-r--r--date-fns/src/locale/ka/index.d.ts4
-rw-r--r--date-fns/src/locale/ka/index.js29
-rw-r--r--date-fns/src/locale/ka/index.js.flow35
-rw-r--r--date-fns/src/locale/ka/snapshot.md304
-rw-r--r--date-fns/src/locale/kk/_lib/formatDistance/index.js246
-rw-r--r--date-fns/src/locale/kk/_lib/formatLong/index.js38
-rw-r--r--date-fns/src/locale/kk/_lib/formatRelative/index.js62
-rw-r--r--date-fns/src/locale/kk/_lib/localize/index.js203
-rw-r--r--date-fns/src/locale/kk/_lib/match/index.js160
-rw-r--r--date-fns/src/locale/kk/index.d.ts4
-rw-r--r--date-fns/src/locale/kk/index.js28
-rw-r--r--date-fns/src/locale/kk/index.js.flow35
-rw-r--r--date-fns/src/locale/kk/snapshot.md304
-rw-r--r--date-fns/src/locale/kn/_lib/formatDistance/index.js203
-rw-r--r--date-fns/src/locale/kn/_lib/formatLong/index.js42
-rw-r--r--date-fns/src/locale/kn/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/kn/_lib/localize/index.js171
-rw-r--r--date-fns/src/locale/kn/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/kn/index.d.ts4
-rw-r--r--date-fns/src/locale/kn/index.js28
-rw-r--r--date-fns/src/locale/kn/index.js.flow35
-rw-r--r--date-fns/src/locale/kn/snapshot.md304
-rw-r--r--date-fns/src/locale/ko/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/ko/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ko/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ko/_lib/localize/index.js171
-rw-r--r--date-fns/src/locale/ko/_lib/match/index.js126
-rw-r--r--date-fns/src/locale/ko/index.d.ts4
-rw-r--r--date-fns/src/locale/ko/index.js30
-rw-r--r--date-fns/src/locale/ko/index.js.flow35
-rw-r--r--date-fns/src/locale/ko/snapshot.md304
-rw-r--r--date-fns/src/locale/lb/_lib/formatDistance/index.js231
-rw-r--r--date-fns/src/locale/lb/_lib/formatLong/index.js42
-rw-r--r--date-fns/src/locale/lb/_lib/formatRelative/index.js27
-rw-r--r--date-fns/src/locale/lb/_lib/localize/index.js167
-rw-r--r--date-fns/src/locale/lb/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/lb/index.d.ts4
-rw-r--r--date-fns/src/locale/lb/index.js28
-rw-r--r--date-fns/src/locale/lb/index.js.flow35
-rw-r--r--date-fns/src/locale/lb/snapshot.md304
-rw-r--r--date-fns/src/locale/lt/_lib/formatDistance/index.js165
-rw-r--r--date-fns/src/locale/lt/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/lt/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/lt/_lib/localize/index.js225
-rw-r--r--date-fns/src/locale/lt/_lib/match/index.js150
-rw-r--r--date-fns/src/locale/lt/index.d.ts4
-rw-r--r--date-fns/src/locale/lt/index.js32
-rw-r--r--date-fns/src/locale/lt/index.js.flow35
-rw-r--r--date-fns/src/locale/lt/snapshot.md304
-rw-r--r--date-fns/src/locale/lv/_lib/formatDistance/index.js158
-rw-r--r--date-fns/src/locale/lv/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/lv/_lib/formatRelative/index.js43
-rw-r--r--date-fns/src/locale/lv/_lib/localize/index.js250
-rw-r--r--date-fns/src/locale/lv/_lib/match/index.js140
-rw-r--r--date-fns/src/locale/lv/index.d.ts4
-rw-r--r--date-fns/src/locale/lv/index.js28
-rw-r--r--date-fns/src/locale/lv/index.js.flow35
-rw-r--r--date-fns/src/locale/lv/snapshot.md304
-rw-r--r--date-fns/src/locale/mk/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/mk/_lib/formatLong/index.js38
-rw-r--r--date-fns/src/locale/mk/_lib/formatRelative/index.js92
-rw-r--r--date-fns/src/locale/mk/_lib/localize/index.js124
-rw-r--r--date-fns/src/locale/mk/_lib/match/index.js124
-rw-r--r--date-fns/src/locale/mk/index.d.ts4
-rw-r--r--date-fns/src/locale/mk/index.js29
-rw-r--r--date-fns/src/locale/mk/index.js.flow35
-rw-r--r--date-fns/src/locale/mk/snapshot.md304
-rw-r--r--date-fns/src/locale/mn/_lib/formatDistance/index.js138
-rw-r--r--date-fns/src/locale/mn/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/mn/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/mn/_lib/localize/index.js208
-rw-r--r--date-fns/src/locale/mn/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/mn/index.d.ts4
-rw-r--r--date-fns/src/locale/mn/index.js28
-rw-r--r--date-fns/src/locale/mn/index.js.flow35
-rw-r--r--date-fns/src/locale/mn/snapshot.md304
-rw-r--r--date-fns/src/locale/ms/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/ms/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ms/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ms/_lib/localize/index.js169
-rw-r--r--date-fns/src/locale/ms/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/ms/index.d.ts4
-rw-r--r--date-fns/src/locale/ms/index.js28
-rw-r--r--date-fns/src/locale/ms/index.js.flow35
-rw-r--r--date-fns/src/locale/ms/snapshot.md304
-rw-r--r--date-fns/src/locale/mt/_lib/formatDistance/index.js108
-rw-r--r--date-fns/src/locale/mt/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/mt/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/mt/_lib/localize/index.js167
-rw-r--r--date-fns/src/locale/mt/_lib/match/index.js145
-rw-r--r--date-fns/src/locale/mt/index.d.ts4
-rw-r--r--date-fns/src/locale/mt/index.js29
-rw-r--r--date-fns/src/locale/mt/index.js.flow35
-rw-r--r--date-fns/src/locale/mt/snapshot.md304
-rw-r--r--date-fns/src/locale/nb/_lib/formatDistance/index.js127
-rw-r--r--date-fns/src/locale/nb/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/nb/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/nb/_lib/localize/index.js124
-rw-r--r--date-fns/src/locale/nb/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/nb/index.d.ts4
-rw-r--r--date-fns/src/locale/nb/index.js30
-rw-r--r--date-fns/src/locale/nb/index.js.flow35
-rw-r--r--date-fns/src/locale/nb/snapshot.md304
-rw-r--r--date-fns/src/locale/nl-BE/_lib/formatDistance/index.js86
-rw-r--r--date-fns/src/locale/nl-BE/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/nl-BE/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/nl-BE/_lib/localize/index.js132
-rw-r--r--date-fns/src/locale/nl-BE/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/nl-BE/index.d.ts4
-rw-r--r--date-fns/src/locale/nl-BE/index.js31
-rw-r--r--date-fns/src/locale/nl-BE/index.js.flow35
-rw-r--r--date-fns/src/locale/nl-BE/snapshot.md304
-rw-r--r--date-fns/src/locale/nl/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/nl/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/nl/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/nl/_lib/localize/index.js132
-rw-r--r--date-fns/src/locale/nl/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/nl/index.d.ts4
-rw-r--r--date-fns/src/locale/nl/index.js33
-rw-r--r--date-fns/src/locale/nl/index.js.flow35
-rw-r--r--date-fns/src/locale/nl/snapshot.md304
-rw-r--r--date-fns/src/locale/nn/_lib/formatDistance/index.js127
-rw-r--r--date-fns/src/locale/nn/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/nn/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/nn/_lib/localize/index.js124
-rw-r--r--date-fns/src/locale/nn/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/nn/index.d.ts4
-rw-r--r--date-fns/src/locale/nn/index.js28
-rw-r--r--date-fns/src/locale/nn/index.js.flow35
-rw-r--r--date-fns/src/locale/nn/snapshot.md304
-rw-r--r--date-fns/src/locale/pl/_lib/formatDistance/index.js169
-rw-r--r--date-fns/src/locale/pl/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/pl/_lib/formatRelative/index.js69
-rw-r--r--date-fns/src/locale/pl/_lib/localize/index.js215
-rw-r--r--date-fns/src/locale/pl/_lib/match/index.js149
-rw-r--r--date-fns/src/locale/pl/index.d.ts4
-rw-r--r--date-fns/src/locale/pl/index.js31
-rw-r--r--date-fns/src/locale/pl/index.js.flow35
-rw-r--r--date-fns/src/locale/pl/snapshot.md304
-rw-r--r--date-fns/src/locale/pt-BR/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/pt-BR/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/pt-BR/_lib/formatRelative/index.js22
-rw-r--r--date-fns/src/locale/pt-BR/_lib/localize/index.js164
-rw-r--r--date-fns/src/locale/pt-BR/_lib/match/index.js139
-rw-r--r--date-fns/src/locale/pt-BR/index.d.ts4
-rw-r--r--date-fns/src/locale/pt-BR/index.js29
-rw-r--r--date-fns/src/locale/pt-BR/index.js.flow35
-rw-r--r--date-fns/src/locale/pt-BR/snapshot.md304
-rw-r--r--date-fns/src/locale/pt/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/pt/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/pt/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/pt/_lib/localize/index.js166
-rw-r--r--date-fns/src/locale/pt/_lib/match/index.js141
-rw-r--r--date-fns/src/locale/pt/index.d.ts4
-rw-r--r--date-fns/src/locale/pt/index.js29
-rw-r--r--date-fns/src/locale/pt/index.js.flow35
-rw-r--r--date-fns/src/locale/pt/snapshot.md304
-rw-r--r--date-fns/src/locale/ro/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/ro/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ro/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ro/_lib/localize/index.js164
-rw-r--r--date-fns/src/locale/ro/_lib/match/index.js146
-rw-r--r--date-fns/src/locale/ro/index.d.ts4
-rw-r--r--date-fns/src/locale/ro/index.js30
-rw-r--r--date-fns/src/locale/ro/index.js.flow35
-rw-r--r--date-fns/src/locale/ro/snapshot.md304
-rw-r--r--date-fns/src/locale/ru/_lib/formatDistance/index.js247
-rw-r--r--date-fns/src/locale/ru/_lib/formatLong/index.js38
-rw-r--r--date-fns/src/locale/ru/_lib/formatRelative/index.js88
-rw-r--r--date-fns/src/locale/ru/_lib/localize/index.js210
-rw-r--r--date-fns/src/locale/ru/_lib/match/index.js138
-rw-r--r--date-fns/src/locale/ru/index.d.ts4
-rw-r--r--date-fns/src/locale/ru/index.js29
-rw-r--r--date-fns/src/locale/ru/index.js.flow35
-rw-r--r--date-fns/src/locale/ru/snapshot.md304
-rw-r--r--date-fns/src/locale/sk/_lib/formatDistance/index.js231
-rw-r--r--date-fns/src/locale/sk/_lib/formatLong/index.js44
-rw-r--r--date-fns/src/locale/sk/_lib/formatRelative/index.js81
-rw-r--r--date-fns/src/locale/sk/_lib/localize/index.js204
-rw-r--r--date-fns/src/locale/sk/_lib/match/index.js138
-rw-r--r--date-fns/src/locale/sk/index.d.ts4
-rw-r--r--date-fns/src/locale/sk/index.js28
-rw-r--r--date-fns/src/locale/sk/index.js.flow35
-rw-r--r--date-fns/src/locale/sk/snapshot.md304
-rw-r--r--date-fns/src/locale/sl/_lib/formatDistance/index.js338
-rw-r--r--date-fns/src/locale/sl/_lib/formatLong/index.js39
-rw-r--r--date-fns/src/locale/sl/_lib/formatRelative/index.js44
-rw-r--r--date-fns/src/locale/sl/_lib/localize/index.js162
-rw-r--r--date-fns/src/locale/sl/_lib/match/index.js155
-rw-r--r--date-fns/src/locale/sl/index.d.ts4
-rw-r--r--date-fns/src/locale/sl/index.js29
-rw-r--r--date-fns/src/locale/sl/index.js.flow35
-rw-r--r--date-fns/src/locale/sl/snapshot.md304
-rw-r--r--date-fns/src/locale/sq/_lib/formatDistance/index.js86
-rw-r--r--date-fns/src/locale/sq/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/sq/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/sq/_lib/localize/index.js181
-rw-r--r--date-fns/src/locale/sq/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/sq/index.d.ts4
-rw-r--r--date-fns/src/locale/sq/index.js28
-rw-r--r--date-fns/src/locale/sq/index.js.flow35
-rw-r--r--date-fns/src/locale/sq/snapshot.md304
-rw-r--r--date-fns/src/locale/sr-Latn/_lib/formatDistance/index.js191
-rw-r--r--date-fns/src/locale/sr-Latn/_lib/formatLong/index.js39
-rw-r--r--date-fns/src/locale/sr-Latn/_lib/formatRelative/index.js44
-rw-r--r--date-fns/src/locale/sr-Latn/_lib/localize/index.js222
-rw-r--r--date-fns/src/locale/sr-Latn/_lib/match/index.js118
-rw-r--r--date-fns/src/locale/sr-Latn/index.d.ts4
-rw-r--r--date-fns/src/locale/sr-Latn/index.js28
-rw-r--r--date-fns/src/locale/sr-Latn/index.js.flow35
-rw-r--r--date-fns/src/locale/sr-Latn/snapshot.md304
-rw-r--r--date-fns/src/locale/sr/_lib/formatDistance/index.js191
-rw-r--r--date-fns/src/locale/sr/_lib/formatLong/index.js39
-rw-r--r--date-fns/src/locale/sr/_lib/formatRelative/index.js44
-rw-r--r--date-fns/src/locale/sr/_lib/localize/index.js222
-rw-r--r--date-fns/src/locale/sr/_lib/match/index.js118
-rw-r--r--date-fns/src/locale/sr/index.d.ts4
-rw-r--r--date-fns/src/locale/sr/index.js28
-rw-r--r--date-fns/src/locale/sr/index.js.flow35
-rw-r--r--date-fns/src/locale/sr/snapshot.md304
-rw-r--r--date-fns/src/locale/sv/_lib/formatDistance/index.js127
-rw-r--r--date-fns/src/locale/sv/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/sv/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/sv/_lib/localize/index.js168
-rw-r--r--date-fns/src/locale/sv/_lib/match/index.js135
-rw-r--r--date-fns/src/locale/sv/index.d.ts4
-rw-r--r--date-fns/src/locale/sv/index.js30
-rw-r--r--date-fns/src/locale/sv/index.js.flow35
-rw-r--r--date-fns/src/locale/sv/snapshot.md304
-rw-r--r--date-fns/src/locale/ta/_lib/formatDistance/index.js236
-rw-r--r--date-fns/src/locale/ta/_lib/formatLong/index.js45
-rw-r--r--date-fns/src/locale/ta/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ta/_lib/localize/index.js209
-rw-r--r--date-fns/src/locale/ta/_lib/match/index.js148
-rw-r--r--date-fns/src/locale/ta/index.d.ts4
-rw-r--r--date-fns/src/locale/ta/index.js28
-rw-r--r--date-fns/src/locale/ta/index.js.flow35
-rw-r--r--date-fns/src/locale/ta/snapshot.md304
-rw-r--r--date-fns/src/locale/te/_lib/formatDistance/index.js199
-rw-r--r--date-fns/src/locale/te/_lib/formatLong/index.js45
-rw-r--r--date-fns/src/locale/te/_lib/formatRelative/index.js14
-rw-r--r--date-fns/src/locale/te/_lib/localize/index.js173
-rw-r--r--date-fns/src/locale/te/_lib/match/index.js140
-rw-r--r--date-fns/src/locale/te/index.d.ts4
-rw-r--r--date-fns/src/locale/te/index.js28
-rw-r--r--date-fns/src/locale/te/index.js.flow35
-rw-r--r--date-fns/src/locale/te/snapshot.md304
-rw-r--r--date-fns/src/locale/th/_lib/formatDistance/index.js105
-rw-r--r--date-fns/src/locale/th/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/th/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/th/_lib/localize/index.js172
-rw-r--r--date-fns/src/locale/th/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/th/index.d.ts4
-rw-r--r--date-fns/src/locale/th/index.js30
-rw-r--r--date-fns/src/locale/th/index.js.flow35
-rw-r--r--date-fns/src/locale/th/snapshot.md304
-rw-r--r--date-fns/src/locale/tr/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/tr/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/tr/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/tr/_lib/localize/index.js167
-rw-r--r--date-fns/src/locale/tr/_lib/match/index.js153
-rw-r--r--date-fns/src/locale/tr/index.d.ts4
-rw-r--r--date-fns/src/locale/tr/index.js33
-rw-r--r--date-fns/src/locale/tr/index.js.flow35
-rw-r--r--date-fns/src/locale/tr/snapshot.md304
-rw-r--r--date-fns/src/locale/types.ts105
-rw-r--r--date-fns/src/locale/ug/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/ug/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/ug/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/ug/_lib/localize/index.js177
-rw-r--r--date-fns/src/locale/ug/_lib/match/index.js136
-rw-r--r--date-fns/src/locale/ug/index.d.ts4
-rw-r--r--date-fns/src/locale/ug/index.js28
-rw-r--r--date-fns/src/locale/ug/index.js.flow35
-rw-r--r--date-fns/src/locale/ug/snapshot.md304
-rw-r--r--date-fns/src/locale/uk/_lib/formatDistance/index.js247
-rw-r--r--date-fns/src/locale/uk/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/uk/_lib/formatRelative/index.js82
-rw-r--r--date-fns/src/locale/uk/_lib/localize/index.js217
-rw-r--r--date-fns/src/locale/uk/_lib/match/index.js142
-rw-r--r--date-fns/src/locale/uk/index.d.ts4
-rw-r--r--date-fns/src/locale/uk/index.js29
-rw-r--r--date-fns/src/locale/uk/index.js.flow35
-rw-r--r--date-fns/src/locale/uk/snapshot.md304
-rw-r--r--date-fns/src/locale/uz/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/uz/_lib/formatLong/index.js38
-rw-r--r--date-fns/src/locale/uz/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/uz/_lib/localize/index.js181
-rw-r--r--date-fns/src/locale/uz/_lib/match/index.js137
-rw-r--r--date-fns/src/locale/uz/index.d.ts4
-rw-r--r--date-fns/src/locale/uz/index.js28
-rw-r--r--date-fns/src/locale/uz/index.js.flow35
-rw-r--r--date-fns/src/locale/uz/snapshot.md304
-rw-r--r--date-fns/src/locale/vi/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/vi/_lib/formatLong/index.js47
-rw-r--r--date-fns/src/locale/vi/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/vi/_lib/localize/index.js295
-rw-r--r--date-fns/src/locale/vi/_lib/match/index.js158
-rw-r--r--date-fns/src/locale/vi/index.d.ts4
-rw-r--r--date-fns/src/locale/vi/index.js29
-rw-r--r--date-fns/src/locale/vi/index.js.flow35
-rw-r--r--date-fns/src/locale/vi/snapshot.md304
-rw-r--r--date-fns/src/locale/zh-CN/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/zh-CN/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/zh-CN/_lib/formatRelative/index.js29
-rw-r--r--date-fns/src/locale/zh-CN/_lib/localize/index.js194
-rw-r--r--date-fns/src/locale/zh-CN/_lib/match/index.js135
-rw-r--r--date-fns/src/locale/zh-CN/index.d.ts4
-rw-r--r--date-fns/src/locale/zh-CN/index.js32
-rw-r--r--date-fns/src/locale/zh-CN/index.js.flow35
-rw-r--r--date-fns/src/locale/zh-CN/snapshot.md304
-rw-r--r--date-fns/src/locale/zh-TW/_lib/formatDistance/index.js101
-rw-r--r--date-fns/src/locale/zh-TW/_lib/formatLong/index.js41
-rw-r--r--date-fns/src/locale/zh-TW/_lib/formatRelative/index.js12
-rw-r--r--date-fns/src/locale/zh-TW/_lib/localize/index.js196
-rw-r--r--date-fns/src/locale/zh-TW/_lib/match/index.js135
-rw-r--r--date-fns/src/locale/zh-TW/index.d.ts4
-rw-r--r--date-fns/src/locale/zh-TW/index.js30
-rw-r--r--date-fns/src/locale/zh-TW/index.js.flow35
-rw-r--r--date-fns/src/locale/zh-TW/snapshot.md304
-rw-r--r--date-fns/src/max/benchmark.js27
-rw-r--r--date-fns/src/max/index.d.ts4
-rw-r--r--date-fns/src/max/index.js.flow52
-rw-r--r--date-fns/src/max/index.ts69
-rw-r--r--date-fns/src/max/test.ts92
-rw-r--r--date-fns/src/milliseconds/index.d.ts4
-rw-r--r--date-fns/src/milliseconds/index.js.flow52
-rw-r--r--date-fns/src/milliseconds/index.ts62
-rw-r--r--date-fns/src/milliseconds/test.ts65
-rw-r--r--date-fns/src/millisecondsToHours/index.d.ts4
-rw-r--r--date-fns/src/millisecondsToHours/index.js.flow52
-rw-r--r--date-fns/src/millisecondsToHours/index.ts31
-rw-r--r--date-fns/src/millisecondsToHours/test.ts22
-rw-r--r--date-fns/src/millisecondsToMinutes/index.d.ts4
-rw-r--r--date-fns/src/millisecondsToMinutes/index.js.flow52
-rw-r--r--date-fns/src/millisecondsToMinutes/index.ts31
-rw-r--r--date-fns/src/millisecondsToMinutes/test.ts21
-rw-r--r--date-fns/src/millisecondsToSeconds/index.d.ts4
-rw-r--r--date-fns/src/millisecondsToSeconds/index.js.flow52
-rw-r--r--date-fns/src/millisecondsToSeconds/index.ts31
-rw-r--r--date-fns/src/millisecondsToSeconds/test.ts22
-rw-r--r--date-fns/src/min/benchmark.js27
-rw-r--r--date-fns/src/min/index.d.ts4
-rw-r--r--date-fns/src/min/index.js.flow52
-rw-r--r--date-fns/src/min/index.ts73
-rw-r--r--date-fns/src/min/test.ts93
-rw-r--r--date-fns/src/minutesToHours/index.d.ts4
-rw-r--r--date-fns/src/minutesToHours/index.js.flow52
-rw-r--r--date-fns/src/minutesToHours/index.ts31
-rw-r--r--date-fns/src/minutesToHours/test.ts21
-rw-r--r--date-fns/src/minutesToMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/minutesToMilliseconds/index.js.flow52
-rw-r--r--date-fns/src/minutesToMilliseconds/index.ts25
-rw-r--r--date-fns/src/minutesToMilliseconds/test.ts20
-rw-r--r--date-fns/src/minutesToSeconds/index.d.ts4
-rw-r--r--date-fns/src/minutesToSeconds/index.js.flow52
-rw-r--r--date-fns/src/minutesToSeconds/index.ts25
-rw-r--r--date-fns/src/minutesToSeconds/test.ts20
-rw-r--r--date-fns/src/monthsToQuarters/index.d.ts4
-rw-r--r--date-fns/src/monthsToQuarters/index.js.flow52
-rw-r--r--date-fns/src/monthsToQuarters/index.ts31
-rw-r--r--date-fns/src/monthsToQuarters/test.ts21
-rw-r--r--date-fns/src/monthsToYears/index.d.ts4
-rw-r--r--date-fns/src/monthsToYears/index.js.flow52
-rw-r--r--date-fns/src/monthsToYears/index.ts30
-rw-r--r--date-fns/src/monthsToYears/test.ts21
-rw-r--r--date-fns/src/nextDay/index.d.ts4
-rw-r--r--date-fns/src/nextDay/index.js.flow52
-rw-r--r--date-fns/src/nextDay/index.ts46
-rw-r--r--date-fns/src/nextDay/test.ts86
-rw-r--r--date-fns/src/nextFriday/index.d.ts4
-rw-r--r--date-fns/src/nextFriday/index.js.flow52
-rw-r--r--date-fns/src/nextFriday/index.ts25
-rw-r--r--date-fns/src/nextFriday/test.ts48
-rw-r--r--date-fns/src/nextMonday/index.d.ts4
-rw-r--r--date-fns/src/nextMonday/index.js.flow52
-rw-r--r--date-fns/src/nextMonday/index.ts25
-rw-r--r--date-fns/src/nextMonday/test.ts48
-rw-r--r--date-fns/src/nextSaturday/index.d.ts4
-rw-r--r--date-fns/src/nextSaturday/index.js.flow52
-rw-r--r--date-fns/src/nextSaturday/index.ts25
-rw-r--r--date-fns/src/nextSaturday/test.ts48
-rw-r--r--date-fns/src/nextSunday/index.d.ts4
-rw-r--r--date-fns/src/nextSunday/index.js.flow52
-rw-r--r--date-fns/src/nextSunday/index.ts25
-rw-r--r--date-fns/src/nextSunday/test.ts48
-rw-r--r--date-fns/src/nextThursday/index.d.ts4
-rw-r--r--date-fns/src/nextThursday/index.js.flow52
-rw-r--r--date-fns/src/nextThursday/index.ts25
-rw-r--r--date-fns/src/nextThursday/test.ts48
-rw-r--r--date-fns/src/nextTuesday/index.d.ts4
-rw-r--r--date-fns/src/nextTuesday/index.js.flow52
-rw-r--r--date-fns/src/nextTuesday/index.ts25
-rw-r--r--date-fns/src/nextTuesday/test.ts47
-rw-r--r--date-fns/src/nextWednesday/index.d.ts4
-rw-r--r--date-fns/src/nextWednesday/index.js.flow52
-rw-r--r--date-fns/src/nextWednesday/index.ts25
-rw-r--r--date-fns/src/nextWednesday/test.ts48
-rw-r--r--date-fns/src/parse/_lib/parsers/index.js1735
-rw-r--r--date-fns/src/parse/benchmark.js20
-rw-r--r--date-fns/src/parse/index.d.ts4
-rw-r--r--date-fns/src/parse/index.js626
-rw-r--r--date-fns/src/parse/index.js.flow63
-rw-r--r--date-fns/src/parse/test.js2665
-rw-r--r--date-fns/src/parseISO/benchmark.js16
-rw-r--r--date-fns/src/parseISO/index.d.ts4
-rw-r--r--date-fns/src/parseISO/index.js343
-rw-r--r--date-fns/src/parseISO/index.js.flow57
-rw-r--r--date-fns/src/parseISO/test.js452
-rw-r--r--date-fns/src/parseJSON/benchmark.js16
-rw-r--r--date-fns/src/parseJSON/index.d.ts4
-rw-r--r--date-fns/src/parseJSON/index.js.flow52
-rw-r--r--date-fns/src/parseJSON/index.ts62
-rw-r--r--date-fns/src/parseJSON/test.ts132
-rw-r--r--date-fns/src/quartersToMonths/index.d.ts4
-rw-r--r--date-fns/src/quartersToMonths/index.js.flow52
-rw-r--r--date-fns/src/quartersToMonths/index.ts25
-rw-r--r--date-fns/src/quartersToMonths/test.ts21
-rw-r--r--date-fns/src/quartersToYears/index.d.ts4
-rw-r--r--date-fns/src/quartersToYears/index.js.flow52
-rw-r--r--date-fns/src/quartersToYears/index.ts31
-rw-r--r--date-fns/src/quartersToYears/test.ts21
-rw-r--r--date-fns/src/roundToNearestMinutes/index.d.ts4
-rw-r--r--date-fns/src/roundToNearestMinutes/index.js61
-rw-r--r--date-fns/src/roundToNearestMinutes/index.js.flow57
-rw-r--r--date-fns/src/roundToNearestMinutes/test.js70
-rw-r--r--date-fns/src/secondsToHours/index.d.ts4
-rw-r--r--date-fns/src/secondsToHours/index.js.flow52
-rw-r--r--date-fns/src/secondsToHours/index.ts31
-rw-r--r--date-fns/src/secondsToHours/test.ts21
-rw-r--r--date-fns/src/secondsToMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/secondsToMilliseconds/index.js.flow52
-rw-r--r--date-fns/src/secondsToMilliseconds/index.ts25
-rw-r--r--date-fns/src/secondsToMilliseconds/test.ts16
-rw-r--r--date-fns/src/secondsToMinutes/index.d.ts4
-rw-r--r--date-fns/src/secondsToMinutes/index.js.flow52
-rw-r--r--date-fns/src/secondsToMinutes/index.ts31
-rw-r--r--date-fns/src/secondsToMinutes/test.ts21
-rw-r--r--date-fns/src/set/benchmark.js25
-rw-r--r--date-fns/src/set/index.d.ts4
-rw-r--r--date-fns/src/set/index.js.flow63
-rw-r--r--date-fns/src/set/index.ts89
-rw-r--r--date-fns/src/set/test.ts143
-rw-r--r--date-fns/src/setDate/benchmark.js21
-rw-r--r--date-fns/src/setDate/index.d.ts4
-rw-r--r--date-fns/src/setDate/index.js.flow52
-rw-r--r--date-fns/src/setDate/index.ts34
-rw-r--r--date-fns/src/setDate/test.ts49
-rw-r--r--date-fns/src/setDay/benchmark.js21
-rw-r--r--date-fns/src/setDay/index.d.ts4
-rw-r--r--date-fns/src/setDay/index.js69
-rw-r--r--date-fns/src/setDay/index.js.flow59
-rw-r--r--date-fns/src/setDay/test.js147
-rw-r--r--date-fns/src/setDayOfYear/benchmark.js21
-rw-r--r--date-fns/src/setDayOfYear/index.d.ts4
-rw-r--r--date-fns/src/setDayOfYear/index.js.flow52
-rw-r--r--date-fns/src/setDayOfYear/index.ts38
-rw-r--r--date-fns/src/setDayOfYear/test.ts50
-rw-r--r--date-fns/src/setHours/benchmark.js21
-rw-r--r--date-fns/src/setHours/index.d.ts4
-rw-r--r--date-fns/src/setHours/index.js34
-rw-r--r--date-fns/src/setHours/index.js.flow52
-rw-r--r--date-fns/src/setHours/test.js49
-rw-r--r--date-fns/src/setISODay/benchmark.js21
-rw-r--r--date-fns/src/setISODay/index.d.ts4
-rw-r--r--date-fns/src/setISODay/index.js.flow52
-rw-r--r--date-fns/src/setISODay/index.ts39
-rw-r--r--date-fns/src/setISODay/test.ts78
-rw-r--r--date-fns/src/setISOWeek/benchmark.js21
-rw-r--r--date-fns/src/setISOWeek/index.d.ts4
-rw-r--r--date-fns/src/setISOWeek/index.js.flow52
-rw-r--r--date-fns/src/setISOWeek/index.ts38
-rw-r--r--date-fns/src/setISOWeek/test.ts60
-rw-r--r--date-fns/src/setISOWeekYear/benchmark.js21
-rw-r--r--date-fns/src/setISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/setISOWeekYear/index.js.flow52
-rw-r--r--date-fns/src/setISOWeekYear/index.ts49
-rw-r--r--date-fns/src/setISOWeekYear/test.ts69
-rw-r--r--date-fns/src/setMilliseconds/benchmark.js21
-rw-r--r--date-fns/src/setMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/setMilliseconds/index.js.flow52
-rw-r--r--date-fns/src/setMilliseconds/index.ts34
-rw-r--r--date-fns/src/setMilliseconds/test.ts64
-rw-r--r--date-fns/src/setMinutes/benchmark.js21
-rw-r--r--date-fns/src/setMinutes/index.d.ts4
-rw-r--r--date-fns/src/setMinutes/index.js34
-rw-r--r--date-fns/src/setMinutes/index.js.flow52
-rw-r--r--date-fns/src/setMinutes/test.js49
-rw-r--r--date-fns/src/setMonth/benchmark.js21
-rw-r--r--date-fns/src/setMonth/index.d.ts4
-rw-r--r--date-fns/src/setMonth/index.js.flow52
-rw-r--r--date-fns/src/setMonth/index.ts44
-rw-r--r--date-fns/src/setMonth/test.ts65
-rw-r--r--date-fns/src/setQuarter/benchmark.js21
-rw-r--r--date-fns/src/setQuarter/index.d.ts4
-rw-r--r--date-fns/src/setQuarter/index.js.flow52
-rw-r--r--date-fns/src/setQuarter/index.ts36
-rw-r--r--date-fns/src/setQuarter/test.ts65
-rw-r--r--date-fns/src/setSeconds/benchmark.js21
-rw-r--r--date-fns/src/setSeconds/index.d.ts4
-rw-r--r--date-fns/src/setSeconds/index.js.flow52
-rw-r--r--date-fns/src/setSeconds/index.ts34
-rw-r--r--date-fns/src/setSeconds/test.ts61
-rw-r--r--date-fns/src/setWeek/index.d.ts4
-rw-r--r--date-fns/src/setWeek/index.js58
-rw-r--r--date-fns/src/setWeek/index.js.flow60
-rw-r--r--date-fns/src/setWeek/test.js100
-rw-r--r--date-fns/src/setWeekYear/index.d.ts4
-rw-r--r--date-fns/src/setWeekYear/index.js77
-rw-r--r--date-fns/src/setWeekYear/index.js.flow60
-rw-r--r--date-fns/src/setWeekYear/test.js109
-rw-r--r--date-fns/src/setYear/benchmark.js21
-rw-r--r--date-fns/src/setYear/index.d.ts4
-rw-r--r--date-fns/src/setYear/index.js.flow52
-rw-r--r--date-fns/src/setYear/index.ts40
-rw-r--r--date-fns/src/setYear/test.ts49
-rw-r--r--date-fns/src/startOfDay/benchmark.js21
-rw-r--r--date-fns/src/startOfDay/index.d.ts4
-rw-r--r--date-fns/src/startOfDay/index.js.flow52
-rw-r--r--date-fns/src/startOfDay/index.ts32
-rw-r--r--date-fns/src/startOfDay/test.ts35
-rw-r--r--date-fns/src/startOfDecade/benchmark.js15
-rw-r--r--date-fns/src/startOfDecade/index.d.ts4
-rw-r--r--date-fns/src/startOfDecade/index.js.flow52
-rw-r--r--date-fns/src/startOfDecade/index.ts34
-rw-r--r--date-fns/src/startOfDecade/test.ts35
-rw-r--r--date-fns/src/startOfHour/benchmark.js21
-rw-r--r--date-fns/src/startOfHour/index.d.ts4
-rw-r--r--date-fns/src/startOfHour/index.js.flow52
-rw-r--r--date-fns/src/startOfHour/index.ts32
-rw-r--r--date-fns/src/startOfHour/test.ts35
-rw-r--r--date-fns/src/startOfISOWeek/benchmark.js21
-rw-r--r--date-fns/src/startOfISOWeek/index.d.ts4
-rw-r--r--date-fns/src/startOfISOWeek/index.js.flow52
-rw-r--r--date-fns/src/startOfISOWeek/index.ts32
-rw-r--r--date-fns/src/startOfISOWeek/test.ts35
-rw-r--r--date-fns/src/startOfISOWeekYear/benchmark.js15
-rw-r--r--date-fns/src/startOfISOWeekYear/index.d.ts4
-rw-r--r--date-fns/src/startOfISOWeekYear/index.js.flow52
-rw-r--r--date-fns/src/startOfISOWeekYear/index.ts39
-rw-r--r--date-fns/src/startOfISOWeekYear/test.ts51
-rw-r--r--date-fns/src/startOfMinute/benchmark.js21
-rw-r--r--date-fns/src/startOfMinute/index.d.ts4
-rw-r--r--date-fns/src/startOfMinute/index.js.flow52
-rw-r--r--date-fns/src/startOfMinute/index.ts32
-rw-r--r--date-fns/src/startOfMinute/test.ts35
-rw-r--r--date-fns/src/startOfMonth/benchmark.js21
-rw-r--r--date-fns/src/startOfMonth/index.d.ts4
-rw-r--r--date-fns/src/startOfMonth/index.js.flow52
-rw-r--r--date-fns/src/startOfMonth/index.ts33
-rw-r--r--date-fns/src/startOfMonth/test.ts35
-rw-r--r--date-fns/src/startOfQuarter/benchmark.js21
-rw-r--r--date-fns/src/startOfQuarter/index.d.ts4
-rw-r--r--date-fns/src/startOfQuarter/index.js.flow52
-rw-r--r--date-fns/src/startOfQuarter/index.ts35
-rw-r--r--date-fns/src/startOfQuarter/test.ts35
-rw-r--r--date-fns/src/startOfSecond/benchmark.js21
-rw-r--r--date-fns/src/startOfSecond/index.d.ts4
-rw-r--r--date-fns/src/startOfSecond/index.js.flow52
-rw-r--r--date-fns/src/startOfSecond/index.ts32
-rw-r--r--date-fns/src/startOfSecond/test.ts35
-rw-r--r--date-fns/src/startOfToday/benchmark.js9
-rw-r--r--date-fns/src/startOfToday/index.d.ts4
-rw-r--r--date-fns/src/startOfToday/index.js.flow52
-rw-r--r--date-fns/src/startOfToday/index.ts28
-rw-r--r--date-fns/src/startOfToday/test.ts24
-rw-r--r--date-fns/src/startOfTomorrow/benchmark.js9
-rw-r--r--date-fns/src/startOfTomorrow/index.d.ts4
-rw-r--r--date-fns/src/startOfTomorrow/index.js.flow52
-rw-r--r--date-fns/src/startOfTomorrow/index.ts34
-rw-r--r--date-fns/src/startOfTomorrow/test.ts34
-rw-r--r--date-fns/src/startOfWeek/benchmark.js21
-rw-r--r--date-fns/src/startOfWeek/index.d.ts4
-rw-r--r--date-fns/src/startOfWeek/index.js.flow58
-rw-r--r--date-fns/src/startOfWeek/index.ts66
-rw-r--r--date-fns/src/startOfWeek/test.ts113
-rw-r--r--date-fns/src/startOfWeekYear/index.d.ts4
-rw-r--r--date-fns/src/startOfWeekYear/index.js71
-rw-r--r--date-fns/src/startOfWeekYear/index.js.flow59
-rw-r--r--date-fns/src/startOfWeekYear/test.js83
-rw-r--r--date-fns/src/startOfYear/benchmark.js21
-rw-r--r--date-fns/src/startOfYear/index.d.ts4
-rw-r--r--date-fns/src/startOfYear/index.js.flow52
-rw-r--r--date-fns/src/startOfYear/index.ts34
-rw-r--r--date-fns/src/startOfYear/test.ts46
-rw-r--r--date-fns/src/startOfYesterday/benchmark.js9
-rw-r--r--date-fns/src/startOfYesterday/index.d.ts4
-rw-r--r--date-fns/src/startOfYesterday/index.js.flow52
-rw-r--r--date-fns/src/startOfYesterday/index.ts34
-rw-r--r--date-fns/src/startOfYesterday/test.ts34
-rw-r--r--date-fns/src/sub/benchmark.js25
-rw-r--r--date-fns/src/sub/index.d.ts4
-rw-r--r--date-fns/src/sub/index.js72
-rw-r--r--date-fns/src/sub/index.js.flow52
-rw-r--r--date-fns/src/sub/test.js82
-rw-r--r--date-fns/src/subBusinessDays/index.d.ts4
-rw-r--r--date-fns/src/subBusinessDays/index.js28
-rw-r--r--date-fns/src/subBusinessDays/index.js.flow52
-rw-r--r--date-fns/src/subBusinessDays/test.js63
-rw-r--r--date-fns/src/subDays/benchmark.js21
-rw-r--r--date-fns/src/subDays/index.d.ts4
-rw-r--r--date-fns/src/subDays/index.js.flow52
-rw-r--r--date-fns/src/subDays/index.ts32
-rw-r--r--date-fns/src/subDays/test.ts52
-rw-r--r--date-fns/src/subHours/benchmark.js21
-rw-r--r--date-fns/src/subHours/index.d.ts4
-rw-r--r--date-fns/src/subHours/index.js.flow52
-rw-r--r--date-fns/src/subHours/index.ts32
-rw-r--r--date-fns/src/subHours/test.ts52
-rw-r--r--date-fns/src/subISOWeekYears/benchmark.js15
-rw-r--r--date-fns/src/subISOWeekYears/index.d.ts4
-rw-r--r--date-fns/src/subISOWeekYears/index.js.flow52
-rw-r--r--date-fns/src/subISOWeekYears/index.ts39
-rw-r--r--date-fns/src/subISOWeekYears/test.ts62
-rw-r--r--date-fns/src/subMilliseconds/benchmark.js21
-rw-r--r--date-fns/src/subMilliseconds/index.d.ts4
-rw-r--r--date-fns/src/subMilliseconds/index.js.flow52
-rw-r--r--date-fns/src/subMilliseconds/index.ts32
-rw-r--r--date-fns/src/subMilliseconds/test.ts67
-rw-r--r--date-fns/src/subMinutes/benchmark.js21
-rw-r--r--date-fns/src/subMinutes/index.d.ts4
-rw-r--r--date-fns/src/subMinutes/index.js.flow52
-rw-r--r--date-fns/src/subMinutes/index.ts32
-rw-r--r--date-fns/src/subMinutes/test.ts54
-rw-r--r--date-fns/src/subMonths/benchmark.js21
-rw-r--r--date-fns/src/subMonths/index.d.ts4
-rw-r--r--date-fns/src/subMonths/index.js.flow52
-rw-r--r--date-fns/src/subMonths/index.ts32
-rw-r--r--date-fns/src/subMonths/test.ts69
-rw-r--r--date-fns/src/subQuarters/benchmark.js21
-rw-r--r--date-fns/src/subQuarters/index.d.ts4
-rw-r--r--date-fns/src/subQuarters/index.js.flow52
-rw-r--r--date-fns/src/subQuarters/index.ts32
-rw-r--r--date-fns/src/subQuarters/test.ts69
-rw-r--r--date-fns/src/subSeconds/benchmark.js21
-rw-r--r--date-fns/src/subSeconds/index.d.ts4
-rw-r--r--date-fns/src/subSeconds/index.js.flow52
-rw-r--r--date-fns/src/subSeconds/index.ts32
-rw-r--r--date-fns/src/subSeconds/test.ts55
-rw-r--r--date-fns/src/subWeeks/benchmark.js21
-rw-r--r--date-fns/src/subWeeks/index.d.ts4
-rw-r--r--date-fns/src/subWeeks/index.js.flow52
-rw-r--r--date-fns/src/subWeeks/index.ts32
-rw-r--r--date-fns/src/subWeeks/test.ts52
-rw-r--r--date-fns/src/subYears/benchmark.js21
-rw-r--r--date-fns/src/subYears/index.d.ts4
-rw-r--r--date-fns/src/subYears/index.js.flow52
-rw-r--r--date-fns/src/subYears/index.ts32
-rw-r--r--date-fns/src/subYears/test.ts68
-rw-r--r--date-fns/src/toDate/benchmark.js16
-rw-r--r--date-fns/src/toDate/index.d.ts4
-rw-r--r--date-fns/src/toDate/index.js.flow52
-rw-r--r--date-fns/src/toDate/index.ts61
-rw-r--r--date-fns/src/toDate/test.ts136
-rw-r--r--date-fns/src/types.ts53
-rw-r--r--date-fns/src/weeksToDays/index.d.ts4
-rw-r--r--date-fns/src/weeksToDays/index.js.flow52
-rw-r--r--date-fns/src/weeksToDays/index.ts25
-rw-r--r--date-fns/src/weeksToDays/test.ts21
-rw-r--r--date-fns/src/yearsToMonths/index.d.ts4
-rw-r--r--date-fns/src/yearsToMonths/index.js.flow52
-rw-r--r--date-fns/src/yearsToMonths/index.ts25
-rw-r--r--date-fns/src/yearsToMonths/test.ts21
-rw-r--r--date-fns/src/yearsToQuarters/index.d.ts4
-rw-r--r--date-fns/src/yearsToQuarters/index.js.flow52
-rw-r--r--date-fns/src/yearsToQuarters/index.ts25
-rw-r--r--date-fns/src/yearsToQuarters/test.ts21
2564 files changed, 141435 insertions, 0 deletions
diff --git a/date-fns/src/_lib/addLeadingZeros/index.js b/date-fns/src/_lib/addLeadingZeros/index.js
new file mode 100644
index 0000000..62f812b
--- /dev/null
+++ b/date-fns/src/_lib/addLeadingZeros/index.js
@@ -0,0 +1,8 @@
+export default function addLeadingZeros(number, targetLength) {
+ var sign = number < 0 ? '-' : ''
+ var output = Math.abs(number).toString()
+ while (output.length < targetLength) {
+ output = '0' + output
+ }
+ return sign + output
+}
diff --git a/date-fns/src/_lib/assign/index.js b/date-fns/src/_lib/assign/index.js
new file mode 100644
index 0000000..6fd8782
--- /dev/null
+++ b/date-fns/src/_lib/assign/index.js
@@ -0,0 +1,17 @@
+export default function assign(target, dirtyObject) {
+ if (target == null) {
+ throw new TypeError(
+ 'assign requires that input parameter not be null or undefined'
+ )
+ }
+
+ dirtyObject = dirtyObject || {}
+
+ for (var property in dirtyObject) {
+ if (dirtyObject.hasOwnProperty(property)) {
+ target[property] = dirtyObject[property]
+ }
+ }
+
+ return target
+}
diff --git a/date-fns/src/_lib/assign/test.js b/date-fns/src/_lib/assign/test.js
new file mode 100644
index 0000000..629358f
--- /dev/null
+++ b/date-fns/src/_lib/assign/test.js
@@ -0,0 +1,30 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import assign from '.'
+
+describe('assign', function() {
+ it('assigns properties of the second argument to the first argument', function() {
+ var object = {}
+ assign(object, { a: 1, b: 2, c: 3 })
+ assert.deepEqual(object, { a: 1, b: 2, c: 3 })
+ })
+
+ it('the object passed as 2nd argument remains unchanged when the result is mutated', function() {
+ var object = { a: 1, b: 2, c: 3 }
+ var result = assign({}, object)
+ result.c = 4
+ assert.deepEqual(object, { a: 1, b: 2, c: 3 })
+ })
+
+ it('returns the first argument when the second argument is `undefined`', function() {
+ var original = { a: 1, b: 2, c: 3 }
+ var result = assign(original, undefined)
+ assert(original === result)
+ })
+
+ it('throws TypeError exception if the first argument is `undefined', function() {
+ assert.throws(assign.bind(null, undefined, { a: 1, b: 2, c: 3 }), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/cloneObject/index.js b/date-fns/src/_lib/cloneObject/index.js
new file mode 100644
index 0000000..34dd17b
--- /dev/null
+++ b/date-fns/src/_lib/cloneObject/index.js
@@ -0,0 +1,5 @@
+import assign from '../assign/index'
+
+export default function cloneObject(dirtyObject) {
+ return assign({}, dirtyObject)
+}
diff --git a/date-fns/src/_lib/cloneObject/test.js b/date-fns/src/_lib/cloneObject/test.js
new file mode 100644
index 0000000..96302bb
--- /dev/null
+++ b/date-fns/src/_lib/cloneObject/test.js
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import cloneObject from '.'
+
+describe('cloneObject', function () {
+ it('makes a copy of an object', function () {
+ var result = cloneObject({a: 1, b: 2, c: 3})
+ assert.deepEqual(result, {a: 1, b: 2, c: 3})
+ })
+
+ it('the copy remains unchanged when the original is changed', function () {
+ var original = {a: 1, b: 2, c: 3}
+ var copy = cloneObject(original)
+ original.c = 4
+ assert.deepEqual(copy, {a: 1, b: 2, c: 3})
+ })
+
+ it('the original remains unchanged when the copy is changed', function () {
+ var original = {a: 1, b: 2, c: 3}
+ var copy = cloneObject(original)
+ copy.c = 4
+ assert.deepEqual(original, {a: 1, b: 2, c: 3})
+ })
+
+ it('returns an empty object when argument is `undefined`', function () {
+ var result = cloneObject(undefined)
+ assert.deepEqual(result, {})
+ })
+})
diff --git a/date-fns/src/_lib/format/formatters/index.js b/date-fns/src/_lib/format/formatters/index.js
new file mode 100644
index 0000000..4638060
--- /dev/null
+++ b/date-fns/src/_lib/format/formatters/index.js
@@ -0,0 +1,768 @@
+import lightFormatters from '../lightFormatters/index'
+import getUTCDayOfYear from '../../../_lib/getUTCDayOfYear/index'
+import getUTCISOWeek from '../../../_lib/getUTCISOWeek/index'
+import getUTCISOWeekYear from '../../../_lib/getUTCISOWeekYear/index'
+import getUTCWeek from '../../../_lib/getUTCWeek/index'
+import getUTCWeekYear from '../../../_lib/getUTCWeekYear/index'
+import addLeadingZeros from '../../addLeadingZeros/index'
+
+var dayPeriodEnum = {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'midnight',
+ noon: 'noon',
+ morning: 'morning',
+ afternoon: 'afternoon',
+ evening: 'evening',
+ night: 'night'
+}
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | Milliseconds in day |
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
+ * | d | Day of month | D | Day of year |
+ * | e | Local day of week | E | Day of week |
+ * | f | | F* | Day of week in month |
+ * | g* | Modified Julian day | G | Era |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | i! | ISO day of week | I! | ISO week of year |
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
+ * | k | Hour [1-24] | K | Hour [0-11] |
+ * | l* | (deprecated) | L | Stand-alone month |
+ * | m | Minute | M | Month |
+ * | n | | N | |
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
+ * | p! | Long localized time | P! | Long localized date |
+ * | q | Stand-alone quarter | Q | Quarter |
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
+ * | s | Second | S | Fraction of second |
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
+ * | u | Extended year | U* | Cyclic year |
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
+ * | w | Local week of year | W* | Week of month |
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
+ * | y | Year (abs) | Y | Local week-numbering year |
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ *
+ * Letters marked by ! are non-standard, but implemented by date-fns:
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
+ * i.e. 7 for Sunday, 1 for Monday, etc.
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
+ * `R` is supposed to be used in conjunction with `I` and `i`
+ * for universal ISO week-numbering date, whereas
+ * `Y` is supposed to be used in conjunction with `w` and `e`
+ * for week-numbering date specific to the locale.
+ * - `P` is long localized date format
+ * - `p` is long localized time format
+ */
+
+var formatters = {
+ // Era
+ G: function(date, token, localize) {
+ var era = date.getUTCFullYear() > 0 ? 1 : 0
+ switch (token) {
+ // AD, BC
+ case 'G':
+ case 'GG':
+ case 'GGG':
+ return localize.era(era, { width: 'abbreviated' })
+ // A, B
+ case 'GGGGG':
+ return localize.era(era, { width: 'narrow' })
+ // Anno Domini, Before Christ
+ case 'GGGG':
+ default:
+ return localize.era(era, { width: 'wide' })
+ }
+ },
+
+ // Year
+ y: function(date, token, localize) {
+ // Ordinal number
+ if (token === 'yo') {
+ var signedYear = date.getUTCFullYear()
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ var year = signedYear > 0 ? signedYear : 1 - signedYear
+ return localize.ordinalNumber(year, { unit: 'year' })
+ }
+
+ return lightFormatters.y(date, token)
+ },
+
+ // Local week-numbering year
+ Y: function(date, token, localize, options) {
+ var signedWeekYear = getUTCWeekYear(date, options)
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear
+
+ // Two digit year
+ if (token === 'YY') {
+ var twoDigitYear = weekYear % 100
+ return addLeadingZeros(twoDigitYear, 2)
+ }
+
+ // Ordinal number
+ if (token === 'Yo') {
+ return localize.ordinalNumber(weekYear, { unit: 'year' })
+ }
+
+ // Padding
+ return addLeadingZeros(weekYear, token.length)
+ },
+
+ // ISO week-numbering year
+ R: function(date, token) {
+ var isoWeekYear = getUTCISOWeekYear(date)
+
+ // Padding
+ return addLeadingZeros(isoWeekYear, token.length)
+ },
+
+ // Extended year. This is a single number designating the year of this calendar system.
+ // The main difference between `y` and `u` localizers are B.C. years:
+ // | Year | `y` | `u` |
+ // |------|-----|-----|
+ // | AC 1 | 1 | 1 |
+ // | BC 1 | 1 | 0 |
+ // | BC 2 | 2 | -1 |
+ // Also `yy` always returns the last two digits of a year,
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
+ u: function(date, token) {
+ var year = date.getUTCFullYear()
+ return addLeadingZeros(year, token.length)
+ },
+
+ // Quarter
+ Q: function(date, token, localize) {
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3)
+ switch (token) {
+ // 1, 2, 3, 4
+ case 'Q':
+ return String(quarter)
+ // 01, 02, 03, 04
+ case 'QQ':
+ return addLeadingZeros(quarter, 2)
+ // 1st, 2nd, 3rd, 4th
+ case 'Qo':
+ return localize.ordinalNumber(quarter, { unit: 'quarter' })
+ // Q1, Q2, Q3, Q4
+ case 'QQQ':
+ return localize.quarter(quarter, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case 'QQQQQ':
+ return localize.quarter(quarter, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ // 1st quarter, 2nd quarter, ...
+ case 'QQQQ':
+ default:
+ return localize.quarter(quarter, {
+ width: 'wide',
+ context: 'formatting'
+ })
+ }
+ },
+
+ // Stand-alone quarter
+ q: function(date, token, localize) {
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3)
+ switch (token) {
+ // 1, 2, 3, 4
+ case 'q':
+ return String(quarter)
+ // 01, 02, 03, 04
+ case 'qq':
+ return addLeadingZeros(quarter, 2)
+ // 1st, 2nd, 3rd, 4th
+ case 'qo':
+ return localize.ordinalNumber(quarter, { unit: 'quarter' })
+ // Q1, Q2, Q3, Q4
+ case 'qqq':
+ return localize.quarter(quarter, {
+ width: 'abbreviated',
+ context: 'standalone'
+ })
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case 'qqqqq':
+ return localize.quarter(quarter, {
+ width: 'narrow',
+ context: 'standalone'
+ })
+ // 1st quarter, 2nd quarter, ...
+ case 'qqqq':
+ default:
+ return localize.quarter(quarter, {
+ width: 'wide',
+ context: 'standalone'
+ })
+ }
+ },
+
+ // Month
+ M: function(date, token, localize) {
+ var month = date.getUTCMonth()
+ switch (token) {
+ case 'M':
+ case 'MM':
+ return lightFormatters.M(date, token)
+ // 1st, 2nd, ..., 12th
+ case 'Mo':
+ return localize.ordinalNumber(month + 1, { unit: 'month' })
+ // Jan, Feb, ..., Dec
+ case 'MMM':
+ return localize.month(month, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ // J, F, ..., D
+ case 'MMMMM':
+ return localize.month(month, { width: 'narrow', context: 'formatting' })
+ // January, February, ..., December
+ case 'MMMM':
+ default:
+ return localize.month(month, { width: 'wide', context: 'formatting' })
+ }
+ },
+
+ // Stand-alone month
+ L: function(date, token, localize) {
+ var month = date.getUTCMonth()
+ switch (token) {
+ // 1, 2, ..., 12
+ case 'L':
+ return String(month + 1)
+ // 01, 02, ..., 12
+ case 'LL':
+ return addLeadingZeros(month + 1, 2)
+ // 1st, 2nd, ..., 12th
+ case 'Lo':
+ return localize.ordinalNumber(month + 1, { unit: 'month' })
+ // Jan, Feb, ..., Dec
+ case 'LLL':
+ return localize.month(month, {
+ width: 'abbreviated',
+ context: 'standalone'
+ })
+ // J, F, ..., D
+ case 'LLLLL':
+ return localize.month(month, { width: 'narrow', context: 'standalone' })
+ // January, February, ..., December
+ case 'LLLL':
+ default:
+ return localize.month(month, { width: 'wide', context: 'standalone' })
+ }
+ },
+
+ // Local week of year
+ w: function(date, token, localize, options) {
+ var week = getUTCWeek(date, options)
+
+ if (token === 'wo') {
+ return localize.ordinalNumber(week, { unit: 'week' })
+ }
+
+ return addLeadingZeros(week, token.length)
+ },
+
+ // ISO week of year
+ I: function(date, token, localize) {
+ var isoWeek = getUTCISOWeek(date)
+
+ if (token === 'Io') {
+ return localize.ordinalNumber(isoWeek, { unit: 'week' })
+ }
+
+ return addLeadingZeros(isoWeek, token.length)
+ },
+
+ // Day of the month
+ d: function(date, token, localize) {
+ if (token === 'do') {
+ return localize.ordinalNumber(date.getUTCDate(), { unit: 'date' })
+ }
+
+ return lightFormatters.d(date, token)
+ },
+
+ // Day of year
+ D: function(date, token, localize) {
+ var dayOfYear = getUTCDayOfYear(date)
+
+ if (token === 'Do') {
+ return localize.ordinalNumber(dayOfYear, { unit: 'dayOfYear' })
+ }
+
+ return addLeadingZeros(dayOfYear, token.length)
+ },
+
+ // Day of week
+ E: function(date, token, localize) {
+ var dayOfWeek = date.getUTCDay()
+ switch (token) {
+ // Tue
+ case 'E':
+ case 'EE':
+ case 'EEE':
+ return localize.day(dayOfWeek, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ // T
+ case 'EEEEE':
+ return localize.day(dayOfWeek, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ // Tu
+ case 'EEEEEE':
+ return localize.day(dayOfWeek, {
+ width: 'short',
+ context: 'formatting'
+ })
+ // Tuesday
+ case 'EEEE':
+ default:
+ return localize.day(dayOfWeek, { width: 'wide', context: 'formatting' })
+ }
+ },
+
+ // Local day of week
+ e: function(date, token, localize, options) {
+ var dayOfWeek = date.getUTCDay()
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7
+ switch (token) {
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
+ case 'e':
+ return String(localDayOfWeek)
+ // Padded numerical value
+ case 'ee':
+ return addLeadingZeros(localDayOfWeek, 2)
+ // 1st, 2nd, ..., 7th
+ case 'eo':
+ return localize.ordinalNumber(localDayOfWeek, { unit: 'day' })
+ case 'eee':
+ return localize.day(dayOfWeek, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ // T
+ case 'eeeee':
+ return localize.day(dayOfWeek, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ // Tu
+ case 'eeeeee':
+ return localize.day(dayOfWeek, {
+ width: 'short',
+ context: 'formatting'
+ })
+ // Tuesday
+ case 'eeee':
+ default:
+ return localize.day(dayOfWeek, { width: 'wide', context: 'formatting' })
+ }
+ },
+
+ // Stand-alone local day of week
+ c: function(date, token, localize, options) {
+ var dayOfWeek = date.getUTCDay()
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7
+ switch (token) {
+ // Numerical value (same as in `e`)
+ case 'c':
+ return String(localDayOfWeek)
+ // Padded numerical value
+ case 'cc':
+ return addLeadingZeros(localDayOfWeek, token.length)
+ // 1st, 2nd, ..., 7th
+ case 'co':
+ return localize.ordinalNumber(localDayOfWeek, { unit: 'day' })
+ case 'ccc':
+ return localize.day(dayOfWeek, {
+ width: 'abbreviated',
+ context: 'standalone'
+ })
+ // T
+ case 'ccccc':
+ return localize.day(dayOfWeek, {
+ width: 'narrow',
+ context: 'standalone'
+ })
+ // Tu
+ case 'cccccc':
+ return localize.day(dayOfWeek, {
+ width: 'short',
+ context: 'standalone'
+ })
+ // Tuesday
+ case 'cccc':
+ default:
+ return localize.day(dayOfWeek, { width: 'wide', context: 'standalone' })
+ }
+ },
+
+ // ISO day of week
+ i: function(date, token, localize) {
+ var dayOfWeek = date.getUTCDay()
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek
+ switch (token) {
+ // 2
+ case 'i':
+ return String(isoDayOfWeek)
+ // 02
+ case 'ii':
+ return addLeadingZeros(isoDayOfWeek, token.length)
+ // 2nd
+ case 'io':
+ return localize.ordinalNumber(isoDayOfWeek, { unit: 'day' })
+ // Tue
+ case 'iii':
+ return localize.day(dayOfWeek, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ // T
+ case 'iiiii':
+ return localize.day(dayOfWeek, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ // Tu
+ case 'iiiiii':
+ return localize.day(dayOfWeek, {
+ width: 'short',
+ context: 'formatting'
+ })
+ // Tuesday
+ case 'iiii':
+ default:
+ return localize.day(dayOfWeek, { width: 'wide', context: 'formatting' })
+ }
+ },
+
+ // AM or PM
+ a: function(date, token, localize) {
+ var hours = date.getUTCHours()
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'
+
+ switch (token) {
+ case 'a':
+ case 'aa':
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ case 'aaa':
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ .toLowerCase()
+ case 'aaaaa':
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ case 'aaaa':
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'wide',
+ context: 'formatting'
+ })
+ }
+ },
+
+ // AM, PM, midnight, noon
+ b: function(date, token, localize) {
+ var hours = date.getUTCHours()
+ var dayPeriodEnumValue
+ if (hours === 12) {
+ dayPeriodEnumValue = dayPeriodEnum.noon
+ } else if (hours === 0) {
+ dayPeriodEnumValue = dayPeriodEnum.midnight
+ } else {
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am'
+ }
+
+ switch (token) {
+ case 'b':
+ case 'bb':
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ case 'bbb':
+ return localize
+ .dayPeriod(dayPeriodEnumValue, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ .toLowerCase()
+ case 'bbbbb':
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ case 'bbbb':
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'wide',
+ context: 'formatting'
+ })
+ }
+ },
+
+ // in the morning, in the afternoon, in the evening, at night
+ B: function(date, token, localize) {
+ var hours = date.getUTCHours()
+ var dayPeriodEnumValue
+ if (hours >= 17) {
+ dayPeriodEnumValue = dayPeriodEnum.evening
+ } else if (hours >= 12) {
+ dayPeriodEnumValue = dayPeriodEnum.afternoon
+ } else if (hours >= 4) {
+ dayPeriodEnumValue = dayPeriodEnum.morning
+ } else {
+ dayPeriodEnumValue = dayPeriodEnum.night
+ }
+
+ switch (token) {
+ case 'B':
+ case 'BB':
+ case 'BBB':
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'abbreviated',
+ context: 'formatting'
+ })
+ case 'BBBBB':
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ case 'BBBB':
+ default:
+ return localize.dayPeriod(dayPeriodEnumValue, {
+ width: 'wide',
+ context: 'formatting'
+ })
+ }
+ },
+
+ // Hour [1-12]
+ h: function(date, token, localize) {
+ if (token === 'ho') {
+ var hours = date.getUTCHours() % 12
+ if (hours === 0) hours = 12
+ return localize.ordinalNumber(hours, { unit: 'hour' })
+ }
+
+ return lightFormatters.h(date, token)
+ },
+
+ // Hour [0-23]
+ H: function(date, token, localize) {
+ if (token === 'Ho') {
+ return localize.ordinalNumber(date.getUTCHours(), { unit: 'hour' })
+ }
+
+ return lightFormatters.H(date, token)
+ },
+
+ // Hour [0-11]
+ K: function(date, token, localize) {
+ var hours = date.getUTCHours() % 12
+
+ if (token === 'Ko') {
+ return localize.ordinalNumber(hours, { unit: 'hour' })
+ }
+
+ return addLeadingZeros(hours, token.length)
+ },
+
+ // Hour [1-24]
+ k: function(date, token, localize) {
+ var hours = date.getUTCHours()
+ if (hours === 0) hours = 24
+
+ if (token === 'ko') {
+ return localize.ordinalNumber(hours, { unit: 'hour' })
+ }
+
+ return addLeadingZeros(hours, token.length)
+ },
+
+ // Minute
+ m: function(date, token, localize) {
+ if (token === 'mo') {
+ return localize.ordinalNumber(date.getUTCMinutes(), { unit: 'minute' })
+ }
+
+ return lightFormatters.m(date, token)
+ },
+
+ // Second
+ s: function(date, token, localize) {
+ if (token === 'so') {
+ return localize.ordinalNumber(date.getUTCSeconds(), { unit: 'second' })
+ }
+
+ return lightFormatters.s(date, token)
+ },
+
+ // Fraction of second
+ S: function(date, token) {
+ return lightFormatters.S(date, token)
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
+ X: function(date, token, _localize, options) {
+ var originalDate = options._originalDate || date
+ var timezoneOffset = originalDate.getTimezoneOffset()
+
+ if (timezoneOffset === 0) {
+ return 'Z'
+ }
+
+ switch (token) {
+ // Hours and optional minutes
+ case 'X':
+ return formatTimezoneWithOptionalMinutes(timezoneOffset)
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XX`
+ case 'XXXX':
+ case 'XX': // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset)
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `XXX`
+ case 'XXXXX':
+ case 'XXX': // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ':')
+ }
+ },
+
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
+ x: function(date, token, _localize, options) {
+ var originalDate = options._originalDate || date
+ var timezoneOffset = originalDate.getTimezoneOffset()
+
+ switch (token) {
+ // Hours and optional minutes
+ case 'x':
+ return formatTimezoneWithOptionalMinutes(timezoneOffset)
+
+ // Hours, minutes and optional seconds without `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xx`
+ case 'xxxx':
+ case 'xx': // Hours and minutes without `:` delimiter
+ return formatTimezone(timezoneOffset)
+
+ // Hours, minutes and optional seconds with `:` delimiter
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
+ // so this token always has the same output as `xxx`
+ case 'xxxxx':
+ case 'xxx': // Hours and minutes with `:` delimiter
+ default:
+ return formatTimezone(timezoneOffset, ':')
+ }
+ },
+
+ // Timezone (GMT)
+ O: function(date, token, _localize, options) {
+ var originalDate = options._originalDate || date
+ var timezoneOffset = originalDate.getTimezoneOffset()
+
+ switch (token) {
+ // Short
+ case 'O':
+ case 'OO':
+ case 'OOO':
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':')
+ // Long
+ case 'OOOO':
+ default:
+ return 'GMT' + formatTimezone(timezoneOffset, ':')
+ }
+ },
+
+ // Timezone (specific non-location)
+ z: function(date, token, _localize, options) {
+ var originalDate = options._originalDate || date
+ var timezoneOffset = originalDate.getTimezoneOffset()
+
+ switch (token) {
+ // Short
+ case 'z':
+ case 'zz':
+ case 'zzz':
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':')
+ // Long
+ case 'zzzz':
+ default:
+ return 'GMT' + formatTimezone(timezoneOffset, ':')
+ }
+ },
+
+ // Seconds timestamp
+ t: function(date, token, _localize, options) {
+ var originalDate = options._originalDate || date
+ var timestamp = Math.floor(originalDate.getTime() / 1000)
+ return addLeadingZeros(timestamp, token.length)
+ },
+
+ // Milliseconds timestamp
+ T: function(date, token, _localize, options) {
+ var originalDate = options._originalDate || date
+ var timestamp = originalDate.getTime()
+ return addLeadingZeros(timestamp, token.length)
+ }
+}
+
+function formatTimezoneShort(offset, dirtyDelimiter) {
+ var sign = offset > 0 ? '-' : '+'
+ var absOffset = Math.abs(offset)
+ var hours = Math.floor(absOffset / 60)
+ var minutes = absOffset % 60
+ if (minutes === 0) {
+ return sign + String(hours)
+ }
+ var delimiter = dirtyDelimiter || ''
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2)
+}
+
+function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
+ if (offset % 60 === 0) {
+ var sign = offset > 0 ? '-' : '+'
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2)
+ }
+ return formatTimezone(offset, dirtyDelimiter)
+}
+
+function formatTimezone(offset, dirtyDelimiter) {
+ var delimiter = dirtyDelimiter || ''
+ var sign = offset > 0 ? '-' : '+'
+ var absOffset = Math.abs(offset)
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2)
+ var minutes = addLeadingZeros(absOffset % 60, 2)
+ return sign + hours + delimiter + minutes
+}
+
+export default formatters
diff --git a/date-fns/src/_lib/format/lightFormatters/index.ts b/date-fns/src/_lib/format/lightFormatters/index.ts
new file mode 100644
index 0000000..9e7138e
--- /dev/null
+++ b/date-fns/src/_lib/format/lightFormatters/index.ts
@@ -0,0 +1,94 @@
+import addLeadingZeros from '../../addLeadingZeros/index'
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | |
+ * | d | Day of month | D | |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | m | Minute | M | Month |
+ * | s | Second | S | Fraction of second |
+ * | y | Year (abs) | Y | |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ */
+
+const formatters = {
+ // Year
+ y(date: Date, token: string): string {
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
+ // | Year | y | yy | yyy | yyyy | yyyyy |
+ // |----------|-------|----|-------|-------|-------|
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
+
+ const signedYear = date.getUTCFullYear()
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
+ const year = signedYear > 0 ? signedYear : 1 - signedYear
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length)
+ },
+
+ // Month
+ M(date: Date, token: string): string {
+ const month = date.getUTCMonth()
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2)
+ },
+
+ // Day of the month
+ d(date: Date, token: string): string {
+ return addLeadingZeros(date.getUTCDate(), token.length)
+ },
+
+ // AM or PM
+ a(date: Date, token: string): string {
+ const dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am'
+
+ switch (token) {
+ case 'a':
+ case 'aa':
+ return dayPeriodEnumValue.toUpperCase()
+ case 'aaa':
+ return dayPeriodEnumValue
+ case 'aaaaa':
+ return dayPeriodEnumValue[0]
+ case 'aaaa':
+ default:
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.'
+ }
+ },
+
+ // Hour [1-12]
+ h(date: Date, token: string): string {
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length)
+ },
+
+ // Hour [0-23]
+ H(date: Date, token: string): string {
+ return addLeadingZeros(date.getUTCHours(), token.length)
+ },
+
+ // Minute
+ m(date: Date, token: string): string {
+ return addLeadingZeros(date.getUTCMinutes(), token.length)
+ },
+
+ // Second
+ s(date: Date, token: string): string {
+ return addLeadingZeros(date.getUTCSeconds(), token.length)
+ },
+
+ // Fraction of second
+ S(date: Date, token: string): string {
+ const numberOfDigits = token.length
+ const milliseconds = date.getUTCMilliseconds()
+ const fractionalSeconds = Math.floor(
+ milliseconds * Math.pow(10, numberOfDigits - 3)
+ )
+ return addLeadingZeros(fractionalSeconds, token.length)
+ },
+}
+
+export default formatters
diff --git a/date-fns/src/_lib/format/longFormatters/index.js b/date-fns/src/_lib/format/longFormatters/index.js
new file mode 100644
index 0000000..ff84163
--- /dev/null
+++ b/date-fns/src/_lib/format/longFormatters/index.js
@@ -0,0 +1,66 @@
+function dateLongFormatter(pattern, formatLong) {
+ switch (pattern) {
+ case 'P':
+ return formatLong.date({ width: 'short' })
+ case 'PP':
+ return formatLong.date({ width: 'medium' })
+ case 'PPP':
+ return formatLong.date({ width: 'long' })
+ case 'PPPP':
+ default:
+ return formatLong.date({ width: 'full' })
+ }
+}
+
+function timeLongFormatter(pattern, formatLong) {
+ switch (pattern) {
+ case 'p':
+ return formatLong.time({ width: 'short' })
+ case 'pp':
+ return formatLong.time({ width: 'medium' })
+ case 'ppp':
+ return formatLong.time({ width: 'long' })
+ case 'pppp':
+ default:
+ return formatLong.time({ width: 'full' })
+ }
+}
+
+function dateTimeLongFormatter(pattern, formatLong) {
+ var matchResult = pattern.match(/(P+)(p+)?/)
+ var datePattern = matchResult[1]
+ var timePattern = matchResult[2]
+
+ if (!timePattern) {
+ return dateLongFormatter(pattern, formatLong)
+ }
+
+ var dateTimeFormat
+
+ switch (datePattern) {
+ case 'P':
+ dateTimeFormat = formatLong.dateTime({ width: 'short' })
+ break
+ case 'PP':
+ dateTimeFormat = formatLong.dateTime({ width: 'medium' })
+ break
+ case 'PPP':
+ dateTimeFormat = formatLong.dateTime({ width: 'long' })
+ break
+ case 'PPPP':
+ default:
+ dateTimeFormat = formatLong.dateTime({ width: 'full' })
+ break
+ }
+
+ return dateTimeFormat
+ .replace('{{date}}', dateLongFormatter(datePattern, formatLong))
+ .replace('{{time}}', timeLongFormatter(timePattern, formatLong))
+}
+
+var longFormatters = {
+ p: timeLongFormatter,
+ P: dateTimeLongFormatter
+}
+
+export default longFormatters
diff --git a/date-fns/src/_lib/getTimezoneOffsetInMilliseconds/index.js b/date-fns/src/_lib/getTimezoneOffsetInMilliseconds/index.js
new file mode 100644
index 0000000..0b637c4
--- /dev/null
+++ b/date-fns/src/_lib/getTimezoneOffsetInMilliseconds/index.js
@@ -0,0 +1,26 @@
+/**
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
+ * They usually appear for dates that denote time before the timezones were introduced
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
+ * and GMT+01:00:00 after that date)
+ *
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
+ * which would lead to incorrect calculations.
+ *
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
+ */
+export default function getTimezoneOffsetInMilliseconds(date) {
+ const utcDate = new Date(
+ Date.UTC(
+ date.getFullYear(),
+ date.getMonth(),
+ date.getDate(),
+ date.getHours(),
+ date.getMinutes(),
+ date.getSeconds(),
+ date.getMilliseconds()
+ )
+ )
+ utcDate.setUTCFullYear(date.getFullYear())
+ return date.getTime() - utcDate.getTime()
+}
diff --git a/date-fns/src/_lib/getTimezoneOffsetInMilliseconds/test.js b/date-fns/src/_lib/getTimezoneOffsetInMilliseconds/test.js
new file mode 100644
index 0000000..821e16f
--- /dev/null
+++ b/date-fns/src/_lib/getTimezoneOffsetInMilliseconds/test.js
@@ -0,0 +1,28 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getTimezoneOffsetInMilliseconds from '.'
+
+describe('getTimezoneOffsetInMilliseconds', function () {
+ it('works for a modern date', function () {
+ var date = new Date(2018, 0 /* Jan */, 1, 12, 34, 56, 789)
+ var result = date.getTime() - getTimezoneOffsetInMilliseconds(date)
+ var expectedResult = Date.UTC(2018, 0 /* Jan */, 1, 12, 34, 56, 789)
+ assert(result === expectedResult)
+ })
+
+ it('works for a date before standardized timezones', function () {
+ var date = new Date(1800, 0 /* Jan */, 1, 12, 34, 56, 789)
+ var result = date.getTime() - getTimezoneOffsetInMilliseconds(date)
+ var expectedResult = Date.UTC(1800, 0 /* Jan */, 1, 12, 34, 56, 789)
+ assert(result === expectedResult)
+ })
+
+ it('works for a date BC', function () {
+ var date = new Date(-500, 0 /* Jan */, 1, 12, 34, 56, 789)
+ var result = date.getTime() - getTimezoneOffsetInMilliseconds(date)
+ var expectedResult = Date.UTC(-500, 0 /* Jan */, 1, 12, 34, 56, 789)
+ assert(result === expectedResult)
+ })
+})
diff --git a/date-fns/src/_lib/getUTCDayOfYear/index.js b/date-fns/src/_lib/getUTCDayOfYear/index.js
new file mode 100644
index 0000000..37cdc0e
--- /dev/null
+++ b/date-fns/src/_lib/getUTCDayOfYear/index.js
@@ -0,0 +1,18 @@
+import toDate from '../../toDate/index'
+import requiredArgs from '../requiredArgs/index'
+
+var MILLISECONDS_IN_DAY = 86400000
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function getUTCDayOfYear(dirtyDate) {
+ requiredArgs(1, arguments)
+
+ var date = toDate(dirtyDate)
+ var timestamp = date.getTime()
+ date.setUTCMonth(0, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ var startOfYearTimestamp = date.getTime()
+ var difference = timestamp - startOfYearTimestamp
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1
+}
diff --git a/date-fns/src/_lib/getUTCDayOfYear/test.js b/date-fns/src/_lib/getUTCDayOfYear/test.js
new file mode 100644
index 0000000..b4f2963
--- /dev/null
+++ b/date-fns/src/_lib/getUTCDayOfYear/test.js
@@ -0,0 +1,36 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getUTCDayOfYear from '.'
+
+describe('getUTCDayOfYear', function() {
+ it('returns the day of the year of the given date', function() {
+ var result = getUTCDayOfYear(new Date(Date.UTC(2014, 6 /* Jul */, 2)))
+ assert(result === 183)
+ })
+
+ it('accepts a timestamp', function() {
+ var result = getUTCDayOfYear(
+ new Date(Date.UTC(2014, 0 /* Jan */, 2)).getTime()
+ )
+ assert(result === 2)
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(0, 11 /* Dec */, 31)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var result = getUTCDayOfYear(initialDate)
+ assert(result === 366)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ var result = getUTCDayOfYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getUTCDayOfYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/getUTCISOWeek/index.js b/date-fns/src/_lib/getUTCISOWeek/index.js
new file mode 100644
index 0000000..ab17ea2
--- /dev/null
+++ b/date-fns/src/_lib/getUTCISOWeek/index.js
@@ -0,0 +1,21 @@
+import toDate from '../../toDate/index'
+import startOfUTCISOWeek from '../startOfUTCISOWeek/index'
+import startOfUTCISOWeekYear from '../startOfUTCISOWeekYear/index'
+import requiredArgs from '../requiredArgs/index'
+
+var MILLISECONDS_IN_WEEK = 604800000
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function getUTCISOWeek(dirtyDate) {
+ requiredArgs(1, arguments)
+
+ var date = toDate(dirtyDate)
+ var diff =
+ startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime()
+
+ // Round the number of days to the nearest integer
+ // because the number of milliseconds in a week is not constant
+ // (e.g. it's different in the week of the daylight saving time clock shift)
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1
+}
diff --git a/date-fns/src/_lib/getUTCISOWeek/test.js b/date-fns/src/_lib/getUTCISOWeek/test.js
new file mode 100644
index 0000000..29dc6b2
--- /dev/null
+++ b/date-fns/src/_lib/getUTCISOWeek/test.js
@@ -0,0 +1,58 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getUTCISOWeek from '.'
+
+describe('getUTCISOWeek', function() {
+ it('returns the ISO week of the given date', function() {
+ var result = getUTCISOWeek(new Date(Date.UTC(2005, 0 /* Jan */, 2)))
+ assert(result === 53)
+ })
+
+ it('accepts a timestamp', function() {
+ var result = getUTCISOWeek(
+ new Date(Date.UTC(2008, 11 /* Dec */, 29)).getTime()
+ )
+ assert(result === 1)
+ })
+
+ describe('edge cases', function() {
+ it('returns the ISO week at 1 January 2016', function() {
+ var result = getUTCISOWeek(new Date(Date.UTC(2016, 0 /* Jan */, 1)))
+ assert(result === 53)
+ })
+
+ it('returns the ISO week at 1 May 2016', function() {
+ var result = getUTCISOWeek(new Date(Date.UTC(2016, 4 /* May */, 1)))
+ assert(result === 17)
+ })
+
+ it('returns the ISO week at 2 May 2016', function() {
+ var result = getUTCISOWeek(new Date(Date.UTC(2016, 4 /* May */, 2)))
+ assert(result === 18)
+ })
+
+ it('returns the ISO week at 31 May 2016', function() {
+ var result = getUTCISOWeek(new Date(Date.UTC(2016, 4 /* May */, 31)))
+ assert(result === 22)
+ })
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(7, 11 /* Dec */, 30)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var result = getUTCISOWeek(initialDate)
+ assert(result === 52)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ var result = getUTCISOWeek(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getUTCISOWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/getUTCISOWeekYear/index.js b/date-fns/src/_lib/getUTCISOWeekYear/index.js
new file mode 100644
index 0000000..e098159
--- /dev/null
+++ b/date-fns/src/_lib/getUTCISOWeekYear/index.js
@@ -0,0 +1,30 @@
+import toDate from '../../toDate/index'
+import startOfUTCISOWeek from '../startOfUTCISOWeek/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function getUTCISOWeekYear(dirtyDate) {
+ requiredArgs(1, arguments)
+
+ var date = toDate(dirtyDate)
+ var year = date.getUTCFullYear()
+
+ var fourthOfJanuaryOfNextYear = new Date(0)
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4)
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0)
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear)
+
+ var fourthOfJanuaryOfThisYear = new Date(0)
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4)
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0)
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear)
+
+ if (date.getTime() >= startOfNextYear.getTime()) {
+ return year + 1
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
+ return year
+ } else {
+ return year - 1
+ }
+}
diff --git a/date-fns/src/_lib/getUTCISOWeekYear/test.js b/date-fns/src/_lib/getUTCISOWeekYear/test.js
new file mode 100644
index 0000000..07aab97
--- /dev/null
+++ b/date-fns/src/_lib/getUTCISOWeekYear/test.js
@@ -0,0 +1,36 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getUTCISOWeekYear from '.'
+
+describe('getUTCISOWeekYear', function() {
+ it('returns the ISO week-numbering year of the given date', function() {
+ var result = getUTCISOWeekYear(new Date(Date.UTC(2007, 11 /* Dec */, 31)))
+ assert(result === 2008)
+ })
+
+ it('accepts a timestamp', function() {
+ var result = getUTCISOWeekYear(
+ new Date(Date.UTC(2005, 0 /* Jan */, 1)).getTime()
+ )
+ assert(result === 2004)
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(7, 11 /* Dec */, 31)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var result = getUTCISOWeekYear(initialDate)
+ assert(result === 8)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ var result = getUTCISOWeekYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getUTCISOWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/getUTCWeek/index.js b/date-fns/src/_lib/getUTCWeek/index.js
new file mode 100644
index 0000000..0b69ba2
--- /dev/null
+++ b/date-fns/src/_lib/getUTCWeek/index.js
@@ -0,0 +1,22 @@
+import toDate from '../../toDate/index'
+import startOfUTCWeek from '../startOfUTCWeek/index'
+import startOfUTCWeekYear from '../startOfUTCWeekYear/index'
+import requiredArgs from '../requiredArgs/index'
+
+var MILLISECONDS_IN_WEEK = 604800000
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function getUTCWeek(dirtyDate, options) {
+ requiredArgs(1, arguments)
+
+ var date = toDate(dirtyDate)
+ var diff =
+ startOfUTCWeek(date, options).getTime() -
+ startOfUTCWeekYear(date, options).getTime()
+
+ // Round the number of days to the nearest integer
+ // because the number of milliseconds in a week is not constant
+ // (e.g. it's different in the week of the daylight saving time clock shift)
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1
+}
diff --git a/date-fns/src/_lib/getUTCWeek/test.js b/date-fns/src/_lib/getUTCWeek/test.js
new file mode 100644
index 0000000..0814368
--- /dev/null
+++ b/date-fns/src/_lib/getUTCWeek/test.js
@@ -0,0 +1,70 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getUTCWeek from '.'
+
+describe('getUTCWeek', function() {
+ it('returns the local week of year of the given date', function() {
+ var result = getUTCWeek(new Date(Date.UTC(2005, 0 /* Jan */, 2)))
+ assert(result === 2)
+ })
+
+ it('accepts a timestamp', function() {
+ var result = getUTCWeek(Date.UTC(2008, 11 /* Dec */, 29))
+ assert(result === 1)
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(7, 11 /* Dec */, 30)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var result = getUTCWeek(initialDate)
+ assert(result === 1)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ var result = getUTCWeek(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function() {
+ var date = new Date(Date.UTC(2005, 0 /* Jan */, 2))
+ var result = getUTCWeek(date, {
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert(result === 53)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var date = new Date(Date.UTC(2005, 0 /* Jan */, 2))
+ var result = getUTCWeek(date, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert(result === 53)
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ var block = getUTCWeek.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ weekStartsOn: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function() {
+ var block = getUTCWeek.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ firstWeekContainsDate: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getUTCWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/getUTCWeekYear/index.js b/date-fns/src/_lib/getUTCWeekYear/index.js
new file mode 100644
index 0000000..1f561c7
--- /dev/null
+++ b/date-fns/src/_lib/getUTCWeekYear/index.js
@@ -0,0 +1,51 @@
+import toInteger from '../toInteger/index'
+import toDate from '../../toDate/index'
+import startOfUTCWeek from '../startOfUTCWeek/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function getUTCWeekYear(dirtyDate, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ var date = toDate(dirtyDate, dirtyOptions)
+ var year = date.getUTCFullYear()
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeFirstWeekContainsDate =
+ locale && locale.options && locale.options.firstWeekContainsDate
+ var defaultFirstWeekContainsDate =
+ localeFirstWeekContainsDate == null
+ ? 1
+ : toInteger(localeFirstWeekContainsDate)
+ var firstWeekContainsDate =
+ options.firstWeekContainsDate == null
+ ? defaultFirstWeekContainsDate
+ : toInteger(options.firstWeekContainsDate)
+
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
+ throw new RangeError(
+ 'firstWeekContainsDate must be between 1 and 7 inclusively'
+ )
+ }
+
+ var firstWeekOfNextYear = new Date(0)
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate)
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0)
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions)
+
+ var firstWeekOfThisYear = new Date(0)
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate)
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0)
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions)
+
+ if (date.getTime() >= startOfNextYear.getTime()) {
+ return year + 1
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
+ return year
+ } else {
+ return year - 1
+ }
+}
diff --git a/date-fns/src/_lib/getUTCWeekYear/test.js b/date-fns/src/_lib/getUTCWeekYear/test.js
new file mode 100644
index 0000000..3b45fc4
--- /dev/null
+++ b/date-fns/src/_lib/getUTCWeekYear/test.js
@@ -0,0 +1,70 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getUTCWeekYear from '.'
+
+describe('getUTCWeekYear', function() {
+ it('returns the local week-numbering year of the given date', function() {
+ var result = getUTCWeekYear(new Date(Date.UTC(2004, 11 /* Dec */, 26)))
+ assert(result === 2005)
+ })
+
+ it('accepts a timestamp', function() {
+ var result = getUTCWeekYear(Date.UTC(2000, 11 /* Dec */, 30))
+ assert(result === 2000)
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(7, 11 /* Dec */, 31)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var result = getUTCWeekYear(initialDate)
+ assert(result === 8)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ var result = getUTCWeekYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function() {
+ var date = new Date(Date.UTC(2004, 11 /* Dec */, 26))
+ var result = getUTCWeekYear(date, {
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert(result === 2004)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var date = new Date(Date.UTC(2004, 11 /* Dec */, 26))
+ var result = getUTCWeekYear(date, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert(result === 2004)
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ var block = getUTCWeekYear.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ weekStartsOn: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function() {
+ var block = getUTCWeekYear.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ firstWeekContainsDate: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getUTCWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/isSameUTCWeek/index.js b/date-fns/src/_lib/isSameUTCWeek/index.js
new file mode 100644
index 0000000..699806f
--- /dev/null
+++ b/date-fns/src/_lib/isSameUTCWeek/index.js
@@ -0,0 +1,13 @@
+import startOfUTCWeek from '../startOfUTCWeek/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function isSameUTCWeek(dirtyDateLeft, dirtyDateRight, options) {
+ requiredArgs(2, arguments)
+
+ var dateLeftStartOfWeek = startOfUTCWeek(dirtyDateLeft, options)
+ var dateRightStartOfWeek = startOfUTCWeek(dirtyDateRight, options)
+
+ return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime()
+}
diff --git a/date-fns/src/_lib/isSameUTCWeek/test.js b/date-fns/src/_lib/isSameUTCWeek/test.js
new file mode 100644
index 0000000..909d034
--- /dev/null
+++ b/date-fns/src/_lib/isSameUTCWeek/test.js
@@ -0,0 +1,111 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameUTCWeek from '.'
+
+describe('isSameUTCWeek', function() {
+ it('returns true if the given dates have the same week', function() {
+ var result = isSameUTCWeek(
+ new Date(Date.UTC(2014, 7 /* Aug */, 31)),
+ new Date(Date.UTC(2014, 8 /* Sep */, 4))
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different weeks', function() {
+ var result = isSameUTCWeek(
+ new Date(Date.UTC(2014, 7 /* Aug */, 30)),
+ new Date(Date.UTC(2014, 8 /* Sep */, 4))
+ )
+ assert(result === false)
+ })
+
+ it('allows to specify which day is the first day of the week', function() {
+ var result = isSameUTCWeek(
+ new Date(Date.UTC(2014, 7 /* Aug */, 31)),
+ new Date(Date.UTC(2014, 8 /* Sep */, 4)),
+ { weekStartsOn: 1 }
+ )
+ assert(result === false)
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function() {
+ var result = isSameUTCWeek(
+ new Date(Date.UTC(2014, 7 /* Aug */, 31)),
+ new Date(Date.UTC(2014, 8 /* Sep */, 4)),
+ {
+ locale: {
+ options: { weekStartsOn: 1 }
+ }
+ }
+ )
+ assert(result === false)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var result = isSameUTCWeek(
+ new Date(Date.UTC(2014, 7 /* Aug */, 31)),
+ new Date(Date.UTC(2014, 8 /* Sep */, 4)),
+ {
+ weekStartsOn: 1,
+ locale: {
+ options: { weekStartsOn: 0 }
+ }
+ }
+ )
+ assert(result === false)
+ })
+
+ it('implicitly converts options', function() {
+ var result = isSameUTCWeek(
+ new Date(Date.UTC(2014, 7 /* Aug */, 31)),
+ new Date(Date.UTC(2014, 8 /* Sep */, 4)),
+ { weekStartsOn: '1' }
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ var result = isSameUTCWeek(
+ Date.UTC(2014, 7 /* Aug */, 31),
+ Date.UTC(2014, 8 /* Sep */, 4)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ var result = isSameUTCWeek(
+ new Date(NaN),
+ new Date(Date.UTC(1989, 6 /* Jul */, 10))
+ )
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ var result = isSameUTCWeek(
+ new Date(Date.UTC(1987, 1 /* Feb */, 11)),
+ new Date(NaN)
+ )
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ var result = isSameUTCWeek(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ var block = isSameUTCWeek.bind(
+ null,
+ new Date(Date.UTC(2014, 7 /* Aug */, 31)),
+ new Date(Date.UTC(2014, 8 /* Sep */, 4)),
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isSameUTCWeek.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/protectedTokens/index.js b/date-fns/src/_lib/protectedTokens/index.js
new file mode 100644
index 0000000..c62313f
--- /dev/null
+++ b/date-fns/src/_lib/protectedTokens/index.js
@@ -0,0 +1,30 @@
+var protectedDayOfYearTokens = ['D', 'DD']
+var protectedWeekYearTokens = ['YY', 'YYYY']
+
+export function isProtectedDayOfYearToken(token) {
+ return protectedDayOfYearTokens.indexOf(token) !== -1
+}
+
+export function isProtectedWeekYearToken(token) {
+ return protectedWeekYearTokens.indexOf(token) !== -1
+}
+
+export function throwProtectedError(token, format, input) {
+ if (token === 'YYYY') {
+ throw new RangeError(
+ `Use \`yyyy\` instead of \`YYYY\` (in \`${format}\`) for formatting years to the input \`${input}\`; see: https://git.io/fxCyr`
+ )
+ } else if (token === 'YY') {
+ throw new RangeError(
+ `Use \`yy\` instead of \`YY\` (in \`${format}\`) for formatting years to the input \`${input}\`; see: https://git.io/fxCyr`
+ )
+ } else if (token === 'D') {
+ throw new RangeError(
+ `Use \`d\` instead of \`D\` (in \`${format}\`) for formatting days of the month to the input \`${input}\`; see: https://git.io/fxCyr`
+ )
+ } else if (token === 'DD') {
+ throw new RangeError(
+ `Use \`dd\` instead of \`DD\` (in \`${format}\`) for formatting days of the month to the input \`${input}\`; see: https://git.io/fxCyr`
+ )
+ }
+}
diff --git a/date-fns/src/_lib/requiredArgs/index.ts b/date-fns/src/_lib/requiredArgs/index.ts
new file mode 100644
index 0000000..bdbb950
--- /dev/null
+++ b/date-fns/src/_lib/requiredArgs/index.ts
@@ -0,0 +1,12 @@
+export default function requiredArgs(required: number, args: IArguments) {
+ if (args.length < required) {
+ throw new TypeError(
+ required +
+ ' argument' +
+ (required > 1 ? 's' : '') +
+ ' required, but only ' +
+ args.length +
+ ' present'
+ )
+ }
+}
diff --git a/date-fns/src/_lib/requiredArgs/test.js b/date-fns/src/_lib/requiredArgs/test.js
new file mode 100644
index 0000000..a6cbe4a
--- /dev/null
+++ b/date-fns/src/_lib/requiredArgs/test.js
@@ -0,0 +1,37 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import requiredArgs from '.'
+
+describe('requiredArgs', function () {
+ function wrapperFn(required) {
+ // $ExpectedMistake
+ return function () {
+ requiredArgs(required, arguments)
+ }
+ }
+ const twoArgsRequired = wrapperFn(2)
+
+ describe('with correct number of passed arguments', function () {
+ it('does not throw an error', function () {
+ assert.doesNotThrow(() => twoArgsRequired(1, 2))
+ })
+ })
+
+ describe('with wrong number of arguments', function () {
+ it('throws correct error message', function () {
+ assert.throws(
+ function () {
+ twoArgsRequired(1)
+ },
+ function (err) {
+ return (
+ err instanceof TypeError &&
+ err.message === '2 arguments required, but only 1 present'
+ )
+ }
+ )
+ })
+ })
+})
diff --git a/date-fns/src/_lib/setUTCDay/index.js b/date-fns/src/_lib/setUTCDay/index.js
new file mode 100644
index 0000000..6e4e472
--- /dev/null
+++ b/date-fns/src/_lib/setUTCDay/index.js
@@ -0,0 +1,38 @@
+import toInteger from '../toInteger/index'
+import toDate from '../../toDate/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {
+ requiredArgs(2, arguments)
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeWeekStartsOn =
+ locale && locale.options && locale.options.weekStartsOn
+ var defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ var weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ var date = toDate(dirtyDate)
+ var day = toInteger(dirtyDay)
+
+ var currentDay = date.getUTCDay()
+
+ var remainder = day % 7
+ var dayIndex = (remainder + 7) % 7
+
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay
+
+ date.setUTCDate(date.getUTCDate() + diff)
+ return date
+}
diff --git a/date-fns/src/_lib/setUTCDay/test.js b/date-fns/src/_lib/setUTCDay/test.js
new file mode 100644
index 0000000..a34074b
--- /dev/null
+++ b/date-fns/src/_lib/setUTCDay/test.js
@@ -0,0 +1,132 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setUTCDay from '.'
+
+describe('setUTCDay', function () {
+ it('sets the day of the week', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 0)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 31)))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 0, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 7)))
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 0, {
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 7)))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 0, {
+ weekStartsOn: 1,
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 7)))
+ })
+
+ describe('the day index is more than 6', function () {
+ it('sets the day of the next week', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 8)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 8)))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 7, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 14)))
+ })
+
+ it('sets the day of another week in the future', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 14, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 21)))
+ })
+ })
+
+ describe('the day index is less than 0', function () {
+ it('sets the day of the last week', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), -6)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 25)))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), -7, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 31)))
+ })
+
+ it('set the day of another week in the past', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), -14, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 24)))
+ })
+ })
+
+ it('accepts a timestamp', function () {
+ var result = setUTCDay(
+ new Date(Date.UTC(2014, 8 /* Sep */, 1)).getTime(),
+ 3
+ )
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 3)))
+ })
+
+ it('converts a fractional number to an integer', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 0.9)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 31)))
+ })
+
+ it('implicitly converts number arguments', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), '0')
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 31)))
+ })
+
+ it('implicitly converts options', function () {
+ var result = setUTCDay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 0, {
+ weekStartsOn: '1',
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 7)))
+ })
+
+ it('does not mutate the original date', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 1))
+ setUTCDay(date, 3)
+ assert.deepEqual(date, new Date(Date.UTC(2014, 8 /* Sep */, 1)))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ var result = setUTCDay(new Date(NaN), 0)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function () {
+ var result = setUTCDay(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ var block = setUTCDay.bind(null, new Date(2014, 8 /* Sep */, 1), 0, {
+ weekStartsOn: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(setUTCDay.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/setUTCISODay/index.js b/date-fns/src/_lib/setUTCISODay/index.js
new file mode 100644
index 0000000..cbd2fbc
--- /dev/null
+++ b/date-fns/src/_lib/setUTCISODay/index.js
@@ -0,0 +1,27 @@
+import toInteger from '../toInteger/index'
+import toDate from '../../toDate/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function setUTCISODay(dirtyDate, dirtyDay) {
+ requiredArgs(2, arguments)
+
+ var day = toInteger(dirtyDay)
+
+ if (day % 7 === 0) {
+ day = day - 7
+ }
+
+ var weekStartsOn = 1
+ var date = toDate(dirtyDate)
+ var currentDay = date.getUTCDay()
+
+ var remainder = day % 7
+ var dayIndex = (remainder + 7) % 7
+
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay
+
+ date.setUTCDate(date.getUTCDate() + diff)
+ return date
+}
diff --git a/date-fns/src/_lib/setUTCISODay/test.js b/date-fns/src/_lib/setUTCISODay/test.js
new file mode 100644
index 0000000..11b6019
--- /dev/null
+++ b/date-fns/src/_lib/setUTCISODay/test.js
@@ -0,0 +1,79 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setUTCISODay from '.'
+
+describe('setUTCISODay', function () {
+ it('sets the day of the ISO week', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 3)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 3)))
+ })
+
+ it('sets the day to Sunday of this ISO week if the index is 7', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 7)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 7)))
+ })
+
+ describe('the day index is more than 7', function () {
+ it('sets the day of the next ISO week', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 8)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 8)))
+ })
+
+ it('sets the day of another ISO week in the future', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 21)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 21)))
+ })
+ })
+
+ describe('the day index is less than 1', function () {
+ it('sets the day of the last ISO week', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 0)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 31)))
+ })
+
+ it('set the day of another ISO week in the past', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), -13)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 18)))
+ })
+ })
+
+ it('accepts a timestamp', function () {
+ var result = setUTCISODay(
+ new Date(Date.UTC(2014, 8 /* Sep */, 1)).getTime(),
+ 3
+ )
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 3)))
+ })
+
+ it('converts a fractional number to an integer', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), 3.33)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 3)))
+ })
+
+ it('implicitly converts number arguments', function () {
+ var result = setUTCISODay(new Date(Date.UTC(2014, 8 /* Sep */, 1)), '3')
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 3)))
+ })
+
+ it('does not mutate the original date', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 1))
+ setUTCISODay(date, 3)
+ assert.deepEqual(date, new Date(Date.UTC(2014, 8 /* Sep */, 1)))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ var result = setUTCISODay(new Date(NaN), 3)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function () {
+ var result = setUTCISODay(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(setUTCISODay.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/setUTCISOWeek/index.js b/date-fns/src/_lib/setUTCISOWeek/index.js
new file mode 100644
index 0000000..99ce6da
--- /dev/null
+++ b/date-fns/src/_lib/setUTCISOWeek/index.js
@@ -0,0 +1,16 @@
+import toInteger from '../toInteger/index'
+import toDate from '../../toDate/index'
+import getUTCISOWeek from '../getUTCISOWeek/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
+ requiredArgs(2, arguments)
+
+ var date = toDate(dirtyDate)
+ var isoWeek = toInteger(dirtyISOWeek)
+ var diff = getUTCISOWeek(date) - isoWeek
+ date.setUTCDate(date.getUTCDate() - diff * 7)
+ return date
+}
diff --git a/date-fns/src/_lib/setUTCISOWeek/test.js b/date-fns/src/_lib/setUTCISOWeek/test.js
new file mode 100644
index 0000000..07b7276
--- /dev/null
+++ b/date-fns/src/_lib/setUTCISOWeek/test.js
@@ -0,0 +1,61 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setUTCISOWeek from '.'
+
+describe('setUTCISOWeek', function() {
+ it('sets the ISO week', function() {
+ var result = setUTCISOWeek(new Date(Date.UTC(2004, 7 /* Aug */, 7)), 53)
+ assert.deepEqual(result, new Date(Date.UTC(2005, 0 /* Jan */, 1)))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = setUTCISOWeek(
+ new Date(Date.UTC(2009, 11 /* Dec */, 2)).getTime(),
+ 1
+ )
+ assert.deepEqual(result, new Date(Date.UTC(2008, 11 /* Dec */, 31)))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ var result = setUTCISOWeek(new Date(Date.UTC(2004, 7 /* Aug */, 7)), 53.53)
+ assert.deepEqual(result, new Date(Date.UTC(2005, 0 /* Jan */, 1)))
+ })
+
+ it('implicitly converts number arguments', function() {
+ var result = setUTCISOWeek(new Date(Date.UTC(2004, 7 /* Aug */, 7)), '53')
+ assert.deepEqual(result, new Date(Date.UTC(2005, 0 /* Jan */, 1)))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(Date.UTC(2014, 6 /* Jul */, 2))
+ setUTCISOWeek(date, 52)
+ assert.deepEqual(date, new Date(Date.UTC(2014, 6 /* Jul */, 2)))
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(4, 0 /* Jan */, 4)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var expectedResult = new Date(0)
+ expectedResult.setUTCFullYear(4, 11 /* Dec */, 26)
+ expectedResult.setUTCHours(0, 0, 0, 0)
+ var result = setUTCISOWeek(initialDate, 52)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = setUTCISOWeek(new Date(NaN), 53)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ var result = setUTCISOWeek(new Date(2004, 7 /* Aug */, 7), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(setUTCISOWeek.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/setUTCWeek/index.js b/date-fns/src/_lib/setUTCWeek/index.js
new file mode 100644
index 0000000..606d817
--- /dev/null
+++ b/date-fns/src/_lib/setUTCWeek/index.js
@@ -0,0 +1,16 @@
+import toInteger from '../toInteger/index'
+import toDate from '../../toDate/index'
+import getUTCWeek from '../getUTCWeek/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function setUTCWeek(dirtyDate, dirtyWeek, options) {
+ requiredArgs(2, arguments)
+
+ var date = toDate(dirtyDate)
+ var week = toInteger(dirtyWeek)
+ var diff = getUTCWeek(date, options) - week
+ date.setUTCDate(date.getUTCDate() - diff * 7)
+ return date
+}
diff --git a/date-fns/src/_lib/setUTCWeek/test.js b/date-fns/src/_lib/setUTCWeek/test.js
new file mode 100644
index 0000000..58aea10
--- /dev/null
+++ b/date-fns/src/_lib/setUTCWeek/test.js
@@ -0,0 +1,95 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setUTCWeek from '.'
+
+describe('setUTCWeek', function() {
+ it('sets the local week', function() {
+ var result = setUTCWeek(new Date(Date.UTC(2005, 0 /* Jan */, 2)), 1)
+ assert.deepEqual(result, new Date(Date.UTC(2004, 11 /* Dec */, 26)))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = setUTCWeek(Date.UTC(2009, 11 /* Dec */, 2), 1)
+ assert.deepEqual(result, new Date(Date.UTC(2008, 11 /* Dec */, 31)))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ var result = setUTCWeek(new Date(Date.UTC(2005, 0 /* Jan */, 2)), 1.1)
+ assert.deepEqual(result, new Date(Date.UTC(2004, 11 /* Dec */, 26)))
+ })
+
+ it('implicitly converts number arguments', function() {
+ var result = setUTCWeek(new Date(Date.UTC(2004, 7 /* Aug */, 7)), '53')
+ assert.deepEqual(result, new Date(Date.UTC(2005, 0 /* Jan */, 1)))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ setUTCWeek(date, 52)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(4, 0 /* Jan */, 4)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var expectedResult = new Date(0)
+ expectedResult.setUTCFullYear(4, 11 /* Dec */, 19)
+ expectedResult.setUTCHours(0, 0, 0, 0)
+ var result = setUTCWeek(initialDate, 52)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = setUTCWeek(new Date(NaN), 53)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ var result = setUTCWeek(new Date(2004, 7 /* Aug */, 7), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function() {
+ var date = new Date(Date.UTC(2005, 0 /* Jan */, 2))
+ var result = setUTCWeek(date, 1, {
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2004, 0 /* Jan */, 4)))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var date = new Date(Date.UTC(2005, 0 /* Jan */, 2))
+ var result = setUTCWeek(date, 1, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2004, 0 /* Jan */, 4)))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ var block = setUTCWeek.bind(null, new Date(2004, 7 /* Aug */, 7), 53, {
+ weekStartsOn: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function() {
+ var block = setUTCWeek.bind(null, new Date(2004, 7 /* Aug */, 7), 53, {
+ firstWeekContainsDate: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setUTCWeek.bind(null), TypeError)
+ assert.throws(setUTCWeek.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/startOfUTCISOWeek/index.js b/date-fns/src/_lib/startOfUTCISOWeek/index.js
new file mode 100644
index 0000000..4633c38
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCISOWeek/index.js
@@ -0,0 +1,18 @@
+import toDate from '../../toDate/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function startOfUTCISOWeek(dirtyDate) {
+ requiredArgs(1, arguments)
+
+ var weekStartsOn = 1
+
+ var date = toDate(dirtyDate)
+ var day = date.getUTCDay()
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn
+
+ date.setUTCDate(date.getUTCDate() - diff)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/_lib/startOfUTCISOWeek/test.js b/date-fns/src/_lib/startOfUTCISOWeek/test.js
new file mode 100644
index 0000000..1c93535
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCISOWeek/test.js
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfUTCISOWeek from '.'
+
+describe('startOfUTCISOWeek', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of an ISO week', function() {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ var result = startOfUTCISOWeek(date)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 1)))
+ })
+
+ it('accepts a timestamp', function() {
+ var date = new Date(Date.UTC(2014, 1 /* Feb */, 11, 11, 55, 0)).getTime()
+ var result = startOfUTCISOWeek(date)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 1 /* Feb */, 10)))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ startOfUTCISOWeek(date)
+ assert.deepEqual(date, new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0)))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = startOfUTCISOWeek(new Date(NaN))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfUTCISOWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/startOfUTCISOWeekYear/index.js b/date-fns/src/_lib/startOfUTCISOWeekYear/index.js
new file mode 100644
index 0000000..db3313c
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCISOWeekYear/index.js
@@ -0,0 +1,16 @@
+import getUTCISOWeekYear from '../getUTCISOWeekYear/index'
+import startOfUTCISOWeek from '../startOfUTCISOWeek/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function startOfUTCISOWeekYear(dirtyDate) {
+ requiredArgs(1, arguments)
+
+ var year = getUTCISOWeekYear(dirtyDate)
+ var fourthOfJanuary = new Date(0)
+ fourthOfJanuary.setUTCFullYear(year, 0, 4)
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0)
+ var date = startOfUTCISOWeek(fourthOfJanuary)
+ return date
+}
diff --git a/date-fns/src/_lib/startOfUTCISOWeekYear/test.js b/date-fns/src/_lib/startOfUTCISOWeekYear/test.js
new file mode 100644
index 0000000..5d0485f
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCISOWeekYear/test.js
@@ -0,0 +1,58 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfUTCISOWeekYear from '.'
+
+describe('startOfUTCISOWeekYear', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of an ISO year', function() {
+ var result = startOfUTCISOWeekYear(
+ new Date(Date.UTC(2009, 0 /* Jan */, 1, 16, 0))
+ )
+ assert.deepEqual(
+ result,
+ new Date(Date.UTC(2008, 11 /* Dec */, 29, 0, 0, 0, 0))
+ )
+ })
+
+ it('accepts a timestamp', function() {
+ var result = startOfUTCISOWeekYear(
+ new Date(Date.UTC(2005, 0 /* Jan */, 1, 6, 0)).getTime()
+ )
+ assert.deepEqual(
+ result,
+ new Date(Date.UTC(2003, 11 /* Dec */, 29, 0, 0, 0, 0))
+ )
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(Date.UTC(2014, 6 /* Jul */, 2))
+ startOfUTCISOWeekYear(date)
+ assert.deepEqual(date, new Date(Date.UTC(2014, 6 /* Jul */, 2)))
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(9, 0 /* Jan */, 1)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var expectedResult = new Date(0)
+ expectedResult.setUTCFullYear(8, 11 /* Dec */, 29)
+ expectedResult.setUTCHours(0, 0, 0, 0)
+ var result = startOfUTCISOWeekYear(initialDate)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('correctly handles years in which 4 January is Sunday', function() {
+ var result = startOfUTCISOWeekYear(new Date(Date.UTC(2009, 6 /* Jul */, 2)))
+ assert.deepEqual(result, new Date(Date.UTC(2008, 11 /* Dec */, 29)))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = startOfUTCISOWeekYear(new Date(NaN))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfUTCISOWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/startOfUTCWeek/index.js b/date-fns/src/_lib/startOfUTCWeek/index.js
new file mode 100644
index 0000000..fb5db75
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCWeek/index.js
@@ -0,0 +1,33 @@
+import toInteger from '../toInteger/index'
+import toDate from '../../toDate/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function startOfUTCWeek(dirtyDate, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeWeekStartsOn =
+ locale && locale.options && locale.options.weekStartsOn
+ var defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ var weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ var date = toDate(dirtyDate)
+ var day = date.getUTCDay()
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn
+
+ date.setUTCDate(date.getUTCDate() - diff)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/_lib/startOfUTCWeek/test.js b/date-fns/src/_lib/startOfUTCWeek/test.js
new file mode 100644
index 0000000..15680f0
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCWeek/test.js
@@ -0,0 +1,108 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfUTCWeek from '.'
+
+describe('startOfUTCWeek', function () {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a week', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ var result = startOfUTCWeek(date)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 31)))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ var result = startOfUTCWeek(date, { weekStartsOn: 1 })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 1)))
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ var result = startOfUTCWeek(date, {
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 1)))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ var result = startOfUTCWeek(date, {
+ weekStartsOn: 1,
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 1)))
+ })
+
+ it('implicitly converts options', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ var result = startOfUTCWeek(date, { weekStartsOn: '1' })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 8 /* Sep */, 1)))
+ })
+
+ it('accepts a timestamp', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0)).getTime()
+ var result = startOfUTCWeek(date)
+ assert.deepEqual(result, new Date(Date.UTC(2014, 7 /* Aug */, 31)))
+ })
+
+ it('does not mutate the original date', function () {
+ var date = new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0))
+ startOfUTCWeek(date)
+ assert.deepEqual(date, new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0)))
+ })
+
+ describe('edge cases', function () {
+ describe('when the given day is before the start of a week', function () {
+ it('it returns the start of a week', function () {
+ var date = new Date(Date.UTC(2014, 9 /* Oct */, 6))
+ var result = startOfUTCWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 9 /* Oct */, 1)))
+ })
+ })
+
+ describe('when the given day is the start of a week', function () {
+ it('it returns the start of a week', function () {
+ var date = new Date(Date.UTC(2014, 9 /* Oct */, 8))
+ var result = startOfUTCWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 9 /* Oct */, 8)))
+ })
+ })
+
+ describe('when the given day is after the start of a week', function () {
+ it('it returns the start of a week', function () {
+ var date = new Date(Date.UTC(2014, 9 /* Oct */, 10))
+ var result = startOfUTCWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(Date.UTC(2014, 9 /* Oct */, 8)))
+ })
+ })
+
+ it('handles the week at the start of a year', function () {
+ var date = new Date(Date.UTC(2014, 0 /* Jan */, 1))
+ var result = startOfUTCWeek(date)
+ assert.deepEqual(result, new Date(Date.UTC(2013, 11 /* Dec */, 29)))
+ })
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ var result = startOfUTCWeek(new Date(NaN))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ var block = startOfUTCWeek.bind(
+ null,
+ new Date(Date.UTC(2014, 8 /* Sep */, 2, 11, 55, 0)),
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(startOfUTCWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/startOfUTCWeekYear/index.js b/date-fns/src/_lib/startOfUTCWeekYear/index.js
new file mode 100644
index 0000000..5b505db
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCWeekYear/index.js
@@ -0,0 +1,30 @@
+import toInteger from '../toInteger/index'
+import getUTCWeekYear from '../getUTCWeekYear/index'
+import startOfUTCWeek from '../startOfUTCWeek/index'
+import requiredArgs from '../requiredArgs/index'
+
+// This function will be a part of public API when UTC function will be implemented.
+// See issue: https://github.com/date-fns/date-fns/issues/376
+export default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeFirstWeekContainsDate =
+ locale && locale.options && locale.options.firstWeekContainsDate
+ var defaultFirstWeekContainsDate =
+ localeFirstWeekContainsDate == null
+ ? 1
+ : toInteger(localeFirstWeekContainsDate)
+ var firstWeekContainsDate =
+ options.firstWeekContainsDate == null
+ ? defaultFirstWeekContainsDate
+ : toInteger(options.firstWeekContainsDate)
+
+ var year = getUTCWeekYear(dirtyDate, dirtyOptions)
+ var firstWeek = new Date(0)
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate)
+ firstWeek.setUTCHours(0, 0, 0, 0)
+ var date = startOfUTCWeek(firstWeek, dirtyOptions)
+ return date
+}
diff --git a/date-fns/src/_lib/startOfUTCWeekYear/test.js b/date-fns/src/_lib/startOfUTCWeekYear/test.js
new file mode 100644
index 0000000..73bb518
--- /dev/null
+++ b/date-fns/src/_lib/startOfUTCWeekYear/test.js
@@ -0,0 +1,95 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfUTCWeekYear from '.'
+
+describe('startOfUTCWeekYear', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a week year', function() {
+ var result = startOfUTCWeekYear(new Date(Date.UTC(2005, 6 /* Jul */, 2)))
+ assert.deepEqual(
+ result,
+ new Date(Date.UTC(2004, 11 /* Dec */, 26, 0, 0, 0, 0))
+ )
+ })
+
+ it('accepts a timestamp', function() {
+ var result = startOfUTCWeekYear(Date.UTC(2005, 0 /* Jan */, 1, 6, 0))
+ assert.deepEqual(
+ result,
+ new Date(Date.UTC(2004, 11 /* Dec */, 26, 0, 0, 0, 0))
+ )
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(Date.UTC(2014, 6 /* Jul */, 2))
+ startOfUTCWeekYear(date)
+ assert.deepEqual(date, new Date(Date.UTC(2014, 6 /* Jul */, 2)))
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setUTCFullYear(9, 0 /* Jan */, 1)
+ initialDate.setUTCHours(0, 0, 0, 0)
+ var expectedResult = new Date(0)
+ expectedResult.setUTCFullYear(8, 11 /* Dec */, 28)
+ expectedResult.setUTCHours(0, 0, 0, 0)
+ var result = startOfUTCWeekYear(initialDate)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = startOfUTCWeekYear(new Date(NaN))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function() {
+ var date = new Date(Date.UTC(2005, 6 /* Jul */, 2))
+ var result = startOfUTCWeekYear(date, {
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert.deepEqual(
+ result,
+ new Date(Date.UTC(2005, 0 /* Jan */, 3, 0, 0, 0, 0))
+ )
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var date = new Date(2005, 6 /* Jul */, 2)
+ var result = startOfUTCWeekYear(date, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert.deepEqual(
+ result,
+ new Date(Date.UTC(2005, 0 /* Jan */, 3, 0, 0, 0, 0))
+ )
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ var block = startOfUTCWeekYear.bind(
+ null,
+ new Date(2007, 11 /* Dec */, 31),
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function() {
+ var block = startOfUTCWeekYear.bind(
+ null,
+ new Date(2007, 11 /* Dec */, 31),
+ { firstWeekContainsDate: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfUTCWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/_lib/test/index.ts b/date-fns/src/_lib/test/index.ts
new file mode 100644
index 0000000..ecd8f8c
--- /dev/null
+++ b/date-fns/src/_lib/test/index.ts
@@ -0,0 +1 @@
+export function assertType<T>(_: T) {}
diff --git a/date-fns/src/_lib/toInteger/index.ts b/date-fns/src/_lib/toInteger/index.ts
new file mode 100644
index 0000000..e9a9359
--- /dev/null
+++ b/date-fns/src/_lib/toInteger/index.ts
@@ -0,0 +1,13 @@
+export default function toInteger(dirtyNumber: unknown) {
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
+ return NaN
+ }
+
+ const number = Number(dirtyNumber)
+
+ if (isNaN(number)) {
+ return number
+ }
+
+ return number < 0 ? Math.ceil(number) : Math.floor(number)
+}
diff --git a/date-fns/src/_lib/toInteger/test.js b/date-fns/src/_lib/toInteger/test.js
new file mode 100644
index 0000000..6542890
--- /dev/null
+++ b/date-fns/src/_lib/toInteger/test.js
@@ -0,0 +1,64 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import toInteger from '.'
+
+describe('toInteger', function () {
+ it('truncates positive numbers', function () {
+ var result = toInteger(10.99)
+ assert(result === 10)
+ })
+
+ it('truncates negative numbers', function () {
+ var result = toInteger(-5.5)
+ assert(result === -5)
+ })
+
+ it('converts convertable strings', function () {
+ var result = toInteger('-10.75')
+ assert(result === -10)
+ })
+
+ it('returns NaN for non-convertable strings', function () {
+ var result = toInteger('Foobar')
+ assert(typeof result === 'number' && isNaN(result))
+ })
+
+ it('returns NaN for false', function () {
+ var result = toInteger(false)
+ assert(typeof result === 'number' && isNaN(result))
+ })
+
+ it('returns NaN for true', function () {
+ var result = toInteger(true)
+ assert(typeof result === 'number' && isNaN(result))
+ })
+
+ it('returns NaN for null', function () {
+ var result = toInteger(null)
+ assert(typeof result === 'number' && isNaN(result))
+ })
+
+ it('returns NaN for undefined', function () {
+ var result = toInteger(undefined)
+ assert(typeof result === 'number' && isNaN(result))
+ })
+
+ it('returns NaN for NaN', function () {
+ var result = toInteger(NaN)
+ assert(typeof result === 'number' && isNaN(result))
+ })
+
+ it('converts convertable objects', function () {
+ // eslint-disable-next-line no-new-wrappers
+ var result = toInteger(new Number(123))
+ assert(result === 123)
+ })
+
+ it('returns NaN for non-convertable objects', function () {
+ // eslint-disable-next-line no-new-wrappers
+ var result = toInteger({})
+ assert(typeof result === 'number' && isNaN(result))
+ })
+})
diff --git a/date-fns/src/add/benchmark.js b/date-fns/src/add/benchmark.js
new file mode 100644
index 0000000..20544ae
--- /dev/null
+++ b/date-fns/src/add/benchmark.js
@@ -0,0 +1,25 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import add from '.'
+import moment from 'moment'
+
+suite(
+ 'add',
+ function() {
+ benchmark('date-fns', function() {
+ return add(this.date, { hours: 5, minutes: 10 })
+ })
+
+ benchmark('Moment.js', function() {
+ return this.moment.add({ hours: 5, minutes: 10 }, 'seconds')
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ this.moment = moment()
+ }
+ }
+)
diff --git a/date-fns/src/add/index.d.ts b/date-fns/src/add/index.d.ts
new file mode 100644
index 0000000..f620aa0
--- /dev/null
+++ b/date-fns/src/add/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { add } from 'date-fns'
+export default add
diff --git a/date-fns/src/add/index.js.flow b/date-fns/src/add/index.js.flow
new file mode 100644
index 0000000..e79df7c
--- /dev/null
+++ b/date-fns/src/add/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, duration: Duration) => Date
diff --git a/date-fns/src/add/index.ts b/date-fns/src/add/index.ts
new file mode 100644
index 0000000..5a4f019
--- /dev/null
+++ b/date-fns/src/add/index.ts
@@ -0,0 +1,79 @@
+import addDays from '../addDays/index'
+import addMonths from '../addMonths/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import toInteger from '../_lib/toInteger/index'
+import { Duration } from '../types'
+
+/**
+ * @name add
+ * @category Common Helpers
+ * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.
+ *
+ * @description
+ * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ *
+ * | Key | Description |
+ * |----------------|------------------------------------|
+ * | years | Amount of years to be added |
+ * | months | Amount of months to be added |
+ * | weeks | Amount of weeks to be added |
+ * | days | Amount of days to be added |
+ * | hours | Amount of hours to be added |
+ * | minutes | Amount of minutes to be added |
+ * | seconds | Amount of seconds to be added |
+ *
+ * All values default to 0
+ *
+ * @returns {Date} the new date with the seconds added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add the following duration to 1 September 2014, 10:19:50
+ * const result = add(new Date(2014, 8, 1, 10, 19, 50), {
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30,
+ * })
+ * //=> Thu Jun 15 2017 15:29:20
+ */
+export default function add(
+ dirtyDate: Date | number,
+ duration: Duration
+): Date {
+ requiredArgs(2, arguments)
+
+ if (!duration || typeof duration !== 'object') return new Date(NaN)
+
+ const years = 'years' in duration ? toInteger(duration.years) : 0
+ const months = 'months' in duration ? toInteger(duration.months) : 0
+ const weeks = 'weeks' in duration ? toInteger(duration.weeks) : 0
+ const days = 'days' in duration ? toInteger(duration.days) : 0
+ const hours = 'hours' in duration ? toInteger(duration.hours) : 0
+ const minutes = 'minutes' in duration ? toInteger(duration.minutes) : 0
+ const seconds = 'seconds' in duration ? toInteger(duration.seconds) : 0
+
+ // Add years and months
+ const date = toDate(dirtyDate)
+ const dateWithMonths =
+ months || years ? addMonths(date, months + years * 12) : date
+
+ // Add weeks and days
+ const dateWithDays =
+ days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths
+
+ // Add days, hours, minutes and seconds
+ const minutesToAdd = minutes + hours * 60
+ const secondsToAdd = seconds + minutesToAdd * 60
+ const msToAdd = secondsToAdd * 1000
+ const finalDate = new Date(dateWithDays.getTime() + msToAdd)
+
+ return finalDate
+}
diff --git a/date-fns/src/add/test.ts b/date-fns/src/add/test.ts
new file mode 100644
index 0000000..8c8d7a9
--- /dev/null
+++ b/date-fns/src/add/test.ts
@@ -0,0 +1,99 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import add from '.'
+import { getDstTransitions } from '../../test/dst/tzOffsetTransitions'
+
+describe('add', function() {
+ it('adds the values from the given object', function() {
+ const result = add(new Date(2014, 8 /* Sep */, 1, 10, 19, 50), {
+ years: 2,
+ months: 9,
+ weeks: 1,
+ days: 7,
+ hours: 5,
+ minutes: 9,
+ seconds: 30
+ })
+ assert.deepStrictEqual(result, new Date(2017, 5 /* June */, 15, 15, 29, 20))
+ })
+
+ it('returns same date object when passed empty duration values', function() {
+ const result = add(new Date(2014, 8 /* Sep */, 1, 10).getTime(), {})
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 1, 10))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = add(new Date(2014, 8 /* Sep */, 1, 10).getTime(), {
+ hours: 4
+ })
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 1, 14))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = add(new Date(2014, 8 /* Sep */, 1, 10), { hours: 4.2 })
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 1, 14))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = add(new Date(2014, 8 /* Sep */, 1, 10), { hours: '4.2' })
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 1, 14))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1, 10)
+ add(date, { hours: 4 })
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1, 10))
+ })
+
+ it('works well if the desired month has fewer days and the provided date is in the last day of a month', function() {
+ const date = new Date(2014, 11 /* Dec */, 31)
+ const result = add(date, { months: 9 })
+ assert.deepStrictEqual(result, new Date(2015, 8 /* Sep */, 30))
+ })
+
+ const dstTransitions = getDstTransitions(2017)
+ const dstOnly = dstTransitions.start && dstTransitions.end ? it : it.skip
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone || process.env.tz
+ const HOUR = 1000 * 60 * 60
+
+ dstOnly(
+ `works at DST-end boundary in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = dstTransitions.end
+ const result = add(date!, { hours: 1 })
+ assert.deepStrictEqual(result, new Date(date!.getTime() + HOUR))
+ }
+ )
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(-1, 10 /* Nov */, 30)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 1 /* Feb */, 29)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = add(initialDate, { months: 3 })
+ assert.deepStrictEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = add(new Date(NaN), { hours: 5 })
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws RangeError exception if passed Number as duration', function() {
+ // @ts-expect-error
+ const result = add(new Date(2014, 8, 1), 'wut')
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(add.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(add.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addBusinessDays/index.d.ts b/date-fns/src/addBusinessDays/index.d.ts
new file mode 100644
index 0000000..b1c084e
--- /dev/null
+++ b/date-fns/src/addBusinessDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addBusinessDays } from 'date-fns'
+export default addBusinessDays
diff --git a/date-fns/src/addBusinessDays/index.js.flow b/date-fns/src/addBusinessDays/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addBusinessDays/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addBusinessDays/index.ts b/date-fns/src/addBusinessDays/index.ts
new file mode 100644
index 0000000..0cfdf5c
--- /dev/null
+++ b/date-fns/src/addBusinessDays/index.ts
@@ -0,0 +1,67 @@
+import isWeekend from '../isWeekend/index'
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import isSunday from '../isSunday/index'
+import isSaturday from '../isSaturday/index'
+
+/**
+ * @name addBusinessDays
+ * @category Day Helpers
+ * @summary Add the specified number of business days (mon - fri) to the given date.
+ *
+ * @description
+ * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of business days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the business days added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 10 business days to 1 September 2014:
+ * const result = addBusinessDays(new Date(2014, 8, 1), 10)
+ * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)
+ */
+export default function addBusinessDays(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const startedOnWeekend = isWeekend(date)
+ const amount = toInteger(dirtyAmount)
+
+ if (isNaN(amount)) return new Date(NaN)
+
+ const hours = date.getHours()
+ const sign = amount < 0 ? -1 : 1
+ const fullWeeks = toInteger(amount / 5)
+
+ date.setDate(date.getDate() + fullWeeks * 7)
+
+ // Get remaining days not part of a full week
+ let restDays = Math.abs(amount % 5)
+
+ // Loops over remaining days
+ while (restDays > 0) {
+ date.setDate(date.getDate() + sign)
+ if (!isWeekend(date)) restDays -= 1
+ }
+
+ // If the date is a weekend day and we reduce a dividable of
+ // 5 from it, we land on a weekend date.
+ // To counter this, we add days accordingly to land on the next business day
+ if (startedOnWeekend && isWeekend(date) && amount !== 0) {
+ // If we're reducing days, we want to add days until we land on a weekday
+ // If we're adding days we want to reduce days until we land on a weekday
+ if (isSaturday(date)) date.setDate(date.getDate() + (sign < 0 ? 2 : -1))
+ if (isSunday(date)) date.setDate(date.getDate() + (sign < 0 ? 1 : -2))
+ }
+
+ // Restore hours to avoid DST lag
+ date.setHours(hours)
+
+ return date
+}
diff --git a/date-fns/src/addBusinessDays/test.ts b/date-fns/src/addBusinessDays/test.ts
new file mode 100644
index 0000000..e23bc11
--- /dev/null
+++ b/date-fns/src/addBusinessDays/test.ts
@@ -0,0 +1,95 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addBusinessDays from '.'
+
+describe('addBusinessDays', function() {
+ it('adds the given number of business days', function() {
+ const result = addBusinessDays(new Date(2014, 8 /* Sep */, 1), 10)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 15))
+ })
+
+ it('handles negative amount', function() {
+ const result = addBusinessDays(new Date(2014, 8 /* Sep */, 15), -10)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns the Monday when 1 day is added on the Friday', () => {
+ assert.deepStrictEqual(
+ addBusinessDays(new Date(2020, 0 /* Jan */, 10), 1), // Friday
+ new Date(2020, 0 /* Jan */, 13) // Monday
+ )
+ })
+
+ it('returns the Monday when 1 day is added on the Satuday', () => {
+ assert.deepStrictEqual(
+ addBusinessDays(new Date(2020, 0 /* Jan */, 11), 1), // Saturday
+ new Date(2020, 0 /* Jan */, 13) // Monday
+ )
+ })
+
+ it('returns the Monday when 1 day is added on the Sunday', () => {
+ assert.deepStrictEqual(
+ addBusinessDays(new Date(2020, 0 /* Jan */, 12), 1), // Sunday
+ new Date(2020, 0 /* Jan */, 13) // Monday
+ )
+ })
+
+ it('can handle a large number of business days', function() {
+ // @ts-ignore
+ if (typeof this.timeout === 'function') {
+ // @ts-ignore
+ this.timeout(500 /* 500 ms test timeout */)
+ }
+
+ const result = addBusinessDays(new Date(2014, 0 /* Jan */, 1), 3387885)
+ assert.deepStrictEqual(result, new Date(15000, 0 /* Jan */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addBusinessDays(new Date(2014, 8 /* Sep */, 1).getTime(), 10)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 15))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addBusinessDays(new Date(2014, 8 /* Sep */, 1), 10.5)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 15))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addBusinessDays(new Date(2014, 8 /* Sep */, 1), '10')
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 15))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ addBusinessDays(date, 11)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addBusinessDays(new Date(NaN), 10)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addBusinessDays(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addBusinessDays.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addBusinessDays.bind(null, 1), TypeError)
+ })
+ it('starting from a weekend day should land on a weekday when reducing a divisible by 5', function() {
+ const substractResult = addBusinessDays(new Date(2019, 7, 18), -5)
+ assert.deepStrictEqual(substractResult, new Date(2019, 7, 12))
+
+ const addResult = addBusinessDays(new Date(2019, 7, 18), 5)
+ assert.deepStrictEqual(addResult, new Date(2019, 7, 23))
+ })
+})
diff --git a/date-fns/src/addDays/benchmark.js b/date-fns/src/addDays/benchmark.js
new file mode 100644
index 0000000..6501f56
--- /dev/null
+++ b/date-fns/src/addDays/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addDays from '.'
+import moment from 'moment'
+
+suite('addDays', function () {
+ benchmark('date-fns', function () {
+ return addDays(this.date, 7)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(7, 'days')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addDays/index.d.ts b/date-fns/src/addDays/index.d.ts
new file mode 100644
index 0000000..fd7fb3d
--- /dev/null
+++ b/date-fns/src/addDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addDays } from 'date-fns'
+export default addDays
diff --git a/date-fns/src/addDays/index.js.flow b/date-fns/src/addDays/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addDays/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addDays/index.ts b/date-fns/src/addDays/index.ts
new file mode 100644
index 0000000..110ad51
--- /dev/null
+++ b/date-fns/src/addDays/index.ts
@@ -0,0 +1,44 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addDays
+ * @category Day Helpers
+ * @summary Add the specified number of days to the given date.
+ *
+ * @description
+ * Add the specified number of days to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} - the new date with the days added
+ * @throws {TypeError} - 2 arguments required
+ *
+ * @example
+ * // Add 10 days to 1 September 2014:
+ * const result = addDays(new Date(2014, 8, 1), 10)
+ * //=> Thu Sep 11 2014 00:00:00
+ */
+export default function addDays(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const amount = toInteger(dirtyAmount)
+ if (isNaN(amount)) {
+ return new Date(NaN)
+ }
+ if (!amount) {
+ // If 0 days, no-op to avoid changing times in the hour before end of DST
+ return date
+ }
+ date.setDate(date.getDate() + amount)
+ return date
+}
diff --git a/date-fns/src/addDays/test.ts b/date-fns/src/addDays/test.ts
new file mode 100644
index 0000000..5795dcd
--- /dev/null
+++ b/date-fns/src/addDays/test.ts
@@ -0,0 +1,129 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addDays from '.'
+import { getDstTransitions } from '../../test/dst/tzOffsetTransitions'
+
+describe('addDays', function() {
+ it('adds the given number of days', function() {
+ const result = addDays(new Date(2014, 8 /* Sep */, 1), 10)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 11))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addDays(new Date(2014, 8 /* Sep */, 1).getTime(), 10)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 11))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addDays(new Date(2014, 8 /* Sep */, 1), 10.5)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 11))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addDays(new Date(2014, 8 /* Sep */, 1), '10')
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 11))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ addDays(date, 11)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addDays(new Date(NaN), 10)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addDays(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ // @ts-expect-error
+ assert.throws(addDays.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addDays.bind(null, 1), TypeError)
+ })
+
+ const dstTransitions = getDstTransitions(2017)
+ const dstOnly = dstTransitions.start && dstTransitions.end ? it : it.skip
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone || process.env.tz
+ const HOUR = 1000 * 60 * 60
+ const MINUTE = 1000 * 60
+ // It's usually 1 hour, but for some timezones, e.g. Australia/Lord_Howe, it is 30 minutes
+ const dstOffset = dstTransitions.start && dstTransitions.end ? ((dstTransitions.end.getTimezoneOffset() - dstTransitions.start.getTimezoneOffset()) * MINUTE) : NaN
+
+ dstOnly(
+ `works at DST-start boundary in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = dstTransitions.start
+ const result = addDays(date!, 1)
+ assert.deepStrictEqual(result, new Date(date!.getTime() + 24 * HOUR))
+ }
+ )
+
+ dstOnly(
+ `works at DST-start - 30 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.start!.getTime() - 0.5 * HOUR)
+ const result = addDays(date, 1)
+ // started before the transition so will only be 23 hours later in local time
+ assert.deepStrictEqual(result, new Date(date.getTime() + 24 * HOUR - dstOffset))
+ }
+ )
+
+ dstOnly(
+ `works at DST-start - 60 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.start!.getTime() - 1 * HOUR)
+ const result = addDays(date, 1)
+ // started before the transition so will only be 23 hours later in local time
+ assert.deepStrictEqual(result, new Date(date.getTime() + 24 * HOUR - dstOffset))
+ }
+ )
+
+ dstOnly(
+ `works at DST-end boundary in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = dstTransitions.end
+ const result = addDays(date!, 1)
+ assert.deepStrictEqual(result, new Date(date!.getTime() + 24 * HOUR))
+ }
+ )
+
+ dstOnly(
+ `works at DST-end - 30 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.end!.getTime() - 0.5 * HOUR)
+ const result = addDays(date, 1)
+ // started before the transition so will be 25 hours later in local
+ // time because one hour repeats after DST ends.
+ assert.deepStrictEqual(result, new Date(date.getTime() + 24 * HOUR + dstOffset))
+ }
+ )
+
+ dstOnly(
+ `works at DST-end - 60 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.end!.getTime() - 1 * HOUR)
+ const result = addDays(date, 1)
+ // started before the transition so will be 25 hours later in local
+ // time because one hour repeats after DST ends.
+ assert.deepStrictEqual(result, new Date(date.getTime() + 24 * HOUR + dstOffset))
+ }
+ )
+
+ dstOnly(
+ `doesn't mutate if zero increment is used: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.end!)
+ const result = addDays(date, 0)
+ assert.deepStrictEqual(result, date)
+ }
+ )
+})
diff --git a/date-fns/src/addHours/benchmark.js b/date-fns/src/addHours/benchmark.js
new file mode 100644
index 0000000..f706c9e
--- /dev/null
+++ b/date-fns/src/addHours/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addHours from '.'
+import moment from 'moment'
+
+suite('addHours', function () {
+ benchmark('date-fns', function () {
+ return addHours(this.date, 3)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(3, 'hours')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addHours/index.d.ts b/date-fns/src/addHours/index.d.ts
new file mode 100644
index 0000000..b3b6066
--- /dev/null
+++ b/date-fns/src/addHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addHours } from 'date-fns'
+export default addHours
diff --git a/date-fns/src/addHours/index.js.flow b/date-fns/src/addHours/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addHours/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addHours/index.ts b/date-fns/src/addHours/index.ts
new file mode 100644
index 0000000..d7de0e3
--- /dev/null
+++ b/date-fns/src/addHours/index.ts
@@ -0,0 +1,37 @@
+import toInteger from '../_lib/toInteger/index'
+import addMilliseconds from '../addMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+const MILLISECONDS_IN_HOUR = 3600000
+
+/**
+ * @name addHours
+ * @category Hour Helpers
+ * @summary Add the specified number of hours to the given date.
+ *
+ * @description
+ * Add the specified number of hours to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of hours to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the hours added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 2 hours to 10 July 2014 23:00:00:
+ * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)
+ * //=> Fri Jul 11 2014 01:00:00
+ */
+export default function addHours(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR)
+}
diff --git a/date-fns/src/addHours/test.ts b/date-fns/src/addHours/test.ts
new file mode 100644
index 0000000..c920a64
--- /dev/null
+++ b/date-fns/src/addHours/test.ts
@@ -0,0 +1,54 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addHours from '.'
+
+describe('addHours', function() {
+ it('adds the given numbers of hours', function() {
+ const result = addHours(new Date(2014, 6 /* Jul */, 10, 23, 0), 2)
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 11, 1, 0))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addHours(
+ new Date(2014, 6 /* Jul */, 10, 23, 0).getTime(),
+ 26
+ )
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 12, 1, 0))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addHours(new Date(2014, 6 /* Jul */, 10, 23, 0), 2.5)
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 11, 1, 0))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addHours(new Date(2014, 6 /* Jul */, 10, 23, 0), '2')
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 11, 1, 0))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 23, 0)
+ addHours(date, 10)
+ assert.deepStrictEqual(date, new Date(2014, 6 /* Jul */, 10, 23, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addHours(new Date(NaN), 2)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addHours(new Date(2014, 6 /* Jul */, 10, 23, 0), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addHours.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addHours.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addISOWeekYears/benchmark.js b/date-fns/src/addISOWeekYears/benchmark.js
new file mode 100644
index 0000000..c52596d
--- /dev/null
+++ b/date-fns/src/addISOWeekYears/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addISOWeekYears from '.'
+
+suite('addISOWeekYears', function () {
+ benchmark('date-fns', function () {
+ return addISOWeekYears(this.date, 7)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/addISOWeekYears/index.d.ts b/date-fns/src/addISOWeekYears/index.d.ts
new file mode 100644
index 0000000..e1e6e09
--- /dev/null
+++ b/date-fns/src/addISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addISOWeekYears } from 'date-fns'
+export default addISOWeekYears
diff --git a/date-fns/src/addISOWeekYears/index.js.flow b/date-fns/src/addISOWeekYears/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addISOWeekYears/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addISOWeekYears/index.ts b/date-fns/src/addISOWeekYears/index.ts
new file mode 100644
index 0000000..297b613
--- /dev/null
+++ b/date-fns/src/addISOWeekYears/index.ts
@@ -0,0 +1,43 @@
+import toInteger from '../_lib/toInteger/index'
+import getISOWeekYear from '../getISOWeekYear/index'
+import setISOWeekYear from '../setISOWeekYear/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Add the specified number of ISO week-numbering years to the given date.
+ *
+ * @description
+ * Add the specified number of ISO week-numbering years to the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `addISOYears` to `addISOWeekYears`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of ISO week-numbering years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the ISO week-numbering years added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 5 ISO week-numbering years to 2 July 2010:
+ * const result = addISOWeekYears(new Date(2010, 6, 2), 5)
+ * //=> Fri Jun 26 2015 00:00:00
+ */
+export default function addISOWeekYears(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return setISOWeekYear(dirtyDate, getISOWeekYear(dirtyDate) + amount)
+}
diff --git a/date-fns/src/addISOWeekYears/test.ts b/date-fns/src/addISOWeekYears/test.ts
new file mode 100644
index 0000000..a122d71
--- /dev/null
+++ b/date-fns/src/addISOWeekYears/test.ts
@@ -0,0 +1,64 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addISOWeekYears from '.'
+
+describe('addISOWeekYears', function() {
+ it('adds the given number of ISO week-numbering years', function() {
+ const result = addISOWeekYears(new Date(2010, 6 /* Jul */, 2), 5)
+ assert.deepStrictEqual(result, new Date(2015, 5 /* Jun */, 26))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addISOWeekYears(new Date(2014, 8 /* Sep */, 1).getTime(), 12)
+ assert.deepStrictEqual(result, new Date(2026, 7 /* Aug */, 31))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addISOWeekYears(new Date(2010, 6 /* Jul */, 2), 5.6)
+ assert.deepStrictEqual(result, new Date(2015, 5 /* Jun */, 26))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addISOWeekYears(new Date(2010, 6 /* Jul */, 2), '5')
+ assert.deepStrictEqual(result, new Date(2015, 5 /* Jun */, 26))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ addISOWeekYears(date, 12)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(10, 6 /* Jul */, 2)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(15, 5 /* Jun */, 26)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = addISOWeekYears(initialDate, 5)
+ assert.deepStrictEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addISOWeekYears(new Date(NaN), 5)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addISOWeekYears(new Date(2010, 6 /* Jul */, 2), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addISOWeekYears.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addISOWeekYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addMilliseconds/benchmark.js b/date-fns/src/addMilliseconds/benchmark.js
new file mode 100644
index 0000000..b7271d5
--- /dev/null
+++ b/date-fns/src/addMilliseconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addMilliseconds from '.'
+import moment from 'moment'
+
+suite('addMilliseconds', function () {
+ benchmark('date-fns', function () {
+ return addMilliseconds(this.date, 500)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(500, 'milliseconds')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addMilliseconds/index.d.ts b/date-fns/src/addMilliseconds/index.d.ts
new file mode 100644
index 0000000..1afb956
--- /dev/null
+++ b/date-fns/src/addMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addMilliseconds } from 'date-fns'
+export default addMilliseconds
diff --git a/date-fns/src/addMilliseconds/index.js.flow b/date-fns/src/addMilliseconds/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addMilliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addMilliseconds/index.ts b/date-fns/src/addMilliseconds/index.ts
new file mode 100644
index 0000000..18aefe5
--- /dev/null
+++ b/date-fns/src/addMilliseconds/index.ts
@@ -0,0 +1,36 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addMilliseconds
+ * @category Millisecond Helpers
+ * @summary Add the specified number of milliseconds to the given date.
+ *
+ * @description
+ * Add the specified number of milliseconds to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the milliseconds added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
+ * //=> Thu Jul 10 2014 12:45:30.750
+ */
+export default function addMilliseconds(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const timestamp = toDate(dirtyDate).getTime()
+ const amount = toInteger(dirtyAmount)
+ return new Date(timestamp + amount)
+}
diff --git a/date-fns/src/addMilliseconds/test.ts b/date-fns/src/addMilliseconds/test.ts
new file mode 100644
index 0000000..997a5c6
--- /dev/null
+++ b/date-fns/src/addMilliseconds/test.ts
@@ -0,0 +1,80 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addMilliseconds from '.'
+
+describe('addMilliseconds', function() {
+ it('adds the given number of milliseconds', function() {
+ const result = addMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0),
+ 750
+ )
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 750)
+ )
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0).getTime(),
+ 500
+ )
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 500)
+ )
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0),
+ 750.75
+ )
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 750)
+ )
+ })
+
+ it('implicitly converts number arguments', function() {
+ const result = addMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 5),
+ //@ts-expect-error
+ '750'
+ )
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 755)
+ )
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0)
+ addMilliseconds(date, 250)
+ assert.deepStrictEqual(date, new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addMilliseconds(new Date(NaN), 750)
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0),
+ NaN
+ )
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ //@ts-expect-error
+ assert.throws(addMilliseconds.bind(null), TypeError)
+ //@ts-expect-error
+ assert.throws(addMilliseconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addMinutes/benchmark.js b/date-fns/src/addMinutes/benchmark.js
new file mode 100644
index 0000000..281e06c
--- /dev/null
+++ b/date-fns/src/addMinutes/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addMinutes from '.'
+import moment from 'moment'
+
+suite('addMinutes', function () {
+ benchmark('date-fns', function () {
+ return addMinutes(this.date, 30)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(30, 'minutes')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addMinutes/index.d.ts b/date-fns/src/addMinutes/index.d.ts
new file mode 100644
index 0000000..fcf15e5
--- /dev/null
+++ b/date-fns/src/addMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addMinutes } from 'date-fns'
+export default addMinutes
diff --git a/date-fns/src/addMinutes/index.js.flow b/date-fns/src/addMinutes/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addMinutes/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addMinutes/index.ts b/date-fns/src/addMinutes/index.ts
new file mode 100644
index 0000000..41ecc48
--- /dev/null
+++ b/date-fns/src/addMinutes/index.ts
@@ -0,0 +1,37 @@
+import toInteger from '../_lib/toInteger/index'
+import addMilliseconds from '../addMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+const MILLISECONDS_IN_MINUTE = 60000
+
+/**
+ * @name addMinutes
+ * @category Minute Helpers
+ * @summary Add the specified number of minutes to the given date.
+ *
+ * @description
+ * Add the specified number of minutes to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the minutes added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 30 minutes to 10 July 2014 12:00:00:
+ * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)
+ * //=> Thu Jul 10 2014 12:30:00
+ */
+export default function addMinutes(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE)
+}
diff --git a/date-fns/src/addMinutes/test.ts b/date-fns/src/addMinutes/test.ts
new file mode 100644
index 0000000..f4b515c
--- /dev/null
+++ b/date-fns/src/addMinutes/test.ts
@@ -0,0 +1,57 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addMinutes from '.'
+
+describe('addMinutes', function() {
+ it('adds the given number of minutes', function() {
+ const result = addMinutes(new Date(2014, 6 /* Jul */, 10, 12, 0), 30)
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addMinutes(
+ new Date(2014, 6 /* Jul */, 10, 12, 0).getTime(),
+ 20
+ )
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 20))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addMinutes(new Date(2014, 6 /* Jul */, 10, 12, 0), 30.99)
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 30))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addMinutes(new Date(2014, 6 /* Jul */, 10, 12, 5), '30')
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 35))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 12, 0)
+ addMinutes(date, 25)
+ assert.deepStrictEqual(date, new Date(2014, 6 /* Jul */, 10, 12, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addMinutes(new Date(NaN), 30)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addMinutes(new Date(2014, 6 /* Jul */, 10, 12, 0), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addMinutes.bind(null), TypeError)
+
+ // @ts-expect-error
+ assert.throws(addMinutes.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addMonths/benchmark.js b/date-fns/src/addMonths/benchmark.js
new file mode 100644
index 0000000..13f5203
--- /dev/null
+++ b/date-fns/src/addMonths/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addMonths from '.'
+import moment from 'moment'
+
+suite('addMonths', function () {
+ benchmark('date-fns', function () {
+ return addMonths(this.date, 4)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(4, 'months')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addMonths/index.d.ts b/date-fns/src/addMonths/index.d.ts
new file mode 100644
index 0000000..1308e13
--- /dev/null
+++ b/date-fns/src/addMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addMonths } from 'date-fns'
+export default addMonths
diff --git a/date-fns/src/addMonths/index.js.flow b/date-fns/src/addMonths/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addMonths/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addMonths/index.ts b/date-fns/src/addMonths/index.ts
new file mode 100644
index 0000000..7b34369
--- /dev/null
+++ b/date-fns/src/addMonths/index.ts
@@ -0,0 +1,74 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addMonths
+ * @category Month Helpers
+ * @summary Add the specified number of months to the given date.
+ *
+ * @description
+ * Add the specified number of months to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the months added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 5 months to 1 September 2014:
+ * const result = addMonths(new Date(2014, 8, 1), 5)
+ * //=> Sun Feb 01 2015 00:00:00
+ */
+export default function addMonths(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const amount = toInteger(dirtyAmount)
+ if (isNaN(amount)) {
+ return new Date(NaN)
+ }
+ if (!amount) {
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
+ return date
+ }
+ const dayOfMonth = date.getDate()
+
+ // The JS Date object supports date math by accepting out-of-bounds values for
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
+ // want except that dates will wrap around the end of a month, meaning that
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
+ // we'll default to the end of the desired month by adding 1 to the desired
+ // month and using a date of 0 to back up one day to the end of the desired
+ // month.
+ const endOfDesiredMonth = new Date(date.getTime())
+ endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0)
+ const daysInMonth = endOfDesiredMonth.getDate()
+ if (dayOfMonth >= daysInMonth) {
+ // If we're already at the end of the month, then this is the correct date
+ // and we're done.
+ return endOfDesiredMonth
+ } else {
+ // Otherwise, we now know that setting the original day-of-month value won't
+ // cause an overflow, so set the desired day-of-month. Note that we can't
+ // just set the date of `endOfDesiredMonth` because that object may have had
+ // its time changed in the unusual case where where a DST transition was on
+ // the last day of the month and its local time was in the hour skipped or
+ // repeated next to a DST transition. So we use `date` instead which is
+ // guaranteed to still have the original time.
+ date.setFullYear(
+ endOfDesiredMonth.getFullYear(),
+ endOfDesiredMonth.getMonth(),
+ dayOfMonth
+ )
+ return date
+ }
+}
diff --git a/date-fns/src/addMonths/test.ts b/date-fns/src/addMonths/test.ts
new file mode 100644
index 0000000..fb1afb6
--- /dev/null
+++ b/date-fns/src/addMonths/test.ts
@@ -0,0 +1,173 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addMonths from '.'
+import { getDstTransitions } from '../../test/dst/tzOffsetTransitions'
+
+describe('addMonths', function() {
+ it('adds the given number of months', function() {
+ const result = addMonths(new Date(2014, 8 /* Sep */, 1), 5)
+ assert.deepStrictEqual(result, new Date(2015, 1 /* Feb */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addMonths(new Date(2014, 8 /* Sep */, 1).getTime(), 12)
+ assert.deepStrictEqual(result, new Date(2015, 8 /* Sep */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addMonths(new Date(2014, 8 /* Sep */, 1), 5.75)
+ assert.deepStrictEqual(result, new Date(2015, 1 /* Feb */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addMonths(new Date(2014, 8 /* Sep */, 1), '5')
+ assert.deepStrictEqual(result, new Date(2015, 1 /* Feb */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ addMonths(date, 12)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('works well if the desired month has fewer days and the provided date is in the last day of a month', function() {
+ const date = new Date(2014, 11 /* Dec */, 31)
+ const result = addMonths(date, 2)
+ assert.deepStrictEqual(result, new Date(2015, 1 /* Feb */, 28))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(0, 0 /* Jan */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 1 /* Feb */, 29)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = addMonths(initialDate, 1)
+ assert.deepStrictEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addMonths(new Date(NaN), 5)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addMonths(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addMonths.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addMonths.bind(null, 1), TypeError)
+ })
+
+ const dstTransitions = getDstTransitions(2017)
+ const dstOnly = dstTransitions.start && dstTransitions.end ? it : it.skip
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone || process.env.tz
+ const HOUR = 1000 * 60 * 60
+ const override = (
+ base: Date,
+ year = base.getFullYear(),
+ month = base.getMonth(),
+ day = base.getDate(),
+ hour = base.getHours(),
+ minute = base.getMinutes()
+ ) => new Date(year, month, day, hour, minute)
+
+ dstOnly(
+ `works at DST-start boundary in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = dstTransitions.start
+ const result = addMonths(date!, 2)
+ assert.deepStrictEqual(
+ result,
+ override(date!, date!.getFullYear(), date!.getMonth() + 2)
+ )
+ }
+ )
+
+ dstOnly(
+ `works at DST-start - 30 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.start!.getTime() - 0.5 * HOUR)
+ const result = addMonths(date, 2)
+ const expected = override(date, date.getFullYear(), date.getMonth() + 2)
+ assert.deepStrictEqual(result, expected)
+ }
+ )
+
+ dstOnly(
+ `works at DST-start - 60 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.start!.getTime() - 1 * HOUR)
+ const result = addMonths(date, 2)
+ const expected = override(date, date.getFullYear(), date.getMonth() + 2)
+ assert.deepStrictEqual(result, expected)
+ }
+ )
+
+ dstOnly(
+ `works at DST-end boundary in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = dstTransitions.end
+ const result = addMonths(date!, 2)
+ assert.deepStrictEqual(
+ result,
+ override(
+ date!,
+ date!.getFullYear() + (date!.getMonth() >= 10 ? 1 : 0),
+ (date!.getMonth() + 2) % 12 // protect against wrap for Nov.
+ )
+ )
+ }
+ )
+
+ dstOnly(
+ `works at DST-end - 30 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.end!.getTime() - 0.5 * HOUR)
+ const result = addMonths(date, 2)
+ assert.deepStrictEqual(
+ result,
+ override(
+ date,
+ date.getFullYear() + (date.getMonth() >= 10 ? 1 : 0),
+ (date.getMonth() + 2) % 12 // protect against wrap for Nov.
+ )
+ )
+ }
+ )
+
+ dstOnly(
+ `works at DST-end - 60 mins in local timezone: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.end!.getTime() - 1 * HOUR)
+ const result = addMonths(date, 2)
+ assert.deepStrictEqual(
+ result,
+ override(
+ date,
+ date.getFullYear() + (date.getMonth() >= 10 ? 1 : 0),
+ (date.getMonth() + 2) % 12 // protect against wrap for Nov.
+ )
+ )
+ }
+ )
+
+ dstOnly(
+ `doesn't mutate if zero increment is used: ${tz || '(unknown)'}`,
+ function() {
+ const date = new Date(dstTransitions.end!)
+ const result = addMonths(date, 0)
+ assert.deepStrictEqual(result, date)
+ }
+ )
+})
diff --git a/date-fns/src/addQuarters/benchmark.js b/date-fns/src/addQuarters/benchmark.js
new file mode 100644
index 0000000..8e90c2f
--- /dev/null
+++ b/date-fns/src/addQuarters/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addQuarters from '.'
+import moment from 'moment'
+
+suite('addQuarters', function () {
+ benchmark('date-fns', function () {
+ return addQuarters(this.date, 2)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(2, 'quarters')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addQuarters/index.d.ts b/date-fns/src/addQuarters/index.d.ts
new file mode 100644
index 0000000..a046e67
--- /dev/null
+++ b/date-fns/src/addQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addQuarters } from 'date-fns'
+export default addQuarters
diff --git a/date-fns/src/addQuarters/index.js.flow b/date-fns/src/addQuarters/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addQuarters/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addQuarters/index.ts b/date-fns/src/addQuarters/index.ts
new file mode 100644
index 0000000..4eaebf0
--- /dev/null
+++ b/date-fns/src/addQuarters/index.ts
@@ -0,0 +1,36 @@
+import toInteger from '../_lib/toInteger/index'
+import addMonths from '../addMonths/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addQuarters
+ * @category Quarter Helpers
+ * @summary Add the specified number of year quarters to the given date.
+ *
+ * @description
+ * Add the specified number of year quarters to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of quarters to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the quarters added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 1 quarter to 1 September 2014:
+ * const result = addQuarters(new Date(2014, 8, 1), 1)
+ * //=> Mon Dec 01 2014 00:00:00
+ */
+export default function addQuarters(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ const months = amount * 3
+ return addMonths(dirtyDate, months)
+}
diff --git a/date-fns/src/addQuarters/test.ts b/date-fns/src/addQuarters/test.ts
new file mode 100644
index 0000000..a09434e
--- /dev/null
+++ b/date-fns/src/addQuarters/test.ts
@@ -0,0 +1,70 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addQuarters from '.'
+
+describe('addQuarters', function() {
+ it('adds the given number of quarters', function() {
+ const result = addQuarters(new Date(2014, 8 /* Sep */, 1), 1)
+ assert.deepStrictEqual(result, new Date(2014, 11 /* Dec */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addQuarters(new Date(2014, 8 /* Sep */, 1).getTime(), 4)
+ assert.deepStrictEqual(result, new Date(2015, 8 /* Sep */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addQuarters(new Date(2014, 8 /* Sep */, 1), 1.91)
+ assert.deepStrictEqual(result, new Date(2014, 11 /* Dec */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addQuarters(new Date(2014, 8 /* Sep */, 1), '1')
+ assert.deepStrictEqual(result, new Date(2014, 11 /* Dec */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ addQuarters(date, 4)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('works well if the desired month has fewer days and the provided date is in the last day of a month', function() {
+ const date = new Date(2014, 11 /* Dec */, 31)
+ const result = addQuarters(date, 3)
+ assert.deepStrictEqual(result, new Date(2015, 8 /* Sep */, 30))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(-1, 10 /* Nov */, 30)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 1 /* Feb */, 29)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = addQuarters(initialDate, 1)
+ assert.deepStrictEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addQuarters(new Date(NaN), 1)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addQuarters(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addQuarters.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addQuarters.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addSeconds/benchmark.js b/date-fns/src/addSeconds/benchmark.js
new file mode 100644
index 0000000..799bb3c
--- /dev/null
+++ b/date-fns/src/addSeconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addSeconds from '.'
+import moment from 'moment'
+
+suite('addSeconds', function () {
+ benchmark('date-fns', function () {
+ return addSeconds(this.date, 15)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(15, 'seconds')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addSeconds/index.d.ts b/date-fns/src/addSeconds/index.d.ts
new file mode 100644
index 0000000..9b1e669
--- /dev/null
+++ b/date-fns/src/addSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addSeconds } from 'date-fns'
+export default addSeconds
diff --git a/date-fns/src/addSeconds/index.js.flow b/date-fns/src/addSeconds/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addSeconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addSeconds/index.ts b/date-fns/src/addSeconds/index.ts
new file mode 100644
index 0000000..c858a04
--- /dev/null
+++ b/date-fns/src/addSeconds/index.ts
@@ -0,0 +1,35 @@
+import toInteger from '../_lib/toInteger/index'
+import addMilliseconds from '../addMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addSeconds
+ * @category Second Helpers
+ * @summary Add the specified number of seconds to the given date.
+ *
+ * @description
+ * Add the specified number of seconds to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the seconds added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 30 seconds to 10 July 2014 12:45:00:
+ * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
+ * //=> Thu Jul 10 2014 12:45:30
+ */
+export default function addSeconds(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addMilliseconds(dirtyDate, amount * 1000)
+}
diff --git a/date-fns/src/addSeconds/test.ts b/date-fns/src/addSeconds/test.ts
new file mode 100644
index 0000000..86032ed
--- /dev/null
+++ b/date-fns/src/addSeconds/test.ts
@@ -0,0 +1,59 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addSeconds from '.'
+
+describe('addSeconds', function() {
+ it('adds the given number of seconds', function() {
+ const result = addSeconds(new Date(2014, 6 /* Jul */, 10, 12, 45, 0), 30)
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addSeconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 0).getTime(),
+ 20
+ )
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 20))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addSeconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 0),
+ 30.777
+ )
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 30))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addSeconds(new Date(2014, 6 /* Jul */, 10, 12, 45, 5), '30')
+ assert.deepStrictEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 35))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 12, 45, 0)
+ addSeconds(date, 15)
+ assert.deepStrictEqual(date, new Date(2014, 6 /* Jul */, 10, 12, 45, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addSeconds(new Date(NaN), 30)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addSeconds(new Date(2014, 6 /* Jul */, 10, 12, 45, 0), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addSeconds.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addSeconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addWeeks/benchmark.js b/date-fns/src/addWeeks/benchmark.js
new file mode 100644
index 0000000..a6dfed7
--- /dev/null
+++ b/date-fns/src/addWeeks/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addWeeks from '.'
+import moment from 'moment'
+
+suite('addWeeks', function () {
+ benchmark('date-fns', function () {
+ return addWeeks(this.date, 2)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(2, 'weeks')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addWeeks/index.d.ts b/date-fns/src/addWeeks/index.d.ts
new file mode 100644
index 0000000..25bb83a
--- /dev/null
+++ b/date-fns/src/addWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addWeeks } from 'date-fns'
+export default addWeeks
diff --git a/date-fns/src/addWeeks/index.js.flow b/date-fns/src/addWeeks/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addWeeks/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addWeeks/index.ts b/date-fns/src/addWeeks/index.ts
new file mode 100644
index 0000000..0b52616
--- /dev/null
+++ b/date-fns/src/addWeeks/index.ts
@@ -0,0 +1,36 @@
+import toInteger from '../_lib/toInteger/index'
+import addDays from '../addDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addWeeks
+ * @category Week Helpers
+ * @summary Add the specified number of weeks to the given date.
+ *
+ * @description
+ * Add the specified number of week to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of weeks to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the weeks added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 4 weeks to 1 September 2014:
+ * const result = addWeeks(new Date(2014, 8, 1), 4)
+ * //=> Mon Sep 29 2014 00:00:00
+ */
+export default function addWeeks(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ const days = amount * 7
+ return addDays(dirtyDate, days)
+}
diff --git a/date-fns/src/addWeeks/test.ts b/date-fns/src/addWeeks/test.ts
new file mode 100644
index 0000000..cd0b916
--- /dev/null
+++ b/date-fns/src/addWeeks/test.ts
@@ -0,0 +1,53 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addWeeks from '.'
+
+describe('addWeeks', function() {
+ it('adds the given number of weeks', function() {
+ const result = addWeeks(new Date(2014, 8 /* Sep */, 1), 4)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 29))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addWeeks(new Date(2014, 8 /* Sep */, 1).getTime(), 1)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 8))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addWeeks(new Date(2014, 8 /* Sep */, 1), 4.95)
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 29))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addWeeks(new Date(2014, 8 /* Sep */, 1), '4')
+ assert.deepStrictEqual(result, new Date(2014, 8 /* Sep */, 29))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ addWeeks(date, 2)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addWeeks(new Date(NaN), 4)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addWeeks(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addWeeks.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addWeeks.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/addYears/benchmark.js b/date-fns/src/addYears/benchmark.js
new file mode 100644
index 0000000..26d8b99
--- /dev/null
+++ b/date-fns/src/addYears/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import addYears from '.'
+import moment from 'moment'
+
+suite('addYears', function () {
+ benchmark('date-fns', function () {
+ return addYears(this.date, 20)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.add(20, 'years')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/addYears/index.d.ts b/date-fns/src/addYears/index.d.ts
new file mode 100644
index 0000000..df7255f
--- /dev/null
+++ b/date-fns/src/addYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addYears } from 'date-fns'
+export default addYears
diff --git a/date-fns/src/addYears/index.js.flow b/date-fns/src/addYears/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/addYears/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/addYears/index.ts b/date-fns/src/addYears/index.ts
new file mode 100644
index 0000000..84e1b94
--- /dev/null
+++ b/date-fns/src/addYears/index.ts
@@ -0,0 +1,35 @@
+import toInteger from '../_lib/toInteger/index'
+import addMonths from '../addMonths/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name addYears
+ * @category Year Helpers
+ * @summary Add the specified number of years to the given date.
+ *
+ * @description
+ * Add the specified number of years to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the years added
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Add 5 years to 1 September 2014:
+ * const result = addYears(new Date(2014, 8, 1), 5)
+ * //=> Sun Sep 01 2019 00:00:00
+ */
+export default function addYears(
+ dirtyDate: Date | number,
+ dirtyAmount: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addMonths(dirtyDate, amount * 12)
+}
diff --git a/date-fns/src/addYears/test.ts b/date-fns/src/addYears/test.ts
new file mode 100644
index 0000000..30031f6
--- /dev/null
+++ b/date-fns/src/addYears/test.ts
@@ -0,0 +1,69 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import addYears from '.'
+
+describe('addYears', function() {
+ it('adds the given number of years', function() {
+ const result = addYears(new Date(2014, 8 /* Sep */, 1), 5)
+ assert.deepStrictEqual(result, new Date(2019, 8 /* Sep */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = addYears(new Date(2014, 8 /* Sep */, 1).getTime(), 12)
+ assert.deepStrictEqual(result, new Date(2026, 8 /* Sep */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = addYears(new Date(2014, 8 /* Sep */, 1), 5.555)
+ assert.deepStrictEqual(result, new Date(2019, 8 /* Sep */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = addYears(new Date(2014, 8 /* Sep */, 1), '5')
+ assert.deepStrictEqual(result, new Date(2019, 8 /* Sep */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ addYears(date, 12)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('handles the leap years properly', function() {
+ const result = addYears(new Date(2016, 1 /* Feb */, 29), 1)
+ assert.deepStrictEqual(result, new Date(2017, 1 /* Feb */, 28))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(0, 1 /* Feb */, 29)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(1, 1 /* Feb */, 28)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = addYears(initialDate, 1)
+ assert.deepStrictEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = addYears(new Date(NaN), 5)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = addYears(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(addYears.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(addYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/areIntervalsOverlapping/index.d.ts b/date-fns/src/areIntervalsOverlapping/index.d.ts
new file mode 100644
index 0000000..8cc0fd1
--- /dev/null
+++ b/date-fns/src/areIntervalsOverlapping/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { areIntervalsOverlapping } from 'date-fns'
+export default areIntervalsOverlapping
diff --git a/date-fns/src/areIntervalsOverlapping/index.js.flow b/date-fns/src/areIntervalsOverlapping/index.js.flow
new file mode 100644
index 0000000..9cab45d
--- /dev/null
+++ b/date-fns/src/areIntervalsOverlapping/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ intervalLeft: Interval,
+ intervalRight: Interval,
+ options?: {
+ inclusive?: boolean,
+ }
+) => boolean
diff --git a/date-fns/src/areIntervalsOverlapping/index.ts b/date-fns/src/areIntervalsOverlapping/index.ts
new file mode 100644
index 0000000..3dfcbb4
--- /dev/null
+++ b/date-fns/src/areIntervalsOverlapping/index.ts
@@ -0,0 +1,117 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name areIntervalsOverlapping
+ * @category Interval Helpers
+ * @summary Is the given time interval overlapping with another time interval?
+ *
+ * @description
+ * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `areRangesOverlapping` to `areIntervalsOverlapping`.
+ * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology:
+ *
+ * ```
+ * 2.1.3
+ * time interval
+ * part of the time axis limited by two instants
+ * ```
+ *
+ * Also, this function now accepts an object with `start` and `end` properties
+ * instead of two arguments as an interval.
+ * This function now throws `RangeError` if the start of the interval is after its end
+ * or if any date in the interval is `Invalid Date`.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * areRangesOverlapping(
+ * new Date(2014, 0, 10), new Date(2014, 0, 20),
+ * new Date(2014, 0, 17), new Date(2014, 0, 21)
+ * )
+ *
+ * // v2.0.0 onward
+ *
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * ```
+ *
+ * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @param {Object} [options] - the object with options
+ * @param {Boolean} [options.inclusive=false] - whether the comparison is inclusive or not
+ * @returns {Boolean} whether the time intervals are overlapping
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // For overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * //=> true
+ *
+ * @example
+ * // For non-overlapping time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // For adjacent time intervals:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }
+ * )
+ * //=> false
+ *
+ * @example
+ * // Using the inclusive option:
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }
+ * )
+ * //=> false
+ * areIntervalsOverlapping(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },
+ * { inclusive: true }
+ * )
+ * //=> true
+ */
+export default function areIntervalsOverlapping(
+ dirtyIntervalLeft: Interval,
+ dirtyIntervalRight: Interval,
+ options = { inclusive: false }
+): boolean {
+ requiredArgs(2, arguments)
+
+ const intervalLeft = dirtyIntervalLeft || {}
+ const intervalRight = dirtyIntervalRight || {}
+ const leftStartTime = toDate(intervalLeft.start).getTime()
+ const leftEndTime = toDate(intervalLeft.end).getTime()
+ const rightStartTime = toDate(intervalRight.start).getTime()
+ const rightEndTime = toDate(intervalRight.end).getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ if (options.inclusive) {
+ return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime
+ }
+
+ return leftStartTime < rightEndTime && rightStartTime < leftEndTime
+}
diff --git a/date-fns/src/areIntervalsOverlapping/test.ts b/date-fns/src/areIntervalsOverlapping/test.ts
new file mode 100644
index 0000000..1ff7c32
--- /dev/null
+++ b/date-fns/src/areIntervalsOverlapping/test.ts
@@ -0,0 +1,253 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import areIntervalsOverlapping from '.'
+import context from 'assert'
+
+describe('areIntervalsOverlapping', function () {
+ const initialIntervalStart = new Date(2016, 10, 10, 13, 0, 0)
+ const initialIntervalEnd = new Date(2016, 11, 3, 15, 0, 0)
+
+ describe("when the time intervals don't overlap", function () {
+ it('returns false for a valid non overlapping interval before another interval', function () {
+ const earlierIntervalStart = new Date(2016, 9, 25)
+ const earlierIntervalEnd = new Date(2016, 10, 9)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: earlierIntervalStart, end: earlierIntervalEnd }
+ )
+ assert(isOverlapping === false)
+ })
+
+ it('returns false for a valid non overlapping interval after another interval', function () {
+ const laterIntervalStart = new Date(2016, 11, 4)
+ const laterIntervalEnd = new Date(2016, 11, 9)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: laterIntervalStart, end: laterIntervalEnd }
+ )
+ assert(isOverlapping === false)
+ })
+
+ it('returns false for a non overlapping same-day interval', function () {
+ const sameDayIntervalStart = new Date(2016, 11, 4, 9, 0, 0)
+ const sameDayIntervalEnd = new Date(2016, 11, 4, 18, 0, 0)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: sameDayIntervalStart, end: sameDayIntervalEnd }
+ )
+ assert(isOverlapping === false)
+ })
+
+ it('returns false for an interval differing by a few hours', function () {
+ const oneDayOverlappingIntervalStart = new Date(2016, 11, 3, 18, 0, 0)
+ const oneDayOverlappingIntervalEnd = new Date(2016, 11, 14, 13, 0, 0)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ {
+ start: oneDayOverlappingIntervalStart,
+ end: oneDayOverlappingIntervalEnd,
+ }
+ )
+ assert(isOverlapping === false)
+ })
+
+ it("returns false for an interval with the same startDateTime as the initial time intervals's endDateTime", function () {
+ const oneDayOverlapIntervalStart = new Date(2016, 11, 3, 15, 0, 0)
+ const oneDayOverlapIntervalEnd = new Date(2016, 11, 14, 13, 0, 0)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: oneDayOverlapIntervalStart, end: oneDayOverlapIntervalEnd }
+ )
+ assert(isOverlapping === false)
+ })
+
+ it("returns false for an interval with the same endDateTime as the initial time interval's startDateTime", function () {
+ const oneDayOverlapIntervalStart = new Date(2016, 10, 3, 15, 0, 0)
+ const oneDayOverlapIntervalEnd = new Date(2016, 10, 10, 13, 0, 0)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: oneDayOverlapIntervalStart, end: oneDayOverlapIntervalEnd }
+ )
+ assert(isOverlapping === false)
+ })
+ })
+
+ describe('when the time intervals overlap', function () {
+ it('returns true for an interval included within another interval', function () {
+ const includedIntervalStart = new Date(2016, 10, 14)
+ const includedIntervalEnd = new Date(2016, 10, 14)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: includedIntervalStart, end: includedIntervalEnd }
+ )
+ assert(isOverlapping === true)
+ })
+
+ it('returns true for an interval overlapping at the end', function () {
+ const endOverlappingIntervalStart = new Date(2016, 10, 5)
+ const endOverlappingIntervalEnd = new Date(2016, 10, 14)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: endOverlappingIntervalStart, end: endOverlappingIntervalEnd }
+ )
+ assert(isOverlapping === true)
+ })
+
+ it('returns true for an interval overlapping at the beginning', function () {
+ const startOverlappingIntervalStart = new Date(2016, 10, 20)
+ const startOverlappingIntervalEnd = new Date(2016, 11, 14)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ {
+ start: startOverlappingIntervalStart,
+ end: startOverlappingIntervalEnd,
+ }
+ )
+ assert(isOverlapping === true)
+ })
+
+ it('returns true for an interval including another interval', function () {
+ const includingIntervalStart = new Date(2016, 10, 5)
+ const includingIntervalEnd = new Date(2016, 11, 15)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: includingIntervalStart, end: includingIntervalEnd }
+ )
+ assert(isOverlapping === true)
+ })
+ })
+
+ it('accepts timestamp', function () {
+ const initialIntervalStart = new Date(2016, 10, 10, 13, 0, 0).getTime()
+ const initialIntervalEnd = new Date(2016, 11, 3, 15, 0, 0).getTime()
+
+ const endOverlappingIntervalStart = new Date(2016, 10, 5).getTime()
+ const endOverlappingIntervalEnd = new Date(2016, 10, 14).getTime()
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: endOverlappingIntervalStart, end: endOverlappingIntervalEnd }
+ )
+ assert(isOverlapping === true)
+ })
+
+ it('throws an exception if the start date of the initial time interval is after the end date', function () {
+ const block = areIntervalsOverlapping.bind(
+ null,
+ { start: new Date(2016, 10, 7), end: new Date(2016, 10, 3) },
+ { start: new Date(2016, 10, 5), end: new Date(2016, 10, 15) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date of the compared time interval is after the end date', function () {
+ const block = areIntervalsOverlapping.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ { start: new Date(2016, 10, 15), end: new Date(2016, 10, 5) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the initial interval is undefined', function () {
+ // @ts-expect-error
+ const block = areIntervalsOverlapping.bind(null, undefined, {
+ start: new Date(2016, 10, 5),
+ end: new Date(2016, 10, 15),
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the compared interval is undefined', function () {
+ // @ts-expect-error
+ const block = areIntervalsOverlapping.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ describe('when the inclusive option is true', function () {
+ it("returns true for an interval with the same startDateTime as the initial time interval's endDateTime", function () {
+ const oneDayOverlapIntervalStart = new Date(2016, 11, 3, 15, 0, 0)
+ const oneDayOverlapIntervalEnd = new Date(2016, 11, 14, 13, 0, 0)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: oneDayOverlapIntervalStart, end: oneDayOverlapIntervalEnd },
+ { inclusive: true }
+ )
+ assert(isOverlapping)
+ })
+
+ it("returns true for an interval with the same endDateTime as the initial time interval's startDateTime", function () {
+ const oneDayOverlapIntervalStart = new Date(2016, 10, 3, 15, 0, 0)
+ const oneDayOverlapIntervalEnd = new Date(2016, 10, 10, 13, 0, 0)
+
+ const isOverlapping = areIntervalsOverlapping(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: oneDayOverlapIntervalStart, end: oneDayOverlapIntervalEnd },
+ { inclusive: true }
+ )
+ assert(isOverlapping)
+ })
+ })
+
+ describe('one of the dates is `Invalid Date`', function () {
+ it('throws an exception if the start date of the initial time interval is `Invalid Date`', function () {
+ const block = areIntervalsOverlapping.bind(
+ null,
+ { start: new Date(NaN), end: new Date(2016, 10, 3) },
+ { start: new Date(2016, 10, 5), end: new Date(2016, 10, 15) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date of the initial time interval is `Invalid Date`', function () {
+ const block = areIntervalsOverlapping.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(NaN) },
+ { start: new Date(2016, 10, 5), end: new Date(2016, 10, 15) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date of the compared time interval is `Invalid Date`', function () {
+ const block = areIntervalsOverlapping.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ { start: new Date(NaN), end: new Date(2016, 10, 5) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date of the compared time interval is `Invalid Date`', function () {
+ const block = areIntervalsOverlapping.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ { start: new Date(2016, 10, 5), end: new Date(NaN) }
+ )
+ assert.throws(block, RangeError)
+ })
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ // @ts-expect-error
+ assert.throws(areIntervalsOverlapping.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(areIntervalsOverlapping.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/closestIndexTo/benchmark.js b/date-fns/src/closestIndexTo/benchmark.js
new file mode 100644
index 0000000..c9a91a3
--- /dev/null
+++ b/date-fns/src/closestIndexTo/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import closestIndexTo from '.'
+
+suite('closestIndexTo', function () {
+ benchmark('date-fns', function () {
+ return closestIndexTo(this.date, this.array)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.array = [
+ new Date(this.date.getTime() + 604800001),
+ new Date(this.date.getTime() - 604800000)
+ ]
+ }
+})
diff --git a/date-fns/src/closestIndexTo/index.d.ts b/date-fns/src/closestIndexTo/index.d.ts
new file mode 100644
index 0000000..672d132
--- /dev/null
+++ b/date-fns/src/closestIndexTo/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { closestIndexTo } from 'date-fns'
+export default closestIndexTo
diff --git a/date-fns/src/closestIndexTo/index.js b/date-fns/src/closestIndexTo/index.js
new file mode 100644
index 0000000..2b6b73c
--- /dev/null
+++ b/date-fns/src/closestIndexTo/index.js
@@ -0,0 +1,79 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name closestIndexTo
+ * @category Common Helpers
+ * @summary Return an index of the closest date from the array comparing to the given date.
+ *
+ * @description
+ * Return an index of the closest date from the array comparing to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - Now, `closestIndexTo` doesn't throw an exception
+ * when the second argument is not an array, and returns Invalid Date instead.
+ *
+ * @param {Date|Number} dateToCompare - the date to compare with
+ * @param {Date[]|Number[]} datesArray - the array to search
+ * @returns {Number} an index of the date closest to the given date
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Which date is closer to 6 September 2015?
+ * var dateToCompare = new Date(2015, 8, 6)
+ * var datesArray = [
+ * new Date(2015, 0, 1),
+ * new Date(2016, 0, 1),
+ * new Date(2017, 0, 1)
+ * ]
+ * var result = closestIndexTo(dateToCompare, datesArray)
+ * //=> 1
+ */
+export default function closestIndexTo(dirtyDateToCompare, dirtyDatesArray) {
+ requiredArgs(2, arguments)
+
+ var dateToCompare = toDate(dirtyDateToCompare)
+
+ if (isNaN(dateToCompare)) {
+ return NaN
+ }
+
+ var timeToCompare = dateToCompare.getTime()
+
+ var datesArray
+ // `dirtyDatesArray` is undefined or null
+ if (dirtyDatesArray == null) {
+ datesArray = []
+
+ // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method
+ } else if (typeof dirtyDatesArray.forEach === 'function') {
+ datesArray = dirtyDatesArray
+
+ // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array
+ } else {
+ datesArray = Array.prototype.slice.call(dirtyDatesArray)
+ }
+
+ var result
+ var minDistance
+ datesArray.forEach(function(dirtyDate, index) {
+ var currentDate = toDate(dirtyDate)
+
+ if (isNaN(currentDate)) {
+ result = NaN
+ minDistance = NaN
+ return
+ }
+
+ var distance = Math.abs(timeToCompare - currentDate.getTime())
+ if (result == null || distance < minDistance) {
+ result = index
+ minDistance = distance
+ }
+ })
+
+ return result
+}
diff --git a/date-fns/src/closestIndexTo/index.js.flow b/date-fns/src/closestIndexTo/index.js.flow
new file mode 100644
index 0000000..335e082
--- /dev/null
+++ b/date-fns/src/closestIndexTo/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateToCompare: Date | number,
+ datesArray: (Date | number)[]
+) => number
diff --git a/date-fns/src/closestIndexTo/test.js b/date-fns/src/closestIndexTo/test.js
new file mode 100644
index 0000000..d070c4c
--- /dev/null
+++ b/date-fns/src/closestIndexTo/test.js
@@ -0,0 +1,102 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import closestIndexTo from '.'
+
+describe('closestIndexTo', function() {
+ it('returns the date index from the given array closest to the given date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = closestIndexTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert.equal(result, 0)
+ })
+
+ it('works if the closest date from the given array is before the given date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2, 6, 30, 4, 500)
+ var result = closestIndexTo(date, [
+ new Date(2014, 6 /* Jul */, 2, 6, 30, 5, 900),
+ new Date(2014, 6 /* Jul */, 2, 6, 30, 3, 900),
+ new Date(2014, 6 /* Jul */, 2, 6, 30, 10)
+ ])
+ assert.equal(result, 1)
+ })
+
+ it('accepts timestamps', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ var result = closestIndexTo(date, [
+ new Date(2015, 7 /* Aug */, 31).getTime(),
+ new Date(2012, 6 /* Jul */, 2).getTime()
+ ])
+ assert.equal(result, 0)
+ })
+
+ it('returns undefined if the given array is empty', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ var result = closestIndexTo(date, [])
+ assert(result == null)
+ })
+
+ it('returns NaN if the given date is `Invalid Date`', function() {
+ var date = new Date(NaN)
+ var result = closestIndexTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if any date in the given array is `Invalid Date`', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = closestIndexTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(NaN),
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if any value in the given array is undefined', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = closestIndexTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ // $ExpectedMistake
+ undefined,
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert(isNaN(result))
+ })
+
+ it('converts Array-like objects into Array', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var object = {
+ '0': new Date(2015, 7 /* Aug */, 31),
+ '1': new Date(2012, 6 /* Jul */, 2),
+ length: 2
+ }
+ // $ExpectedMistake
+ var result = closestIndexTo(date, object)
+ assert.equal(result, 0)
+ })
+
+ it('converts undefined into empty array', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ // $ExpectedMistake
+ var result = closestIndexTo(date, undefined)
+ assert(result == null)
+ })
+
+ it('converts null into empty array', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ // $ExpectedMistake
+ var result = closestIndexTo(date, null)
+ assert(result == null)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(closestIndexTo.bind(null), TypeError)
+ assert.throws(closestIndexTo.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/closestTo/benchmark.js b/date-fns/src/closestTo/benchmark.js
new file mode 100644
index 0000000..79ab881
--- /dev/null
+++ b/date-fns/src/closestTo/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import closestTo from '.'
+
+suite('closestTo', function () {
+ benchmark('date-fns', function () {
+ return closestTo(this.date, this.array)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.array = [
+ new Date(this.date.getTime() + 604800001),
+ new Date(this.date.getTime() - 604800000)
+ ]
+ }
+})
diff --git a/date-fns/src/closestTo/index.d.ts b/date-fns/src/closestTo/index.d.ts
new file mode 100644
index 0000000..d4e084e
--- /dev/null
+++ b/date-fns/src/closestTo/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { closestTo } from 'date-fns'
+export default closestTo
diff --git a/date-fns/src/closestTo/index.js b/date-fns/src/closestTo/index.js
new file mode 100644
index 0000000..64bfff1
--- /dev/null
+++ b/date-fns/src/closestTo/index.js
@@ -0,0 +1,77 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name closestTo
+ * @category Common Helpers
+ * @summary Return a date from the array closest to the given date.
+ *
+ * @description
+ * Return a date from the array closest to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - Now, `closestTo` doesn't throw an exception
+ * when the second argument is not an array, and returns Invalid Date instead.
+ *
+ * @param {Date|Number} dateToCompare - the date to compare with
+ * @param {Date[]|Number[]} datesArray - the array to search
+ * @returns {Date} the date from the array closest to the given date
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030?
+ * var dateToCompare = new Date(2015, 8, 6)
+ * var result = closestTo(dateToCompare, [
+ * new Date(2000, 0, 1),
+ * new Date(2030, 0, 1)
+ * ])
+ * //=> Tue Jan 01 2030 00:00:00
+ */
+export default function closestTo(dirtyDateToCompare, dirtyDatesArray) {
+ requiredArgs(2, arguments)
+
+ var dateToCompare = toDate(dirtyDateToCompare)
+
+ if (isNaN(dateToCompare)) {
+ return new Date(NaN)
+ }
+
+ var timeToCompare = dateToCompare.getTime()
+
+ var datesArray
+ // `dirtyDatesArray` is undefined or null
+ if (dirtyDatesArray == null) {
+ datesArray = []
+
+ // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method
+ } else if (typeof dirtyDatesArray.forEach === 'function') {
+ datesArray = dirtyDatesArray
+
+ // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array
+ } else {
+ datesArray = Array.prototype.slice.call(dirtyDatesArray)
+ }
+
+ var result
+ var minDistance
+ datesArray.forEach(function(dirtyDate) {
+ var currentDate = toDate(dirtyDate)
+
+ if (isNaN(currentDate)) {
+ result = new Date(NaN)
+ minDistance = NaN
+ return
+ }
+
+ var distance = Math.abs(timeToCompare - currentDate.getTime())
+ if (result == null || distance < minDistance) {
+ result = currentDate
+ minDistance = distance
+ }
+ })
+
+ return result
+}
diff --git a/date-fns/src/closestTo/index.js.flow b/date-fns/src/closestTo/index.js.flow
new file mode 100644
index 0000000..318e080
--- /dev/null
+++ b/date-fns/src/closestTo/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateToCompare: Date | number,
+ datesArray: (Date | number)[]
+) => Date
diff --git a/date-fns/src/closestTo/test.js b/date-fns/src/closestTo/test.js
new file mode 100644
index 0000000..1924972
--- /dev/null
+++ b/date-fns/src/closestTo/test.js
@@ -0,0 +1,112 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import closestTo from '.'
+
+describe('closestTo', function() {
+ it('returns the date from the given array closest to the given date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = closestTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert.deepEqual(result, new Date(2015, 7 /* Aug */, 31))
+ })
+
+ it('works if the closest date from the given array is before the given date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2, 6, 30, 4, 500)
+ var result = closestTo(date, [
+ new Date(2014, 6 /* Jul */, 2, 6, 30, 5, 900),
+ new Date(2014, 6 /* Jul */, 2, 6, 30, 3, 900),
+ new Date(2014, 6 /* Jul */, 2, 6, 30, 10)
+ ])
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 2, 6, 30, 3, 900))
+ })
+
+ it('accepts timestamps', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ var result = closestTo(date, [
+ new Date(2015, 7 /* Aug */, 31).getTime(),
+ new Date(2012, 6 /* Jul */, 2).getTime()
+ ])
+ assert.deepEqual(result, new Date(2015, 7 /* Aug */, 31))
+ })
+
+ it('returns undefined if the given array is empty', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ var result = closestTo(date, [])
+ assert(result == null)
+ })
+
+ it('returns `Invalid Date` if the given date is `Invalid Date`', function() {
+ var date = new Date(NaN)
+ var result = closestTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if any date in the given array is `Invalid Date`', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = closestTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(NaN),
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if any date in the given array is `Invalid Date`', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = closestTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(NaN),
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if any value in the given array is undefined', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = closestTo(date, [
+ new Date(2015, 7 /* Aug */, 31),
+ // $ExpectedMistake
+ undefined,
+ new Date(2012, 6 /* Jul */, 2)
+ ])
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('converts Array-like objects into Array', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var object = {
+ '0': new Date(2015, 7 /* Aug */, 31),
+ '1': new Date(2012, 6 /* Jul */, 2),
+ length: 2
+ }
+ // $ExpectedMistake
+ var result = closestTo(date, object)
+ assert.deepEqual(result, new Date(2015, 7 /* Aug */, 31))
+ })
+
+ it('converts undefined into empty array', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ // $ExpectedMistake
+ var result = closestTo(date, undefined)
+ assert(result == null)
+ })
+
+ it('converts null into empty array', function() {
+ var date = new Date(2014, 6 /* Jul */, 2).getTime()
+ // $ExpectedMistake
+ var result = closestTo(date, null)
+ assert(result == null)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(closestTo.bind(null), TypeError)
+ assert.throws(closestTo.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/compareAsc/benchmark.js b/date-fns/src/compareAsc/benchmark.js
new file mode 100644
index 0000000..479f252
--- /dev/null
+++ b/date-fns/src/compareAsc/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import compareAsc from '.'
+
+suite('compareAsc', function () {
+ benchmark('date-fns', function () {
+ return compareAsc(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/compareAsc/index.d.ts b/date-fns/src/compareAsc/index.d.ts
new file mode 100644
index 0000000..ff920e6
--- /dev/null
+++ b/date-fns/src/compareAsc/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { compareAsc } from 'date-fns'
+export default compareAsc
diff --git a/date-fns/src/compareAsc/index.js.flow b/date-fns/src/compareAsc/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/compareAsc/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/compareAsc/index.ts b/date-fns/src/compareAsc/index.ts
new file mode 100644
index 0000000..0fa1fcb
--- /dev/null
+++ b/date-fns/src/compareAsc/index.ts
@@ -0,0 +1,59 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name compareAsc
+ * @category Common Helpers
+ * @summary Compare the two dates and return -1, 0 or 1.
+ *
+ * @description
+ * Compare the two dates and return 1 if the first date is after the second,
+ * -1 if the first date is before the second or 0 if dates are equal.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to compare
+ * @param {Date|Number} dateRight - the second date to compare
+ * @returns {Number} the result of the comparison
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Compare 11 February 1987 and 10 July 1989:
+ * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))
+ * //=> -1
+ *
+ * @example
+ * // Sort the array of dates:
+ * const result = [
+ * new Date(1995, 6, 2),
+ * new Date(1987, 1, 11),
+ * new Date(1989, 6, 10)
+ * ].sort(compareAsc)
+ * //=> [
+ * // Wed Feb 11 1987 00:00:00,
+ * // Mon Jul 10 1989 00:00:00,
+ * // Sun Jul 02 1995 00:00:00
+ * // ]
+ */
+export default function compareAsc(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const diff = dateLeft.getTime() - dateRight.getTime()
+
+ if (diff < 0) {
+ return -1
+ } else if (diff > 0) {
+ return 1
+ // Return 0 if diff is 0; return NaN if diff is NaN
+ } else {
+ return diff
+ }
+}
diff --git a/date-fns/src/compareAsc/test.ts b/date-fns/src/compareAsc/test.ts
new file mode 100644
index 0000000..c12c560
--- /dev/null
+++ b/date-fns/src/compareAsc/test.ts
@@ -0,0 +1,81 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import compareAsc from '.'
+
+describe('compareAsc', function() {
+ it('returns 0 if the given dates are equal', function() {
+ const result = compareAsc(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === 0)
+ })
+
+ it('returns -1 if the first date is before the second one', function() {
+ const result = compareAsc(
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === -1)
+ })
+
+ it('returns 1 if the first date is after the second one', function() {
+ const result = compareAsc(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ )
+ assert(result === 1)
+ })
+
+ it('sorts the dates array in the chronological order when function is passed as the argument to Array.prototype.sort()', function() {
+ const unsortedArray = [
+ new Date(1995, 6 /* Jul */, 2),
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10)
+ ]
+
+ const sortedArray = [
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1995, 6 /* Jul */, 2)
+ ]
+
+
+ unsortedArray.sort(compareAsc)
+ const result = unsortedArray
+
+ assert.deepStrictEqual(result, sortedArray)
+ })
+
+ it('accepts timestamps', function() {
+ const result = compareAsc(
+ new Date(1987, 1 /* Feb */, 11).getTime(),
+ new Date(1989, 6 /* Jul */, 10).getTime()
+ )
+ assert(result === -1)
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function() {
+ const result = compareAsc(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function() {
+ const result = compareAsc(new Date(1989, 6 /* Jul */, 10), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function() {
+ const result = compareAsc(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ //@ts-expect-error
+ assert.throws(compareAsc.bind(null), TypeError)
+ //@ts-expect-error
+ assert.throws(compareAsc.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/compareDesc/benchmark.js b/date-fns/src/compareDesc/benchmark.js
new file mode 100644
index 0000000..c67d4bc
--- /dev/null
+++ b/date-fns/src/compareDesc/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import compareDesc from '.'
+
+suite('compareDesc', function () {
+ benchmark('date-fns', function () {
+ return compareDesc(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/compareDesc/index.d.ts b/date-fns/src/compareDesc/index.d.ts
new file mode 100644
index 0000000..673fab5
--- /dev/null
+++ b/date-fns/src/compareDesc/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { compareDesc } from 'date-fns'
+export default compareDesc
diff --git a/date-fns/src/compareDesc/index.js.flow b/date-fns/src/compareDesc/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/compareDesc/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/compareDesc/index.ts b/date-fns/src/compareDesc/index.ts
new file mode 100644
index 0000000..bdedfa9
--- /dev/null
+++ b/date-fns/src/compareDesc/index.ts
@@ -0,0 +1,59 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name compareDesc
+ * @category Common Helpers
+ * @summary Compare the two dates reverse chronologically and return -1, 0 or 1.
+ *
+ * @description
+ * Compare the two dates and return -1 if the first date is after the second,
+ * 1 if the first date is before the second or 0 if dates are equal.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to compare
+ * @param {Date|Number} dateRight - the second date to compare
+ * @returns {Number} the result of the comparison
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Compare 11 February 1987 and 10 July 1989 reverse chronologically:
+ * const result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10))
+ * //=> 1
+ *
+ * @example
+ * // Sort the array of dates in reverse chronological order:
+ * const result = [
+ * new Date(1995, 6, 2),
+ * new Date(1987, 1, 11),
+ * new Date(1989, 6, 10)
+ * ].sort(compareDesc)
+ * //=> [
+ * // Sun Jul 02 1995 00:00:00,
+ * // Mon Jul 10 1989 00:00:00,
+ * // Wed Feb 11 1987 00:00:00
+ * // ]
+ */
+export default function compareDesc(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const diff = dateLeft.getTime() - dateRight.getTime()
+
+ if (diff > 0) {
+ return -1
+ } else if (diff < 0) {
+ return 1
+ // Return 0 if diff is 0; return NaN if diff is NaN
+ } else {
+ return diff
+ }
+}
diff --git a/date-fns/src/compareDesc/test.ts b/date-fns/src/compareDesc/test.ts
new file mode 100644
index 0000000..1ecb557
--- /dev/null
+++ b/date-fns/src/compareDesc/test.ts
@@ -0,0 +1,80 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import compareDesc from '.'
+
+describe('compareDesc', function() {
+ it('returns 0 if the given dates are equal', function() {
+ const result = compareDesc(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === 0)
+ })
+
+ it('returns 1 if the first date is before the second one', function() {
+ const result = compareDesc(
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === 1)
+ })
+
+ it('returns -1 if the first date is after the second one', function() {
+ const result = compareDesc(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ )
+ assert(result === -1)
+ })
+
+ it('sorts the dates array in the reverse chronological order when function is passed as the argument to Array.prototype.sort()', function() {
+ const unsortedArray = [
+ new Date(1995, 6 /* Jul */, 2),
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10)
+ ]
+
+ const sortedArray = [
+ new Date(1995, 6 /* Jul */, 2),
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ ]
+
+ unsortedArray.sort(compareDesc)
+ const result = unsortedArray
+
+ assert.deepStrictEqual(result, sortedArray)
+ })
+
+ it('accepts timestamps', function() {
+ const result = compareDesc(
+ new Date(1987, 1 /* Feb */, 11).getTime(),
+ new Date(1989, 6 /* Jul */, 10).getTime()
+ )
+ assert(result === 1)
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function() {
+ const result = compareDesc(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function() {
+ const result = compareDesc(new Date(1989, 6 /* Jul */, 10), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function() {
+ const result = compareDesc(new Date(1989, 6 /* Jul */, 10), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ //@ts-expect-error
+ assert.throws(compareDesc.bind(null), TypeError)
+ //@ts-expect-error
+ assert.throws(compareDesc.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/constants/index.d.ts b/date-fns/src/constants/index.d.ts
new file mode 100644
index 0000000..64e4bfa
--- /dev/null
+++ b/date-fns/src/constants/index.d.ts
@@ -0,0 +1,2 @@
+export const maxTime: number
+export const minTime: number
diff --git a/date-fns/src/constants/index.js.flow b/date-fns/src/constants/index.js.flow
new file mode 100644
index 0000000..d57a406
--- /dev/null
+++ b/date-fns/src/constants/index.js.flow
@@ -0,0 +1,4 @@
+// @flow
+
+declare export var maxTime: number
+declare export var minTime: number
diff --git a/date-fns/src/constants/index.ts b/date-fns/src/constants/index.ts
new file mode 100644
index 0000000..fc643b8
--- /dev/null
+++ b/date-fns/src/constants/index.ts
@@ -0,0 +1,119 @@
+/**
+ * Days in 1 week.
+ *
+ * @name daysInWeek
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const daysInWeek = 7
+
+/**
+ * Maximum allowed time.
+ *
+ * @name maxTime
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000
+
+/**
+ * Milliseconds in 1 minute
+ *
+ * @name millisecondsInMinute
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const millisecondsInMinute = 60000
+
+/**
+ * Milliseconds in 1 hour
+ *
+ * @name millisecondsInHour
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const millisecondsInHour = 3600000
+
+/**
+ * Milliseconds in 1 second
+ *
+ * @name millisecondsInSecond
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const millisecondsInSecond = 1000
+
+/**
+ * Minimum allowed time.
+ *
+ * @name minTime
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const minTime = -maxTime
+
+/**
+ * Minutes in 1 hour
+ *
+ * @name minutesInHour
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const minutesInHour = 60
+
+/**
+ * Months in 1 quarter
+ *
+ * @name monthsInQuarter
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const monthsInQuarter = 3
+
+/**
+ * Months in 1 year
+ *
+ * @name monthsInYear
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const monthsInYear = 12
+
+/**
+ * Quarters in 1 year
+ *
+ * @name quartersInYear
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const quartersInYear = 4
+
+/**
+ * Seconds in 1 hour
+ *
+ * @name secondsInHour
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const secondsInHour = 3600
+
+/**
+ * Seconds in 1 minute
+ *
+ * @name secondsInMinute
+ * @constant
+ * @type {number}
+ * @default
+ */
+export const secondsInMinute = 60
diff --git a/date-fns/src/daysToWeeks/index.d.ts b/date-fns/src/daysToWeeks/index.d.ts
new file mode 100644
index 0000000..666112f
--- /dev/null
+++ b/date-fns/src/daysToWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { daysToWeeks } from 'date-fns'
+export default daysToWeeks
diff --git a/date-fns/src/daysToWeeks/index.js.flow b/date-fns/src/daysToWeeks/index.js.flow
new file mode 100644
index 0000000..181aec6
--- /dev/null
+++ b/date-fns/src/daysToWeeks/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (days: number) => number
diff --git a/date-fns/src/daysToWeeks/index.ts b/date-fns/src/daysToWeeks/index.ts
new file mode 100644
index 0000000..b7b7efb
--- /dev/null
+++ b/date-fns/src/daysToWeeks/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { daysInWeek } from '../constants/index'
+
+/**
+ * @name daysToWeeks
+ * @category Conversion Helpers
+ * @summary Convert days to weeks.
+ *
+ * @description
+ * Convert a number of days to a full number of weeks.
+ *
+ * @param {number} days - number of days to be converted
+ *
+ * @returns {number} the number of days converted in weeks
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 14 days to weeks:
+ * const result = daysToWeeks(14)
+ * //=> 2
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = daysToWeeks(13)
+ * //=> 1
+ */
+export default function daysToWeeks(days: number): number {
+ requiredArgs(1, arguments)
+ const weeks = days / daysInWeek
+ return Math.floor(weeks)
+}
diff --git a/date-fns/src/daysToWeeks/test.ts b/date-fns/src/daysToWeeks/test.ts
new file mode 100644
index 0000000..837d60c
--- /dev/null
+++ b/date-fns/src/daysToWeeks/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import daysToWeeks from '.'
+
+describe('daysToWeeks', () => {
+ it('converts days to weeks', function () {
+ assert(daysToWeeks(7) === 1)
+ assert(daysToWeeks(14) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(daysToWeeks(8) === 1)
+ assert(daysToWeeks(6) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(daysToWeeks(7.5) === 1)
+ assert(daysToWeeks(0) === 0)
+ })
+}) \ No newline at end of file
diff --git a/date-fns/src/differenceInBusinessDays/index.d.ts b/date-fns/src/differenceInBusinessDays/index.d.ts
new file mode 100644
index 0000000..8decd89
--- /dev/null
+++ b/date-fns/src/differenceInBusinessDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInBusinessDays } from 'date-fns'
+export default differenceInBusinessDays
diff --git a/date-fns/src/differenceInBusinessDays/index.js.flow b/date-fns/src/differenceInBusinessDays/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInBusinessDays/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInBusinessDays/index.ts b/date-fns/src/differenceInBusinessDays/index.ts
new file mode 100644
index 0000000..46fd575
--- /dev/null
+++ b/date-fns/src/differenceInBusinessDays/index.ts
@@ -0,0 +1,62 @@
+import isValid from '../isValid/index'
+import isWeekend from '../isWeekend/index'
+import toDate from '../toDate/index'
+import differenceInCalendarDays from '../differenceInCalendarDays/index'
+import addDays from '../addDays/index'
+import isSameDay from '../isSameDay/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInBusinessDays
+ * @category Day Helpers
+ * @summary Get the number of business days between the given dates.
+ *
+ * @description
+ * Get the number of business day periods between the given dates.
+ * Business days being days that arent in the weekend.
+ * Like `differenceInCalendarDays`, the function removes the times from
+ * the dates before calculating the difference.
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of business days
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many business days are between
+ * // 10 January 2014 and 20 July 2014?
+ * var result = differenceInBusinessDays(
+ * new Date(2014, 6, 20),
+ * new Date(2014, 0, 10)
+ * )
+ * //=> 136
+ */
+export default function differenceInBusinessDays(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ let dateRight = toDate(dirtyDateRight)
+
+ if (!isValid(dateLeft) || !isValid(dateRight)) return NaN
+
+ const calendarDifference = differenceInCalendarDays(dateLeft, dateRight)
+ const sign = calendarDifference < 0 ? -1 : 1
+
+ const weeks = toInteger(calendarDifference / 7)
+
+ let result = weeks * 5
+ dateRight = addDays(dateRight, weeks * 7)
+
+ // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week
+ while (!isSameDay(dateLeft, dateRight)) {
+ // sign is used to account for both negative and positive differences
+ result += isWeekend(dateRight) ? 0 : sign
+ dateRight = addDays(dateRight, sign)
+ }
+
+ return result === 0 ? 0 : result
+}
diff --git a/date-fns/src/differenceInBusinessDays/test.ts b/date-fns/src/differenceInBusinessDays/test.ts
new file mode 100644
index 0000000..f30e671
--- /dev/null
+++ b/date-fns/src/differenceInBusinessDays/test.ts
@@ -0,0 +1,141 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInBusinessDays from '.'
+
+describe('differenceInBusinessDays', function () {
+ it('returns the number of business days between the given dates, excluding weekends', function () {
+ const result = differenceInBusinessDays(
+ new Date(2014, 6 /* Jul */, 18),
+ new Date(2014, 0 /* Jan */, 10)
+ )
+ assert(result === 135)
+ })
+
+ it('can handle long ranges', function () {
+ // @ts-ignore
+ if (typeof this.timeout === 'function') {
+ // @ts-ignore
+ this.timeout(500 /* 500 ms test timeout */)
+ }
+ const result = differenceInBusinessDays(
+ new Date(15000, 0 /* Jan */, 1),
+ new Date(2014, 0 /* Jan */, 1)
+ )
+ assert(result === 3387885)
+ })
+
+ it('the same except given first date falls on a weekend', function () {
+ const result = differenceInBusinessDays(
+ new Date(2019, 6 /* Jul */, 20),
+ new Date(2019, 6 /* Jul */, 18)
+ )
+ assert(result === 2)
+ })
+
+ it('the same except given second date falls on a weekend', function () {
+ const result = differenceInBusinessDays(
+ new Date(2019, 6 /* Jul */, 23),
+ new Date(2019, 6 /* Jul */, 20)
+ )
+ assert(result === 1)
+ })
+
+ it('the same except both given dates fall on a weekend', function () {
+ const result = differenceInBusinessDays(
+ new Date(2019, 6 /* Jul */, 28),
+ new Date(2019, 6 /* Jul */, 20)
+ )
+ assert(result === 5)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInBusinessDays(
+ new Date(2014, 0 /* Jan */, 10),
+ new Date(2014, 6 /* Jul */, 20)
+ )
+ assert(result === -135)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInBusinessDays(
+ new Date(2014, 6, 18).getTime(),
+ new Date(2014, 0, 10).getTime()
+ )
+ assert(result === 135)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a day, but the given dates are in different calendar days', function () {
+ const result = differenceInBusinessDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 4, 23, 59)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInBusinessDays(
+ new Date(2014, 8 /* Sep */, 4, 23, 59),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('the time values of the given dates are the same', function () {
+ const result = differenceInBusinessDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 4, 0, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInBusinessDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number) {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInBusinessDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInBusinessDays(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInBusinessDays(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInBusinessDays(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInBusinessDays.bind(null), TypeError)
+ assert.throws(differenceInBusinessDays.bind(null, 1), TypeError)
+ })
+ })
+})
diff --git a/date-fns/src/differenceInCalendarDays/benchmark.js b/date-fns/src/differenceInCalendarDays/benchmark.js
new file mode 100644
index 0000000..ed704ed
--- /dev/null
+++ b/date-fns/src/differenceInCalendarDays/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInCalendarDays from '.'
+
+suite('differenceInCalendarDays', function () {
+ benchmark('date-fns', function () {
+ return differenceInCalendarDays(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInCalendarDays/index.d.ts b/date-fns/src/differenceInCalendarDays/index.d.ts
new file mode 100644
index 0000000..384b796
--- /dev/null
+++ b/date-fns/src/differenceInCalendarDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarDays } from 'date-fns'
+export default differenceInCalendarDays
diff --git a/date-fns/src/differenceInCalendarDays/index.js.flow b/date-fns/src/differenceInCalendarDays/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInCalendarDays/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInCalendarDays/index.ts b/date-fns/src/differenceInCalendarDays/index.ts
new file mode 100644
index 0000000..488c4ca
--- /dev/null
+++ b/date-fns/src/differenceInCalendarDays/index.ts
@@ -0,0 +1,59 @@
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import startOfDay from '../startOfDay/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+const MILLISECONDS_IN_DAY = 86400000
+
+/**
+ * @name differenceInCalendarDays
+ * @category Day Helpers
+ * @summary Get the number of calendar days between the given dates.
+ *
+ * @description
+ * Get the number of calendar days between the given dates. This means that the times are removed
+ * from the dates and then the difference in days is calculated.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of calendar days
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many calendar days are between
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
+ * const result = differenceInCalendarDays(
+ * new Date(2012, 6, 2, 0, 0),
+ * new Date(2011, 6, 2, 23, 0)
+ * )
+ * //=> 366
+ * // How many calendar days are between
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
+ * const result = differenceInCalendarDays(
+ * new Date(2011, 6, 3, 0, 1),
+ * new Date(2011, 6, 2, 23, 59)
+ * )
+ * //=> 1
+ */
+export default function differenceInCalendarDays(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const startOfDayLeft = startOfDay(dirtyDateLeft)
+ const startOfDayRight = startOfDay(dirtyDateRight)
+
+ const timestampLeft =
+ startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft)
+ const timestampRight =
+ startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight)
+
+ // Round the number of days to the nearest integer
+ // because the number of milliseconds in a day is not constant
+ // (e.g. it's different in the day of the daylight saving time clock shift)
+ return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY)
+}
diff --git a/date-fns/src/differenceInCalendarDays/test.ts b/date-fns/src/differenceInCalendarDays/test.ts
new file mode 100644
index 0000000..c122d1a
--- /dev/null
+++ b/date-fns/src/differenceInCalendarDays/test.ts
@@ -0,0 +1,215 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInCalendarDays from '.'
+import { getDstTransitions } from '../../test/dst/tzOffsetTransitions'
+
+describe('differenceInCalendarDays', function () {
+ it('returns the number of calendar days between the given dates', function () {
+ const result = differenceInCalendarDays(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 366)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInCalendarDays(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -366)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInCalendarDays(
+ new Date(2014, 8 /* Sep */, 5, 18, 0).getTime(),
+ new Date(2014, 8 /* Sep */, 4, 6, 0).getTime()
+ )
+ assert(result === 1)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a day, but the given dates are in different calendar days', function () {
+ const result = differenceInCalendarDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 4, 23, 59)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInCalendarDays(
+ new Date(2014, 8 /* Sep */, 4, 23, 59),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('the time values of the given the given dates are the same', function () {
+ const result = differenceInCalendarDays(
+ new Date(2014, 8 /* Sep */, 6, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('the given the given dates are the same', function () {
+ const result = differenceInCalendarDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInCalendarDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInCalendarDays(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInCalendarDays(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInCalendarDays(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInCalendarDays.bind(null), TypeError)
+ assert.throws(differenceInCalendarDays.bind(null, 1), TypeError)
+ })
+
+ // These tests were copy-pasted almost unchanged from DST tests for
+ // `differenceInDays`
+ const dstTransitions = getDstTransitions(2017)
+ const dstOnly = dstTransitions.start && dstTransitions.end ? it : it.skip
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone || process.env.tz
+ dstOnly(
+ `works across DST start & end in local timezone: ${tz || '(unknown)'}`,
+ function () {
+ const { start, end } = dstTransitions
+ const HOUR = 1000 * 60 * 60
+ const MINUTE = 1000 * 60
+ function sameTime(t1: Date, t2: Date): boolean {
+ return (
+ t1.getHours() === t2.getHours() &&
+ t1.getMinutes() === t2.getMinutes() &&
+ t1.getSeconds() === t2.getSeconds() &&
+ t1.getMilliseconds() === t2.getMilliseconds()
+ )
+ }
+
+ assert(start !== undefined)
+ assert(end !== undefined)
+
+ if (start === undefined || end === undefined) {
+ return
+ }
+
+ // It's usually 1 hour, but for some timezones, e.g. Australia/Lord_Howe, it is 30 minutes
+ const dstOffset =
+ (end.getTimezoneOffset() - start.getTimezoneOffset()) * MINUTE
+
+ // TEST DST START (SPRING)
+
+ // anchor to one hour before the boundary
+ {
+ const a = new Date(start.getTime() - HOUR) // 1 hour before DST
+ const b = new Date(a.getTime() + 24 * HOUR - dstOffset) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR - dstOffset) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInCalendarDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(b, a) === 1) // 23 hours -> 1 day
+ assert(differenceInCalendarDays(c, a) === 2) // 47 hours -> 2 days
+ }
+ // anchor exactly at the boundary
+ {
+ const a = start // exactly when DST starts
+ const b = new Date(a.getTime() + 24 * HOUR) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInCalendarDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(b, a) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(c, a) === 2) // 2 normal 24-hour days
+ }
+
+ // TEST DST END (FALL)
+
+ // make sure that diffs across a "fall back" DST boundary won't report a full day
+ // until 25 hours have elapsed.
+ {
+ const a = new Date(end.getTime() - HOUR / 2) // 1 hour before Standard Time starts
+ const b = new Date(a.getTime() + 24 * HOUR + dstOffset - 15 * MINUTE) // 1 day later, 15 mins earlier local time
+ const c = new Date(a.getTime() + 48 * HOUR + dstOffset - 15 * MINUTE) // 2 days later, 15 mins earlier local time
+
+ assert(differenceInCalendarDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(b, a) === 1) // 24.75 hours but 1 calendar days
+ assert(differenceInCalendarDays(c, a) === 2) // 49.75 hours but 2 calendar days
+ }
+ // anchor to one hour before the boundary
+ {
+ const a = new Date(end.getTime() - HOUR) // 1 hour before Standard Time starts
+ const b = new Date(a.getTime() + 24 * HOUR + dstOffset) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR + dstOffset) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInCalendarDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(b, a) === 1) // 25 hours -> 1 day
+ assert(differenceInCalendarDays(c, a) === 2) // 49 hours -> 2 days
+ }
+ // anchor to one hour after the boundary
+ {
+ const a = new Date(end.getTime() + HOUR) // 1 hour after Standard Time starts
+ const b = new Date(a.getTime() + 24 * HOUR) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInCalendarDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(b, a) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(c, a) === 2) // 2 normal 24-hour days
+ }
+ // anchor exactly at the boundary
+ {
+ const a = end // exactly when Standard Time starts
+ const b = new Date(a.getTime() + 24 * HOUR) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR) // 2 days later, same local time
+ assert(differenceInCalendarDays(b, a) === 1) // normal 24-hour day
+ assert(differenceInCalendarDays(c, a) === 2) // 2 normal 24-hour days
+ }
+ }
+ )
+})
diff --git a/date-fns/src/differenceInCalendarISOWeekYears/benchmark.js b/date-fns/src/differenceInCalendarISOWeekYears/benchmark.js
new file mode 100644
index 0000000..9f06d40
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeekYears/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInCalendarISOWeekYears from '.'
+
+suite('differenceInCalendarISOWeekYears', function () {
+ benchmark('date-fns', function () {
+ return differenceInCalendarISOWeekYears(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInCalendarISOWeekYears/index.d.ts b/date-fns/src/differenceInCalendarISOWeekYears/index.d.ts
new file mode 100644
index 0000000..bd8325c
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarISOWeekYears } from 'date-fns'
+export default differenceInCalendarISOWeekYears
diff --git a/date-fns/src/differenceInCalendarISOWeekYears/index.js.flow b/date-fns/src/differenceInCalendarISOWeekYears/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeekYears/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInCalendarISOWeekYears/index.ts b/date-fns/src/differenceInCalendarISOWeekYears/index.ts
new file mode 100644
index 0000000..609657e
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeekYears/index.ts
@@ -0,0 +1,43 @@
+import getISOWeekYear from '../getISOWeekYear/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInCalendarISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Get the number of calendar ISO week-numbering years between the given dates.
+ *
+ * @description
+ * Get the number of calendar ISO week-numbering years between the given dates.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `differenceInCalendarISOYears` to `differenceInCalendarISOWeekYears`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of calendar ISO week-numbering years
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?
+ * const result = differenceInCalendarISOWeekYears(
+ * new Date(2012, 0, 1),
+ * new Date(2010, 0, 1)
+ * )
+ * //=> 2
+ */
+export default function differenceInCalendarISOWeekYears(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ return getISOWeekYear(dirtyDateLeft) - getISOWeekYear(dirtyDateRight)
+}
diff --git a/date-fns/src/differenceInCalendarISOWeekYears/test.ts b/date-fns/src/differenceInCalendarISOWeekYears/test.ts
new file mode 100644
index 0000000..db38e28
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeekYears/test.ts
@@ -0,0 +1,118 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInCalendarISOWeekYears from '.'
+
+describe('differenceInCalendarISOWeekYears', function () {
+ it('returns the number of calendar ISO week-numbering years between the given dates', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2014, 6 /* Jul */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 4)
+ })
+
+ it('handles dates before 100 AD', function () {
+ const firstDate = new Date(0)
+ firstDate.setFullYear(14, 0 /* Jan */, 1)
+ firstDate.setHours(0, 0, 0, 0)
+ const secondDate = new Date(0)
+ secondDate.setFullYear(0, 0 /* Jan */, 1)
+ secondDate.setHours(0, 0, 0, 0)
+ const result = differenceInCalendarISOWeekYears(firstDate, secondDate)
+ assert(result === 15)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than an ISO year, but the given dates are in different calendar ISO years', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2012, 0 /* Jan */, 2),
+ new Date(2012, 0 /* Jan */, 1)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2012, 0 /* Jan */, 1),
+ new Date(2012, 0 /* Jan */, 2)
+ )
+ assert(result === -1)
+ })
+
+ it('the ISO weeks and weekdays of the given dates are the same', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2013, 11 /* Dec */, 30),
+ new Date(2012, 0 /* Jan */, 2)
+ )
+ assert(result === 2)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInCalendarISOWeekYears(
+ new Date(NaN),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInCalendarISOWeekYears.bind(null), TypeError)
+ assert.throws(differenceInCalendarISOWeekYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInCalendarISOWeeks/benchmark.js b/date-fns/src/differenceInCalendarISOWeeks/benchmark.js
new file mode 100644
index 0000000..a9f5243
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeeks/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInCalendarISOWeeks from '.'
+
+suite('differenceInCalendarISOWeeks', function () {
+ benchmark('date-fns', function () {
+ return differenceInCalendarISOWeeks(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInCalendarISOWeeks/index.d.ts b/date-fns/src/differenceInCalendarISOWeeks/index.d.ts
new file mode 100644
index 0000000..7364227
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarISOWeeks } from 'date-fns'
+export default differenceInCalendarISOWeeks
diff --git a/date-fns/src/differenceInCalendarISOWeeks/index.js.flow b/date-fns/src/differenceInCalendarISOWeeks/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeeks/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInCalendarISOWeeks/index.ts b/date-fns/src/differenceInCalendarISOWeeks/index.ts
new file mode 100644
index 0000000..d761914
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeeks/index.ts
@@ -0,0 +1,54 @@
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import startOfISOWeek from '../startOfISOWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+const MILLISECONDS_IN_WEEK = 604800000
+
+/**
+ * @name differenceInCalendarISOWeeks
+ * @category ISO Week Helpers
+ * @summary Get the number of calendar ISO weeks between the given dates.
+ *
+ * @description
+ * Get the number of calendar ISO weeks between the given dates.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of calendar ISO weeks
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?
+ * const result = differenceInCalendarISOWeeks(
+ * new Date(2014, 6, 21),
+ * new Date(2014, 6, 6)
+ * )
+ * //=> 3
+ */
+export default function differenceInCalendarISOWeeks(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const startOfISOWeekLeft = startOfISOWeek(dirtyDateLeft)
+ const startOfISOWeekRight = startOfISOWeek(dirtyDateRight)
+
+ const timestampLeft =
+ startOfISOWeekLeft.getTime() -
+ getTimezoneOffsetInMilliseconds(startOfISOWeekLeft)
+ const timestampRight =
+ startOfISOWeekRight.getTime() -
+ getTimezoneOffsetInMilliseconds(startOfISOWeekRight)
+
+ // Round the number of days to the nearest integer
+ // because the number of milliseconds in a week is not constant
+ // (e.g. it's different in the week of the daylight saving time clock shift)
+ return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK)
+}
diff --git a/date-fns/src/differenceInCalendarISOWeeks/test.ts b/date-fns/src/differenceInCalendarISOWeeks/test.ts
new file mode 100644
index 0000000..5318cad
--- /dev/null
+++ b/date-fns/src/differenceInCalendarISOWeeks/test.ts
@@ -0,0 +1,104 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInCalendarISOWeeks from '.'
+
+describe('differenceInCalendarISOWeeks', function () {
+ it('returns the number of calendar ISO weeks between the given dates', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0)
+ )
+ assert(result === 2)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ new Date(2014, 6 /* Jul */, 8, 18, 0)
+ )
+ assert(result === -2)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 6 /* Jul */, 12).getTime(),
+ new Date(2014, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 1)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than an ISO week, but the given dates are in different calendar ISO weeks', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 6 /* Jul */, 7),
+ new Date(2014, 6 /* Jul */, 6)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 6 /* Jul */, 6),
+ new Date(2014, 6 /* Jul */, 7)
+ )
+ assert(result === -1)
+ })
+
+ it('the days of weeks of the given dates are the same', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 6 /* Jul */, 9),
+ new Date(2014, 6 /* Jul */, 2)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInCalendarISOWeeks(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInCalendarISOWeeks(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInCalendarISOWeeks(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInCalendarISOWeeks.bind(null), TypeError)
+ assert.throws(differenceInCalendarISOWeeks.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInCalendarMonths/benchmark.js b/date-fns/src/differenceInCalendarMonths/benchmark.js
new file mode 100644
index 0000000..7530bf0
--- /dev/null
+++ b/date-fns/src/differenceInCalendarMonths/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInCalendarMonths from '.'
+
+suite('differenceInCalendarMonths', function () {
+ benchmark('date-fns', function () {
+ return differenceInCalendarMonths(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInCalendarMonths/index.d.ts b/date-fns/src/differenceInCalendarMonths/index.d.ts
new file mode 100644
index 0000000..743bf76
--- /dev/null
+++ b/date-fns/src/differenceInCalendarMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarMonths } from 'date-fns'
+export default differenceInCalendarMonths
diff --git a/date-fns/src/differenceInCalendarMonths/index.js.flow b/date-fns/src/differenceInCalendarMonths/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInCalendarMonths/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInCalendarMonths/index.ts b/date-fns/src/differenceInCalendarMonths/index.ts
new file mode 100644
index 0000000..dcf1c44
--- /dev/null
+++ b/date-fns/src/differenceInCalendarMonths/index.ts
@@ -0,0 +1,42 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInCalendarMonths
+ * @category Month Helpers
+ * @summary Get the number of calendar months between the given dates.
+ *
+ * @description
+ * Get the number of calendar months between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of calendar months
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many calendar months are between 31 January 2014 and 1 September 2014?
+ * var result = differenceInCalendarMonths(
+ * new Date(2014, 8, 1),
+ * new Date(2014, 0, 31)
+ * )
+ * //=> 8
+ */
+export default function differenceInCalendarMonths(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const yearDiff = dateLeft.getFullYear() - dateRight.getFullYear()
+ const monthDiff = dateLeft.getMonth() - dateRight.getMonth()
+
+ return yearDiff * 12 + monthDiff
+}
diff --git a/date-fns/src/differenceInCalendarMonths/test.ts b/date-fns/src/differenceInCalendarMonths/test.ts
new file mode 100644
index 0000000..9174c58
--- /dev/null
+++ b/date-fns/src/differenceInCalendarMonths/test.ts
@@ -0,0 +1,104 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInCalendarMonths from '.'
+
+describe('differenceInCalendarMonths', function () {
+ it('returns the number of calendar months between the given dates', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 12)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -12)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2014, 7 /* Aug */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 49)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a month, but the given dates are in different calendar months', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2014, 8 /* Sep */, 1),
+ new Date(2014, 7 /* Aug */, 31)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2014, 7 /* Aug */, 31),
+ new Date(2014, 8 /* Sep */, 1)
+ )
+ assert(result === -1)
+ })
+
+ it('the days of months of the given dates are the same', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2014, 8 /* Sep */, 6),
+ new Date(2014, 7 /* Aug */, 6)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInCalendarMonths(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInCalendarMonths(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInCalendarMonths(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInCalendarMonths(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInCalendarMonths.bind(null), TypeError)
+ assert.throws(differenceInCalendarMonths.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInCalendarQuarters/benchmark.js b/date-fns/src/differenceInCalendarQuarters/benchmark.js
new file mode 100644
index 0000000..098a4ee
--- /dev/null
+++ b/date-fns/src/differenceInCalendarQuarters/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInCalendarQuarters from '.'
+
+suite('differenceInCalendarQuarters', function () {
+ benchmark('date-fns', function () {
+ return differenceInCalendarQuarters(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInCalendarQuarters/index.d.ts b/date-fns/src/differenceInCalendarQuarters/index.d.ts
new file mode 100644
index 0000000..177e072
--- /dev/null
+++ b/date-fns/src/differenceInCalendarQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarQuarters } from 'date-fns'
+export default differenceInCalendarQuarters
diff --git a/date-fns/src/differenceInCalendarQuarters/index.js.flow b/date-fns/src/differenceInCalendarQuarters/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInCalendarQuarters/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInCalendarQuarters/index.ts b/date-fns/src/differenceInCalendarQuarters/index.ts
new file mode 100644
index 0000000..d3569fd
--- /dev/null
+++ b/date-fns/src/differenceInCalendarQuarters/index.ts
@@ -0,0 +1,43 @@
+import getQuarter from '../getQuarter/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInCalendarQuarters
+ * @category Quarter Helpers
+ * @summary Get the number of calendar quarters between the given dates.
+ *
+ * @description
+ * Get the number of calendar quarters between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of calendar quarters
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many calendar quarters are between 31 December 2013 and 2 July 2014?
+ * var result = differenceInCalendarQuarters(
+ * new Date(2014, 6, 2),
+ * new Date(2013, 11, 31)
+ * )
+ * //=> 3
+ */
+export default function differenceInCalendarQuarters(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const yearDiff = dateLeft.getFullYear() - dateRight.getFullYear()
+ const quarterDiff = getQuarter(dateLeft) - getQuarter(dateRight)
+
+ return yearDiff * 4 + quarterDiff
+}
diff --git a/date-fns/src/differenceInCalendarQuarters/test.ts b/date-fns/src/differenceInCalendarQuarters/test.ts
new file mode 100644
index 0000000..f889687
--- /dev/null
+++ b/date-fns/src/differenceInCalendarQuarters/test.ts
@@ -0,0 +1,104 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInCalendarQuarters from '.'
+
+describe('differenceInCalendarQuarters', function () {
+ it('returns the number of calendar quarters between the given dates', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 4)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -4)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2014, 9 /* Oct */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 17)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a quarter, but the given dates are in different calendar quarters', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2014, 6 /* Jul */, 1),
+ new Date(2014, 5 /* Jun */, 30)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2014, 5 /* Jun */, 30),
+ new Date(2014, 6 /* Jul */, 1)
+ )
+ assert(result === -1)
+ })
+
+ it('the days of months of the given dates are the same', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2014, 3 /* Apr */, 6),
+ new Date(2014, 0 /* Jan */, 6)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInCalendarQuarters(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInCalendarQuarters(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInCalendarQuarters(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInCalendarQuarters.bind(null), TypeError)
+ assert.throws(differenceInCalendarQuarters.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInCalendarWeeks/benchmark.js b/date-fns/src/differenceInCalendarWeeks/benchmark.js
new file mode 100644
index 0000000..d014aee
--- /dev/null
+++ b/date-fns/src/differenceInCalendarWeeks/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInCalendarWeeks from '.'
+
+suite('differenceInCalendarWeeks', function () {
+ benchmark('date-fns', function () {
+ return differenceInCalendarWeeks(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInCalendarWeeks/index.d.ts b/date-fns/src/differenceInCalendarWeeks/index.d.ts
new file mode 100644
index 0000000..c370dd6
--- /dev/null
+++ b/date-fns/src/differenceInCalendarWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarWeeks } from 'date-fns'
+export default differenceInCalendarWeeks
diff --git a/date-fns/src/differenceInCalendarWeeks/index.js.flow b/date-fns/src/differenceInCalendarWeeks/index.js.flow
new file mode 100644
index 0000000..e4968a9
--- /dev/null
+++ b/date-fns/src/differenceInCalendarWeeks/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => number
diff --git a/date-fns/src/differenceInCalendarWeeks/index.ts b/date-fns/src/differenceInCalendarWeeks/index.ts
new file mode 100644
index 0000000..da15cb7
--- /dev/null
+++ b/date-fns/src/differenceInCalendarWeeks/index.ts
@@ -0,0 +1,67 @@
+import startOfWeek from '../startOfWeek/index'
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, WeekStartOptions } from '../types'
+
+const MILLISECONDS_IN_WEEK = 604800000
+
+/**
+ * @name differenceInCalendarWeeks
+ * @category Week Helpers
+ * @summary Get the number of calendar weeks between the given dates.
+ *
+ * @description
+ * Get the number of calendar weeks between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Number} the number of calendar weeks
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // How many calendar weeks are between 5 July 2014 and 20 July 2014?
+ * const result = differenceInCalendarWeeks(
+ * new Date(2014, 6, 20),
+ * new Date(2014, 6, 5)
+ * )
+ * //=> 3
+ *
+ * @example
+ * // If the week starts on Monday,
+ * // how many calendar weeks are between 5 July 2014 and 20 July 2014?
+ * const result = differenceInCalendarWeeks(
+ * new Date(2014, 6, 20),
+ * new Date(2014, 6, 5),
+ * { weekStartsOn: 1 }
+ * )
+ * //=> 2
+ */
+export default function differenceInCalendarWeeks(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number,
+ dirtyOptions?: LocaleOptions & WeekStartOptions
+): number {
+ requiredArgs(2, arguments)
+
+ const startOfWeekLeft = startOfWeek(dirtyDateLeft, dirtyOptions)
+ const startOfWeekRight = startOfWeek(dirtyDateRight, dirtyOptions)
+
+ const timestampLeft =
+ startOfWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekLeft)
+ const timestampRight =
+ startOfWeekRight.getTime() -
+ getTimezoneOffsetInMilliseconds(startOfWeekRight)
+
+ // Round the number of days to the nearest integer
+ // because the number of milliseconds in a week is not constant
+ // (e.g. it's different in the week of the daylight saving time clock shift)
+ return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK)
+}
diff --git a/date-fns/src/differenceInCalendarWeeks/test.ts b/date-fns/src/differenceInCalendarWeeks/test.ts
new file mode 100644
index 0000000..8a1f6e2
--- /dev/null
+++ b/date-fns/src/differenceInCalendarWeeks/test.ts
@@ -0,0 +1,164 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInCalendarWeeks from '.'
+
+describe('differenceInCalendarWeeks', function () {
+ it('returns the number of calendar weeks between the given dates', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ { weekStartsOn: 1 }
+ )
+ assert(result === 2)
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ {
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ }
+ )
+ assert(result === 2)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ {
+ weekStartsOn: 1,
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ }
+ )
+ assert(result === 2)
+ })
+
+ it('returns a positive number if the time value of the second date is smaller', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ // @ts-expect-error
+ { weekStartsOn: '1' }
+ )
+ assert(result === 2)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ new Date(2014, 6 /* Jul */, 8, 18, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 12).getTime(),
+ new Date(2014, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 1)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a week, but the given dates are in different calendar weeks', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 6),
+ new Date(2014, 6 /* Jul */, 5)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 5),
+ new Date(2014, 6 /* Jul */, 6)
+ )
+ assert(result === -1)
+ })
+
+ it('the days of weeks of the given dates are the same', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 6 /* Jul */, 9),
+ new Date(2014, 6 /* Jul */, 2)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInCalendarWeeks(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInCalendarWeeks(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInCalendarWeeks(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ // @ts-expect-error
+ const block = differenceInCalendarWeeks.bind(
+ null,
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInCalendarWeeks.bind(null), TypeError)
+ assert.throws(differenceInCalendarWeeks.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInCalendarYears/benchmark.js b/date-fns/src/differenceInCalendarYears/benchmark.js
new file mode 100644
index 0000000..74f42ba
--- /dev/null
+++ b/date-fns/src/differenceInCalendarYears/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInCalendarYears from '.'
+
+suite('differenceInCalendarYears', function () {
+ benchmark('date-fns', function () {
+ return differenceInCalendarYears(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInCalendarYears/index.d.ts b/date-fns/src/differenceInCalendarYears/index.d.ts
new file mode 100644
index 0000000..3692b07
--- /dev/null
+++ b/date-fns/src/differenceInCalendarYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarYears } from 'date-fns'
+export default differenceInCalendarYears
diff --git a/date-fns/src/differenceInCalendarYears/index.js.flow b/date-fns/src/differenceInCalendarYears/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInCalendarYears/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInCalendarYears/index.ts b/date-fns/src/differenceInCalendarYears/index.ts
new file mode 100644
index 0000000..586b0fd
--- /dev/null
+++ b/date-fns/src/differenceInCalendarYears/index.ts
@@ -0,0 +1,39 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInCalendarYears
+ * @category Year Helpers
+ * @summary Get the number of calendar years between the given dates.
+ *
+ * @description
+ * Get the number of calendar years between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of calendar years
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many calendar years are between 31 December 2013 and 11 February 2015?
+ * const result = differenceInCalendarYears(
+ * new Date(2015, 1, 11),
+ * new Date(2013, 11, 31)
+ * )
+ * //=> 2
+ */
+export default function differenceInCalendarYears(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ return dateLeft.getFullYear() - dateRight.getFullYear()
+}
diff --git a/date-fns/src/differenceInCalendarYears/test.ts b/date-fns/src/differenceInCalendarYears/test.ts
new file mode 100644
index 0000000..7a27322
--- /dev/null
+++ b/date-fns/src/differenceInCalendarYears/test.ts
@@ -0,0 +1,105 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInCalendarYears from '.'
+
+describe('differenceInCalendarYears', function () {
+ it('returns the number of calendar years between the given dates', function () {
+ const result = differenceInCalendarYears(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInCalendarYears(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInCalendarYears(
+ new Date(2014, 6 /* Jul */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 4)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a year, but the given dates are in different calendar years', function () {
+ const result = differenceInCalendarYears(
+ new Date(2015, 0 /* Jan */, 1),
+ new Date(2014, 11 /* Dec */, 31)
+ )
+ assert(result === 1)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInCalendarYears(
+ new Date(2014, 11 /* Dec */, 31),
+ new Date(2015, 0 /* Jan */, 1)
+ )
+ assert(result === -1)
+ })
+
+ it('the days and months of the given dates are the same', function () {
+ const result = differenceInCalendarYears(
+ new Date(2014, 8 /* Sep */, 5),
+ new Date(2012, 8 /* Sep */, 5)
+ )
+ assert(result === 2)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInCalendarYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInCalendarYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInCalendarYears(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInCalendarYears(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInCalendarYears(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInCalendarYears.bind(null), TypeError)
+ assert.throws(differenceInCalendarYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInDays/benchmark.js b/date-fns/src/differenceInDays/benchmark.js
new file mode 100644
index 0000000..2bc0f44
--- /dev/null
+++ b/date-fns/src/differenceInDays/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInDays from '.'
+import moment from 'moment'
+
+suite('differenceInDays', function () {
+ benchmark('date-fns', function () {
+ return differenceInDays(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'day')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInDays/index.d.ts b/date-fns/src/differenceInDays/index.d.ts
new file mode 100644
index 0000000..de04cde
--- /dev/null
+++ b/date-fns/src/differenceInDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInDays } from 'date-fns'
+export default differenceInDays
diff --git a/date-fns/src/differenceInDays/index.js.flow b/date-fns/src/differenceInDays/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInDays/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInDays/index.ts b/date-fns/src/differenceInDays/index.ts
new file mode 100644
index 0000000..5851836
--- /dev/null
+++ b/date-fns/src/differenceInDays/index.ts
@@ -0,0 +1,104 @@
+import toDate from '../toDate/index'
+import differenceInCalendarDays from '../differenceInCalendarDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+// Like `compareAsc` but uses local time not UTC, which is needed
+// for accurate equality comparisons of UTC timestamps that end up
+// having the same representation in local time, e.g. one hour before
+// DST ends vs. the instant that DST ends.
+function compareLocalAsc(dateLeft: Date, dateRight: Date): number {
+ const diff =
+ dateLeft.getFullYear() - dateRight.getFullYear() ||
+ dateLeft.getMonth() - dateRight.getMonth() ||
+ dateLeft.getDate() - dateRight.getDate() ||
+ dateLeft.getHours() - dateRight.getHours() ||
+ dateLeft.getMinutes() - dateRight.getMinutes() ||
+ dateLeft.getSeconds() - dateRight.getSeconds() ||
+ dateLeft.getMilliseconds() - dateRight.getMilliseconds()
+
+ if (diff < 0) {
+ return -1
+ } else if (diff > 0) {
+ return 1
+ // Return 0 if diff is 0; return NaN if diff is NaN
+ } else {
+ return diff
+ }
+}
+
+/**
+ * @name differenceInDays
+ * @category Day Helpers
+ * @summary Get the number of full days between the given dates.
+ *
+ * @description
+ * Get the number of full day periods between two dates. Fractional days are
+ * truncated towards zero.
+ *
+ * One "full day" is the distance between a local time in one day to the same
+ * local time on the next or previous day. A full day can sometimes be less than
+ * or more than 24 hours if a daylight savings change happens between two dates.
+ *
+ * To ignore DST and only measure exact 24-hour periods, use this instead:
+ * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.
+ *
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of full days according to the local timezone
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many full days are between
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
+ * const result = differenceInDays(
+ * new Date(2012, 6, 2, 0, 0),
+ * new Date(2011, 6, 2, 23, 0)
+ * )
+ * //=> 365
+ * // How many full days are between
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
+ * const result = differenceInDays(
+ * new Date(2011, 6, 3, 0, 1),
+ * new Date(2011, 6, 2, 23, 59)
+ * )
+ * //=> 0
+ * // How many full days are between
+ * // 1 March 2020 0:00 and 1 June 2020 0:00 ?
+ * // Note: because local time is used, the
+ * // result will always be 92 days, even in
+ * // time zones where DST starts and the
+ * // period has only 92*24-1 hours.
+ * const result = differenceInDays(
+ * new Date(2020, 5, 1),
+ * new Date(2020, 2, 1)
+ * )
+//=> 92
+ */
+export default function differenceInDays(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const sign = compareLocalAsc(dateLeft, dateRight)
+ const difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight))
+
+ dateLeft.setDate(dateLeft.getDate() - sign * difference)
+
+ // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full
+ // If so, result must be decreased by 1 in absolute value
+ const isLastDayNotFull = Number(
+ compareLocalAsc(dateLeft, dateRight) === -sign
+ )
+ const result = sign * (difference - isLastDayNotFull)
+ // Prevent negative zero
+ return result === 0 ? 0 : result
+}
diff --git a/date-fns/src/differenceInDays/test.ts b/date-fns/src/differenceInDays/test.ts
new file mode 100644
index 0000000..4afa6f8
--- /dev/null
+++ b/date-fns/src/differenceInDays/test.ts
@@ -0,0 +1,214 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInDays from '.'
+import { getDstTransitions } from '../../test/dst/tzOffsetTransitions'
+
+describe('differenceInDays', function () {
+ it('returns the number of full days between the given dates', function () {
+ const result = differenceInDays(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 366)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInDays(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -366)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInDays(
+ new Date(2014, 8 /* Sep */, 5, 18, 0).getTime(),
+ new Date(2014, 8 /* Sep */, 4, 6, 0).getTime()
+ )
+ assert(result === 1)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a day, but the given dates are in different calendar days', function () {
+ const result = differenceInDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 4, 23, 59)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInDays(
+ new Date(2014, 8 /* Sep */, 4, 23, 59),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('the time values of the given dates are the same', function () {
+ const result = differenceInDays(
+ new Date(2014, 8 /* Sep */, 6, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ const dstTransitions = getDstTransitions(2017)
+ const dstOnly = dstTransitions.start && dstTransitions.end ? it : it.skip
+ const tz =
+ Intl.DateTimeFormat().resolvedOptions().timeZone || process.env.tz
+ dstOnly(
+ `works across DST start & end in local timezone: ${tz || '(unknown)'}`,
+ function () {
+ const { start, end } = dstTransitions
+ const HOUR = 1000 * 60 * 60
+ const MINUTE = 1000 * 60
+ function sameTime(t1: Date, t2: Date): boolean {
+ return (
+ t1.getHours() === t2.getHours() &&
+ t1.getMinutes() === t2.getMinutes() &&
+ t1.getSeconds() === t2.getSeconds() &&
+ t1.getMilliseconds() === t2.getMilliseconds()
+ )
+ }
+
+ assert(start !== undefined)
+ assert(end !== undefined)
+
+ if (start === undefined || end === undefined) {
+ return
+ }
+
+ // It's usually 1 hour, but for some timezones, e.g. Australia/Lord_Howe, it is 30 minutes
+ const dstOffset =
+ (end.getTimezoneOffset() - start.getTimezoneOffset()) * MINUTE
+
+ // TEST DST START (SPRING)
+
+ // anchor to one hour before the boundary
+ {
+ const a = new Date(start.getTime() - HOUR) // 1 hour before DST
+ const b = new Date(a.getTime() + 24 * HOUR - dstOffset) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR - dstOffset) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInDays(b, a) === 1) // 23 hours -> 1 day
+ assert(differenceInDays(c, a) === 2) // 47 hours -> 2 days
+ }
+ // anchor exactly, the boundary
+ {
+ const a = start // exactly when DST starts
+ const b = new Date(a.getTime() + 24 * HOUR) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInDays(b, a) === 1) // normal 24-hour day
+ assert(differenceInDays(c, a) === 2) // 2 normal 24-hour days
+ }
+
+ // TEST DST END (FALL)
+
+ // make sure that diffs across a "fall back" DST boundary won't report a full day
+ // until 25 hours have elapsed.
+ {
+ const a = new Date(end.getTime() - HOUR / 2) // 1 hour before Standard Time starts
+ const b = new Date(a.getTime() + 24 * HOUR + dstOffset - 15 * MINUTE) // 1 day later, 15 mins earlier local time
+ const c = new Date(a.getTime() + 48 * HOUR + dstOffset - 15 * MINUTE) // 2 days later, 15 mins earlier local time
+
+ assert(differenceInDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInDays(b, a) === 0) // 24.75 hours -> 0 full days (because hour lost to DST)
+ assert(differenceInDays(c, a) === 1) // 48.75 hours -> 1 full day (because hour lost to DST)
+ }
+ // anchor to one hour before the boundary
+ {
+ const a = new Date(end.getTime() - HOUR) // 1 hour before Standard Time start
+ const b = new Date(a.getTime() + 24 * HOUR + dstOffset) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR + dstOffset) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInDays(b, a) === 1) // 25 hours -> 1 day
+ assert(differenceInDays(c, a) === 2) // 49 hours -> 2 days
+ }
+ // anchor to one hour after the boundary
+ {
+ const a = new Date(end.getTime() + HOUR) // 1 hour after Standard Time start
+ const b = new Date(a.getTime() + 24 * HOUR) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR) // 2 days later, same local time
+
+ assert(sameTime(a, b))
+ assert(sameTime(a, c))
+ assert(sameTime(b, c))
+ assert(differenceInDays(c, b) === 1) // normal 24-hour day
+ assert(differenceInDays(b, a) === 1) // normal 24-hour day
+ assert(differenceInDays(c, a) === 2) // 2 normal 24-hour days
+ }
+ // anchor exactly at the boundary
+ {
+ const a = end // exactly when Standard Time starts
+ const b = new Date(a.getTime() + 24 * HOUR) // 1 day later, same local time
+ const c = new Date(a.getTime() + 48 * HOUR) // 2 days later, same local time
+ assert(differenceInDays(b, a) === 1) // normal 24-hour day
+ assert(differenceInDays(c, a) === 2) // 2 normal 24-hour days
+ }
+ }
+ )
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInDays(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInDays(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInDays(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInDays(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInDays.bind(null), TypeError)
+ assert.throws(differenceInDays.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInHours/benchmark.js b/date-fns/src/differenceInHours/benchmark.js
new file mode 100644
index 0000000..895a26b
--- /dev/null
+++ b/date-fns/src/differenceInHours/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInHours from '.'
+import moment from 'moment'
+
+suite('differenceInHours', function () {
+ benchmark('date-fns', function () {
+ return differenceInHours(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'hour')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInHours/index.d.ts b/date-fns/src/differenceInHours/index.d.ts
new file mode 100644
index 0000000..4559ab9
--- /dev/null
+++ b/date-fns/src/differenceInHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInHours } from 'date-fns'
+export default differenceInHours
diff --git a/date-fns/src/differenceInHours/index.js.flow b/date-fns/src/differenceInHours/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInHours/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInHours/index.ts b/date-fns/src/differenceInHours/index.ts
new file mode 100644
index 0000000..3c940b1
--- /dev/null
+++ b/date-fns/src/differenceInHours/index.ts
@@ -0,0 +1,38 @@
+import differenceInMilliseconds from '../differenceInMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+const MILLISECONDS_IN_HOUR = 3600000
+
+/**
+ * @name differenceInHours
+ * @category Hour Helpers
+ * @summary Get the number of hours between the given dates.
+ *
+ * @description
+ * Get the number of hours between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of hours
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?
+ * var result = differenceInHours(
+ * new Date(2014, 6, 2, 19, 0),
+ * new Date(2014, 6, 2, 6, 50)
+ * )
+ * //=> 12
+ */
+export default function differenceInHours(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): number {
+ requiredArgs(2, arguments)
+
+ const diff =
+ differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) /
+ MILLISECONDS_IN_HOUR
+ return diff > 0 ? Math.floor(diff) : Math.ceil(diff)
+}
diff --git a/date-fns/src/differenceInHours/test.ts b/date-fns/src/differenceInHours/test.ts
new file mode 100644
index 0000000..303b7fa
--- /dev/null
+++ b/date-fns/src/differenceInHours/test.ts
@@ -0,0 +1,107 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import differenceInHours from '.'
+
+describe('differenceInHours', function() {
+ it('returns the number of hours between the given dates', function() {
+ const result = differenceInHours(
+ new Date(2014, 6 /* Jul */, 2, 20, 0),
+ new Date(2014, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 14)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function() {
+ const result = differenceInHours(
+ new Date(2014, 6 /* Jul */, 2, 6, 0),
+ new Date(2014, 6 /* Jul */, 2, 20, 0)
+ )
+ assert(result === -14)
+ })
+
+ it('accepts timestamps', function() {
+ const result = differenceInHours(
+ new Date(2014, 8 /* Sep */, 5, 18, 0).getTime(),
+ new Date(2014, 8 /* Sep */, 5, 6, 0).getTime()
+ )
+ assert(result === 12)
+ })
+
+ describe('edge cases', function() {
+ it('the difference is less than an hour, but the given dates are in different calendar hours', function() {
+ const result = differenceInHours(
+ new Date(2014, 8 /* Sep */, 5, 12),
+ new Date(2014, 8 /* Sep */, 5, 11, 59)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function() {
+ const result = differenceInHours(
+ new Date(2014, 8 /* Sep */, 5, 11, 59),
+ new Date(2014, 8 /* Sep */, 5, 12)
+ )
+ assert(result === 0)
+ })
+
+ it('the difference is an integral number of hours', function() {
+ const result = differenceInHours(
+ new Date(2014, 8 /* Sep */, 5, 13, 0),
+ new Date(2014, 8 /* Sep */, 5, 12, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function() {
+ const result = differenceInHours(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInHours(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function() {
+ const result = differenceInHours(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function() {
+ const result = differenceInHours(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function() {
+ const result = differenceInHours(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ //@ts-expect-error
+ assert.throws(differenceInHours.bind(null), TypeError)
+ //@ts-expect-error
+ assert.throws(differenceInHours.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInISOWeekYears/benchmark.js b/date-fns/src/differenceInISOWeekYears/benchmark.js
new file mode 100644
index 0000000..bd3804e
--- /dev/null
+++ b/date-fns/src/differenceInISOWeekYears/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInISOWeekYears from '.'
+
+suite('differenceInISOWeekYears', function () {
+ benchmark('date-fns', function () {
+ return differenceInISOWeekYears(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/differenceInISOWeekYears/index.d.ts b/date-fns/src/differenceInISOWeekYears/index.d.ts
new file mode 100644
index 0000000..ce7cb57
--- /dev/null
+++ b/date-fns/src/differenceInISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInISOWeekYears } from 'date-fns'
+export default differenceInISOWeekYears
diff --git a/date-fns/src/differenceInISOWeekYears/index.js.flow b/date-fns/src/differenceInISOWeekYears/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInISOWeekYears/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInISOWeekYears/index.ts b/date-fns/src/differenceInISOWeekYears/index.ts
new file mode 100644
index 0000000..75f268c
--- /dev/null
+++ b/date-fns/src/differenceInISOWeekYears/index.ts
@@ -0,0 +1,63 @@
+import toDate from '../toDate/index'
+import differenceInCalendarISOWeekYears from '../differenceInCalendarISOWeekYears/index'
+import compareAsc from '../compareAsc/index'
+import subISOWeekYears from '../subISOWeekYears/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Get the number of full ISO week-numbering years between the given dates.
+ *
+ * @description
+ * Get the number of full ISO week-numbering years between the given dates.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `differenceInISOYears` to `differenceInISOWeekYears`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of full ISO week-numbering years
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?
+ * var result = differenceInISOWeekYears(
+ * new Date(2012, 0, 1),
+ * new Date(2010, 0, 1)
+ * )
+ * //=> 1
+ */
+export default function differenceInISOWeekYears(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ let dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const sign = compareAsc(dateLeft, dateRight)
+ const difference = Math.abs(
+ differenceInCalendarISOWeekYears(dateLeft, dateRight)
+ )
+ dateLeft = subISOWeekYears(dateLeft, sign * difference)
+
+ // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1
+ // if last calendar ISO year is not full
+ // If so, result must be decreased by 1 in absolute value
+ const isLastISOWeekYearNotFull = Number(
+ compareAsc(dateLeft, dateRight) === -sign
+ )
+ const result = sign * (difference - isLastISOWeekYearNotFull)
+ // Prevent negative zero
+ return result === 0 ? 0 : result
+}
diff --git a/date-fns/src/differenceInISOWeekYears/test.ts b/date-fns/src/differenceInISOWeekYears/test.ts
new file mode 100644
index 0000000..f4192ee
--- /dev/null
+++ b/date-fns/src/differenceInISOWeekYears/test.ts
@@ -0,0 +1,115 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInISOWeekYears from '.'
+
+describe('differenceInISOWeekYears', function () {
+ it('returns the number of full ISO week-numbering years between the given dates', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2014, 6 /* Jul */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 4)
+ })
+
+ it('handles dates before 100 AD', function () {
+ const firstDate = new Date(0)
+ firstDate.setFullYear(14, 0 /* Jan */, 1)
+ firstDate.setHours(0, 0, 0, 0)
+ const secondDate = new Date(0)
+ secondDate.setFullYear(0, 0 /* Jan */, 1)
+ secondDate.setHours(0, 0, 0, 0)
+ const result = differenceInISOWeekYears(firstDate, secondDate)
+ assert(result === 14)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than an ISO year, but the given dates are in different calendar years', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2012, 0 /* Jan */, 2),
+ new Date(2012, 0 /* Jan */, 1)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2012, 0 /* Jan */, 1),
+ new Date(2012, 0 /* Jan */, 2)
+ )
+ assert(result === 0)
+ })
+
+ it('the ISO weeks and weekdays of the given dates are the same', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2013, 11 /* Dec */, 30),
+ new Date(2012, 0 /* Jan */, 2)
+ )
+ assert(result === 2)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInISOWeekYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInISOWeekYears(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInISOWeekYears(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInISOWeekYears(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInISOWeekYears.bind(null), TypeError)
+ assert.throws(differenceInISOWeekYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInMilliseconds/benchmark.js b/date-fns/src/differenceInMilliseconds/benchmark.js
new file mode 100644
index 0000000..ab4d05a
--- /dev/null
+++ b/date-fns/src/differenceInMilliseconds/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInMilliseconds from '.'
+import moment from 'moment'
+
+suite('differenceInMilliseconds', function () {
+ benchmark('date-fns', function () {
+ return differenceInMilliseconds(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInMilliseconds/index.d.ts b/date-fns/src/differenceInMilliseconds/index.d.ts
new file mode 100644
index 0000000..c72a3ab
--- /dev/null
+++ b/date-fns/src/differenceInMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInMilliseconds } from 'date-fns'
+export default differenceInMilliseconds
diff --git a/date-fns/src/differenceInMilliseconds/index.js.flow b/date-fns/src/differenceInMilliseconds/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInMilliseconds/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInMilliseconds/index.ts b/date-fns/src/differenceInMilliseconds/index.ts
new file mode 100644
index 0000000..a0fc552
--- /dev/null
+++ b/date-fns/src/differenceInMilliseconds/index.ts
@@ -0,0 +1,39 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInMilliseconds
+ * @category Millisecond Helpers
+ * @summary Get the number of milliseconds between the given dates.
+ *
+ * @description
+ * Get the number of milliseconds between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of milliseconds
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many milliseconds are between
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
+ * const result = differenceInMilliseconds(
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
+ * )
+ * //=> 1100
+ */
+export default function differenceInMilliseconds(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+ return dateLeft.getTime() - dateRight.getTime()
+}
diff --git a/date-fns/src/differenceInMilliseconds/test.ts b/date-fns/src/differenceInMilliseconds/test.ts
new file mode 100644
index 0000000..366c03b
--- /dev/null
+++ b/date-fns/src/differenceInMilliseconds/test.ts
@@ -0,0 +1,70 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInMilliseconds from '.'
+
+describe('differenceInMilliseconds', function () {
+ it('returns the number of milliseconds between the given dates', function () {
+ const result = differenceInMilliseconds(
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 700),
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 600)
+ )
+ assert(result === 100)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInMilliseconds(
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 600),
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 20, 700)
+ )
+ assert(result === -100)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInMilliseconds(
+ new Date(2014, 8 /* Sep */, 5, 18, 30, 45, 500).getTime(),
+ new Date(2014, 8 /* Sep */, 5, 18, 30, 45, 500).getTime()
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInMilliseconds(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInMilliseconds(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInMilliseconds(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInMilliseconds(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInMilliseconds.bind(null), TypeError)
+ assert.throws(differenceInMilliseconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInMinutes/benchmark.js b/date-fns/src/differenceInMinutes/benchmark.js
new file mode 100644
index 0000000..8c77a49
--- /dev/null
+++ b/date-fns/src/differenceInMinutes/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInMinutes from '.'
+import moment from 'moment'
+
+suite('differenceInMinutes', function () {
+ benchmark('date-fns', function () {
+ return differenceInMinutes(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'minute')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInMinutes/index.d.ts b/date-fns/src/differenceInMinutes/index.d.ts
new file mode 100644
index 0000000..28348fc
--- /dev/null
+++ b/date-fns/src/differenceInMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInMinutes } from 'date-fns'
+export default differenceInMinutes
diff --git a/date-fns/src/differenceInMinutes/index.js b/date-fns/src/differenceInMinutes/index.js
new file mode 100644
index 0000000..c1b103c
--- /dev/null
+++ b/date-fns/src/differenceInMinutes/index.js
@@ -0,0 +1,46 @@
+import differenceInMilliseconds from '../differenceInMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+var MILLISECONDS_IN_MINUTE = 60000
+
+/**
+ * @name differenceInMinutes
+ * @category Minute Helpers
+ * @summary Get the number of minutes between the given dates.
+ *
+ * @description
+ * Get the signed number of full (rounded towards 0) minutes between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of minutes
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
+ * var result = differenceInMinutes(
+ * new Date(2014, 6, 2, 12, 20, 0),
+ * new Date(2014, 6, 2, 12, 7, 59)
+ * )
+ * //=> 12
+ *
+ * @example
+ * // How many minutes are from 10:01:59 to 10:00:00
+ * var result = differenceInMinutes(
+ * new Date(2000, 0, 1, 10, 0, 0),
+ * new Date(2000, 0, 1, 10, 1, 59)
+ * )
+ * //=> -1
+ */
+export default function differenceInMinutes(dirtyDateLeft, dirtyDateRight) {
+ requiredArgs(2, arguments)
+
+ var diff =
+ differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) /
+ MILLISECONDS_IN_MINUTE
+ return diff > 0 ? Math.floor(diff) : Math.ceil(diff)
+}
diff --git a/date-fns/src/differenceInMinutes/index.js.flow b/date-fns/src/differenceInMinutes/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInMinutes/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInMinutes/test.js b/date-fns/src/differenceInMinutes/test.js
new file mode 100644
index 0000000..ff6a6c3
--- /dev/null
+++ b/date-fns/src/differenceInMinutes/test.js
@@ -0,0 +1,105 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInMinutes from '.'
+
+describe('differenceInMinutes', function() {
+ it('returns the number of minutes between the given dates', function() {
+ var result = differenceInMinutes(
+ new Date(2014, 6 /* Jul */, 2, 12, 20),
+ new Date(2014, 6 /* Jul */, 2, 12, 6)
+ )
+ assert(result === 14)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function() {
+ var result = differenceInMinutes(
+ new Date(2014, 6 /* Jul */, 2, 12, 6),
+ new Date(2014, 6 /* Jul */, 2, 12, 20)
+ )
+ assert(result === -14)
+ })
+
+ it('accepts timestamps', function() {
+ var result = differenceInMinutes(
+ new Date(2014, 8 /* Sep */, 5, 18, 45).getTime(),
+ new Date(2014, 8 /* Sep */, 5, 18, 15).getTime()
+ )
+ assert(result === 30)
+ })
+
+ describe('edge cases', function() {
+ it('the difference is less than a minute, but the given dates are in different calendar minutes', function() {
+ var result = differenceInMinutes(
+ new Date(2014, 8 /* Sep */, 5, 12, 12),
+ new Date(2014, 8 /* Sep */, 5, 12, 11, 59)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function() {
+ var result = differenceInMinutes(
+ new Date(2014, 8 /* Sep */, 5, 12, 11, 59),
+ new Date(2014, 8 /* Sep */, 5, 12, 12)
+ )
+ assert(result === 0)
+ })
+
+ it('the difference is an integral number of minutes', function() {
+ var result = differenceInMinutes(
+ new Date(2014, 8 /* Sep */, 5, 12, 25),
+ new Date(2014, 8 /* Sep */, 5, 12, 15)
+ )
+ assert(result === 10)
+ })
+
+ it('the given dates are the same', function() {
+ var result = differenceInMinutes(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x) {
+ return x === 0 && 1 / x < 0
+ }
+
+ var result = differenceInMinutes(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ var resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function() {
+ var result = differenceInMinutes(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function() {
+ var result = differenceInMinutes(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function() {
+ var result = differenceInMinutes(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(differenceInMinutes.bind(null), TypeError)
+ assert.throws(differenceInMinutes.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInMonths/benchmark.js b/date-fns/src/differenceInMonths/benchmark.js
new file mode 100644
index 0000000..4c2f1c7
--- /dev/null
+++ b/date-fns/src/differenceInMonths/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInMonths from '.'
+import moment from 'moment'
+
+suite('differenceInMonths', function () {
+ benchmark('date-fns', function () {
+ return differenceInMonths(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'month')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInMonths/index.d.ts b/date-fns/src/differenceInMonths/index.d.ts
new file mode 100644
index 0000000..8fbe977
--- /dev/null
+++ b/date-fns/src/differenceInMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInMonths } from 'date-fns'
+export default differenceInMonths
diff --git a/date-fns/src/differenceInMonths/index.js.flow b/date-fns/src/differenceInMonths/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInMonths/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInMonths/index.ts b/date-fns/src/differenceInMonths/index.ts
new file mode 100644
index 0000000..c8a5c14
--- /dev/null
+++ b/date-fns/src/differenceInMonths/index.ts
@@ -0,0 +1,72 @@
+import toDate from '../toDate/index'
+import differenceInCalendarMonths from '../differenceInCalendarMonths/index'
+import compareAsc from '../compareAsc/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import isLastDayOfMonth from '../isLastDayOfMonth/index'
+
+/**
+ * @name differenceInMonths
+ * @category Month Helpers
+ * @summary Get the number of full months between the given dates.
+ *
+ * @description
+ * Get the number of full months between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of full months
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many full months are between 31 January 2014 and 1 September 2014?
+ * var result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))
+ * //=> 7
+ */
+export default function differenceInMonths(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const sign = compareAsc(dateLeft, dateRight)
+ const difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight))
+ let result
+
+ // Check for the difference of less than month
+ if (difference < 1) {
+ result = 0
+ } else {
+ if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
+ // This will check if the date is end of Feb and assign a higher end of month date
+ // to compare it with Jan
+ dateLeft.setDate(30)
+ }
+
+ dateLeft.setMonth(dateLeft.getMonth() - sign * difference)
+
+ // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full
+ // If so, result must be decreased by 1 in absolute value
+ let isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign
+
+ // Check for cases of one full calendar month
+ if (
+ isLastDayOfMonth(toDate(dirtyDateLeft)) &&
+ difference === 1 &&
+ compareAsc(dirtyDateLeft, dateRight) === 1
+ ) {
+ isLastMonthNotFull = false
+ }
+
+ result = sign * (difference - Number(isLastMonthNotFull))
+ }
+
+ // Prevent negative zero
+ return result === 0 ? 0 : result
+}
diff --git a/date-fns/src/differenceInMonths/test.ts b/date-fns/src/differenceInMonths/test.ts
new file mode 100644
index 0000000..edebb59
--- /dev/null
+++ b/date-fns/src/differenceInMonths/test.ts
@@ -0,0 +1,188 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInMonths from '.'
+
+describe('differenceInMonths', function () {
+ it('returns the number of full months between the given dates', function () {
+ const result = differenceInMonths(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 12)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInMonths(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -12)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInMonths(
+ new Date(2014, 7 /* Aug */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 49)
+ })
+
+ describe('edge cases', function () {
+ it('it returns diff of 1 month between Feb 28 2021 and Jan 30 2021', function () {
+ const result = differenceInMonths(
+ new Date(2021, 1 /* Feb */, 28),
+ new Date(2021, 0 /* Jan */, 30)
+ )
+ assert(result === 1)
+ })
+
+ it('it returns diff of 1 month between Feb 28 2021 and Jan 31 2021', function () {
+ const result = differenceInMonths(
+ new Date(2021, 1 /* Feb */, 28),
+ new Date(2021, 0 /* Jan */, 31)
+ )
+ assert(result === 1)
+ })
+
+ it('it returns diff of 1 month between Nov, 30 2021 and Oct, 31 2021', function () {
+ const result = differenceInMonths(
+ new Date(2021, 10 /* Nov */, 30),
+ new Date(2021, 9 /* Oct */, 31)
+ )
+ assert(result === 1)
+ })
+
+ it('it returns diff of 1 month between Oct, 31 2021 and Sep, 30 2021', function () {
+ const result = differenceInMonths(
+ new Date(2021, 9 /* Oct */, 31),
+ new Date(2021, 8 /* Sep */, 30)
+ )
+ assert(result === 1)
+ })
+
+ it('it returns diff of 6 month between Oct, 31 2021 and Apr, 30 2021', function () {
+ const result = differenceInMonths(
+ new Date(2021, 9 /* Oct */, 31),
+ new Date(2021, 3 /* Apr */, 30)
+ )
+ assert(result === 6)
+ })
+
+ it('it returns diff of -1 month between Sep, 30 2021 and Oct, 31 2021', function () {
+ const result = differenceInMonths(
+ new Date(2021, 8 /* Sep */, 30),
+ new Date(2021, 9 /* Oct */, 31)
+ )
+ assert(result === -1)
+ })
+
+ it('the difference is less than a month, but the given dates are in different calendar months', function () {
+ const result = differenceInMonths(
+ new Date(2014, 7 /* Aug */, 1),
+ new Date(2014, 6 /* Jul */, 31)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInMonths(
+ new Date(2014, 6 /* Jul */, 31),
+ new Date(2014, 7 /* Aug */, 1)
+ )
+ assert(result === 0)
+ })
+
+ it('the days of months of the given dates are the same', function () {
+ const result = differenceInMonths(
+ new Date(2014, 8 /* Sep */, 6),
+ new Date(2014, 7 /* Aug */, 6)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInMonths(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInMonths(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInMonths(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInMonths(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInMonths(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInMonths.bind(null), TypeError)
+ assert.throws(differenceInMonths.bind(null, 1), TypeError)
+ })
+
+ describe('edge cases', function () {
+ it('returns the number of full months between the given dates - end of Feb', function () {
+ assert(
+ differenceInMonths(
+ new Date(2012, 1 /* Feb */, 29, 9, 0, 0),
+ new Date(2012, 1 /* Feb */, 29, 10, 0, 0)
+ ) === 0
+ )
+ assert(
+ differenceInMonths(
+ new Date(2012, 1 /* Feb */, 28, 9, 0, 0),
+ new Date(2012, 1 /* Feb */, 29, 10, 0, 0)
+ ) === 0
+ )
+ assert(
+ differenceInMonths(
+ new Date(2012, 1 /* Feb */, 27, 9, 0, 0),
+ new Date(2012, 1 /* Feb */, 27, 10, 0, 0)
+ ) === 0
+ )
+ assert(
+ differenceInMonths(
+ new Date(2012, 1 /* Feb */, 28, 9, 0, 0),
+ new Date(2012, 1 /* Feb */, 28, 10, 0, 0)
+ ) === 0
+ )
+ })
+
+ assert(
+ differenceInMonths(
+ new Date(2021, 1 /* Feb */, 28, 7, 23, 7),
+ new Date(2021, 1 /* Feb */, 28, 7, 38, 18)
+ ) === 0
+ )
+ })
+})
diff --git a/date-fns/src/differenceInQuarters/benchmark.js b/date-fns/src/differenceInQuarters/benchmark.js
new file mode 100644
index 0000000..5210147
--- /dev/null
+++ b/date-fns/src/differenceInQuarters/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInQuarters from '.'
+import moment from 'moment'
+
+suite('differenceInQuarters', function () {
+ benchmark('date-fns', function () {
+ return differenceInQuarters(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'quarter')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInQuarters/index.d.ts b/date-fns/src/differenceInQuarters/index.d.ts
new file mode 100644
index 0000000..9cc693b
--- /dev/null
+++ b/date-fns/src/differenceInQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInQuarters } from 'date-fns'
+export default differenceInQuarters
diff --git a/date-fns/src/differenceInQuarters/index.js.flow b/date-fns/src/differenceInQuarters/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInQuarters/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInQuarters/index.ts b/date-fns/src/differenceInQuarters/index.ts
new file mode 100644
index 0000000..b53a934
--- /dev/null
+++ b/date-fns/src/differenceInQuarters/index.ts
@@ -0,0 +1,34 @@
+import differenceInMonths from '../differenceInMonths/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInQuarters
+ * @category Quarter Helpers
+ * @summary Get the number of full quarters between the given dates.
+ *
+ * @description
+ * Get the number of full quarters between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of full quarters
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many full quarters are between 31 December 2013 and 2 July 2014?
+ * var result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))
+ * //=> 2
+ */
+export default function differenceInQuarters(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const diff = differenceInMonths(dirtyDateLeft, dirtyDateRight) / 3
+ return diff > 0 ? Math.floor(diff) : Math.ceil(diff)
+}
diff --git a/date-fns/src/differenceInQuarters/test.ts b/date-fns/src/differenceInQuarters/test.ts
new file mode 100644
index 0000000..2cdb8d0
--- /dev/null
+++ b/date-fns/src/differenceInQuarters/test.ts
@@ -0,0 +1,104 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInQuarters from '.'
+
+describe('differenceInQuarters', function () {
+ it('returns the number of full quarters between the given dates', function () {
+ const result = differenceInQuarters(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 4)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInQuarters(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -4)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInQuarters(
+ new Date(2014, 9 /* Oct */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 17)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a quarter, but the given dates are in different calendar quarters', function () {
+ const result = differenceInQuarters(
+ new Date(2014, 6 /* Jul */, 1),
+ new Date(2014, 5 /* Jun */, 30)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInQuarters(
+ new Date(2014, 5 /* Jun */, 30),
+ new Date(2014, 6 /* Jul */, 1)
+ )
+ assert(result === 0)
+ })
+
+ it('the days of months of the given dates are the same', function () {
+ const result = differenceInQuarters(
+ new Date(2014, 3 /* Apr */, 6),
+ new Date(2014, 0 /* Jan */, 6)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInQuarters(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInQuarters(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInQuarters(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInQuarters(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInQuarters(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInQuarters.bind(null), TypeError)
+ assert.throws(differenceInQuarters.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInSeconds/benchmark.js b/date-fns/src/differenceInSeconds/benchmark.js
new file mode 100644
index 0000000..ff52acf
--- /dev/null
+++ b/date-fns/src/differenceInSeconds/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInSeconds from '.'
+import moment from 'moment'
+
+suite('differenceInSeconds', function () {
+ benchmark('date-fns', function () {
+ return differenceInSeconds(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'second')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInSeconds/index.d.ts b/date-fns/src/differenceInSeconds/index.d.ts
new file mode 100644
index 0000000..e317fe2
--- /dev/null
+++ b/date-fns/src/differenceInSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInSeconds } from 'date-fns'
+export default differenceInSeconds
diff --git a/date-fns/src/differenceInSeconds/index.js.flow b/date-fns/src/differenceInSeconds/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInSeconds/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInSeconds/index.ts b/date-fns/src/differenceInSeconds/index.ts
new file mode 100644
index 0000000..d76b0e3
--- /dev/null
+++ b/date-fns/src/differenceInSeconds/index.ts
@@ -0,0 +1,38 @@
+import differenceInMilliseconds from '../differenceInMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInSeconds
+ * @category Second Helpers
+ * @summary Get the number of seconds between the given dates.
+ *
+ * @description
+ * Get the number of seconds between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of seconds
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many seconds are between
+ * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?
+ * const result = differenceInSeconds(
+ * new Date(2014, 6, 2, 12, 30, 20, 0),
+ * new Date(2014, 6, 2, 12, 30, 7, 999)
+ * )
+ * //=> 12
+ */
+export default function differenceInSeconds(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000
+ return diff > 0 ? Math.floor(diff) : Math.ceil(diff)
+}
diff --git a/date-fns/src/differenceInSeconds/test.ts b/date-fns/src/differenceInSeconds/test.ts
new file mode 100644
index 0000000..8e40a32
--- /dev/null
+++ b/date-fns/src/differenceInSeconds/test.ts
@@ -0,0 +1,104 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInSeconds from '.'
+
+describe('differenceInSeconds', function () {
+ it('returns the number of seconds between the given dates', function () {
+ const result = differenceInSeconds(
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 20),
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 6)
+ )
+ assert(result === 14)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInSeconds(
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 6),
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 20)
+ )
+ assert(result === -14)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInSeconds(
+ new Date(2014, 8 /* Sep */, 5, 18, 30, 45).getTime(),
+ new Date(2014, 8 /* Sep */, 5, 18, 30, 15).getTime()
+ )
+ assert(result === 30)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a second, but the given dates are in different calendar seconds', function () {
+ const result = differenceInSeconds(
+ new Date(2014, 8 /* Sep */, 5, 12, 30, 12),
+ new Date(2014, 8 /* Sep */, 5, 12, 30, 11, 999)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInSeconds(
+ new Date(2014, 8 /* Sep */, 5, 12, 30, 11, 999),
+ new Date(2014, 8 /* Sep */, 5, 12, 30, 12)
+ )
+ assert(result === 0)
+ })
+
+ it('the difference is an integral number of seconds', function () {
+ const result = differenceInSeconds(
+ new Date(2014, 8 /* Sep */, 5, 12, 30, 25),
+ new Date(2014, 8 /* Sep */, 5, 12, 30, 15)
+ )
+ assert(result === 10)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInSeconds(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInSeconds(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInSeconds(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInSeconds(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInSeconds(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInSeconds.bind(null), TypeError)
+ assert.throws(differenceInSeconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInWeeks/benchmark.js b/date-fns/src/differenceInWeeks/benchmark.js
new file mode 100644
index 0000000..c29909c
--- /dev/null
+++ b/date-fns/src/differenceInWeeks/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInWeeks from '.'
+import moment from 'moment'
+
+suite('differenceInWeeks', function () {
+ benchmark('date-fns', function () {
+ return differenceInWeeks(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'week')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInWeeks/index.d.ts b/date-fns/src/differenceInWeeks/index.d.ts
new file mode 100644
index 0000000..a42614c
--- /dev/null
+++ b/date-fns/src/differenceInWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInWeeks } from 'date-fns'
+export default differenceInWeeks
diff --git a/date-fns/src/differenceInWeeks/index.js.flow b/date-fns/src/differenceInWeeks/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInWeeks/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInWeeks/index.ts b/date-fns/src/differenceInWeeks/index.ts
new file mode 100644
index 0000000..350da2f
--- /dev/null
+++ b/date-fns/src/differenceInWeeks/index.ts
@@ -0,0 +1,55 @@
+import differenceInDays from '../differenceInDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInWeeks
+ * @category Week Helpers
+ * @summary Get the number of full weeks between the given dates.
+ *
+ * @description
+ * Get the number of full weeks between two dates. Fractional weeks are
+ * truncated towards zero.
+ *
+ * One "full week" is the distance between a local time in one day to the same
+ * local time 7 days earlier or later. A full week can sometimes be less than
+ * or more than 7*24 hours if a daylight savings change happens between two dates.
+ *
+ * To ignore DST and only measure exact 7*24-hour periods, use this instead:
+ * `Math.floor(differenceInHours(dateLeft, dateRight)/(7*24))|0`.
+ *
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of full weeks
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many full weeks are between 5 July 2014 and 20 July 2014?
+ * const result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5))
+ * //=> 2
+ *
+ * // How many full weeks are between
+ * // 1 March 2020 0:00 and 6 June 2020 0:00 ?
+ * // Note: because local time is used, the
+ * // result will always be 8 weeks (54 days),
+ * // even if DST starts and the period has
+ * // only 54*24-1 hours.
+ * const result = differenceInWeeks(
+ * new Date(2020, 5, 1),
+ * new Date(2020, 2, 6)
+ * )
+ * //=> 8
+ */
+export default function differenceInWeeks(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const diff = differenceInDays(dirtyDateLeft, dirtyDateRight) / 7
+ return diff > 0 ? Math.floor(diff) : Math.ceil(diff)
+}
diff --git a/date-fns/src/differenceInWeeks/test.ts b/date-fns/src/differenceInWeeks/test.ts
new file mode 100644
index 0000000..6e8e05e
--- /dev/null
+++ b/date-fns/src/differenceInWeeks/test.ts
@@ -0,0 +1,104 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInWeeks from '.'
+
+describe('differenceInWeeks', function () {
+ it('returns the number of full weeks between the given dates', function () {
+ const result = differenceInWeeks(
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ new Date(2014, 5 /* Jun */, 29, 6, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInWeeks(
+ new Date(2014, 5 /* Jun */, 29, 6, 0),
+ new Date(2014, 6 /* Jul */, 8, 18, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInWeeks(
+ new Date(2014, 6 /* Jul */, 12).getTime(),
+ new Date(2014, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 1)
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a week, but the given dates are in different calendar weeks', function () {
+ const result = differenceInWeeks(
+ new Date(2014, 6 /* Jul */, 6),
+ new Date(2014, 6 /* Jul */, 5)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInWeeks(
+ new Date(2014, 6 /* Jul */, 5),
+ new Date(2014, 6 /* Jul */, 6)
+ )
+ assert(result === 0)
+ })
+
+ it('days of weeks of the given dates are the same', function () {
+ const result = differenceInWeeks(
+ new Date(2014, 6 /* Jul */, 9),
+ new Date(2014, 6 /* Jul */, 2)
+ )
+ assert(result === 1)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInWeeks(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInWeeks(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInWeeks(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInWeeks(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInWeeks(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInWeeks.bind(null), TypeError)
+ assert.throws(differenceInWeeks.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/differenceInYears/benchmark.js b/date-fns/src/differenceInYears/benchmark.js
new file mode 100644
index 0000000..32e905c
--- /dev/null
+++ b/date-fns/src/differenceInYears/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import differenceInYears from '.'
+import moment from 'moment'
+
+suite('differenceInYears', function () {
+ benchmark('date-fns', function () {
+ return differenceInYears(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.diff(this.momentB, 'year')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/differenceInYears/index.d.ts b/date-fns/src/differenceInYears/index.d.ts
new file mode 100644
index 0000000..df839f6
--- /dev/null
+++ b/date-fns/src/differenceInYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInYears } from 'date-fns'
+export default differenceInYears
diff --git a/date-fns/src/differenceInYears/index.js.flow b/date-fns/src/differenceInYears/index.js.flow
new file mode 100644
index 0000000..c799819
--- /dev/null
+++ b/date-fns/src/differenceInYears/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => number
diff --git a/date-fns/src/differenceInYears/index.ts b/date-fns/src/differenceInYears/index.ts
new file mode 100644
index 0000000..111df3d
--- /dev/null
+++ b/date-fns/src/differenceInYears/index.ts
@@ -0,0 +1,51 @@
+import toDate from '../toDate/index'
+import differenceInCalendarYears from '../differenceInCalendarYears/index'
+import compareAsc from '../compareAsc/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name differenceInYears
+ * @category Year Helpers
+ * @summary Get the number of full years between the given dates.
+ *
+ * @description
+ * Get the number of full years between the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the later date
+ * @param {Date|Number} dateRight - the earlier date
+ * @returns {Number} the number of full years
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // How many full years are between 31 December 2013 and 11 February 2015?
+ * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))
+ * //=> 1
+ */
+export default function differenceInYears(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): number {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+
+ const sign = compareAsc(dateLeft, dateRight)
+ const difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight))
+
+ // Set both dates to a valid leap year for accurate comparison when dealing
+ // with leap days
+ dateLeft.setFullYear(1584)
+ dateRight.setFullYear(1584)
+
+ // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full
+ // If so, result must be decreased by 1 in absolute value
+ const isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign
+ const result = sign * (difference - Number(isLastYearNotFull))
+ // Prevent negative zero
+ return result === 0 ? 0 : result
+}
diff --git a/date-fns/src/differenceInYears/test.ts b/date-fns/src/differenceInYears/test.ts
new file mode 100644
index 0000000..60a3866
--- /dev/null
+++ b/date-fns/src/differenceInYears/test.ts
@@ -0,0 +1,146 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import differenceInYears from '.'
+
+describe('differenceInYears', function () {
+ it('returns the number of full years between the given dates', function () {
+ const result = differenceInYears(
+ new Date(2012, 6 /* Jul */, 2, 18, 0),
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('returns a negative number if the time value of the first date is smaller', function () {
+ const result = differenceInYears(
+ new Date(2011, 6 /* Jul */, 2, 6, 0),
+ new Date(2012, 6 /* Jul */, 2, 18, 0)
+ )
+ assert(result === -1)
+ })
+
+ it('accepts timestamps', function () {
+ const result = differenceInYears(
+ new Date(2014, 6 /* Jul */, 2).getTime(),
+ new Date(2010, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === 4)
+ })
+
+ describe('leap days', function () {
+ it('supports past dates with right side after leap day', () => {
+ const result = differenceInYears(
+ new Date(2004, 1 /* Feb */, 29, 0, 0),
+ new Date(2002, 2 /* Mar */, 1, 0, 0)
+ )
+ assert(result === 1)
+ })
+
+ it('supports past dates with right side before leap day', () => {
+ const result = differenceInYears(
+ new Date(2004, 1 /* Feb */, 29, 0, 0),
+ new Date(2002, 1 /* Feb */, 28, 0, 0)
+ )
+ assert(result === 2)
+ })
+
+ it('supports future dates', () => {
+ const result = differenceInYears(
+ new Date(2004, 1 /* Feb */, 29, 0, 0),
+ new Date(2006, 2 /* Mar */, 1, 0, 0)
+ )
+ assert(result === -2)
+ })
+
+ it('supports equal dates of same year', () => {
+ const result = differenceInYears(
+ new Date(2004, 1 /* Feb */, 29, 0, 0),
+ new Date(2004, 1 /* Feb */, 29, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('supports equal dates of different years', () => {
+ const result = differenceInYears(
+ new Date(2008, 1 /* Feb */, 29, 0, 0),
+ new Date(2004, 1 /* Feb */, 29, 0, 0)
+ )
+ assert(result === 4)
+ })
+ })
+
+ describe('edge cases', function () {
+ it('the difference is less than a year, but the given dates are in different calendar years', function () {
+ const result = differenceInYears(
+ new Date(2015, 0 /* Jan */, 1),
+ new Date(2014, 11 /* Dec */, 31)
+ )
+ assert(result === 0)
+ })
+
+ it('the same for the swapped dates', function () {
+ const result = differenceInYears(
+ new Date(2014, 11 /* Dec */, 31),
+ new Date(2015, 0 /* Jan */, 1)
+ )
+ assert(result === 0)
+ })
+
+ it('the days and months of the given dates are the same', function () {
+ const result = differenceInYears(
+ new Date(2014, 8 /* Sep */, 5),
+ new Date(2012, 8 /* Sep */, 5)
+ )
+ assert(result === 2)
+ })
+
+ it('the given dates are the same', function () {
+ const result = differenceInYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === 0)
+ })
+
+ it('does not return -0 when the given dates are the same', () => {
+ function isNegativeZero(x: number): boolean {
+ return x === 0 && 1 / x < 0
+ }
+
+ const result = differenceInYears(
+ new Date(2014, 8 /* Sep */, 5, 0, 0),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+
+ const resultIsNegative = isNegativeZero(result)
+ assert(resultIsNegative === false)
+ })
+ })
+
+ it('returns NaN if the first date is `Invalid Date`', function () {
+ const result = differenceInYears(
+ new Date(NaN),
+ new Date(2017, 0 /* Jan */, 1)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the second date is `Invalid Date`', function () {
+ const result = differenceInYears(
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ )
+ assert(isNaN(result))
+ })
+
+ it('returns NaN if the both dates are `Invalid Date`', function () {
+ const result = differenceInYears(new Date(NaN), new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(differenceInYears.bind(null), TypeError)
+ assert.throws(differenceInYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/eachDayOfInterval/benchmark.js b/date-fns/src/eachDayOfInterval/benchmark.js
new file mode 100644
index 0000000..45d8e44
--- /dev/null
+++ b/date-fns/src/eachDayOfInterval/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachDayOfInterval from '.'
+
+suite('eachDayOfInterval', function () {
+ benchmark('date-fns', function () {
+ return eachDayOfInterval({start: this.dateA, end: this.dateB})
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/eachDayOfInterval/index.d.ts b/date-fns/src/eachDayOfInterval/index.d.ts
new file mode 100644
index 0000000..80fc0dc
--- /dev/null
+++ b/date-fns/src/eachDayOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachDayOfInterval } from 'date-fns'
+export default eachDayOfInterval
diff --git a/date-fns/src/eachDayOfInterval/index.js.flow b/date-fns/src/eachDayOfInterval/index.js.flow
new file mode 100644
index 0000000..5a9b8e4
--- /dev/null
+++ b/date-fns/src/eachDayOfInterval/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ interval: Interval,
+ options?: {
+ step?: number,
+ }
+) => Date[]
diff --git a/date-fns/src/eachDayOfInterval/index.ts b/date-fns/src/eachDayOfInterval/index.ts
new file mode 100644
index 0000000..fded968
--- /dev/null
+++ b/date-fns/src/eachDayOfInterval/index.ts
@@ -0,0 +1,98 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachDayOfInterval
+ * @category Interval Helpers
+ * @summary Return the array of dates within the specified time interval.
+ *
+ * @description
+ * Return the array of dates within the specified time interval.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `eachDay` to `eachDayOfInterval`.
+ * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology:
+ *
+ * ```
+ * 2.1.3
+ * time interval
+ * part of the time axis limited by two instants
+ * ```
+ *
+ * Also, this function now accepts an object with `start` and `end` properties
+ * instead of two arguments as an interval.
+ * This function now throws `RangeError` if the start of the interval is after its end
+ * or if any date in the interval is `Invalid Date`.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20))
+ *
+ * // v2.0.0 onward
+ *
+ * eachDayOfInterval(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }
+ * )
+ * ```
+ *
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @param {Object} [options] - an object with options.
+ * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.
+ * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.step` must be a number greater than 1
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Each day between 6 October 2014 and 10 October 2014:
+ * const result = eachDayOfInterval({
+ * start: new Date(2014, 9, 6),
+ * end: new Date(2014, 9, 10)
+ * })
+ * //=> [
+ * // Mon Oct 06 2014 00:00:00,
+ * // Tue Oct 07 2014 00:00:00,
+ * // Wed Oct 08 2014 00:00:00,
+ * // Thu Oct 09 2014 00:00:00,
+ * // Fri Oct 10 2014 00:00:00
+ * // ]
+ */
+export default function eachDayOfInterval(
+ dirtyInterval: Interval,
+ options?: { step?: number }
+): Date[] {
+ requiredArgs(1, arguments)
+
+ const interval = dirtyInterval || {}
+ const startDate = toDate(interval.start)
+ const endDate = toDate(interval.end)
+
+ const endTime = endDate.getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(startDate.getTime() <= endTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ const dates = []
+
+ const currentDate = startDate
+ currentDate.setHours(0, 0, 0, 0)
+
+ const step = options && 'step' in options ? Number(options.step) : 1
+ if (step < 1 || isNaN(step))
+ throw new RangeError('`options.step` must be a number greater than 1')
+
+ while (currentDate.getTime() <= endTime) {
+ dates.push(toDate(currentDate))
+ currentDate.setDate(currentDate.getDate() + step)
+ currentDate.setHours(0, 0, 0, 0)
+ }
+
+ return dates
+}
diff --git a/date-fns/src/eachDayOfInterval/test.ts b/date-fns/src/eachDayOfInterval/test.ts
new file mode 100644
index 0000000..2ace8e1
--- /dev/null
+++ b/date-fns/src/eachDayOfInterval/test.ts
@@ -0,0 +1,137 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import eachDayOfInterval from '.'
+
+describe('eachDayOfInterval', () => {
+ it('returns an array with starts of days from the day of the start date to the day of the end date', () => {
+ const result = eachDayOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6),
+ end: new Date(2014, 9 /* Oct */, 12)
+ })
+ assert.deepStrictEqual(result, [
+ new Date(2014, 9 /* Oct */, 6),
+ new Date(2014, 9 /* Oct */, 7),
+ new Date(2014, 9 /* Oct */, 8),
+ new Date(2014, 9 /* Oct */, 9),
+ new Date(2014, 9 /* Oct */, 10),
+ new Date(2014, 9 /* Oct */, 11),
+ new Date(2014, 9 /* Oct */, 12)
+ ])
+ })
+
+ it('accepts timestamps', () => {
+ const result = eachDayOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6).getTime(),
+ end: new Date(2014, 9 /* Oct */, 12).getTime()
+ })
+ assert.deepStrictEqual(result, [
+ new Date(2014, 9 /* Oct */, 6),
+ new Date(2014, 9 /* Oct */, 7),
+ new Date(2014, 9 /* Oct */, 8),
+ new Date(2014, 9 /* Oct */, 9),
+ new Date(2014, 9 /* Oct */, 10),
+ new Date(2014, 9 /* Oct */, 11),
+ new Date(2014, 9 /* Oct */, 12)
+ ])
+ })
+
+ it('handles the dates that are not starts of days', () => {
+ const result = eachDayOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 6, 35),
+ end: new Date(2014, 9 /* Oct */, 12, 22, 15)
+ })
+ assert.deepStrictEqual(result, [
+ new Date(2014, 9 /* Oct */, 6),
+ new Date(2014, 9 /* Oct */, 7),
+ new Date(2014, 9 /* Oct */, 8),
+ new Date(2014, 9 /* Oct */, 9),
+ new Date(2014, 9 /* Oct */, 10),
+ new Date(2014, 9 /* Oct */, 11),
+ new Date(2014, 9 /* Oct */, 12)
+ ])
+ })
+
+ it('returns one day if the both arguments are on the same day', () => {
+ const result = eachDayOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 6, 15)
+ })
+ assert.deepStrictEqual(result, [new Date(2014, 9 /* Oct */, 6)])
+ })
+
+ it('returns one day if the both arguments are the same', () => {
+ const result = eachDayOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 6, 14)
+ })
+ assert.deepStrictEqual(result, [new Date(2014, 9 /* Oct */, 6)])
+ })
+
+ it('throws an exception if the start date is after the end date', () => {
+ const block = eachDayOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date is `Invalid Date`', () => {
+ var block = eachDayOfInterval.bind(null, {
+ start: new Date(NaN),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date is `Invalid Date`', () => {
+ var block = eachDayOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the interval is undefined', () => {
+ var block = eachDayOfInterval.bind(
+ null,
+ //@ts-expect-error
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ assert.throws(eachDayOfInterval.bind(null), TypeError)
+ })
+
+ describe('options.step', () => {
+ const interval = {
+ start: new Date(2014, 9 /* Oct */, 6),
+ end: new Date(2014, 9 /* Oct */, 13)
+ }
+
+ const stepError = /^RangeError: `options.step` must be a number greater than 1$/
+
+ it('returns an array with starts of days from the day of the start date to the day of the end date with the given step', () => {
+ const result = eachDayOfInterval(interval, { step: 3 })
+ assert.deepStrictEqual(result, [
+ new Date(2014, 9 /* Oct */, 6),
+ new Date(2014, 9 /* Oct */, 9),
+ new Date(2014, 9 /* Oct */, 12)
+ ])
+ })
+
+ it('throws TypeError error if `options.step` is less than 1', () => {
+ assert.throws(() => eachDayOfInterval(interval, { step: 0 }), stepError)
+ assert.throws(() => eachDayOfInterval(interval, { step: -3 }), stepError)
+ })
+
+ it('throws TypeError error if `options.step` is NaN', () => {
+ //@ts-expect-error
+ assert.throws(() => eachDayOfInterval(interval, { step: 'w' }), stepError)
+ assert.throws(() => eachDayOfInterval(interval, { step: NaN }), stepError)
+ })
+ })
+})
diff --git a/date-fns/src/eachHourOfInterval/benchmark.js b/date-fns/src/eachHourOfInterval/benchmark.js
new file mode 100644
index 0000000..c96c557
--- /dev/null
+++ b/date-fns/src/eachHourOfInterval/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachHourOfInterval from '.'
+
+suite(
+ 'eachHourOfInterval',
+ function() {
+ benchmark('date-fns', function() {
+ return eachHourOfInterval({ start: this.dateA, end: this.dateB })
+ })
+ },
+ {
+ setup: function() {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+ }
+)
diff --git a/date-fns/src/eachHourOfInterval/index.d.ts b/date-fns/src/eachHourOfInterval/index.d.ts
new file mode 100644
index 0000000..4c3addd
--- /dev/null
+++ b/date-fns/src/eachHourOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachHourOfInterval } from 'date-fns'
+export default eachHourOfInterval
diff --git a/date-fns/src/eachHourOfInterval/index.js.flow b/date-fns/src/eachHourOfInterval/index.js.flow
new file mode 100644
index 0000000..5a9b8e4
--- /dev/null
+++ b/date-fns/src/eachHourOfInterval/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ interval: Interval,
+ options?: {
+ step?: number,
+ }
+) => Date[]
diff --git a/date-fns/src/eachHourOfInterval/index.ts b/date-fns/src/eachHourOfInterval/index.ts
new file mode 100644
index 0000000..27ad6dc
--- /dev/null
+++ b/date-fns/src/eachHourOfInterval/index.ts
@@ -0,0 +1,69 @@
+import addHours from '../addHours/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { Interval, StepOptions } from '../types'
+
+/**
+ * @name eachHourOfInterval
+ * @category Interval Helpers
+ * @summary Return the array of hours within the specified time interval.
+ *
+ * @description
+ * Return the array of hours within the specified time interval.
+ *
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @param {Object} [options] - an object with options.
+ * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.
+ * @returns {Date[]} the array with starts of hours from the hour of the interval start to the hour of the interval end
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.step` must be a number greater than 1
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Each hour between 6 October 2014, 12:00 and 6 October 2014, 15:00
+ * var result = eachHourOfInterval({
+ * start: new Date(2014, 9, 6, 12),
+ * end: new Date(2014, 9, 6, 15)
+ * })
+ * //=> [
+ * // Mon Oct 06 2014 12:00:00,
+ * // Mon Oct 06 2014 13:00:00,
+ * // Mon Oct 06 2014 14:00:00,
+ * // Mon Oct 06 2014 15:00:00
+ * // ]
+ */
+export default function eachHourOfInterval(
+ dirtyInterval: Interval,
+ options?: StepOptions
+): Date[] {
+ requiredArgs(1, arguments)
+
+ const interval = dirtyInterval || {}
+ const startDate = toDate(interval.start)
+ const endDate = toDate(interval.end)
+
+ const startTime = startDate.getTime()
+ const endTime = endDate.getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(startTime <= endTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ const dates = []
+
+ let currentDate = startDate
+ currentDate.setMinutes(0, 0, 0)
+
+ const step = options && 'step' in options ? Number(options.step) : 1
+ if (step < 1 || isNaN(step))
+ throw new RangeError('`options.step` must be a number greater than 1')
+
+ while (currentDate.getTime() <= endTime) {
+ dates.push(toDate(currentDate))
+ currentDate = addHours(currentDate, step)
+ }
+
+ return dates
+}
diff --git a/date-fns/src/eachHourOfInterval/test.ts b/date-fns/src/eachHourOfInterval/test.ts
new file mode 100644
index 0000000..4bdaa05
--- /dev/null
+++ b/date-fns/src/eachHourOfInterval/test.ts
@@ -0,0 +1,134 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import eachHourOfInterval from '.'
+
+describe('eachHourOfInterval', () => {
+ it('returns an array with starts of hours from the hour of the start date to the hour of the end date', () => {
+ const result = eachHourOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 12),
+ end: new Date(2014, 9 /* Oct */, 6, 15)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 6, 12),
+ new Date(2014, 9 /* Oct */, 6, 13),
+ new Date(2014, 9 /* Oct */, 6, 14),
+ new Date(2014, 9 /* Oct */, 6, 15)
+ ])
+ })
+
+ it('accepts timestamps', () => {
+ const result = eachHourOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 12).getTime(),
+ end: new Date(2014, 9 /* Oct */, 6, 15).getTime()
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 6, 12),
+ new Date(2014, 9 /* Oct */, 6, 13),
+ new Date(2014, 9 /* Oct */, 6, 14),
+ new Date(2014, 9 /* Oct */, 6, 15)
+ ])
+ })
+
+ it('handles the hours that are not starts of hours', () => {
+ const result = eachHourOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 12, 59, 59, 999),
+ end: new Date(2014, 9 /* Oct */, 6, 15, 59, 59, 999)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 6, 12),
+ new Date(2014, 9 /* Oct */, 6, 13),
+ new Date(2014, 9 /* Oct */, 6, 14),
+ new Date(2014, 9 /* Oct */, 6, 15)
+ ])
+ })
+
+ it('returns one hour if the both arguments are on the same hour', () => {
+ const result = eachHourOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 12, 35),
+ end: new Date(2014, 9 /* Oct */, 6, 12, 47)
+ })
+ assert.deepEqual(result, [new Date(2014, 9 /* Oct */, 6, 12)])
+ })
+
+ it('returns one hour if the both arguments are the same', () => {
+ const result = eachHourOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 12, 35),
+ end: new Date(2014, 9 /* Oct */, 6, 12, 35)
+ })
+ assert.deepEqual(result, [new Date(2014, 9 /* Oct */, 6, 12)])
+ })
+
+ it('throws an exception if the start date is after the end date', () => {
+ const block = eachHourOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12, 35, 0, 0, 1),
+ end: new Date(2014, 9 /* Oct */, 12, 35, 0, 0, 0)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date is `Invalid Date`', () => {
+ const block = eachHourOfInterval.bind(null, {
+ start: new Date(NaN),
+ end: new Date(2014, 9 /* Oct */, 6, 12)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date is `Invalid Date`', () => {
+ const block = eachHourOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12, 12),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the interval is undefined', () => {
+ const block = eachHourOfInterval.bind(
+ null,
+ // $ExpectedMistake
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ assert.throws(eachHourOfInterval.bind(null), TypeError)
+ })
+
+ describe('options.step', () => {
+ const interval = {
+ start: new Date(2014, 9 /* Oct */, 6, 12),
+ end: new Date(2014, 9 /* Oct */, 6, 18)
+ }
+
+ const stepError = /^RangeError: `options.step` must be a number greater than 1$/
+
+ it('returns an array with starts of hours from the hour of the start date to the hour of the end date with the given step', () => {
+ const result = eachHourOfInterval(interval, { step: 3 })
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 6, 12),
+ new Date(2014, 9 /* Oct */, 6, 15),
+ new Date(2014, 9 /* Oct */, 6, 18)
+ ])
+ })
+
+ it('throws TypeError error if `options.step` is less than 1', () => {
+ assert.throws(() => eachHourOfInterval(interval, { step: 0 }), stepError)
+ assert.throws(() => eachHourOfInterval(interval, { step: -3 }), stepError)
+ })
+
+ it('throws TypeError error if `options.step` is NaN', () => {
+ // $ExpectedMistake
+ assert.throws(
+ () => eachHourOfInterval(interval, { step: 'w' }),
+ stepError
+ )
+ assert.throws(
+ () => eachHourOfInterval(interval, { step: NaN }),
+ stepError
+ )
+ })
+ })
+})
diff --git a/date-fns/src/eachMinuteOfInterval/benchmark.js b/date-fns/src/eachMinuteOfInterval/benchmark.js
new file mode 100644
index 0000000..0277233
--- /dev/null
+++ b/date-fns/src/eachMinuteOfInterval/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachMinuteOfInterval from '.'
+
+suite(
+ 'eachMinuteOfInterval',
+ function() {
+ benchmark('date-fns', function() {
+ return eachMinuteOfInterval({ start: this.dateA, end: this.dateB })
+ })
+ },
+ {
+ setup: function() {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 300000)
+ }
+ }
+)
diff --git a/date-fns/src/eachMinuteOfInterval/index.d.ts b/date-fns/src/eachMinuteOfInterval/index.d.ts
new file mode 100644
index 0000000..f96a5e9
--- /dev/null
+++ b/date-fns/src/eachMinuteOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachMinuteOfInterval } from 'date-fns'
+export default eachMinuteOfInterval
diff --git a/date-fns/src/eachMinuteOfInterval/index.js.flow b/date-fns/src/eachMinuteOfInterval/index.js.flow
new file mode 100644
index 0000000..5a9b8e4
--- /dev/null
+++ b/date-fns/src/eachMinuteOfInterval/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ interval: Interval,
+ options?: {
+ step?: number,
+ }
+) => Date[]
diff --git a/date-fns/src/eachMinuteOfInterval/index.ts b/date-fns/src/eachMinuteOfInterval/index.ts
new file mode 100644
index 0000000..682b6c0
--- /dev/null
+++ b/date-fns/src/eachMinuteOfInterval/index.ts
@@ -0,0 +1,70 @@
+import addMinutes from '../addMinutes/index'
+import toDate from '../toDate/index'
+import startOfMinute from '../startOfMinute/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+import { Interval, StepOptions } from '../types'
+
+/**
+ * @name eachMinuteOfInterval
+ * @category Interval Helpers
+ * @summary Return the array of minutes within the specified time interval.
+ *
+ * @description
+ * Returns the array of minutes within the specified time interval.
+ *
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @param {Object} [options] - an object with options.
+ * @param {Number} [options.step=1] - the step to increment by. The starts of minutes from the hour of the interval start to the hour of the interval end
+ * @throws {TypeError} 1 argument requie value should be more than 1.
+ * @returns {Date[]} the array withred
+ * @throws {RangeError} `options.step` must be a number equal or greater than 1
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03
+ * const result = eachMinuteOfInterval({
+ * start: new Date(2014, 9, 14, 13),
+ * end: new Date(2014, 9, 14, 13, 3)
+ * })
+ * //=> [
+ * // Wed Oct 14 2014 13:00:00,
+ * // Wed Oct 14 2014 13:01:00,
+ * // Wed Oct 14 2014 13:02:00,
+ * // Wed Oct 14 2014 13:03:00
+ * // ]
+ */
+export default function eachMinuteOfInterval(
+ interval: Interval,
+ options?: StepOptions
+): Date[] {
+ requiredArgs(1, arguments)
+
+ const startDate = startOfMinute(toDate(interval.start))
+ const endDate = startOfMinute(toDate(interval.end))
+
+ const startTime = startDate.getTime()
+ const endTime = endDate.getTime()
+
+ if (startTime >= endTime) {
+ throw new RangeError('Invalid interval')
+ }
+
+ const dates = []
+
+ let currentDate = startDate
+
+ const step = options && 'step' in options ? Number(options.step) : 1
+ if (step < 1 || isNaN(step))
+ throw new RangeError(
+ '`options.step` must be a number equal or greater than 1'
+ )
+
+ while (currentDate.getTime() <= endTime) {
+ dates.push(toDate(currentDate))
+ currentDate = addMinutes(currentDate, step)
+ }
+
+ return dates
+}
diff --git a/date-fns/src/eachMinuteOfInterval/test.ts b/date-fns/src/eachMinuteOfInterval/test.ts
new file mode 100644
index 0000000..c4dab70
--- /dev/null
+++ b/date-fns/src/eachMinuteOfInterval/test.ts
@@ -0,0 +1,99 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+
+import eachMinuteOfInterval from '.'
+
+describe('eachMinuteOfInterval', () => {
+ it('should return an array of Date objects containing a Date for each minute between the interval', () => {
+ const result = eachMinuteOfInterval({
+ start: new Date(2020, 10, 14, 13, 0),
+ end: new Date(2020, 10, 14, 13, 5)
+ })
+
+ assert.deepEqual(result, [
+ new Date(2020, 10, 14, 13, 0),
+ new Date(2020, 10, 14, 13, 1),
+ new Date(2020, 10, 14, 13, 2),
+ new Date(2020, 10, 14, 13, 3),
+ new Date(2020, 10, 14, 13, 4),
+ new Date(2020, 10, 14, 13, 5)
+ ])
+ })
+
+ it('should handle all the minutes that are not in the begining', () => {
+ const result = eachMinuteOfInterval({
+ start: new Date(2020, 10, 14, 13, 0, 33),
+ end: new Date(2020, 10, 14, 13, 2)
+ })
+
+ assert.deepEqual(result[0], new Date(2020, 10, 14, 13))
+ assert.deepEqual(result[2], new Date(2020, 10, 14, 13, 2))
+ })
+
+ it('should accept timestamps', () => {
+ const start = new Date(2020, 10, 14, 13, 0).getTime()
+ const end = new Date(2020, 10, 14, 13, 2).getTime()
+
+ const result = eachMinuteOfInterval({
+ start,
+ end
+ })
+
+ assert.deepEqual(result, [
+ new Date(2020, 10, 14, 13, 0),
+ new Date(2020, 10, 14, 13, 1),
+ new Date(2020, 10, 14, 13, 2)
+ ])
+ })
+
+ it('throws an exception if the start date is after the end date', () => {
+ const block = eachMinuteOfInterval.bind(null, {
+ start: new Date(2014, 10, 14, 10),
+ end: new Date(2014, 10, 14, 5)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ describe('options.step', () => {
+ const interval = {
+ start: new Date(2020, 9, 14, 13, 1),
+ end: new Date(2020, 9, 14, 13, 7)
+ }
+
+ const stepError = /^RangeError: `options.step` must be a number equal or greater than 1$/
+
+ it('returns an array with starts of hours from the hour of the start date to the hour of the end date with the given step', () => {
+ const result = eachMinuteOfInterval(interval, { step: 3 })
+ assert.deepEqual(result, [
+ new Date(2020, 9, 14, 13, 1),
+ new Date(2020, 9, 14, 13, 4),
+ new Date(2020, 9, 14, 13, 7)
+ ])
+ })
+
+ it('throws TypeError error if `options.step` is less than 1', () => {
+ assert.throws(
+ () => eachMinuteOfInterval(interval, { step: 0 }),
+ stepError
+ )
+ assert.throws(
+ () => eachMinuteOfInterval(interval, { step: -3 }),
+ stepError
+ )
+ })
+
+ it('throws TypeError error if `options.step` is NaN', () => {
+ // $ExpectedMistake
+ assert.throws(
+ () => eachMinuteOfInterval(interval, { step: 'w' }),
+ stepError
+ )
+ assert.throws(
+ () => eachMinuteOfInterval(interval, { step: NaN }),
+ stepError
+ )
+ })
+ })
+})
diff --git a/date-fns/src/eachMonthOfInterval/index.d.ts b/date-fns/src/eachMonthOfInterval/index.d.ts
new file mode 100644
index 0000000..bda4a18
--- /dev/null
+++ b/date-fns/src/eachMonthOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachMonthOfInterval } from 'date-fns'
+export default eachMonthOfInterval
diff --git a/date-fns/src/eachMonthOfInterval/index.js.flow b/date-fns/src/eachMonthOfInterval/index.js.flow
new file mode 100644
index 0000000..30230a5
--- /dev/null
+++ b/date-fns/src/eachMonthOfInterval/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (interval: Interval) => Date[]
diff --git a/date-fns/src/eachMonthOfInterval/index.ts b/date-fns/src/eachMonthOfInterval/index.ts
new file mode 100644
index 0000000..f946338
--- /dev/null
+++ b/date-fns/src/eachMonthOfInterval/index.ts
@@ -0,0 +1,59 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachMonthOfInterval
+ * @category Interval Helpers
+ * @summary Return the array of months within the specified time interval.
+ *
+ * @description
+ * Return the array of months within the specified time interval.
+ *
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @returns {Date[]} the array with starts of months from the month of the interval start to the month of the interval end
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Each month between 6 February 2014 and 10 August 2014:
+ * var result = eachMonthOfInterval({
+ * start: new Date(2014, 1, 6),
+ * end: new Date(2014, 7, 10)
+ * })
+ * //=> [
+ * // Sat Feb 01 2014 00:00:00,
+ * // Sat Mar 01 2014 00:00:00,
+ * // Tue Apr 01 2014 00:00:00,
+ * // Thu May 01 2014 00:00:00,
+ * // Sun Jun 01 2014 00:00:00,
+ * // Tue Jul 01 2014 00:00:00,
+ * // Fri Aug 01 2014 00:00:00
+ * // ]
+ */
+export default function eachMonthOfInterval(dirtyInterval: Interval) {
+ requiredArgs(1, arguments)
+
+ const interval = dirtyInterval || {}
+ const startDate = toDate(interval.start)
+ const endDate = toDate(interval.end)
+
+ const endTime = endDate.getTime()
+ const dates = []
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(startDate.getTime() <= endTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ const currentDate = startDate
+ currentDate.setHours(0, 0, 0, 0)
+ currentDate.setDate(1)
+
+ while (currentDate.getTime() <= endTime) {
+ dates.push(toDate(currentDate))
+ currentDate.setMonth(currentDate.getMonth() + 1)
+ }
+
+ return dates
+}
diff --git a/date-fns/src/eachMonthOfInterval/test.ts b/date-fns/src/eachMonthOfInterval/test.ts
new file mode 100644
index 0000000..45f58db
--- /dev/null
+++ b/date-fns/src/eachMonthOfInterval/test.ts
@@ -0,0 +1,120 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import eachMonthOfInterval from '.'
+
+describe('eachMonthOfInterval', function() {
+ it('returns an array with starts of months from the month of the start date to the month of the end date', function() {
+ const result = eachMonthOfInterval({
+ start: new Date(2014, 2 /* Mar */, 6),
+ end: new Date(2014, 7 /* Aug */, 12)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 2 /* Mar */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 4 /* May */, 1),
+ new Date(2014, 5 /* Jun */, 1),
+ new Date(2014, 6 /* Jul */, 1),
+ new Date(2014, 7 /* Aug */, 1)
+ ])
+ })
+
+ it('accepts timestamps', function() {
+ const result = eachMonthOfInterval({
+ start: new Date(2014, 2 /* Mar */, 6).getTime(),
+ end: new Date(2014, 7 /* Aug */, 12).getTime()
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 2 /* Mar */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 4 /* May */, 1),
+ new Date(2014, 5 /* Jun */, 1),
+ new Date(2014, 6 /* Jul */, 1),
+ new Date(2014, 7 /* Aug */, 1)
+ ])
+ })
+
+ it('handles the dates that are not starts of days', function() {
+ const result = eachMonthOfInterval({
+ start: new Date(2014, 2 /* Mar */, 6, 6, 35),
+ end: new Date(2014, 7 /* Aug */, 12, 22, 15)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 2 /* Mar */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 4 /* May */, 1),
+ new Date(2014, 5 /* Jun */, 1),
+ new Date(2014, 6 /* Jul */, 1),
+ new Date(2014, 7 /* Aug */, 1)
+ ])
+ })
+
+ it('handles the dates that are not containing days', function() {
+ const result = eachMonthOfInterval({
+ start: new Date(2014, 2 /* Mar */),
+ end: new Date(2014, 7 /* Aug */)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 2 /* Mar */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 4 /* May */, 1),
+ new Date(2014, 5 /* Jun */, 1),
+ new Date(2014, 6 /* Jul */, 1),
+ new Date(2014, 7 /* Aug */, 1)
+ ])
+ })
+
+ it('returns one month if the both arguments are on the same month', function() {
+ const result = eachMonthOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 9, 15)
+ })
+ assert.deepEqual(result, [new Date(2014, 9 /* Oct */, 1)])
+ })
+
+ it('returns one month if the both arguments are the same', function() {
+ const result = eachMonthOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 6, 14)
+ })
+ assert.deepEqual(result, [new Date(2014, 9 /* Oct */, 1)])
+ })
+
+ it('throws an exception if the start date is after the end date', function() {
+ const block = eachMonthOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date is `Invalid Date`', function() {
+ const block = eachMonthOfInterval.bind(null, {
+ start: new Date(NaN),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date is `Invalid Date`', function() {
+ const block = eachMonthOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the interval is undefined', function() {
+ const block = eachMonthOfInterval.bind(
+ null,
+ // $ExpectedMistake
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(eachMonthOfInterval.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/eachQuarterOfInterval/index.d.ts b/date-fns/src/eachQuarterOfInterval/index.d.ts
new file mode 100644
index 0000000..879b548
--- /dev/null
+++ b/date-fns/src/eachQuarterOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachQuarterOfInterval } from 'date-fns'
+export default eachQuarterOfInterval
diff --git a/date-fns/src/eachQuarterOfInterval/index.js.flow b/date-fns/src/eachQuarterOfInterval/index.js.flow
new file mode 100644
index 0000000..30230a5
--- /dev/null
+++ b/date-fns/src/eachQuarterOfInterval/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (interval: Interval) => Date[]
diff --git a/date-fns/src/eachQuarterOfInterval/index.ts b/date-fns/src/eachQuarterOfInterval/index.ts
new file mode 100644
index 0000000..cf70f20
--- /dev/null
+++ b/date-fns/src/eachQuarterOfInterval/index.ts
@@ -0,0 +1,61 @@
+import addQuarters from '../addQuarters/index'
+import startOfQuarter from '../startOfQuarter/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachQuarterOfInterval
+ * @category Interval Helpers
+ * @summary Return the array of quarters within the specified time interval.
+ *
+ * @description
+ * Return the array of quarters within the specified time interval.
+ *
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @returns {Date[]} the array with starts of quarters from the quarter of the interval start to the quarter of the interval end
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Each quarter within interval 6 February 2014 - 10 August 2014:
+ * var result = eachQuarterOfInterval({
+ * start: new Date(2014, 1, 6),
+ * end: new Date(2014, 7, 10)
+ * })
+ * //=> [
+ * // Wed Jan 01 2014 00:00:00,
+ * // Tue Apr 01 2014 00:00:00,
+ * // Tue Jul 01 2014 00:00:00,
+ * // ]
+ */
+export default function eachQuarterOfInterval(dirtyInterval: Interval): Date[] {
+ requiredArgs(1, arguments)
+
+ const interval = dirtyInterval || {}
+ const startDate = toDate(interval.start)
+ const endDate = toDate(interval.end)
+
+ var endTime = endDate.getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(startDate.getTime() <= endTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ const startDateQuarter = startOfQuarter(startDate)
+ const endDateQuarter = startOfQuarter(endDate)
+
+ endTime = endDateQuarter.getTime()
+
+ const quarters = []
+
+ var currentQuarter = startDateQuarter
+
+ while (currentQuarter.getTime() <= endTime) {
+ quarters.push(toDate(currentQuarter))
+ currentQuarter = addQuarters(currentQuarter, 1)
+ }
+
+ return quarters
+}
diff --git a/date-fns/src/eachQuarterOfInterval/test.ts b/date-fns/src/eachQuarterOfInterval/test.ts
new file mode 100644
index 0000000..a9edbcb
--- /dev/null
+++ b/date-fns/src/eachQuarterOfInterval/test.ts
@@ -0,0 +1,108 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import eachQuarterOfInterval from '.'
+
+describe('eachQuarterOfInterval', function() {
+ it('returns an array with starts of quarters from the quarter of the start date to the quarter of the end date', function() {
+ const result = eachQuarterOfInterval({
+ start: new Date(2014, 2 /* Mar */, 6),
+ end: new Date(2014, 7 /* Aug */, 12)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 6 /* Jul */, 1)
+ ])
+ })
+
+ it('accepts timestamps', function() {
+ const result = eachQuarterOfInterval({
+ start: new Date(2014, 2 /* Mar */, 6).getTime(),
+ end: new Date(2014, 7 /* Aug */, 12).getTime()
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 6 /* Jul */, 1)
+ ])
+ })
+
+ it('handles the dates that are not starts of days', function() {
+ const result = eachQuarterOfInterval({
+ start: new Date(2014, 2 /* Mar */, 6, 6, 35),
+ end: new Date(2014, 7 /* Aug */, 12, 22, 15)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 6 /* Jul */, 1)
+ ])
+ })
+
+ it('handles the dates that are not containing days', function() {
+ const result = eachQuarterOfInterval({
+ start: new Date(2014, 2 /* Mar */),
+ end: new Date(2014, 7 /* Oct */)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2014, 3 /* Apr */, 1),
+ new Date(2014, 6 /* Jul */, 1)
+ ])
+ })
+
+ it('returns one quarter if the both arguments are on the same quarter', function() {
+ const result = eachQuarterOfInterval({
+ start: new Date(2014, 0 /* Jan */, 6, 14),
+ end: new Date(2014, 2 /* Feb */, 9, 15)
+ })
+ assert.deepEqual(result, [new Date(2014, 0 /* Jan */, 1)])
+ })
+
+ it('returns one quarter if the both arguments are the same', function() {
+ const result = eachQuarterOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 6, 14)
+ })
+ assert.deepEqual(result, [new Date(2014, 9 /* Oct */, 1)])
+ })
+
+ it('throws an exception if the start date is after the end date', function() {
+ const block = eachQuarterOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date is `Invalid Date`', function() {
+ const block = eachQuarterOfInterval.bind(null, {
+ start: new Date(NaN),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date is `Invalid Date`', function() {
+ const block = eachQuarterOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the interval is undefined', function() {
+ const block = eachQuarterOfInterval.bind(
+ null,
+ // $ExpectedMistake
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(eachQuarterOfInterval.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/eachWeekOfInterval/benchmark.js b/date-fns/src/eachWeekOfInterval/benchmark.js
new file mode 100644
index 0000000..65e0830
--- /dev/null
+++ b/date-fns/src/eachWeekOfInterval/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachWeekOfInterval from '.'
+
+suite('eachWeekOfInterval', function () {
+ benchmark('date-fns', function () {
+ return eachWeekOfInterval({start: this.dateA, end: this.dateB})
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 4233600000)
+ }
+})
diff --git a/date-fns/src/eachWeekOfInterval/index.d.ts b/date-fns/src/eachWeekOfInterval/index.d.ts
new file mode 100644
index 0000000..24d1a8a
--- /dev/null
+++ b/date-fns/src/eachWeekOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekOfInterval } from 'date-fns'
+export default eachWeekOfInterval
diff --git a/date-fns/src/eachWeekOfInterval/index.js.flow b/date-fns/src/eachWeekOfInterval/index.js.flow
new file mode 100644
index 0000000..bc8cd5a
--- /dev/null
+++ b/date-fns/src/eachWeekOfInterval/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ interval: Interval,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => Date[]
diff --git a/date-fns/src/eachWeekOfInterval/index.ts b/date-fns/src/eachWeekOfInterval/index.ts
new file mode 100644
index 0000000..1045dd9
--- /dev/null
+++ b/date-fns/src/eachWeekOfInterval/index.ts
@@ -0,0 +1,84 @@
+import { WeekStartOptions } from '../types'
+import addWeeks from '../addWeeks/index'
+import startOfWeek from '../startOfWeek/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachWeekOfInterval
+ * @category Interval Helpers
+ * @summary Return the array of weeks within the specified time interval.
+ *
+ * @description
+ * Return the array of weeks within the specified time interval.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Date[]} the array with starts of weeks from the week of the interval start to the week of the interval end
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be 0, 1, ..., 6
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Each week within interval 6 October 2014 - 23 November 2014:
+ * var result = eachWeekOfInterval({
+ * start: new Date(2014, 9, 6),
+ * end: new Date(2014, 10, 23)
+ * })
+ * //=> [
+ * // Sun Oct 05 2014 00:00:00,
+ * // Sun Oct 12 2014 00:00:00,
+ * // Sun Oct 19 2014 00:00:00,
+ * // Sun Oct 26 2014 00:00:00,
+ * // Sun Nov 02 2014 00:00:00,
+ * // Sun Nov 09 2014 00:00:00,
+ * // Sun Nov 16 2014 00:00:00,
+ * // Sun Nov 23 2014 00:00:00
+ * // ]
+ */
+export default function eachWeekOfInterval(
+ dirtyInterval: Interval,
+ options?: WeekStartOptions
+): Date[] {
+ requiredArgs(1, arguments)
+
+ const interval = dirtyInterval || {}
+ const startDate = toDate(interval.start)
+ const endDate = toDate(interval.end)
+
+ var endTime = endDate.getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(startDate.getTime() <= endTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ const startDateWeek = startOfWeek(startDate, options)
+ const endDateWeek = startOfWeek(endDate, options)
+
+ // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet
+ startDateWeek.setHours(15)
+ endDateWeek.setHours(15)
+
+ endTime = endDateWeek.getTime()
+
+ const weeks = []
+
+ let currentWeek = startDateWeek
+
+ while (currentWeek.getTime() <= endTime) {
+ currentWeek.setHours(0)
+ weeks.push(toDate(currentWeek))
+ currentWeek = addWeeks(currentWeek, 1)
+ currentWeek.setHours(15)
+ }
+
+ return weeks
+}
diff --git a/date-fns/src/eachWeekOfInterval/test.ts b/date-fns/src/eachWeekOfInterval/test.ts
new file mode 100644
index 0000000..4bcf5b1
--- /dev/null
+++ b/date-fns/src/eachWeekOfInterval/test.ts
@@ -0,0 +1,145 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import eachWeekOfInterval from '.'
+
+describe('eachWeekOfInterval', function() {
+ it('returns an array with starts of weeks from the week of the start date to the week of the end date', function() {
+ const result = eachWeekOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6),
+ end: new Date(2014, 10 /* Nov */, 23)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 5),
+ new Date(2014, 9 /* Oct */, 12),
+ new Date(2014, 9 /* Oct */, 19),
+ new Date(2014, 9 /* Oct */, 26),
+ new Date(2014, 10 /* Nov */, 2),
+ new Date(2014, 10 /* Nov */, 9),
+ new Date(2014, 10 /* Nov */, 16),
+ new Date(2014, 10 /* Nov */, 23)
+ ])
+ })
+
+ it('accepts timestamps', function() {
+ const result = eachWeekOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6).getTime(),
+ end: new Date(2014, 10 /* Nov */, 23).getTime()
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 5),
+ new Date(2014, 9 /* Oct */, 12),
+ new Date(2014, 9 /* Oct */, 19),
+ new Date(2014, 9 /* Oct */, 26),
+ new Date(2014, 10 /* Nov */, 2),
+ new Date(2014, 10 /* Nov */, 9),
+ new Date(2014, 10 /* Nov */, 16),
+ new Date(2014, 10 /* Nov */, 23)
+ ])
+ })
+
+ it('handles the dates that are not starts/ends of days and weeks', function() {
+ const result = eachWeekOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 6, 35),
+ end: new Date(2014, 10 /* Nov */, 25, 22, 16)
+ })
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 5),
+ new Date(2014, 9 /* Oct */, 12),
+ new Date(2014, 9 /* Oct */, 19),
+ new Date(2014, 9 /* Oct */, 26),
+ new Date(2014, 10 /* Nov */, 2),
+ new Date(2014, 10 /* Nov */, 9),
+ new Date(2014, 10 /* Nov */, 16),
+ new Date(2014, 10 /* Nov */, 23)
+ ])
+ })
+
+ it('considers the weekStartsOn option', function() {
+ const result = eachWeekOfInterval(
+ {
+ start: new Date(2014, 9 /* Oct */, 6, 6, 35),
+ end: new Date(2014, 10 /* Nov */, 25, 22, 15)
+ },
+ { weekStartsOn: 2 }
+ )
+ assert.deepEqual(result, [
+ new Date(2014, 8 /* Sep */, 30),
+ new Date(2014, 9 /* Oct */, 7),
+ new Date(2014, 9 /* Oct */, 14),
+ new Date(2014, 9 /* Oct */, 21),
+ new Date(2014, 9 /* Oct */, 28),
+ new Date(2014, 10 /* Nov */, 4),
+ new Date(2014, 10 /* Nov */, 11),
+ new Date(2014, 10 /* Nov */, 18),
+ new Date(2014, 10 /* Nov */, 25)
+ ])
+ })
+
+ it('returns one week if the both arguments are on the same week', function() {
+ const result = eachWeekOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 8, 15)
+ })
+ assert.deepEqual(result, [new Date(2014, 9 /* Oct */, 5)])
+ })
+
+ it('returns one day if the both arguments are the same', function() {
+ const result = eachWeekOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 6, 14)
+ })
+ assert.deepEqual(result, [new Date(2014, 9 /* Oct */, 5)])
+ })
+
+ it('throws an exception if the start date is after the end date', function() {
+ const block = eachWeekOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date is `Invalid Date`', function() {
+ const block = eachWeekOfInterval.bind(null, {
+ start: new Date(NaN),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date is `Invalid Date`', function() {
+ const block = eachWeekOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the interval is undefined', function() {
+ const block = eachWeekOfInterval.bind(
+ null,
+ // $ExpectedMistake
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertible to 0, 1, ..., 6 or undefined', function() {
+ const block = eachWeekOfInterval.bind(
+ null,
+ {
+ start: new Date(2014, 9 /* Oct */, 6, 6, 35),
+ end: new Date(2014, 10 /* Nov */, 25, 22, 15)
+ },
+ // $ExpectedMistake
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(eachWeekOfInterval.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/eachWeekendOfInterval/benchmark.js b/date-fns/src/eachWeekendOfInterval/benchmark.js
new file mode 100755
index 0000000..df23caf
--- /dev/null
+++ b/date-fns/src/eachWeekendOfInterval/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachWeekendOfInterval from '.'
+
+suite('eachWeekendOfInterval', function () {
+ benchmark('date-fns', function () {
+ return eachWeekendOfInterval({start: this.dateStart, end: this.dateEnd})
+ })
+}, {
+ setup: function () {
+ this.dateStart = new Date(2022, 0, 1)
+ this.dateEnd = new Date(2022, 11, 31)
+ }
+})
diff --git a/date-fns/src/eachWeekendOfInterval/index.d.ts b/date-fns/src/eachWeekendOfInterval/index.d.ts
new file mode 100644
index 0000000..c0b3fea
--- /dev/null
+++ b/date-fns/src/eachWeekendOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekendOfInterval } from 'date-fns'
+export default eachWeekendOfInterval
diff --git a/date-fns/src/eachWeekendOfInterval/index.js.flow b/date-fns/src/eachWeekendOfInterval/index.js.flow
new file mode 100755
index 0000000..30230a5
--- /dev/null
+++ b/date-fns/src/eachWeekendOfInterval/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (interval: Interval) => Date[]
diff --git a/date-fns/src/eachWeekendOfInterval/index.ts b/date-fns/src/eachWeekendOfInterval/index.ts
new file mode 100644
index 0000000..ffd2873
--- /dev/null
+++ b/date-fns/src/eachWeekendOfInterval/index.ts
@@ -0,0 +1,47 @@
+import eachDayOfInterval from '../eachDayOfInterval/index'
+import isSunday from '../isSunday/index'
+import isWeekend from '../isWeekend/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachWeekendOfInterval
+ * @category Interval Helpers
+ * @summary List all the Saturdays and Sundays in the given date interval.
+ *
+ * @description
+ * Get all the Saturdays and Sundays in the given date interval.
+ *
+ * @param {Interval} interval - the given interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @returns {Date[]} an array containing all the Saturdays and Sundays
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Lists all Saturdays and Sundays in the given date interval
+ * const result = eachWeekendOfInterval({
+ * start: new Date(2018, 8, 17),
+ * end: new Date(2018, 8, 30)
+ * })
+ * //=> [
+ * // Sat Sep 22 2018 00:00:00,
+ * // Sun Sep 23 2018 00:00:00,
+ * // Sat Sep 29 2018 00:00:00,
+ * // Sun Sep 30 2018 00:00:00
+ * // ]
+ */
+export default function eachWeekendOfInterval(interval: Interval): Date[] {
+ requiredArgs(1, arguments)
+
+ const dateInterval = eachDayOfInterval(interval)
+ const weekends = []
+ let index = 0
+ while (index < dateInterval.length) {
+ const date = dateInterval[index++]
+ if (isWeekend(date)) {
+ weekends.push(date)
+ if (isSunday(date)) index = index + 5
+ }
+ }
+ return weekends
+}
diff --git a/date-fns/src/eachWeekendOfInterval/test.ts b/date-fns/src/eachWeekendOfInterval/test.ts
new file mode 100644
index 0000000..75df655
--- /dev/null
+++ b/date-fns/src/eachWeekendOfInterval/test.ts
@@ -0,0 +1,67 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import eachWeekendOfInterval from '.'
+
+describe('eachWeekendOfInterval', function () {
+ it('returns all weekends within the interval', function () {
+ const result = eachWeekendOfInterval({
+ start: new Date(2018, 8 /* Sept */, 17),
+ end: new Date(2018, 8 /* Sept */, 30)
+ })
+ assert.deepEqual(result, [
+ new Date(2018, 8 /* Sept */, 22),
+ new Date(2018, 8 /* Sept */, 23),
+ new Date(2018, 8 /* Sept */, 29),
+ new Date(2018, 8 /* Sept */, 30)
+ ])
+ })
+
+ it('returns all weekends within the interval when starting on a weekend', function () {
+ const result = eachWeekendOfInterval({
+ start: new Date(2018, 8 /* Sept */, 22),
+ end: new Date(2018, 8 /* Sept */, 30)
+ })
+ assert.deepEqual(result, [
+ new Date(2018, 8 /* Sept */, 22),
+ new Date(2018, 8 /* Sept */, 23),
+ new Date(2018, 8 /* Sept */, 29),
+ new Date(2018, 8 /* Sept */, 30)
+ ])
+ })
+
+ it('throws `RangeError` invalid interval start date is used', function () {
+ // $ExpectedMistake
+ const block = eachWeekendOfInterval.bind(null, {
+ start: new Date(NaN),
+ end: new Date(2019, 11 /* Dec */, 31)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` invalid interval end date is used', function () {
+ // $ExpectedMistake
+ const block = eachWeekendOfInterval.bind(null, {
+ start: new Date(2019, 0 /* Jan */, 1),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(eachWeekendOfInterval, TypeError)
+ })
+
+ it('throws `RangeError` if start of an interval is after its end', function () {
+ const block = eachWeekendOfInterval.bind(
+ null,
+ // $ExpectedMistake
+ {
+ start: new Date(2018, 8 /* Sept */, 25),
+ end: new Date(2018, 8 /* Sept */, 6)
+ }
+ )
+ assert.throws(block, RangeError)
+ })
+})
diff --git a/date-fns/src/eachWeekendOfMonth/benchmark.js b/date-fns/src/eachWeekendOfMonth/benchmark.js
new file mode 100644
index 0000000..e5aa4a3
--- /dev/null
+++ b/date-fns/src/eachWeekendOfMonth/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachWeekendOfMonth from '.'
+
+suite('eachWeekendOfMonth', function () {
+ benchmark('date-fns', function () {
+ return eachWeekendOfMonth(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date(2020, 3, 20)
+ }
+})
diff --git a/date-fns/src/eachWeekendOfMonth/index.d.ts b/date-fns/src/eachWeekendOfMonth/index.d.ts
new file mode 100644
index 0000000..cb01c45
--- /dev/null
+++ b/date-fns/src/eachWeekendOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekendOfMonth } from 'date-fns'
+export default eachWeekendOfMonth
diff --git a/date-fns/src/eachWeekendOfMonth/index.js.flow b/date-fns/src/eachWeekendOfMonth/index.js.flow
new file mode 100644
index 0000000..7073332
--- /dev/null
+++ b/date-fns/src/eachWeekendOfMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date[]
diff --git a/date-fns/src/eachWeekendOfMonth/index.ts b/date-fns/src/eachWeekendOfMonth/index.ts
new file mode 100644
index 0000000..1cfdfb7
--- /dev/null
+++ b/date-fns/src/eachWeekendOfMonth/index.ts
@@ -0,0 +1,42 @@
+import eachWeekendOfInterval from '../eachWeekendOfInterval/index'
+import startOfMonth from '../startOfMonth/index'
+import endOfMonth from '../endOfMonth/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachWeekendOfMonth
+ * @category Month Helpers
+ * @summary List all the Saturdays and Sundays in the given month.
+ *
+ * @description
+ * Get all the Saturdays and Sundays in the given month.
+ *
+ * @param {Date|Number} date - the given month
+ * @returns {Date[]} an array containing all the Saturdays and Sundays
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} The passed date is invalid
+ *
+ * @example
+ * // Lists all Saturdays and Sundays in the given month
+ * const result = eachWeekendOfMonth(new Date(2022, 1, 1))
+ * //=> [
+ * // Sat Feb 05 2022 00:00:00,
+ * // Sun Feb 06 2022 00:00:00,
+ * // Sat Feb 12 2022 00:00:00,
+ * // Sun Feb 13 2022 00:00:00,
+ * // Sat Feb 19 2022 00:00:00,
+ * // Sun Feb 20 2022 00:00:00,
+ * // Sat Feb 26 2022 00:00:00,
+ * // Sun Feb 27 2022 00:00:00
+ * // ]
+ */
+export default function eachWeekendOfMonth(dirtyDate: Date): Date[] {
+ requiredArgs(1, arguments)
+
+ const startDate = startOfMonth(dirtyDate)
+ if (isNaN(startDate.getTime()))
+ throw new RangeError('The passed date is invalid')
+
+ const endDate = endOfMonth(dirtyDate)
+ return eachWeekendOfInterval({ start: startDate, end: endDate })
+}
diff --git a/date-fns/src/eachWeekendOfMonth/test.ts b/date-fns/src/eachWeekendOfMonth/test.ts
new file mode 100644
index 0000000..018f2e6
--- /dev/null
+++ b/date-fns/src/eachWeekendOfMonth/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import eachWeekendOfMonth from '.'
+
+describe('eachWeekendOfMonth', () => {
+ it('returns all weekends of the given month', () => {
+ var result = eachWeekendOfMonth(new Date(2022, 1, 20))
+ assert.deepStrictEqual(result, [
+ new Date(2022, 1, 5),
+ new Date(2022, 1, 6),
+ new Date(2022, 1, 12),
+ new Date(2022, 1, 13),
+ new Date(2022, 1, 19),
+ new Date(2022, 1, 20),
+ new Date(2022, 1, 26),
+ new Date(2022, 1, 27)
+ ])
+ })
+
+ it('throws TypeError exception when passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(eachWeekendOfMonth.bind(null), TypeError)
+ })
+
+ it('throws RangeError when the expected year is an invalid date', () => {
+ // @ts-expect-error
+ assert.throws(eachWeekendOfMonth.bind(1, NaN), RangeError)
+ })
+})
diff --git a/date-fns/src/eachWeekendOfYear/benchmark.js b/date-fns/src/eachWeekendOfYear/benchmark.js
new file mode 100644
index 0000000..c490d95
--- /dev/null
+++ b/date-fns/src/eachWeekendOfYear/benchmark.js
@@ -0,0 +1,14 @@
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import eachWeekendOfYear from '.'
+
+suite('eachWeekendOfYear', function () {
+ benchmark('date-fns', function () {
+ return eachWeekendOfYear(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date(2022, 7, 12)
+ }
+})
diff --git a/date-fns/src/eachWeekendOfYear/index.d.ts b/date-fns/src/eachWeekendOfYear/index.d.ts
new file mode 100644
index 0000000..7cda9d1
--- /dev/null
+++ b/date-fns/src/eachWeekendOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekendOfYear } from 'date-fns'
+export default eachWeekendOfYear
diff --git a/date-fns/src/eachWeekendOfYear/index.js b/date-fns/src/eachWeekendOfYear/index.js
new file mode 100644
index 0000000..291e158
--- /dev/null
+++ b/date-fns/src/eachWeekendOfYear/index.js
@@ -0,0 +1,38 @@
+import eachWeekendOfInterval from '../eachWeekendOfInterval/index'
+import startOfYear from '../startOfYear/index'
+import endOfYear from '../endOfYear/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachWeekendOfYear
+ * @category Year Helpers
+ * @summary List all the Saturdays and Sundays in the year.
+ *
+ * @description
+ * Get all the Saturdays and Sundays in the year.
+ *
+ * @param {Date|Number} date - the given year
+ * @returns {Date[]} an array containing all the Saturdays and Sundays
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} The passed date is invalid
+ *
+ * @example
+ * // Lists all Saturdays and Sundays in the year
+ * var result = eachWeekendOfYear(new Date(2020, 1, 1))
+ * //=> [
+ * // Sat Jan 03 2020 00:00:00,
+ * // Sun Jan 04 2020 00:00:00,
+ * // ...
+ * // Sun Dec 27 2020 00:00:00
+ * // ]
+ * ]
+ */
+export default function eachWeekendOfYear(dirtyDate) {
+ requiredArgs(1, arguments)
+
+ var startDate = startOfYear(dirtyDate)
+ if (isNaN(startDate)) throw new RangeError('The passed date is invalid')
+
+ var endDate = endOfYear(dirtyDate)
+ return eachWeekendOfInterval({ start: startDate, end: endDate })
+}
diff --git a/date-fns/src/eachWeekendOfYear/index.js.flow b/date-fns/src/eachWeekendOfYear/index.js.flow
new file mode 100644
index 0000000..7073332
--- /dev/null
+++ b/date-fns/src/eachWeekendOfYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date[]
diff --git a/date-fns/src/eachWeekendOfYear/test.js b/date-fns/src/eachWeekendOfYear/test.js
new file mode 100644
index 0000000..81ebbfe
--- /dev/null
+++ b/date-fns/src/eachWeekendOfYear/test.js
@@ -0,0 +1,24 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import eachWeekendOfYear from '.'
+import isWeekend from '../isWeekend'
+
+describe('eachWeekendOfYear', () => {
+ it('returns all weekends of the given year', () => {
+ var result = eachWeekendOfYear(new Date(2020, 0, 1))
+ assert(result.length === 104)
+ assert(result.every(isWeekend))
+ assert.deepEqual(result[0], new Date(2020, 0, 4))
+ assert.deepEqual(result[103], new Date(2020, 11, 27))
+ })
+
+ it('throws TypeError exception when no argument is passed in', () => {
+ assert.throws(eachWeekendOfYear.bind(null), TypeError)
+ })
+
+ it('throws RangeError exception when date is invalid', () => {
+ assert.throws(eachWeekendOfYear.bind(null, new Date(NaN)), RangeError)
+ })
+})
diff --git a/date-fns/src/eachYearOfInterval/index.d.ts b/date-fns/src/eachYearOfInterval/index.d.ts
new file mode 100644
index 0000000..d6d5d5d
--- /dev/null
+++ b/date-fns/src/eachYearOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachYearOfInterval } from 'date-fns'
+export default eachYearOfInterval
diff --git a/date-fns/src/eachYearOfInterval/index.js b/date-fns/src/eachYearOfInterval/index.js
new file mode 100644
index 0000000..a1eaf50
--- /dev/null
+++ b/date-fns/src/eachYearOfInterval/index.js
@@ -0,0 +1,57 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name eachYearOfInterval
+ * @category Interval Helpers
+ * @summary Return the array of yearly timestamps within the specified time interval.
+ *
+ * @description
+ * Return the array of yearly timestamps within the specified time interval.
+ *
+ * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}
+ * @returns {Date[]} the array with starts of yearly timestamps from the month of the interval start to the month of the interval end
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // Each year between 6 February 2014 and 10 August 2017:
+ * var result = eachYearOfInterval({
+ * start: new Date(2014, 1, 6),
+ * end: new Date(2017, 7, 10)
+ * })
+ * //=> [
+ * // Wed Jan 01 2014 00:00:00,
+ * // Thu Jan 01 2015 00:00:00,
+ * // Fri Jan 01 2016 00:00:00,
+ * // Sun Jan 01 2017 00:00:00
+ * // ]
+ */
+export default function eachYearOfInterval(dirtyInterval) {
+ requiredArgs(1, arguments)
+
+ var interval = dirtyInterval || {}
+ var startDate = toDate(interval.start)
+ var endDate = toDate(interval.end)
+
+ var endTime = endDate.getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(startDate.getTime() <= endTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ var dates = []
+
+ var currentDate = startDate
+ currentDate.setHours(0, 0, 0, 0)
+ currentDate.setMonth(0, 1)
+
+ while (currentDate.getTime() <= endTime) {
+ dates.push(toDate(currentDate))
+ currentDate.setFullYear(currentDate.getFullYear() + 1)
+ }
+
+ return dates
+}
diff --git a/date-fns/src/eachYearOfInterval/index.js.flow b/date-fns/src/eachYearOfInterval/index.js.flow
new file mode 100644
index 0000000..30230a5
--- /dev/null
+++ b/date-fns/src/eachYearOfInterval/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (interval: Interval) => Date[]
diff --git a/date-fns/src/eachYearOfInterval/test.js b/date-fns/src/eachYearOfInterval/test.js
new file mode 100644
index 0000000..2de5e8b
--- /dev/null
+++ b/date-fns/src/eachYearOfInterval/test.js
@@ -0,0 +1,105 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import eachYearOfInterval from '.'
+
+describe('eachYearOfInterval', function() {
+ it('returns an array with starts of days from the day of the start date to the day of the end date', function() {
+ var result = eachYearOfInterval({
+ start: new Date(2012, 9 /* Oct */, 6),
+ end: new Date(2017, 9 /* Oct */, 12)
+ })
+ assert.deepEqual(result, [
+ new Date(2012, 0 /* Jan */, 1),
+ new Date(2013, 0 /* Jan */, 1),
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2015, 0 /* Jan */, 1),
+ new Date(2016, 0 /* Jan */, 1),
+ new Date(2017, 0 /* Jan */, 1)
+ ])
+ })
+
+ it('accepts timestamps', function() {
+ var result = eachYearOfInterval({
+ start: new Date(2012, 9 /* Oct */, 6).getTime(),
+ end: new Date(2017, 9 /* Oct */, 12).getTime()
+ })
+ assert.deepEqual(result, [
+ new Date(2012, 0 /* Jan */, 1),
+ new Date(2013, 0 /* Jan */, 1),
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2015, 0 /* Jan */, 1),
+ new Date(2016, 0 /* Jan */, 1),
+ new Date(2017, 0 /* Jan */, 1)
+ ])
+ })
+
+ it('handles the dates that are not starts of days', function() {
+ var result = eachYearOfInterval({
+ start: new Date(2012, 9 /* Oct */, 6, 6, 35),
+ end: new Date(2017, 9 /* Oct */, 12, 22, 15)
+ })
+ assert.deepEqual(result, [
+ new Date(2012, 0 /* Jan */, 1),
+ new Date(2013, 0 /* Jan */, 1),
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2015, 0 /* Jan */, 1),
+ new Date(2016, 0 /* Jan */, 1),
+ new Date(2017, 0 /* Jan */, 1)
+ ])
+ })
+
+ it('returns one year if the both arguments are on the same year', function() {
+ var result = eachYearOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 6, 15)
+ })
+ assert.deepEqual(result, [new Date(2014, 0 /* Jan */, 1)])
+ })
+
+ it('returns one year if the both arguments are the same', function() {
+ var result = eachYearOfInterval({
+ start: new Date(2014, 9 /* Oct */, 6, 14),
+ end: new Date(2014, 9 /* Oct */, 6, 14)
+ })
+ assert.deepEqual(result, [new Date(2014, 0 /* Jan */, 1)])
+ })
+
+ it('throws an exception if the start date is after the end date', function() {
+ var block = eachYearOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date is `Invalid Date`', function() {
+ var block = eachYearOfInterval.bind(null, {
+ start: new Date(NaN),
+ end: new Date(2014, 9 /* Oct */, 6)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date is `Invalid Date`', function() {
+ var block = eachYearOfInterval.bind(null, {
+ start: new Date(2014, 9 /* Oct */, 12),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the interval is undefined', function() {
+ var block = eachYearOfInterval.bind(
+ null,
+ // $ExpectedMistake
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(eachYearOfInterval.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfDay/benchmark.js b/date-fns/src/endOfDay/benchmark.js
new file mode 100644
index 0000000..88cc738
--- /dev/null
+++ b/date-fns/src/endOfDay/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfDay from '.'
+import moment from 'moment'
+
+suite('endOfDay', function () {
+ benchmark('date-fns', function () {
+ return endOfDay(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('day')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfDay/index.d.ts b/date-fns/src/endOfDay/index.d.ts
new file mode 100644
index 0000000..2ce6172
--- /dev/null
+++ b/date-fns/src/endOfDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfDay } from 'date-fns'
+export default endOfDay
diff --git a/date-fns/src/endOfDay/index.js.flow b/date-fns/src/endOfDay/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfDay/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfDay/index.ts b/date-fns/src/endOfDay/index.ts
new file mode 100644
index 0000000..e8fe6cc
--- /dev/null
+++ b/date-fns/src/endOfDay/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfDay
+ * @category Day Helpers
+ * @summary Return the end of a day for the given date.
+ *
+ * @description
+ * Return the end of a day for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of a day
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of a day for 2 September 2014 11:55:00:
+ * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Sep 02 2014 23:59:59.999
+ */
+export default function endOfDay(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfDay/test.ts b/date-fns/src/endOfDay/test.ts
new file mode 100644
index 0000000..9a9f2a8
--- /dev/null
+++ b/date-fns/src/endOfDay/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfDay from '.'
+
+describe('endOfDay', function() {
+ it('returns the date with the time set to 23:59:59.999', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = endOfDay(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 23, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = endOfDay(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 23, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ endOfDay(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfDay(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfDay.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfDecade/benchmark.js b/date-fns/src/endOfDecade/benchmark.js
new file mode 100644
index 0000000..43296e1
--- /dev/null
+++ b/date-fns/src/endOfDecade/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfDecade from '.'
+
+suite('endOfDecade', function () {
+ benchmark('date-fns', function () {
+ return endOfDecade(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/endOfDecade/index.d.ts b/date-fns/src/endOfDecade/index.d.ts
new file mode 100644
index 0000000..c723f13
--- /dev/null
+++ b/date-fns/src/endOfDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfDecade } from 'date-fns'
+export default endOfDecade
diff --git a/date-fns/src/endOfDecade/index.js.flow b/date-fns/src/endOfDecade/index.js.flow
new file mode 100644
index 0000000..364a3bb
--- /dev/null
+++ b/date-fns/src/endOfDecade/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ additionalDigits?: 0 | 1 | 2,
+ }
+) => Date
diff --git a/date-fns/src/endOfDecade/index.ts b/date-fns/src/endOfDecade/index.ts
new file mode 100644
index 0000000..11c5ddb
--- /dev/null
+++ b/date-fns/src/endOfDecade/index.ts
@@ -0,0 +1,37 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfDecade
+ * @category Decade Helpers
+ * @summary Return the end of a decade for the given date.
+ *
+ * @description
+ * Return the end of a decade for the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of a decade
+ * @param {Object} [options] - an object with options.
+ * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
+ *
+ * @example
+ * // The end of a decade for 12 May 1984 00:00:00:
+ * const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00))
+ * //=> Dec 31 1989 23:59:59.999
+ */
+export default function endOfDecade(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ const decade = 9 + Math.floor(year / 10) * 10
+ date.setFullYear(decade, 11, 31)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfDecade/test.ts b/date-fns/src/endOfDecade/test.ts
new file mode 100644
index 0000000..6328154
--- /dev/null
+++ b/date-fns/src/endOfDecade/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfDecade from '.'
+
+describe('endOfDecade', function() {
+ it('returns the date with the time set to 23:59:59.999 and the date set to the last millisecond of a decade', function() {
+ const date = new Date(2017, 3 /* Apr */, 10, 0, 0, 0)
+ const result = endOfDecade(date)
+ assert.deepEqual(result, new Date(2019, 11 /* Dec */, 31, 23, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2007, 9 /* Oct */, 10, 0, 0, 0).getTime()
+ const result = endOfDecade(date)
+ assert.deepEqual(result, new Date(2009, 11 /* Dec */, 31, 23, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2038, 0 /* Jan */, 19, 3, 14, 8)
+ endOfDecade(date)
+ assert.deepEqual(date, new Date(2038, 0 /* Jan */, 19, 3, 14, 8))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfDecade(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfDecade.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfHour/benchmark.js b/date-fns/src/endOfHour/benchmark.js
new file mode 100644
index 0000000..096fbe0
--- /dev/null
+++ b/date-fns/src/endOfHour/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfHour from '.'
+import moment from 'moment'
+
+suite('endOfHour', function () {
+ benchmark('date-fns', function () {
+ return endOfHour(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('hour')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfHour/index.d.ts b/date-fns/src/endOfHour/index.d.ts
new file mode 100644
index 0000000..10ab321
--- /dev/null
+++ b/date-fns/src/endOfHour/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfHour } from 'date-fns'
+export default endOfHour
diff --git a/date-fns/src/endOfHour/index.js.flow b/date-fns/src/endOfHour/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfHour/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfHour/index.ts b/date-fns/src/endOfHour/index.ts
new file mode 100644
index 0000000..2d0f5cd
--- /dev/null
+++ b/date-fns/src/endOfHour/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfHour
+ * @category Hour Helpers
+ * @summary Return the end of an hour for the given date.
+ *
+ * @description
+ * Return the end of an hour for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of an hour
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of an hour for 2 September 2014 11:55:00:
+ * const result = endOfHour(new Date(2014, 8, 2, 11, 55))
+ * //=> Tue Sep 02 2014 11:59:59.999
+ */
+export default function endOfHour(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setMinutes(59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfHour/test.ts b/date-fns/src/endOfHour/test.ts
new file mode 100644
index 0000000..d3f1ab4
--- /dev/null
+++ b/date-fns/src/endOfHour/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfHour from '.'
+
+describe('endOfHour', function() {
+ it('returns the date with the time set to the last millisecond before an hour ends', function() {
+ const date = new Date(2014, 11, 1, 22, 15)
+ const result = endOfHour(date)
+ assert.deepEqual(result, new Date(2014, 11, 1, 22, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = endOfHour(new Date(2014, 11, 1, 22, 15).getTime())
+ assert.deepEqual(result, new Date(2014, 11, 1, 22, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 11, 1, 22, 15)
+ endOfHour(date)
+ assert.deepEqual(date, new Date(2014, 11, 1, 22, 15))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfHour(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfHour.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfISOWeek/benchmark.js b/date-fns/src/endOfISOWeek/benchmark.js
new file mode 100644
index 0000000..5cea940
--- /dev/null
+++ b/date-fns/src/endOfISOWeek/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfISOWeek from '.'
+import moment from 'moment'
+
+suite('endOfISOWeek', function () {
+ benchmark('date-fns', function () {
+ return endOfISOWeek(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('isoWeek')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfISOWeek/index.d.ts b/date-fns/src/endOfISOWeek/index.d.ts
new file mode 100644
index 0000000..10c3365
--- /dev/null
+++ b/date-fns/src/endOfISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfISOWeek } from 'date-fns'
+export default endOfISOWeek
diff --git a/date-fns/src/endOfISOWeek/index.js.flow b/date-fns/src/endOfISOWeek/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfISOWeek/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfISOWeek/index.ts b/date-fns/src/endOfISOWeek/index.ts
new file mode 100644
index 0000000..91ac05c
--- /dev/null
+++ b/date-fns/src/endOfISOWeek/index.ts
@@ -0,0 +1,32 @@
+import endOfWeek from '../endOfWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfISOWeek
+ * @category ISO Week Helpers
+ * @summary Return the end of an ISO week for the given date.
+ *
+ * @description
+ * Return the end of an ISO week for the given date.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of an ISO week
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of an ISO week for 2 September 2014 11:55:00:
+ * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Sun Sep 07 2014 23:59:59.999
+ */
+export default function endOfISOWeek(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ return endOfWeek(dirtyDate, { weekStartsOn: 1 })
+}
diff --git a/date-fns/src/endOfISOWeek/test.ts b/date-fns/src/endOfISOWeek/test.ts
new file mode 100644
index 0000000..56f6531
--- /dev/null
+++ b/date-fns/src/endOfISOWeek/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfISOWeek from '.'
+
+describe('endOfISOWeek', function() {
+ it('returns the date with the time set to 23:59:59:999 and the date set to the last day of an ISO week', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = endOfISOWeek(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7, 23, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 1 /* Feb */, 11, 11, 55, 0).getTime()
+ const result = endOfISOWeek(date)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 16, 23, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ endOfISOWeek(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfISOWeek(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfISOWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfISOWeekYear/benchmark.js b/date-fns/src/endOfISOWeekYear/benchmark.js
new file mode 100644
index 0000000..89749ac
--- /dev/null
+++ b/date-fns/src/endOfISOWeekYear/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfISOWeekYear from '.'
+
+suite('endOfISOWeekYear', function () {
+ benchmark('date-fns', function () {
+ return endOfISOWeekYear(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/endOfISOWeekYear/index.d.ts b/date-fns/src/endOfISOWeekYear/index.d.ts
new file mode 100644
index 0000000..1878308
--- /dev/null
+++ b/date-fns/src/endOfISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfISOWeekYear } from 'date-fns'
+export default endOfISOWeekYear
diff --git a/date-fns/src/endOfISOWeekYear/index.js.flow b/date-fns/src/endOfISOWeekYear/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfISOWeekYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfISOWeekYear/index.ts b/date-fns/src/endOfISOWeekYear/index.ts
new file mode 100644
index 0000000..5454ba6
--- /dev/null
+++ b/date-fns/src/endOfISOWeekYear/index.ts
@@ -0,0 +1,45 @@
+import getISOWeekYear from '../getISOWeekYear/index'
+import startOfISOWeek from '../startOfISOWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Return the end of an ISO week-numbering year for the given date.
+ *
+ * @description
+ * Return the end of an ISO week-numbering year,
+ * which always starts 3 days before the year's first Thursday.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `endOfISOYear` to `endOfISOWeekYear`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of an ISO week-numbering year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of an ISO week-numbering year for 2 July 2005:
+ * const result = endOfISOWeekYear(new Date(2005, 6, 2))
+ * //=> Sun Jan 01 2006 23:59:59.999
+ */
+export default function endOfISOWeekYear(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const year = getISOWeekYear(dirtyDate)
+ const fourthOfJanuaryOfNextYear = new Date(0)
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4)
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0)
+ const date = startOfISOWeek(fourthOfJanuaryOfNextYear)
+ date.setMilliseconds(date.getMilliseconds() - 1)
+ return date
+}
diff --git a/date-fns/src/endOfISOWeekYear/test.ts b/date-fns/src/endOfISOWeekYear/test.ts
new file mode 100644
index 0000000..5a155c9
--- /dev/null
+++ b/date-fns/src/endOfISOWeekYear/test.ts
@@ -0,0 +1,46 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfISOWeekYear from '.'
+
+describe('endOfISOWeekYear', function() {
+ it('returns the date with the time set to 23:59:59.999 and the date set to the last day of an ISO year', function() {
+ const result = endOfISOWeekYear(new Date(2009, 0 /* Jan */, 1, 16, 0))
+ assert.deepEqual(result, new Date(2010, 0 /* Jan */, 3, 23, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = endOfISOWeekYear(
+ new Date(2005, 0 /* Jan */, 1, 6, 0).getTime()
+ )
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 2, 23, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 2)
+ endOfISOWeekYear(date)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(5, 0 /* Jan */, 4)
+ initialDate.setHours(16, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(6, 0 /* Jan */, 1)
+ expectedResult.setHours(23, 59, 59, 999)
+ const result = endOfISOWeekYear(initialDate)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfISOWeekYear(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfISOWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfMinute/benchmark.js b/date-fns/src/endOfMinute/benchmark.js
new file mode 100644
index 0000000..49b936c
--- /dev/null
+++ b/date-fns/src/endOfMinute/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfMinute from '.'
+import moment from 'moment'
+
+suite('endOfMinute', function () {
+ benchmark('date-fns', function () {
+ return endOfMinute(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('minute')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfMinute/index.d.ts b/date-fns/src/endOfMinute/index.d.ts
new file mode 100644
index 0000000..82d1b5d
--- /dev/null
+++ b/date-fns/src/endOfMinute/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfMinute } from 'date-fns'
+export default endOfMinute
diff --git a/date-fns/src/endOfMinute/index.js.flow b/date-fns/src/endOfMinute/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfMinute/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfMinute/index.ts b/date-fns/src/endOfMinute/index.ts
new file mode 100644
index 0000000..5e28e69
--- /dev/null
+++ b/date-fns/src/endOfMinute/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfMinute
+ * @category Minute Helpers
+ * @summary Return the end of a minute for the given date.
+ *
+ * @description
+ * Return the end of a minute for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of a minute
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of a minute for 1 December 2014 22:15:45.400:
+ * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))
+ * //=> Mon Dec 01 2014 22:15:59.999
+ */
+export default function endOfMinute(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setSeconds(59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfMinute/test.ts b/date-fns/src/endOfMinute/test.ts
new file mode 100644
index 0000000..13f19ee
--- /dev/null
+++ b/date-fns/src/endOfMinute/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfMinute from '.'
+
+describe('endOfMinute', function() {
+ it('returns the date with the time set to the last millisecond before a minute ends', function() {
+ const date = new Date(2014, 11, 1, 22, 15)
+ const result = endOfMinute(date)
+ assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = endOfMinute(new Date(2014, 11, 1, 22, 15).getTime())
+ assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 11, 1, 22, 15)
+ endOfMinute(date)
+ assert.deepEqual(date, new Date(2014, 11, 1, 22, 15))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfMinute(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfMinute.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfMonth/benchmark.js b/date-fns/src/endOfMonth/benchmark.js
new file mode 100644
index 0000000..30791dd
--- /dev/null
+++ b/date-fns/src/endOfMonth/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfMonth from '.'
+import moment from 'moment'
+
+suite('endOfMonth', function () {
+ benchmark('date-fns', function () {
+ return endOfMonth(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('month')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfMonth/index.d.ts b/date-fns/src/endOfMonth/index.d.ts
new file mode 100644
index 0000000..59e7354
--- /dev/null
+++ b/date-fns/src/endOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfMonth } from 'date-fns'
+export default endOfMonth
diff --git a/date-fns/src/endOfMonth/index.js.flow b/date-fns/src/endOfMonth/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfMonth/index.ts b/date-fns/src/endOfMonth/index.ts
new file mode 100644
index 0000000..e5b8f9c
--- /dev/null
+++ b/date-fns/src/endOfMonth/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfMonth
+ * @category Month Helpers
+ * @summary Return the end of a month for the given date.
+ *
+ * @description
+ * Return the end of a month for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of a month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of a month for 2 September 2014 11:55:00:
+ * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Sep 30 2014 23:59:59.999
+ */
+export default function endOfMonth(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const month = date.getMonth()
+ date.setFullYear(date.getFullYear(), month + 1, 0)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfMonth/test.ts b/date-fns/src/endOfMonth/test.ts
new file mode 100644
index 0000000..bdc8494
--- /dev/null
+++ b/date-fns/src/endOfMonth/test.ts
@@ -0,0 +1,52 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfMonth from '.'
+
+describe('endOfMonth', function() {
+ it('returns the date with the time set to 23:59:59.999 and the date set to the last day of a month', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = endOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = endOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ endOfMonth(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ describe('edge cases', function() {
+ it('works for last month in year', function() {
+ const date = new Date(2014, 11 /* Dec */, 1, 0, 0, 0)
+ const result = endOfMonth(date)
+ assert.deepEqual(
+ result,
+ new Date(2014, 11 /* Dec */, 31, 23, 59, 59, 999)
+ )
+ })
+
+ it('works for last day of month', function() {
+ const date = new Date(2014, 9 /* Oct */, 31)
+ const result = endOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 31, 23, 59, 59, 999))
+ })
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfMonth(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfQuarter/benchmark.js b/date-fns/src/endOfQuarter/benchmark.js
new file mode 100644
index 0000000..6ec16a5
--- /dev/null
+++ b/date-fns/src/endOfQuarter/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfQuarter from '.'
+import moment from 'moment'
+
+suite('endOfQuarter', function () {
+ benchmark('date-fns', function () {
+ return endOfQuarter(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('quarter')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfQuarter/index.d.ts b/date-fns/src/endOfQuarter/index.d.ts
new file mode 100644
index 0000000..c91ac76
--- /dev/null
+++ b/date-fns/src/endOfQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfQuarter } from 'date-fns'
+export default endOfQuarter
diff --git a/date-fns/src/endOfQuarter/index.js.flow b/date-fns/src/endOfQuarter/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfQuarter/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfQuarter/index.ts b/date-fns/src/endOfQuarter/index.ts
new file mode 100644
index 0000000..f0ad8a3
--- /dev/null
+++ b/date-fns/src/endOfQuarter/index.ts
@@ -0,0 +1,35 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfQuarter
+ * @category Quarter Helpers
+ * @summary Return the end of a year quarter for the given date.
+ *
+ * @description
+ * Return the end of a year quarter for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of a quarter
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of a quarter for 2 September 2014 11:55:00:
+ * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Sep 30 2014 23:59:59.999
+ */
+export default function endOfQuarter(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const currentMonth = date.getMonth()
+ const month = currentMonth - (currentMonth % 3) + 3
+ date.setMonth(month, 0)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfQuarter/test.ts b/date-fns/src/endOfQuarter/test.ts
new file mode 100644
index 0000000..11d2e5c
--- /dev/null
+++ b/date-fns/src/endOfQuarter/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfQuarter from '.'
+
+describe('endOfQuarter', function() {
+ it('returns the date with the time set to 23:59:59.999 and the date set to the last day of a quarter', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = endOfQuarter(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = endOfQuarter(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30, 23, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ endOfQuarter(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfQuarter(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfQuarter.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfSecond/benchmark.js b/date-fns/src/endOfSecond/benchmark.js
new file mode 100644
index 0000000..ce9cc65
--- /dev/null
+++ b/date-fns/src/endOfSecond/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfSecond from '.'
+import moment from 'moment'
+
+suite('endOfSecond', function () {
+ benchmark('date-fns', function () {
+ return endOfSecond(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('second')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfSecond/index.d.ts b/date-fns/src/endOfSecond/index.d.ts
new file mode 100644
index 0000000..3af9fbd
--- /dev/null
+++ b/date-fns/src/endOfSecond/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfSecond } from 'date-fns'
+export default endOfSecond
diff --git a/date-fns/src/endOfSecond/index.js.flow b/date-fns/src/endOfSecond/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfSecond/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfSecond/index.ts b/date-fns/src/endOfSecond/index.ts
new file mode 100644
index 0000000..2f185be
--- /dev/null
+++ b/date-fns/src/endOfSecond/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfSecond
+ * @category Second Helpers
+ * @summary Return the end of a second for the given date.
+ *
+ * @description
+ * Return the end of a second for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of a second
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of a second for 1 December 2014 22:15:45.400:
+ * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))
+ * //=> Mon Dec 01 2014 22:15:45.999
+ */
+export default function endOfSecond(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setMilliseconds(999)
+ return date
+}
diff --git a/date-fns/src/endOfSecond/test.ts b/date-fns/src/endOfSecond/test.ts
new file mode 100644
index 0000000..bd67ecd
--- /dev/null
+++ b/date-fns/src/endOfSecond/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfSecond from '.'
+
+describe('endOfSecond', function() {
+ it('returns the date with the time set to the last millisecond before a second ends', function() {
+ const date = new Date(2014, 11, 1, 22, 15, 30)
+ const result = endOfSecond(date)
+ assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 30, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45).getTime())
+ assert.deepEqual(result, new Date(2014, 11, 1, 22, 15, 45, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 11, 1, 22, 15, 15, 300)
+ endOfSecond(date)
+ assert.deepEqual(date, new Date(2014, 11, 1, 22, 15, 15, 300))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfSecond(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfSecond.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfToday/benchmark.js b/date-fns/src/endOfToday/benchmark.js
new file mode 100644
index 0000000..515c528
--- /dev/null
+++ b/date-fns/src/endOfToday/benchmark.js
@@ -0,0 +1,9 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfToday from '.'
+
+suite('endOfToday', () => {
+ benchmark('date-fns', () => endOfToday())
+})
diff --git a/date-fns/src/endOfToday/index.d.ts b/date-fns/src/endOfToday/index.d.ts
new file mode 100644
index 0000000..30de098
--- /dev/null
+++ b/date-fns/src/endOfToday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfToday } from 'date-fns'
+export default endOfToday
diff --git a/date-fns/src/endOfToday/index.js.flow b/date-fns/src/endOfToday/index.js.flow
new file mode 100644
index 0000000..26bde32
--- /dev/null
+++ b/date-fns/src/endOfToday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: () => Date
diff --git a/date-fns/src/endOfToday/index.ts b/date-fns/src/endOfToday/index.ts
new file mode 100644
index 0000000..9d0c180
--- /dev/null
+++ b/date-fns/src/endOfToday/index.ts
@@ -0,0 +1,28 @@
+import endOfDay from '../endOfDay/index'
+
+/**
+ * @name endOfToday
+ * @category Day Helpers
+ * @summary Return the end of today.
+ * @pure false
+ *
+ * @description
+ * Return the end of today.
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @returns {Date} the end of today
+ *
+ * @example
+ * // If today is 6 October 2014:
+ * var result = endOfToday()
+ * //=> Mon Oct 6 2014 23:59:59.999
+ */
+export default function endOfToday(): Date {
+ return endOfDay(Date.now())
+}
diff --git a/date-fns/src/endOfToday/test.ts b/date-fns/src/endOfToday/test.ts
new file mode 100644
index 0000000..8aa0e69
--- /dev/null
+++ b/date-fns/src/endOfToday/test.ts
@@ -0,0 +1,24 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon, { SinonFakeTimers } from 'sinon'
+import endOfToday from '.'
+
+describe('endOfToday', () => {
+ let clock: SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 14, 30, 45, 500).getTime()
+ )
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns the current date with the time settled to 23:59:59.999', () => {
+ const result = endOfToday()
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 25, 23, 59, 59, 999))
+ })
+})
diff --git a/date-fns/src/endOfTomorrow/benchmark.js b/date-fns/src/endOfTomorrow/benchmark.js
new file mode 100644
index 0000000..c2b7e6b
--- /dev/null
+++ b/date-fns/src/endOfTomorrow/benchmark.js
@@ -0,0 +1,9 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfTomorrow from '.'
+
+suite('endOfTomorrow', () => {
+ benchmark('date-fns', () => endOfTomorrow())
+})
diff --git a/date-fns/src/endOfTomorrow/index.d.ts b/date-fns/src/endOfTomorrow/index.d.ts
new file mode 100644
index 0000000..df5619e
--- /dev/null
+++ b/date-fns/src/endOfTomorrow/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfTomorrow } from 'date-fns'
+export default endOfTomorrow
diff --git a/date-fns/src/endOfTomorrow/index.js.flow b/date-fns/src/endOfTomorrow/index.js.flow
new file mode 100644
index 0000000..26bde32
--- /dev/null
+++ b/date-fns/src/endOfTomorrow/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: () => Date
diff --git a/date-fns/src/endOfTomorrow/index.ts b/date-fns/src/endOfTomorrow/index.ts
new file mode 100644
index 0000000..a196b1d
--- /dev/null
+++ b/date-fns/src/endOfTomorrow/index.ts
@@ -0,0 +1,34 @@
+/**
+ * @name endOfTomorrow
+ * @category Day Helpers
+ * @summary Return the end of tomorrow.
+ * @pure false
+ *
+ * @description
+ * Return the end of tomorrow.
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `new Date()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @returns {Date} the end of tomorrow
+ *
+ * @example
+ * // If today is 6 October 2014:
+ * const result = endOfTomorrow()
+ * //=> Tue Oct 7 2014 23:59:59.999
+ */
+export default function endOfTomorrow(): Date {
+ const now = new Date()
+ const year = now.getFullYear()
+ const month = now.getMonth()
+ const day = now.getDate()
+
+ const date = new Date(0)
+ date.setFullYear(year, month, day + 1)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfTomorrow/test.ts b/date-fns/src/endOfTomorrow/test.ts
new file mode 100644
index 0000000..01e5afe
--- /dev/null
+++ b/date-fns/src/endOfTomorrow/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import endOfTomorrow from '.'
+
+describe('endOfTomorrow', function() {
+ it('returns tomorrow with the time settled to 23:59:59.999', function() {
+ const clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 14, 30, 45, 500).getTime()
+ )
+
+ const result = endOfTomorrow()
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 26, 23, 59, 59, 999))
+
+ clock.restore()
+ })
+
+ it('handles dates before 100 AD', function() {
+ const now = new Date(0)
+ now.setFullYear(14, 8 /* Sep */, 25)
+ now.setHours(14, 30, 45, 500)
+ const clock = sinon.useFakeTimers(now.getTime())
+
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(14, 8 /* Sep */, 26)
+ expectedResult.setHours(23, 59, 59, 999)
+ const result = endOfTomorrow()
+ assert.deepEqual(result, expectedResult)
+
+ clock.restore()
+ })
+})
diff --git a/date-fns/src/endOfWeek/benchmark.js b/date-fns/src/endOfWeek/benchmark.js
new file mode 100644
index 0000000..4731dc7
--- /dev/null
+++ b/date-fns/src/endOfWeek/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfWeek from '.'
+import moment from 'moment'
+
+suite('endOfWeek', function () {
+ benchmark('date-fns', function () {
+ return endOfWeek(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('week')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfWeek/index.d.ts b/date-fns/src/endOfWeek/index.d.ts
new file mode 100644
index 0000000..50a77a3
--- /dev/null
+++ b/date-fns/src/endOfWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfWeek } from 'date-fns'
+export default endOfWeek
diff --git a/date-fns/src/endOfWeek/index.js.flow b/date-fns/src/endOfWeek/index.js.flow
new file mode 100644
index 0000000..9285b67
--- /dev/null
+++ b/date-fns/src/endOfWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => Date
diff --git a/date-fns/src/endOfWeek/index.ts b/date-fns/src/endOfWeek/index.ts
new file mode 100644
index 0000000..f04a6f0
--- /dev/null
+++ b/date-fns/src/endOfWeek/index.ts
@@ -0,0 +1,67 @@
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, WeekStartOptions } from '../types'
+
+/**
+ * @name endOfWeek
+ * @category Week Helpers
+ * @summary Return the end of a week for the given date.
+ *
+ * @description
+ * Return the end of a week for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Date} the end of a week
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // The end of a week for 2 September 2014 11:55:00:
+ * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Sat Sep 06 2014 23:59:59.999
+ *
+ * @example
+ * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:
+ * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
+ * //=> Sun Sep 07 2014 23:59:59.999
+ */
+export default function endOfWeek(
+ dirtyDate: Date | number,
+ dirtyOptions?: LocaleOptions & WeekStartOptions
+): Date {
+ requiredArgs(1, arguments)
+
+ const options = dirtyOptions || {}
+
+ const locale = options.locale
+ const localeWeekStartsOn =
+ locale && locale.options && locale.options.weekStartsOn
+ const defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ const weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ const date = toDate(dirtyDate)
+ const day = date.getDay()
+ const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn)
+
+ date.setDate(date.getDate() + diff)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfWeek/test.ts b/date-fns/src/endOfWeek/test.ts
new file mode 100644
index 0000000..83e1e2c
--- /dev/null
+++ b/date-fns/src/endOfWeek/test.ts
@@ -0,0 +1,144 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import endOfWeek from '.'
+
+describe('endOfWeek', function () {
+ it('returns the date with the time set to 23:59:59:999 and the date set to the last day of a week', function () {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ var result = endOfWeek(date)
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 8 /* Sep */, 6, 23, 59, 59, 999)
+ )
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ var result = endOfWeek(date, { weekStartsOn: 1 })
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 8 /* Sep */, 7, 23, 59, 59, 999)
+ )
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ var result = endOfWeek(date, {
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ })
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 8 /* Sep */, 7, 23, 59, 59, 999)
+ )
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ var result = endOfWeek(date, {
+ weekStartsOn: 1,
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ })
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 8 /* Sep */, 7, 23, 59, 59, 999)
+ )
+ })
+
+ it('implicitly converts options', function () {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ // @ts-expect-error
+ var result = endOfWeek(date, { weekStartsOn: '1' })
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 8 /* Sep */, 7, 23, 59, 59, 999)
+ )
+ })
+
+ it('accepts a timestamp', function () {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ var result = endOfWeek(date)
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 8 /* Sep */, 6, 23, 59, 59, 999)
+ )
+ })
+
+ it('does not mutate the original date', function () {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ endOfWeek(date)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ describe('edge cases', function () {
+ describe('when the given day is before the start of a week', function () {
+ it('it returns the end of a week', function () {
+ var date = new Date(2014, 9 /* Oct */, 6)
+ var result = endOfWeek(date, { weekStartsOn: 3 })
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 9 /* Oct */, 7, 23, 59, 59, 999)
+ )
+ })
+ })
+
+ describe('when the given day is the start of a week', function () {
+ it('it returns the end of a week', function () {
+ var date = new Date(2014, 9 /* Oct */, 8)
+ var result = endOfWeek(date, { weekStartsOn: 3 })
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 9 /* Oct */, 14, 23, 59, 59, 999)
+ )
+ })
+ })
+
+ describe('when the given day is after the start of a week', function () {
+ it('it returns the end of a week', function () {
+ var date = new Date(2014, 9 /* Oct */, 10)
+ var result = endOfWeek(date, { weekStartsOn: 3 })
+ assert.deepStrictEqual(
+ result,
+ new Date(2014, 9 /* Oct */, 14, 23, 59, 59, 999)
+ )
+ })
+ })
+
+ it('handles the week at the end of a year', function () {
+ var date = new Date(2014, 11 /* Dec */, 29)
+ var result = endOfWeek(date, { weekStartsOn: 5 })
+ assert.deepStrictEqual(
+ result,
+ new Date(2015, 0 /* Jan */, 1, 23, 59, 59, 999)
+ )
+ })
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ var result = endOfWeek(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ // @ts-expect-error
+ var block = endOfWeek.bind(
+ null,
+ new Date(2014, 8 /* Sep */, 2, 11, 55, 0),
+ // $ExpectedMistake
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ // @ts-expect-error
+ assert.throws(endOfWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfYear/benchmark.js b/date-fns/src/endOfYear/benchmark.js
new file mode 100644
index 0000000..c39cc5c
--- /dev/null
+++ b/date-fns/src/endOfYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfYear from '.'
+import moment from 'moment'
+
+suite('endOfYear', function () {
+ benchmark('date-fns', function () {
+ return endOfYear(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.endOf('year')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/endOfYear/index.d.ts b/date-fns/src/endOfYear/index.d.ts
new file mode 100644
index 0000000..63d5191
--- /dev/null
+++ b/date-fns/src/endOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfYear } from 'date-fns'
+export default endOfYear
diff --git a/date-fns/src/endOfYear/index.js.flow b/date-fns/src/endOfYear/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/endOfYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/endOfYear/index.ts b/date-fns/src/endOfYear/index.ts
new file mode 100644
index 0000000..48034ee
--- /dev/null
+++ b/date-fns/src/endOfYear/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name endOfYear
+ * @category Year Helpers
+ * @summary Return the end of a year for the given date.
+ *
+ * @description
+ * Return the end of a year for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of a year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The end of a year for 2 September 2014 11:55:00:
+ * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))
+ * //=> Wed Dec 31 2014 23:59:59.999
+ */
+export default function endOfYear(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ var date = toDate(dirtyDate)
+ var year = date.getFullYear()
+ date.setFullYear(year + 1, 0, 0)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfYear/test.ts b/date-fns/src/endOfYear/test.ts
new file mode 100644
index 0000000..223dba8
--- /dev/null
+++ b/date-fns/src/endOfYear/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import endOfYear from '.'
+
+describe('endOfYear', function() {
+ it('returns the date with the time set to 23:59:59.999 and the date set to the last day of a year', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = endOfYear(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31, 23, 59, 59, 999))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = endOfYear(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31, 23, 59, 59, 999))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ endOfYear(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = endOfYear(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(endOfYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/endOfYesterday/benchmark.js b/date-fns/src/endOfYesterday/benchmark.js
new file mode 100644
index 0000000..e3681e5
--- /dev/null
+++ b/date-fns/src/endOfYesterday/benchmark.js
@@ -0,0 +1,9 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import endOfYesterday from '.'
+
+suite('endOfYesterday', () => {
+ benchmark('date-fns', () => endOfYesterday())
+})
diff --git a/date-fns/src/endOfYesterday/index.d.ts b/date-fns/src/endOfYesterday/index.d.ts
new file mode 100644
index 0000000..b06935b
--- /dev/null
+++ b/date-fns/src/endOfYesterday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfYesterday } from 'date-fns'
+export default endOfYesterday
diff --git a/date-fns/src/endOfYesterday/index.js.flow b/date-fns/src/endOfYesterday/index.js.flow
new file mode 100644
index 0000000..26bde32
--- /dev/null
+++ b/date-fns/src/endOfYesterday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: () => Date
diff --git a/date-fns/src/endOfYesterday/index.ts b/date-fns/src/endOfYesterday/index.ts
new file mode 100644
index 0000000..6207cc5
--- /dev/null
+++ b/date-fns/src/endOfYesterday/index.ts
@@ -0,0 +1,34 @@
+/**
+ * @name endOfYesterday
+ * @category Day Helpers
+ * @summary Return the end of yesterday.
+ * @pure false
+ *
+ * @description
+ * Return the end of yesterday.
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `new Date()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @returns {Date} the end of yesterday
+ *
+ * @example
+ * // If today is 6 October 2014:
+ * const result = endOfYesterday()
+ * //=> Sun Oct 5 2014 23:59:59.999
+ */
+export default function endOfYesterday(): Date {
+ const now = new Date()
+ const year = now.getFullYear()
+ const month = now.getMonth()
+ const day = now.getDate()
+
+ const date = new Date(0)
+ date.setFullYear(year, month, day - 1)
+ date.setHours(23, 59, 59, 999)
+ return date
+}
diff --git a/date-fns/src/endOfYesterday/test.ts b/date-fns/src/endOfYesterday/test.ts
new file mode 100644
index 0000000..4046e64
--- /dev/null
+++ b/date-fns/src/endOfYesterday/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import endOfYesterday from '.'
+
+describe('endOfYesterday', () => {
+ it('returns yesterday with the time settled to 23:59:59.999', () => {
+ const clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 14, 30, 45, 500).getTime()
+ )
+
+ const result = endOfYesterday()
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 24, 23, 59, 59, 999))
+
+ clock.restore()
+ })
+
+ it('handles dates before 100 AD', () => {
+ const now = new Date(0)
+ now.setFullYear(14, 8 /* Sep */, 25)
+ now.setHours(14, 30, 45, 500)
+ const clock = sinon.useFakeTimers(now.getTime())
+
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(14, 8 /* Sep */, 24)
+ expectedResult.setHours(23, 59, 59, 999)
+ const result = endOfYesterday()
+ assert.deepEqual(result, expectedResult)
+
+ clock.restore()
+ })
+})
diff --git a/date-fns/src/format/benchmark.js b/date-fns/src/format/benchmark.js
new file mode 100644
index 0000000..38a9f86
--- /dev/null
+++ b/date-fns/src/format/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import format from '.'
+import moment from 'moment'
+
+suite('format', function () {
+ benchmark('date-fns', function () {
+ return format(this.date, 'dddd, MMMM Do YYYY, h:mm:ss a')
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.format('dddd, MMMM Do YYYY, h:mm:ss a')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/format/index.d.ts b/date-fns/src/format/index.d.ts
new file mode 100644
index 0000000..06d38ce
--- /dev/null
+++ b/date-fns/src/format/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { format } from 'date-fns'
+export default format
diff --git a/date-fns/src/format/index.js b/date-fns/src/format/index.js
new file mode 100644
index 0000000..5a532ea
--- /dev/null
+++ b/date-fns/src/format/index.js
@@ -0,0 +1,471 @@
+import isValid from '../isValid/index'
+import defaultLocale from '../locale/en-US/index'
+import subMilliseconds from '../subMilliseconds/index'
+import toDate from '../toDate/index'
+import formatters from '../_lib/format/formatters/index'
+import longFormatters from '../_lib/format/longFormatters/index'
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import {
+ isProtectedDayOfYearToken,
+ isProtectedWeekYearToken,
+ throwProtectedError
+} from '../_lib/protectedTokens/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+// This RegExp consists of three parts separated by `|`:
+// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
+// (one of the certain letters followed by `o`)
+// - (\w)\1* matches any sequences of the same letter
+// - '' matches two quote characters in a row
+// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
+// except a single quote symbol, which ends the sequence.
+// Two quote characters do not end the sequence.
+// If there is no matching single quote
+// then the sequence will continue until the end of the string.
+// - . matches any single character unmatched by previous parts of the RegExps
+var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g
+
+// This RegExp catches symbols escaped by quotes, and also
+// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
+var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g
+
+var escapedStringRegExp = /^'([^]*?)'?$/
+var doubleQuoteRegExp = /''/g
+var unescapedLatinCharacterRegExp = /[a-zA-Z]/
+
+/**
+ * @name format
+ * @category Common Helpers
+ * @summary Format the date.
+ *
+ * @description
+ * Return the formatted date string in the given format. The result may vary by locale.
+ *
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
+ * > See: https://git.io/fxCyr
+ *
+ * The characters wrapped between two single quotes characters (') are escaped.
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
+ * (see the last example)
+ *
+ * Format of the string is based on Unicode Technical Standard #35:
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
+ * with a few additions (see note 7 below the table).
+ *
+ * Accepted patterns:
+ * | Unit | Pattern | Result examples | Notes |
+ * |---------------------------------|---------|-----------------------------------|-------|
+ * | Era | G..GGG | AD, BC | |
+ * | | GGGG | Anno Domini, Before Christ | 2 |
+ * | | GGGGG | A, B | |
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
+ * | | yy | 44, 01, 00, 17 | 5 |
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
+ * | | yyyyy | ... | 3,5 |
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
+ * | | YY | 44, 01, 00, 17 | 5,8 |
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
+ * | | YYYYY | ... | 3,5 |
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
+ * | | RRRRR | ... | 3,5,7 |
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
+ * | | uu | -43, 01, 1900, 2017 | 5 |
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
+ * | | uuuuu | ... | 3,5 |
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
+ * | | QQ | 01, 02, 03, 04 | |
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
+ * | | qq | 01, 02, 03, 04 | |
+ * | | qqq | Q1, Q2, Q3, Q4 | |
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
+ * | | MM | 01, 02, ..., 12 | |
+ * | | MMM | Jan, Feb, ..., Dec | |
+ * | | MMMM | January, February, ..., December | 2 |
+ * | | MMMMM | J, F, ..., D | |
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
+ * | | LL | 01, 02, ..., 12 | |
+ * | | LLL | Jan, Feb, ..., Dec | |
+ * | | LLLL | January, February, ..., December | 2 |
+ * | | LLLLL | J, F, ..., D | |
+ * | Local week of year | w | 1, 2, ..., 53 | |
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
+ * | | ww | 01, 02, ..., 53 | |
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
+ * | | II | 01, 02, ..., 53 | 7 |
+ * | Day of month | d | 1, 2, ..., 31 | |
+ * | | do | 1st, 2nd, ..., 31st | 7 |
+ * | | dd | 01, 02, ..., 31 | |
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
+ * | | DDD | 001, 002, ..., 365, 366 | |
+ * | | DDDD | ... | 3 |
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
+ * | | EEEEE | M, T, W, T, F, S, S | |
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
+ * | | io | 1st, 2nd, ..., 7th | 7 |
+ * | | ii | 01, 02, ..., 07 | 7 |
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
+ * | | ee | 02, 03, ..., 01 | |
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
+ * | | eeeee | M, T, W, T, F, S, S | |
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
+ * | | cc | 02, 03, ..., 01 | |
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
+ * | | ccccc | M, T, W, T, F, S, S | |
+ * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | AM, PM | a..aa | AM, PM | |
+ * | | aaa | am, pm | |
+ * | | aaaa | a.m., p.m. | 2 |
+ * | | aaaaa | a, p | |
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
+ * | | bbb | am, pm, noon, midnight | |
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
+ * | | bbbbb | a, p, n, mi | |
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
+ * | | BBBB | at night, in the morning, ... | 2 |
+ * | | BBBBB | at night, in the morning, ... | |
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
+ * | | hh | 01, 02, ..., 11, 12 | |
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
+ * | | HH | 00, 01, 02, ..., 23 | |
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
+ * | | KK | 01, 02, ..., 11, 00 | |
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
+ * | | kk | 24, 01, 02, ..., 23 | |
+ * | Minute | m | 0, 1, ..., 59 | |
+ * | | mo | 0th, 1st, ..., 59th | 7 |
+ * | | mm | 00, 01, ..., 59 | |
+ * | Second | s | 0, 1, ..., 59 | |
+ * | | so | 0th, 1st, ..., 59th | 7 |
+ * | | ss | 00, 01, ..., 59 | |
+ * | Fraction of second | S | 0, 1, ..., 9 | |
+ * | | SS | 00, 01, ..., 99 | |
+ * | | SSS | 000, 001, ..., 999 | |
+ * | | SSSS | ... | 3 |
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
+ * | | XX | -0800, +0530, Z | |
+ * | | XXX | -08:00, +05:30, Z | |
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
+ * | | xx | -0800, +0530, +0000 | |
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
+ * | Seconds timestamp | t | 512969520 | 7 |
+ * | | tt | ... | 3,7 |
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
+ * | | TT | ... | 3,7 |
+ * | Long localized date | P | 04/29/1453 | 7 |
+ * | | PP | Apr 29, 1453 | 7 |
+ * | | PPP | April 29th, 1453 | 7 |
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
+ * | Long localized time | p | 12:00 AM | 7 |
+ * | | pp | 12:00:00 AM | 7 |
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
+ * Notes:
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
+ * are the same as "stand-alone" units, but are different in some languages.
+ * "Formatting" units are declined according to the rules of the language
+ * in the context of a date. "Stand-alone" units are always nominative singular:
+ *
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
+ *
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
+ *
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
+ * the single quote characters (see below).
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
+ * the output will be the same as default pattern for this unit, usually
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
+ * are marked with "2" in the last column of the table.
+ *
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
+ *
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
+ *
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
+ * The output will be padded with zeros to match the length of the pattern.
+ *
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
+ *
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
+ * These tokens represent the shortest form of the quarter.
+ *
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
+ *
+ * | Year | `y` | `u` |
+ * |------|-----|-----|
+ * | AC 1 | 1 | 1 |
+ * | BC 1 | 1 | 0 |
+ * | BC 2 | 2 | -1 |
+ *
+ * Also `yy` always returns the last two digits of a year,
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
+ *
+ * | Year | `yy` | `uu` |
+ * |------|------|------|
+ * | 1 | 01 | 01 |
+ * | 14 | 14 | 14 |
+ * | 376 | 76 | 376 |
+ * | 1453 | 53 | 1453 |
+ *
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
+ * except local week-numbering years are dependent on `options.weekStartsOn`
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
+ *
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
+ * so right now these tokens fall back to GMT timezones.
+ *
+ * 7. These patterns are not in the Unicode Technical Standard #35:
+ * - `i`: ISO day of week
+ * - `I`: ISO week of year
+ * - `R`: ISO week-numbering year
+ * - `t`: seconds timestamp
+ * - `T`: milliseconds timestamp
+ * - `o`: ordinal number modifier
+ * - `P`: long localized date
+ * - `p`: long localized time
+ *
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
+ *
+ * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The second argument is now required for the sake of explicitness.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ * format(new Date(2016, 0, 1))
+ *
+ * // v2.0.0 onward
+ * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
+ * ```
+ *
+ * - New format string API for `format` function
+ * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
+ * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
+ *
+ * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
+ *
+ * @param {Date|Number} date - the original date
+ * @param {String} format - the string of tokens
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
+ * see: https://git.io/fxCyr
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
+ * see: https://git.io/fxCyr
+ * @returns {String} the formatted date string
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `options.locale` must contain `localize` property
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
+ *
+ * @example
+ * // Represent 11 February 2014 in middle-endian format:
+ * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
+ * //=> '02/11/2014'
+ *
+ * @example
+ * // Represent 2 July 2014 in Esperanto:
+ * import { eoLocale } from 'date-fns/locale/eo'
+ * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
+ * locale: eoLocale
+ * })
+ * //=> '2-a de julio 2014'
+ *
+ * @example
+ * // Escape string by single quote characters:
+ * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
+ * //=> "3 o'clock"
+ */
+export default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
+ requiredArgs(2, arguments)
+
+ var formatStr = String(dirtyFormatStr)
+ var options = dirtyOptions || {}
+
+ var locale = options.locale || defaultLocale
+
+ var localeFirstWeekContainsDate =
+ locale.options && locale.options.firstWeekContainsDate
+ var defaultFirstWeekContainsDate =
+ localeFirstWeekContainsDate == null
+ ? 1
+ : toInteger(localeFirstWeekContainsDate)
+ var firstWeekContainsDate =
+ options.firstWeekContainsDate == null
+ ? defaultFirstWeekContainsDate
+ : toInteger(options.firstWeekContainsDate)
+
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
+ throw new RangeError(
+ 'firstWeekContainsDate must be between 1 and 7 inclusively'
+ )
+ }
+
+ var localeWeekStartsOn = locale.options && locale.options.weekStartsOn
+ var defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ var weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ if (!locale.localize) {
+ throw new RangeError('locale must contain localize property')
+ }
+
+ if (!locale.formatLong) {
+ throw new RangeError('locale must contain formatLong property')
+ }
+
+ var originalDate = toDate(dirtyDate)
+
+ if (!isValid(originalDate)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate)
+ var utcDate = subMilliseconds(originalDate, timezoneOffset)
+
+ var formatterOptions = {
+ firstWeekContainsDate: firstWeekContainsDate,
+ weekStartsOn: weekStartsOn,
+ locale: locale,
+ _originalDate: originalDate
+ }
+
+ var result = formatStr
+ .match(longFormattingTokensRegExp)
+ .map(function(substring) {
+ var firstCharacter = substring[0]
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
+ var longFormatter = longFormatters[firstCharacter]
+ return longFormatter(substring, locale.formatLong, formatterOptions)
+ }
+ return substring
+ })
+ .join('')
+ .match(formattingTokensRegExp)
+ .map(function(substring) {
+ // Replace two single quote characters with one single quote character
+ if (substring === "''") {
+ return "'"
+ }
+
+ var firstCharacter = substring[0]
+ if (firstCharacter === "'") {
+ return cleanEscapedString(substring)
+ }
+
+ var formatter = formatters[firstCharacter]
+ if (formatter) {
+ if (
+ !options.useAdditionalWeekYearTokens &&
+ isProtectedWeekYearToken(substring)
+ ) {
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate)
+ }
+ if (
+ !options.useAdditionalDayOfYearTokens &&
+ isProtectedDayOfYearToken(substring)
+ ) {
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate)
+ }
+ return formatter(utcDate, substring, locale.localize, formatterOptions)
+ }
+
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
+ throw new RangeError(
+ 'Format string contains an unescaped latin alphabet character `' +
+ firstCharacter +
+ '`'
+ )
+ }
+
+ return substring
+ })
+ .join('')
+
+ return result
+}
+
+function cleanEscapedString(input) {
+ return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'")
+}
diff --git a/date-fns/src/format/index.js.flow b/date-fns/src/format/index.js.flow
new file mode 100644
index 0000000..ca79393
--- /dev/null
+++ b/date-fns/src/format/index.js.flow
@@ -0,0 +1,62 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ format: string,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: number,
+ useAdditionalWeekYearTokens?: boolean,
+ useAdditionalDayOfYearTokens?: boolean,
+ }
+) => string
diff --git a/date-fns/src/format/test.js b/date-fns/src/format/test.js
new file mode 100644
index 0000000..97ad003
--- /dev/null
+++ b/date-fns/src/format/test.js
@@ -0,0 +1,813 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import format from '.'
+
+describe('format', function () {
+ var date = new Date(1986, 3 /* Apr */, 4, 10, 32, 55, 123)
+
+ var offset = date.getTimezoneOffset()
+ var absoluteOffset = Math.abs(offset)
+ var hours = Math.floor(absoluteOffset / 60)
+ var hoursLeadingZero = hours < 10 ? '0' : ''
+ var minutes = absoluteOffset % 60
+ var minutesLeadingZero = minutes < 10 ? '0' : ''
+ var sign = offset > 0 ? '-' : '+'
+
+ var timezone =
+ sign + hoursLeadingZero + hours + ':' + minutesLeadingZero + minutes
+ var timezoneShort = timezone.replace(':', '')
+ var timezoneWithOptionalMinutesShort =
+ minutes === 0 ? sign + hoursLeadingZero + hours : timezoneShort
+
+ var timezoneWithZ = offset === 0 ? 'Z' : timezone
+ var timezoneWithZShort = offset === 0 ? 'Z' : timezoneShort
+ var timezoneWithOptionalMinutesAndZShort =
+ offset === 0 ? 'Z' : timezoneWithOptionalMinutesShort
+
+ var timezoneGMTShort =
+ minutes === 0
+ ? 'GMT' + sign + hours
+ : 'GMT' + sign + hours + ':' + minutesLeadingZero + minutes
+ var timezoneGMT = 'GMT' + timezone
+
+ var timestamp = date.getTime().toString()
+ var secondsTimestamp = Math.floor(date.getTime() / 1000).toString()
+
+ it('accepts a timestamp', function () {
+ var date = new Date(2014, 3, 4).getTime()
+ assert(format(date, 'yyyy-MM-dd') === '2014-04-04')
+ })
+
+ it('escapes characters between the single quote characters', function () {
+ var result = format(date, "'yyyy-'MM-dd'THH:mm:ss.SSSX' yyyy-'MM-dd'")
+ assert(result === 'yyyy-04-04THH:mm:ss.SSSX 1986-MM-dd')
+ })
+
+ it('two single quote characters are transformed into a "real" single quote', function () {
+ var date = new Date(2014, 3, 4, 5)
+ assert(format(date, "''h 'o''clock'''") === "'5 o'clock'")
+ })
+
+ it('accepts new line charactor', function () {
+ var date = new Date(2014, 3, 4, 5)
+ assert.equal(format(date, "yyyy-MM-dd'\n'HH:mm:ss"), '2014-04-04\n05:00:00')
+ })
+
+ describe('ordinal numbers', function () {
+ it('ordinal day of an ordinal month', function () {
+ var result = format(date, "do 'day of the' Mo 'month of' yyyy")
+ assert(result === '4th day of the 4th month of 1986')
+ })
+
+ it('should return a correct ordinal number', function () {
+ var result = []
+ for (var i = 1; i <= 31; i++) {
+ result.push(format(new Date(2015, 0, i), 'do'))
+ }
+ var expected = [
+ '1st',
+ '2nd',
+ '3rd',
+ '4th',
+ '5th',
+ '6th',
+ '7th',
+ '8th',
+ '9th',
+ '10th',
+ '11th',
+ '12th',
+ '13th',
+ '14th',
+ '15th',
+ '16th',
+ '17th',
+ '18th',
+ '19th',
+ '20th',
+ '21st',
+ '22nd',
+ '23rd',
+ '24th',
+ '25th',
+ '26th',
+ '27th',
+ '28th',
+ '29th',
+ '30th',
+ '31st',
+ ]
+ assert.deepEqual(result, expected)
+ })
+ })
+
+ it('era', function () {
+ var result = format(date, 'G GG GGG GGGG GGGGG')
+ assert(result === 'AD AD AD Anno Domini A')
+ })
+
+ describe('year', function () {
+ describe('regular year', function () {
+ it('works as expected', function () {
+ var result = format(date, 'y yo yy yyy yyyy yyyyy')
+ assert(result === '1986 1986th 86 1986 1986 01986')
+ })
+
+ it('1 BC formats as 1', function () {
+ var date = new Date(0)
+ date.setFullYear(0, 0 /* Jan */, 1)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'y')
+ assert(result === '1')
+ })
+
+ it('2 BC formats as 2', function () {
+ var date = new Date(0)
+ date.setFullYear(-1, 0 /* Jan */, 1)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'y')
+ assert(result === '2')
+ })
+ })
+
+ describe('local week-numbering year', function () {
+ it('works as expected', function () {
+ var result = format(date, 'Y Yo YY YYY YYYY YYYYY', {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert(result === '1986 1986th 86 1986 1986 01986')
+ })
+
+ it('the first week of the next year', function () {
+ var result = format(new Date(2013, 11 /* Dec */, 29), 'YYYY', {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert(result === '2014')
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in options', function () {
+ var result = format(new Date(2013, 11 /* Dec */, 29), 'YYYY', {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ useAdditionalWeekYearTokens: true,
+ })
+ assert(result === '2013')
+ })
+
+ it('the first week of year', function () {
+ var result = format(new Date(2016, 0 /* Jan */, 1), 'YYYY', {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert(result === '2016')
+ })
+
+ it('1 BC formats as 1', function () {
+ var date = new Date(0)
+ date.setFullYear(0, 6 /* Jul */, 2)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'Y')
+ assert(result === '1')
+ })
+
+ it('2 BC formats as 2', function () {
+ var date = new Date(0)
+ date.setFullYear(-1, 6 /* Jul */, 2)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'Y')
+ assert(result === '2')
+ })
+ })
+
+ describe('ISO week-numbering year', function () {
+ it('works as expected', function () {
+ var result = format(date, 'R RR RRR RRRR RRRRR')
+ assert(result === '1986 1986 1986 1986 01986')
+ })
+
+ it('the first week of the next year', function () {
+ var result = format(new Date(2013, 11 /* Dec */, 30), 'RRRR')
+ assert(result === '2014')
+ })
+
+ it('the last week of the previous year', function () {
+ var result = format(new Date(2016, 0 /* Jan */, 1), 'RRRR')
+ assert(result === '2015')
+ })
+
+ it('1 BC formats as 0', function () {
+ var date = new Date(0)
+ date.setFullYear(0, 6 /* Jul */, 2)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'R')
+ assert(result === '0')
+ })
+
+ it('2 BC formats as -1', function () {
+ var date = new Date(0)
+ date.setFullYear(-1, 6 /* Jul */, 2)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'R')
+ assert(result === '-1')
+ })
+ })
+
+ describe('extended year', function () {
+ it('works as expected', function () {
+ var result = format(date, 'u uu uuu uuuu uuuuu')
+ assert(result === '1986 1986 1986 1986 01986')
+ })
+
+ it('1 BC formats as 0', function () {
+ var date = new Date(0)
+ date.setFullYear(0, 0, 1)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'u')
+ assert(result === '0')
+ })
+
+ it('2 BC formats as -1', function () {
+ var date = new Date(0)
+ date.setFullYear(-1, 0, 1)
+ date.setHours(0, 0, 0, 0)
+ var result = format(date, 'u')
+ assert(result === '-1')
+ })
+ })
+ })
+
+ describe('quarter', function () {
+ it('formatting quarter', function () {
+ var result = format(date, 'Q Qo QQ QQQ QQQQ QQQQQ')
+ assert(result === '2 2nd 02 Q2 2nd quarter 2')
+ })
+
+ it('stand-alone quarter', function () {
+ var result = format(date, 'q qo qq qqq qqqq qqqqq')
+ assert(result === '2 2nd 02 Q2 2nd quarter 2')
+ })
+
+ it('returns a correct quarter for each month', function () {
+ var result = []
+ for (var i = 0; i <= 11; i++) {
+ result.push(format(new Date(1986, i, 1), 'Q'))
+ }
+ var expected = [
+ '1',
+ '1',
+ '1',
+ '2',
+ '2',
+ '2',
+ '3',
+ '3',
+ '3',
+ '4',
+ '4',
+ '4',
+ ]
+ assert.deepEqual(result, expected)
+ })
+ })
+
+ describe('month', function () {
+ it('formatting month', function () {
+ var result = format(date, 'M Mo MM MMM MMMM MMMMM')
+ assert(result === '4 4th 04 Apr April A')
+ })
+
+ it('stand-alone month', function () {
+ var result = format(date, 'L Lo LL LLL LLLL LLLLL')
+ assert(result === '4 4th 04 Apr April A')
+ })
+ })
+
+ describe('week', function () {
+ describe('local week of year', function () {
+ it('works as expected', function () {
+ var date = new Date(1986, 3 /* Apr */, 6)
+ var result = format(date, 'w wo ww')
+ assert(result === '15 15th 15')
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in options', function () {
+ var date = new Date(1986, 3 /* Apr */, 6)
+ var result = format(date, 'w wo ww', {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ })
+ assert(result === '14 14th 14')
+ })
+ })
+
+ it('ISO week of year', function () {
+ var date = new Date(1986, 3 /* Apr */, 6)
+ var result = format(date, 'I Io II')
+ assert(result === '14 14th 14')
+ })
+ })
+
+ describe('day', function () {
+ it('date', function () {
+ var result = format(date, 'd do dd')
+ assert(result === '4 4th 04')
+ })
+
+ describe('day of year', function () {
+ it('works as expected', function () {
+ var result = format(date, 'D Do DD DDD DDDDD', {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert(result === '94 94th 94 094 00094')
+ })
+
+ it('returns a correct day number for the last day of a leap year', function () {
+ var result = format(
+ new Date(1992, 11 /* Dec */, 31, 23, 59, 59, 999),
+ 'D',
+ { useAdditionalDayOfYearTokens: true }
+ )
+ assert(result === '366')
+ })
+ })
+ })
+
+ describe('week day', function () {
+ describe('day of week', function () {
+ it('works as expected', function () {
+ var result = format(date, 'E EE EEE EEEE EEEEE EEEEEE')
+ assert(result === 'Fri Fri Fri Friday F Fr')
+ })
+ })
+
+ describe('ISO day of week', function () {
+ it('works as expected', function () {
+ var result = format(date, 'i io ii iii iiii iiiii iiiiii')
+ assert(result === '5 5th 05 Fri Friday F Fr')
+ })
+
+ it('returns a correct day of an ISO week', function () {
+ var result = []
+ for (var i = 1; i <= 7; i++) {
+ result.push(format(new Date(1986, 8 /* Sep */, i), 'i'))
+ }
+ var expected = ['1', '2', '3', '4', '5', '6', '7']
+ assert.deepEqual(result, expected)
+ })
+ })
+
+ describe('formatting day of week', function () {
+ it('works as expected', function () {
+ var result = format(date, 'e eo ee eee eeee eeeee eeeeee')
+ assert(result === '6 6th 06 Fri Friday F Fr')
+ })
+
+ it('by default, 1 is Sunday, 2 is Monday, ...', function () {
+ var result = []
+ for (var i = 7; i <= 13; i++) {
+ result.push(format(new Date(1986, 8 /* Sep */, i), 'e'))
+ }
+ var expected = ['1', '2', '3', '4', '5', '6', '7']
+ assert.deepEqual(result, expected)
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = []
+ for (var i = 1; i <= 7; i++) {
+ result.push(
+ format(new Date(1986, 8 /* Sep */, i), 'e', { weekStartsOn: 1 })
+ )
+ }
+ var expected = ['1', '2', '3', '4', '5', '6', '7']
+ assert.deepEqual(result, expected)
+ })
+ })
+
+ describe('stand-alone day of week', function () {
+ it('works as expected', function () {
+ var result = format(date, 'c co cc ccc cccc ccccc cccccc')
+ assert(result === '6 6th 06 Fri Friday F Fr')
+ })
+
+ it('by default, 1 is Sunday, 2 is Monday, ...', function () {
+ var result = []
+ for (var i = 7; i <= 13; i++) {
+ result.push(format(new Date(1986, 8 /* Sep */, i), 'c'))
+ }
+ var expected = ['1', '2', '3', '4', '5', '6', '7']
+ assert.deepEqual(result, expected)
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = []
+ for (var i = 1; i <= 7; i++) {
+ result.push(
+ format(new Date(1986, 8 /* Sep */, i), 'c', { weekStartsOn: 1 })
+ )
+ }
+ var expected = ['1', '2', '3', '4', '5', '6', '7']
+ assert.deepEqual(result, expected)
+ })
+ })
+ })
+
+ describe('day period and hour', function () {
+ it('hour [1-12]', function () {
+ var result = format(new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0), 'h ho hh')
+ assert(result === '12 12th 12')
+ })
+
+ it('hour [0-23]', function () {
+ var result = format(new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0), 'H Ho HH')
+ assert(result === '0 0th 00')
+ })
+
+ it('hour [0-11]', function () {
+ var result = format(new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0), 'K Ko KK')
+ assert(result === '0 0th 00')
+ })
+
+ it('hour [1-24]', function () {
+ var result = format(new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0), 'k ko kk')
+ assert(result === '24 24th 24')
+ })
+
+ describe('AM, PM', function () {
+ it('works as expected', function () {
+ var result = format(
+ new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0),
+ 'a aa aaa aaaa aaaaa'
+ )
+ assert(result === 'AM AM am a.m. a')
+ })
+
+ it('12 PM', function () {
+ var date = new Date(1986, 3 /* Apr */, 4, 12, 0, 0, 900)
+ assert(format(date, 'h H K k a') === '12 12 0 12 PM')
+ })
+
+ it('12 AM', function () {
+ var date = new Date(1986, 3 /* Apr */, 6, 0, 0, 0, 900)
+ assert(format(date, 'h H K k a') === '12 0 0 24 AM')
+ })
+ })
+
+ describe('AM, PM, noon, midnight', function () {
+ it('works as expected', function () {
+ var result = format(
+ new Date(1986, 3 /* Apr */, 6, 2, 0, 0, 900),
+ 'b bb bbb bbbb bbbbb'
+ )
+ assert(result === 'AM AM am a.m. a')
+ })
+
+ it('12 PM', function () {
+ var date = new Date(1986, 3 /* Apr */, 4, 12, 0, 0, 900)
+ assert(format(date, 'b bb bbb bbbb bbbbb') === 'noon noon noon noon n')
+ })
+
+ it('12 AM', function () {
+ var date = new Date(1986, 3 /* Apr */, 6, 0, 0, 0, 900)
+ assert(
+ format(date, 'b bb bbb bbbb bbbbb') ===
+ 'midnight midnight midnight midnight mi'
+ )
+ })
+ })
+
+ describe('flexible day periods', function () {
+ it('works as expected', function () {
+ var result = format(date, 'B, BB, BBB, BBBB, BBBBB')
+ assert(
+ result ===
+ 'in the morning, in the morning, in the morning, in the morning, in the morning'
+ )
+ })
+
+ it('12 PM', function () {
+ var date = new Date(1986, 3 /* Apr */, 4, 12, 0, 0, 900)
+ assert(format(date, 'h B') === '12 in the afternoon')
+ })
+
+ it('5 PM', function () {
+ var date = new Date(1986, 3 /* Apr */, 6, 17, 0, 0, 900)
+ assert(format(date, 'h B') === '5 in the evening')
+ })
+
+ it('12 AM', function () {
+ var date = new Date(1986, 3 /* Apr */, 6, 0, 0, 0, 900)
+ assert(format(date, 'h B') === '12 at night')
+ })
+
+ it('4 AM', function () {
+ var date = new Date(1986, 3 /* Apr */, 6, 4, 0, 0, 900)
+ assert(format(date, 'h B') === '4 in the morning')
+ })
+ })
+ })
+
+ it('minute', function () {
+ var result = format(date, 'm mo mm')
+ assert(result === '32 32nd 32')
+ })
+
+ describe('second', function () {
+ it('second', function () {
+ var result = format(date, 's so ss')
+ assert(result === '55 55th 55')
+ })
+
+ it('fractional seconds', function () {
+ var result = format(date, 'S SS SSS SSSS')
+ assert(result === '1 12 123 1230')
+ })
+ })
+
+ describe('time zone', function () {
+ it('ISO-8601 with Z', function () {
+ var result = format(date, 'X XX XXX XXXX XXXXX')
+ var expectedResult = [
+ timezoneWithOptionalMinutesAndZShort,
+ timezoneWithZShort,
+ timezoneWithZ,
+ timezoneWithZShort,
+ timezoneWithZ,
+ ].join(' ')
+ assert(result === expectedResult)
+ })
+
+ it('ISO-8601 without Z', function () {
+ var result = format(date, 'x xx xxx xxxx xxxxx')
+ var expectedResult = [
+ timezoneWithOptionalMinutesShort,
+ timezoneShort,
+ timezone,
+ timezoneShort,
+ timezone,
+ ].join(' ')
+ assert(result === expectedResult)
+ })
+
+ it('GMT', function () {
+ var result = format(date, 'O OO OOO OOOO')
+ var expectedResult = [
+ timezoneGMTShort,
+ timezoneGMTShort,
+ timezoneGMTShort,
+ timezoneGMT,
+ ].join(' ')
+ assert(result === expectedResult)
+ })
+
+ it('Specific non-location', function () {
+ var result = format(date, 'z zz zzz zzzz')
+ var expectedResult = [
+ timezoneGMTShort,
+ timezoneGMTShort,
+ timezoneGMTShort,
+ timezoneGMT,
+ ].join(' ')
+ assert(result === expectedResult)
+ })
+ })
+
+ describe('timestamp', function () {
+ it('seconds timestamp', function () {
+ var result = format(date, 't')
+ assert(result === secondsTimestamp)
+ })
+
+ it('milliseconds timestamp', function () {
+ var result = format(date, 'T')
+ assert(result === timestamp)
+ })
+ })
+
+ describe('long format', function () {
+ it('short date', function () {
+ var result = format(date, 'P')
+ assert(result === '04/04/1986')
+ })
+
+ it('medium date', function () {
+ var result = format(date, 'PP')
+ assert(result === 'Apr 4, 1986')
+ })
+
+ it('long date', function () {
+ var result = format(date, 'PPP')
+ assert(result === 'April 4th, 1986')
+ })
+
+ it('full date', function () {
+ var result = format(date, 'PPPP')
+ assert(result === 'Friday, April 4th, 1986')
+ })
+
+ it('short time', function () {
+ var result = format(date, 'p')
+ assert(result === '10:32 AM')
+ })
+
+ it('medium time', function () {
+ var result = format(date, 'pp')
+ assert(result === '10:32:55 AM')
+ })
+
+ it('long time', function () {
+ var result = format(date, 'ppp')
+ assert(result === '10:32:55 AM ' + timezoneGMTShort)
+ })
+
+ it('full time', function () {
+ var result = format(date, 'pppp')
+ assert(result === '10:32:55 AM ' + timezoneGMT)
+ })
+
+ it('short date + time', function () {
+ var result = format(date, 'Pp')
+ assert(result === '04/04/1986, 10:32 AM')
+ })
+
+ it('medium date + time', function () {
+ var result = format(date, 'PPpp')
+ assert(result === 'Apr 4, 1986, 10:32:55 AM')
+ })
+
+ it('long date + time', function () {
+ var result = format(date, 'PPPppp')
+ assert(result === 'April 4th, 1986 at 10:32:55 AM ' + timezoneGMTShort)
+ })
+
+ it('full date + time', function () {
+ var result = format(date, 'PPPPpppp')
+ assert(result === 'Friday, April 4th, 1986 at 10:32:55 AM ' + timezoneGMT)
+ })
+
+ it('allows arbitrary combination of date and time', function () {
+ var result = format(date, 'Ppppp')
+ assert(result === '04/04/1986, 10:32:55 AM ' + timezoneGMT)
+ })
+ })
+
+ describe('edge cases', function () {
+ it('throws RangeError if the time value is invalid', () => {
+ assert.throws(
+ format.bind(null, new Date(NaN), 'MMMM d, yyyy'),
+ RangeError
+ )
+ })
+
+ it('handles dates before 100 AD', function () {
+ var initialDate = new Date(0)
+ initialDate.setFullYear(7, 11 /* Dec */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ assert(format(initialDate, 'Y ww i') === '8 01 1')
+ })
+ })
+
+ it('implicitly converts `formatString`', function () {
+ // eslint-disable-next-line no-new-wrappers
+ var formatString = new String('yyyy-MM-dd')
+
+ var date = new Date(2014, 3, 4)
+
+ // $ExpectedMistake
+ assert(format(date, formatString) === '2014-04-04')
+ })
+
+ describe('custom locale', function () {
+ it('allows to pass a custom locale', function () {
+ var customLocale = {
+ localize: {
+ month: function () {
+ return 'works'
+ },
+ },
+ formatLong: {
+ date: function () {
+ return "'It' MMMM!"
+ },
+ },
+ }
+ // $ExpectedMistake
+ var result = format(date, 'PPPP', { locale: customLocale })
+ assert(result === 'It works!')
+ })
+
+ it("throws `RangeError` if `options.locale` doesn't have `localize` property", function () {
+ var customLocale = {
+ formatLong: {},
+ }
+ // $ExpectedMistake
+ var block = format.bind(null, date, 'yyyy-MM-dd', {
+ locale: customLocale,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it("throws `RangeError` if `options.locale` doesn't have `formatLong` property", function () {
+ var customLocale = {
+ // $ExpectedMistake
+ localize: {},
+ }
+ // $ExpectedMistake
+ var block = format.bind(null, date, 'yyyy-MM-dd', {
+ locale: customLocale,
+ })
+ assert.throws(block, RangeError)
+ })
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ // $ExpectedMistake
+ var block = format.bind(null, new Date(2007, 11 /* Dec */, 31), 'yyyy', {
+ weekStartsOn: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function () {
+ // $ExpectedMistake
+ var block = format.bind(null, new Date(2007, 11 /* Dec */, 31), 'yyyy', {
+ firstWeekContainsDate: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws RangeError exception if the format string contains an unescaped latin alphabet character', function () {
+ assert.throws(format.bind(null, date, 'yyyy-MM-dd-nnnn'), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(format.bind(null), TypeError)
+ assert.throws(format.bind(null, 1), TypeError)
+ })
+
+ describe('useAdditionalWeekYearTokens and useAdditionalDayOfYearTokens options', () => {
+ it('throws an error if D token is used', () => {
+ const block = format.bind(null, date, 'yyyy-MM-D')
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /(Use `d` instead of `D` \(in `yyyy-MM-D`\) for formatting days of the month to the input `Fri Apr 04 1986 10:32:55).*(`; see: https:\/\/git.io\/fxCyr)/g
+ )
+ })
+
+ it('allows D token if useAdditionalDayOfYearTokens is set to true', () => {
+ const result = format(date, 'yyyy-MM-D', {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert.deepEqual(result, '1986-04-94')
+ })
+
+ it('throws an error if DD token is used', () => {
+ const block = format.bind(null, date, 'yyyy-MM-DD')
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /(Use `dd` instead of `DD` \(in `yyyy-MM-DD`\) for formatting days of the month to the input `Fri Apr 04 1986 10:32:55).*(`; see: https:\/\/git.io\/fxCyr)/g
+ )
+ })
+
+ it('allows DD token if useAdditionalDayOfYearTokens is set to true', () => {
+ const result = format(date, 'yyyy-MM-DD', {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert.deepEqual(result, '1986-04-94')
+ })
+
+ it('throws an error if YY token is used', () => {
+ const block = format.bind(null, date, 'YY-MM-dd')
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /(Use `yy` instead of `YY` \(in `YY-MM-dd`\) for formatting years to the input `Fri Apr 04 1986 10:32:55).*(`; see: https:\/\/git.io\/fxCyr)/g
+ )
+ })
+
+ it('allows YY token if useAdditionalWeekYearTokens is set to true', () => {
+ const result = format(date, 'YY-MM-dd', {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, '86-04-04')
+ })
+
+ it('throws an error if YYYY token is used', () => {
+ const block = format.bind(null, date, 'YYYY-MM-dd')
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /(Use `yyyy` instead of `YYYY` \(in `YYYY-MM-dd`\) for formatting years to the input `Fri Apr 04 1986 10:32:55).*(`; see: https:\/\/git.io\/fxCyr)/g
+ )
+ })
+
+ it('allows YYYY token if useAdditionalWeekYearTokens is set to true', () => {
+ const result = format(date, 'YYYY-MM-dd', {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, '1986-04-04')
+ })
+ })
+})
diff --git a/date-fns/src/formatDistance/benchmark.js b/date-fns/src/formatDistance/benchmark.js
new file mode 100644
index 0000000..94f5ab0
--- /dev/null
+++ b/date-fns/src/formatDistance/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import formatDistance from '.'
+import moment from 'moment'
+
+suite('formatDistance', function () {
+ benchmark('date-fns', function () {
+ return formatDistance(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.from(this.momentB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/formatDistance/index.d.ts b/date-fns/src/formatDistance/index.d.ts
new file mode 100644
index 0000000..656c64a
--- /dev/null
+++ b/date-fns/src/formatDistance/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistance } from 'date-fns'
+export default formatDistance
diff --git a/date-fns/src/formatDistance/index.js.flow b/date-fns/src/formatDistance/index.js.flow
new file mode 100644
index 0000000..b18d1ba
--- /dev/null
+++ b/date-fns/src/formatDistance/index.js.flow
@@ -0,0 +1,60 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ baseDate: Date | number,
+ options?: {
+ includeSeconds?: boolean,
+ addSuffix?: boolean,
+ locale?: Locale,
+ }
+) => string
diff --git a/date-fns/src/formatDistance/index.ts b/date-fns/src/formatDistance/index.ts
new file mode 100644
index 0000000..214087d
--- /dev/null
+++ b/date-fns/src/formatDistance/index.ts
@@ -0,0 +1,240 @@
+import compareAsc from '../compareAsc/index'
+import differenceInMonths from '../differenceInMonths/index'
+import differenceInSeconds from '../differenceInSeconds/index'
+import defaultLocale from '../locale/en-US/index'
+import toDate from '../toDate/index'
+import cloneObject from '../_lib/cloneObject/index'
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions } from '../types';
+
+const MINUTES_IN_DAY = 1440
+const MINUTES_IN_ALMOST_TWO_DAYS = 2520
+const MINUTES_IN_MONTH = 43200
+const MINUTES_IN_TWO_MONTHS = 86400
+
+/**
+ * @name formatDistance
+ * @category Common Helpers
+ * @summary Return the distance between the given dates in words.
+ *
+ * @description
+ * Return the distance between the given dates in words.
+ *
+ * | Distance between dates | Result |
+ * |-------------------------------------------------------------------|---------------------|
+ * | 0 ... 30 secs | less than a minute |
+ * | 30 secs ... 1 min 30 secs | 1 minute |
+ * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |
+ * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |
+ * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |
+ * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |
+ * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |
+ * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |
+ * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |
+ * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |
+ * | 1 yr ... 1 yr 3 months | about 1 year |
+ * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |
+ * | 1 yr 9 months ... 2 yrs | almost 2 years |
+ * | N yrs ... N yrs 3 months | about N years |
+ * | N yrs 3 months ... N yrs 9 months | over N years |
+ * | N yrs 9 months ... N+1 yrs | almost N+1 years |
+ *
+ * With `options.includeSeconds == true`:
+ * | Distance between dates | Result |
+ * |------------------------|----------------------|
+ * | 0 secs ... 5 secs | less than 5 seconds |
+ * | 5 secs ... 10 secs | less than 10 seconds |
+ * | 10 secs ... 20 secs | less than 20 seconds |
+ * | 20 secs ... 40 secs | half a minute |
+ * | 40 secs ... 60 secs | less than a minute |
+ * | 60 secs ... 90 secs | 1 minute |
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `distanceInWords ` to `formatDistance`
+ * to make its name consistent with `format` and `formatRelative`.
+ *
+ * - The order of arguments is swapped to make the function
+ * consistent with `differenceIn...` functions.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * distanceInWords(
+ * new Date(1986, 3, 4, 10, 32, 0),
+ * new Date(1986, 3, 4, 11, 32, 0),
+ * { addSuffix: true }
+ * ) //=> 'in about 1 hour'
+ *
+ * // v2.0.0 onward
+ *
+ * formatDistance(
+ * new Date(1986, 3, 4, 11, 32, 0),
+ * new Date(1986, 3, 4, 10, 32, 0),
+ * { addSuffix: true }
+ * ) //=> 'in about 1 hour'
+ * ```
+ *
+ * @param {Date|Number} date - the date
+ * @param {Date|Number} baseDate - the date to compare with
+ * @param {Object} [options] - an object with options.
+ * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed
+ * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @returns {String} the distance in words
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `baseDate` must not be Invalid Date
+ * @throws {RangeError} `options.locale` must contain `formatDistance` property
+ *
+ * @example
+ * // What is the distance between 2 July 2014 and 1 January 2015?
+ * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))
+ * //=> '6 months'
+ *
+ * @example
+ * // What is the distance between 1 January 2015 00:00:15
+ * // and 1 January 2015 00:00:00, including seconds?
+ * const result = formatDistance(
+ * new Date(2015, 0, 1, 0, 0, 15),
+ * new Date(2015, 0, 1, 0, 0, 0),
+ * { includeSeconds: true }
+ * )
+ * //=> 'less than 20 seconds'
+ *
+ * @example
+ * // What is the distance from 1 January 2016
+ * // to 1 January 2015, with a suffix?
+ * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {
+ * addSuffix: true
+ * })
+ * //=> 'about 1 year ago'
+ *
+ * @example
+ * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
+ * import { eoLocale } from 'date-fns/locale/eo'
+ * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {
+ * locale: eoLocale
+ * })
+ * //=> 'pli ol 1 jaro'
+ */
+
+
+export default function formatDistance(dirtyDate: Date | number, dirtyBaseDate: Date | number, options: LocaleOptions & { includeSeconds?: boolean, addSuffix?: boolean } = {}): string {
+ requiredArgs(2, arguments)
+
+ const locale = options.locale || defaultLocale
+
+ if (!locale.formatDistance) {
+ throw new RangeError('locale must contain formatDistance property')
+ }
+
+ const comparison = compareAsc(dirtyDate, dirtyBaseDate)
+
+ if (isNaN(comparison)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ const localizeOptions = cloneObject(options)
+ localizeOptions.addSuffix = Boolean(options.addSuffix)
+ localizeOptions.comparison = comparison
+
+ let dateLeft
+ let dateRight
+ if (comparison > 0) {
+ dateLeft = toDate(dirtyBaseDate)
+ dateRight = toDate(dirtyDate)
+ } else {
+ dateLeft = toDate(dirtyDate)
+ dateRight = toDate(dirtyBaseDate)
+ }
+
+ const seconds = differenceInSeconds(dateRight, dateLeft)
+ const offsetInSeconds =
+ (getTimezoneOffsetInMilliseconds(dateRight) -
+ getTimezoneOffsetInMilliseconds(dateLeft)) /
+ 1000
+ const minutes = Math.round((seconds - offsetInSeconds) / 60)
+ let months
+
+ // 0 up to 2 mins
+ if (minutes < 2) {
+ if (options.includeSeconds) {
+ if (seconds < 5) {
+ return locale.formatDistance('lessThanXSeconds', 5, localizeOptions)
+ } else if (seconds < 10) {
+ return locale.formatDistance('lessThanXSeconds', 10, localizeOptions)
+ } else if (seconds < 20) {
+ return locale.formatDistance('lessThanXSeconds', 20, localizeOptions)
+ } else if (seconds < 40) {
+ return locale.formatDistance('halfAMinute', null, localizeOptions)
+ } else if (seconds < 60) {
+ return locale.formatDistance('lessThanXMinutes', 1, localizeOptions)
+ } else {
+ return locale.formatDistance('xMinutes', 1, localizeOptions)
+ }
+ } else {
+ if (minutes === 0) {
+ return locale.formatDistance('lessThanXMinutes', 1, localizeOptions)
+ } else {
+ return locale.formatDistance('xMinutes', minutes, localizeOptions)
+ }
+ }
+
+ // 2 mins up to 0.75 hrs
+ } else if (minutes < 45) {
+ return locale.formatDistance('xMinutes', minutes, localizeOptions)
+
+ // 0.75 hrs up to 1.5 hrs
+ } else if (minutes < 90) {
+ return locale.formatDistance('aboutXHours', 1, localizeOptions)
+
+ // 1.5 hrs up to 24 hrs
+ } else if (minutes < MINUTES_IN_DAY) {
+ const hours = Math.round(minutes / 60)
+ return locale.formatDistance('aboutXHours', hours, localizeOptions)
+
+ // 1 day up to 1.75 days
+ } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {
+ return locale.formatDistance('xDays', 1, localizeOptions)
+
+ // 1.75 days up to 30 days
+ } else if (minutes < MINUTES_IN_MONTH) {
+ const days = Math.round(minutes / MINUTES_IN_DAY)
+ return locale.formatDistance('xDays', days, localizeOptions)
+
+ // 1 month up to 2 months
+ } else if (minutes < MINUTES_IN_TWO_MONTHS) {
+ months = Math.round(minutes / MINUTES_IN_MONTH)
+ return locale.formatDistance('aboutXMonths', months, localizeOptions)
+ }
+
+ months = differenceInMonths(dateRight, dateLeft)
+
+ // 2 months up to 12 months
+ if (months < 12) {
+ const nearestMonth = Math.round(minutes / MINUTES_IN_MONTH)
+ return locale.formatDistance('xMonths', nearestMonth, localizeOptions)
+
+ // 1 year up to max Date
+ } else {
+ const monthsSinceStartOfYear = months % 12
+ const years = Math.floor(months / 12)
+
+ // N years up to 1 years 3 months
+ if (monthsSinceStartOfYear < 3) {
+ return locale.formatDistance('aboutXYears', years, localizeOptions)
+
+ // N years 3 months up to N years 9 months
+ } else if (monthsSinceStartOfYear < 9) {
+ return locale.formatDistance('overXYears', years, localizeOptions)
+
+ // N years 9 months up to N year 12 months
+ } else {
+ return locale.formatDistance('almostXYears', years + 1, localizeOptions)
+ }
+ }
+}
diff --git a/date-fns/src/formatDistance/test.ts b/date-fns/src/formatDistance/test.ts
new file mode 100644
index 0000000..2e2cfaa
--- /dev/null
+++ b/date-fns/src/formatDistance/test.ts
@@ -0,0 +1,299 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import formatDistance from '.'
+
+describe('formatDistance', function () {
+ describe('seconds', function () {
+ describe('when the includeSeconds option is true', function () {
+ it('less than 5 seconds', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 3),
+ { includeSeconds: true }
+ )
+ assert(result === 'less than 5 seconds')
+ })
+
+ it('less than 10 seconds', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 7),
+ { includeSeconds: true }
+ )
+ assert(result === 'less than 10 seconds')
+ })
+
+ it('less than 20 seconds', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 15),
+ { includeSeconds: true }
+ )
+ assert(result === 'less than 20 seconds')
+ })
+
+ it('half a minute', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 25),
+ { includeSeconds: true }
+ )
+ assert(result === 'half a minute')
+ })
+
+ it('less than a minute', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 45),
+ { includeSeconds: true }
+ )
+ assert(result === 'less than a minute')
+ })
+
+ it('1 minute', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 0),
+ { includeSeconds: true }
+ )
+ assert(result === '1 minute')
+ })
+ })
+ })
+
+ describe('minutes', function () {
+ it('less than a minute', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 20)
+ )
+ assert(result === 'less than a minute')
+ })
+
+ it('1 minute', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 50)
+ )
+ assert(result === '1 minute')
+ })
+
+ it('n minutes', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 34, 50)
+ )
+ assert(result === '3 minutes')
+ })
+ })
+
+ describe('hours', function () {
+ it('about 1 hour', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 11, 32, 0)
+ )
+ assert(result === 'about 1 hour')
+ })
+
+ it('about n hours', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 13, 32, 0)
+ )
+ assert(result === 'about 3 hours')
+ })
+ })
+
+ describe('days', function () {
+ it('1 day', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 5, 10, 32, 0)
+ )
+ assert(result === '1 day')
+ })
+
+ it('n days', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 7, 10, 32, 0)
+ )
+ assert(result === '3 days')
+ })
+ })
+
+ describe('months', function () {
+ it('about 1 month', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 4, 4, 10, 32, 0)
+ )
+ assert(result === 'about 1 month')
+ })
+
+ it('n months', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 6, 4, 10, 32, 0)
+ )
+ assert(result === '3 months')
+ })
+ })
+
+ describe('years', function () {
+ it('about 1 year', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1987, 3, 4, 10, 32, 0)
+ )
+ assert(result === 'about 1 year')
+ })
+
+ it('over 1 year', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1987, 9, 4, 10, 32, 0)
+ )
+ assert(result === 'over 1 year')
+ })
+
+ it('almost n years', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1989, 2, 4, 10, 32, 0)
+ )
+ assert(result === 'almost 3 years')
+ })
+
+ it('about n years', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1989, 3, 4, 10, 32, 0)
+ )
+ assert(result === 'about 3 years')
+ })
+
+ it('over n years', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1989, 9, 4, 10, 32, 0)
+ )
+ assert(result === 'over 3 years')
+ })
+ })
+
+ it('accepts timestamps', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0).getTime(),
+ new Date(1986, 3, 4, 11, 32, 0).getTime()
+ )
+ assert(result === 'about 1 hour')
+ })
+
+ describe('when the addSuffix option is true', function () {
+ it('adds a past suffix', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 25),
+ { includeSeconds: true, addSuffix: true }
+ )
+ assert(result === 'half a minute ago')
+ })
+
+ it('adds a future suffix', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 11, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { addSuffix: true }
+ )
+ assert(result === 'in about 1 hour')
+ })
+ })
+
+ describe('implicit conversion of options', function () {
+ it('`options.includeSeconds`', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 7),
+ // @ts-expect-error
+ { includeSeconds: 1 }
+ )
+ assert(result === 'less than 10 seconds')
+ })
+
+ it('`options.addSuffix`', function () {
+ const result = formatDistance(
+ new Date(1986, 3, 4, 11, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ // @ts-expect-error
+ { addSuffix: 1 }
+ )
+ assert(result === 'in about 1 hour')
+ })
+ })
+
+ describe('custom locale', function () {
+ it('can be passed to the function', function () {
+ function localizeDistance(token, count, options) {
+ assert(token === 'lessThanXSeconds')
+ assert(count === 5)
+ assert(options.addSuffix === true)
+ assert(options.comparison > 0)
+ return 'It works!'
+ }
+
+ const customLocale = {
+ formatDistance: localizeDistance,
+ }
+
+ const result = formatDistance(
+ new Date(1986, 3, 4, 10, 32, 3),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { includeSeconds: true, addSuffix: true, locale: customLocale }
+ )
+
+ assert(result === 'It works!')
+ })
+
+ describe('does not contain `formatDistance` property', function () {
+ it('throws `RangeError`', function () {
+ const customLocale = {}
+ const block = formatDistance.bind(
+ null,
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 3),
+ { includeSeconds: true, locale: customLocale }
+ )
+ assert.throws(block, RangeError)
+ })
+ })
+ })
+
+ it('throws RangeError if the first date is `Invalid Date`', function () {
+ assert.throws(
+ formatDistance.bind(null, new Date(NaN), new Date(1986, 3, 7, 10, 32, 0)),
+ RangeError
+ )
+ })
+
+ it('throws RangeError if the second date is `Invalid Date`', function () {
+ assert.throws(
+ formatDistance.bind(null, new Date(1986, 3, 4, 10, 32, 0), new Date(NaN)),
+ RangeError
+ )
+ })
+
+ it('throws RangeError if the both dates are `Invalid Date`', function () {
+ assert.throws(
+ formatDistance.bind(null, new Date(NaN), new Date(NaN)),
+ RangeError
+ )
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(formatDistance.bind(null), TypeError)
+ assert.throws(formatDistance.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/formatDistanceStrict/benchmark.js b/date-fns/src/formatDistanceStrict/benchmark.js
new file mode 100644
index 0000000..d468a03
--- /dev/null
+++ b/date-fns/src/formatDistanceStrict/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import formatDistanceStrict from '.'
+import moment from 'moment'
+
+suite('formatDistanceStrict', function () {
+ benchmark('date-fns', function () {
+ return formatDistanceStrict(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.from(this.momentB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/formatDistanceStrict/index.d.ts b/date-fns/src/formatDistanceStrict/index.d.ts
new file mode 100644
index 0000000..89cce20
--- /dev/null
+++ b/date-fns/src/formatDistanceStrict/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistanceStrict } from 'date-fns'
+export default formatDistanceStrict
diff --git a/date-fns/src/formatDistanceStrict/index.js.flow b/date-fns/src/formatDistanceStrict/index.js.flow
new file mode 100644
index 0000000..26c4b15
--- /dev/null
+++ b/date-fns/src/formatDistanceStrict/index.js.flow
@@ -0,0 +1,61 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ baseDate: Date | number,
+ options?: {
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ locale?: Locale,
+ }
+) => string
diff --git a/date-fns/src/formatDistanceStrict/index.ts b/date-fns/src/formatDistanceStrict/index.ts
new file mode 100644
index 0000000..d792e73
--- /dev/null
+++ b/date-fns/src/formatDistanceStrict/index.ts
@@ -0,0 +1,283 @@
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import compareAsc from '../compareAsc/index'
+import toDate from '../toDate/index'
+import cloneObject from '../_lib/cloneObject/index'
+import defaultLocale from '../locale/en-US/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, Unit } from '../types';
+
+const MILLISECONDS_IN_MINUTE = 1000 * 60
+const MINUTES_IN_DAY = 60 * 24
+const MINUTES_IN_MONTH = MINUTES_IN_DAY * 30
+const MINUTES_IN_YEAR = MINUTES_IN_DAY * 365
+
+/**
+ * @name formatDistanceStrict
+ * @category Common Helpers
+ * @summary Return the distance between the given dates in words.
+ *
+ * @description
+ * Return the distance between the given dates in words, using strict units.
+ * This is like `formatDistance`, but does not use helpers like 'almost', 'over',
+ * 'less than' and the like.
+ *
+ * | Distance between dates | Result |
+ * |------------------------|---------------------|
+ * | 0 ... 59 secs | [0..59] seconds |
+ * | 1 ... 59 mins | [1..59] minutes |
+ * | 1 ... 23 hrs | [1..23] hours |
+ * | 1 ... 29 days | [1..29] days |
+ * | 1 ... 11 months | [1..11] months |
+ * | 1 ... N years | [1..N] years |
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `distanceInWordsStrict` to `formatDistanceStrict`
+ * to make its name consistent with `format` and `formatRelative`.
+ *
+ * - The order of arguments is swapped to make the function
+ * consistent with `differenceIn...` functions.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * distanceInWordsStrict(
+ * new Date(2015, 0, 2),
+ * new Date(2014, 6, 2)
+ * ) //=> '6 months'
+ *
+ * // v2.0.0 onward
+ *
+ * formatDistanceStrict(
+ * new Date(2014, 6, 2),
+ * new Date(2015, 0, 2)
+ * ) //=> '6 months'
+ * ```
+ *
+ * - `partialMethod` option is renamed to `roundingMethod`.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * distanceInWordsStrict(
+ * new Date(1986, 3, 4, 10, 32, 0),
+ * new Date(1986, 3, 4, 10, 33, 1),
+ * { partialMethod: 'ceil' }
+ * ) //=> '2 minutes'
+ *
+ * // v2.0.0 onward
+ *
+ * formatDistanceStrict(
+ * new Date(1986, 3, 4, 10, 33, 1),
+ * new Date(1986, 3, 4, 10, 32, 0),
+ * { roundingMethod: 'ceil' }
+ * ) //=> '2 minutes'
+ * ```
+ *
+ * - If `roundingMethod` is not specified, it now defaults to `round` instead of `floor`.
+ *
+ * - `unit` option now accepts one of the strings:
+ * 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * distanceInWordsStrict(
+ * new Date(1986, 3, 4, 10, 32, 0),
+ * new Date(1986, 3, 4, 10, 33, 1),
+ * { unit: 'm' }
+ * )
+ *
+ * // v2.0.0 onward
+ *
+ * formatDistanceStrict(
+ * new Date(1986, 3, 4, 10, 33, 1),
+ * new Date(1986, 3, 4, 10, 32, 0),
+ * { unit: 'minute' }
+ * )
+ * ```
+ *
+ * @param {Date|Number} date - the date
+ * @param {Date|Number} baseDate - the date to compare with
+ * @param {Object} [options] - an object with options.
+ * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
+ * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit
+ * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @returns {String} the distance in words
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `baseDate` must not be Invalid Date
+ * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'
+ * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'
+ * @throws {RangeError} `options.locale` must contain `formatDistance` property
+ *
+ * @example
+ * // What is the distance between 2 July 2014 and 1 January 2015?
+ * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))
+ * //=> '6 months'
+ *
+ * @example
+ * // What is the distance between 1 January 2015 00:00:15
+ * // and 1 January 2015 00:00:00?
+ * const result = formatDistanceStrict(
+ * new Date(2015, 0, 1, 0, 0, 15),
+ * new Date(2015, 0, 1, 0, 0, 0)
+ * )
+ * //=> '15 seconds'
+ *
+ * @example
+ * // What is the distance from 1 January 2016
+ * // to 1 January 2015, with a suffix?
+ * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {
+ * addSuffix: true
+ * })
+ * //=> '1 year ago'
+ *
+ * @example
+ * // What is the distance from 1 January 2016
+ * // to 1 January 2015, in minutes?
+ * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {
+ * unit: 'minute'
+ * })
+ * //=> '525600 minutes'
+ *
+ * @example
+ * // What is the distance from 1 January 2015
+ * // to 28 January 2015, in months, rounded up?
+ * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {
+ * unit: 'month',
+ * roundingMethod: 'ceil'
+ * })
+ * //=> '1 month'
+ *
+ * @example
+ * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?
+ * import { eoLocale } from 'date-fns/locale/eo'
+ * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {
+ * locale: eoLocale
+ * })
+ * //=> '1 jaro'
+ */
+
+export default function formatDistanceStrict(
+ dirtyDate: Date | number,
+ dirtyBaseDate: Date | number,
+ options: LocaleOptions & {
+ addSuffix?: boolean,
+ unit?: Unit,
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ } = {}
+): string {
+ requiredArgs(2, arguments)
+
+ const locale = options.locale || defaultLocale
+
+ if (!locale.formatDistance) {
+ throw new RangeError('locale must contain localize.formatDistance property')
+ }
+
+ const comparison = compareAsc(dirtyDate, dirtyBaseDate)
+
+ if (isNaN(comparison)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ const localizeOptions = cloneObject(options)
+ localizeOptions.addSuffix = Boolean(options.addSuffix)
+ localizeOptions.comparison = comparison
+
+ let dateLeft
+ let dateRight
+ if (comparison > 0) {
+ dateLeft = toDate(dirtyBaseDate)
+ dateRight = toDate(dirtyDate)
+ } else {
+ dateLeft = toDate(dirtyDate)
+ dateRight = toDate(dirtyBaseDate)
+ }
+
+ const roundingMethod =
+ options.roundingMethod == null ? 'round' : String(options.roundingMethod)
+ let roundingMethodFn
+
+ if (roundingMethod === 'floor') {
+ roundingMethodFn = Math.floor
+ } else if (roundingMethod === 'ceil') {
+ roundingMethodFn = Math.ceil
+ } else if (roundingMethod === 'round') {
+ roundingMethodFn = Math.round
+ } else {
+ throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'")
+ }
+
+ const milliseconds = dateRight.getTime() - dateLeft.getTime()
+ const minutes = milliseconds / MILLISECONDS_IN_MINUTE
+
+ const timezoneOffset =
+ getTimezoneOffsetInMilliseconds(dateRight) -
+ getTimezoneOffsetInMilliseconds(dateLeft)
+
+ // Use DST-normalized difference in minutes for years, months and days;
+ // use regular difference in minutes for hours, minutes and seconds.
+ const dstNormalizedMinutes =
+ (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE
+
+ let unit
+ if (options.unit == null) {
+ if (minutes < 1) {
+ unit = 'second'
+ } else if (minutes < 60) {
+ unit = 'minute'
+ } else if (minutes < MINUTES_IN_DAY) {
+ unit = 'hour'
+ } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) {
+ unit = 'day'
+ } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) {
+ unit = 'month'
+ } else {
+ unit = 'year'
+ }
+ } else {
+ unit = String(options.unit)
+ }
+
+ // 0 up to 60 seconds
+ if (unit === 'second') {
+ const seconds = roundingMethodFn(milliseconds / 1000)
+ return locale.formatDistance('xSeconds', seconds, localizeOptions)
+
+ // 1 up to 60 mins
+ } else if (unit === 'minute') {
+ const roundedMinutes = roundingMethodFn(minutes)
+ return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions)
+
+ // 1 up to 24 hours
+ } else if (unit === 'hour') {
+ const hours = roundingMethodFn(minutes / 60)
+ return locale.formatDistance('xHours', hours, localizeOptions)
+
+ // 1 up to 30 days
+ } else if (unit === 'day') {
+ const days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY)
+ return locale.formatDistance('xDays', days, localizeOptions)
+
+ // 1 up to 12 months
+ } else if (unit === 'month') {
+ const months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH)
+ return months === 12 && options.unit !== 'month'
+ ? locale.formatDistance('xYears', 1, localizeOptions)
+ : locale.formatDistance('xMonths', months, localizeOptions)
+
+ // 1 year up to max Date
+ } else if (unit === 'year') {
+ const years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR)
+ return locale.formatDistance('xYears', years, localizeOptions)
+ }
+
+ throw new RangeError(
+ "unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'"
+ )
+}
diff --git a/date-fns/src/formatDistanceStrict/test.ts b/date-fns/src/formatDistanceStrict/test.ts
new file mode 100644
index 0000000..52bb2bd
--- /dev/null
+++ b/date-fns/src/formatDistanceStrict/test.ts
@@ -0,0 +1,524 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import formatDistanceStrict from '.'
+
+describe('formatDistanceStrict', function () {
+ describe('seconds', function () {
+ describe('when no unit is set', function () {
+ it('0 seconds', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 5),
+ new Date(1986, 3, 4, 10, 32, 5)
+ )
+ assert(result === '0 seconds')
+ })
+
+ it('5 seconds', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 5)
+ )
+ assert(result === '5 seconds')
+ })
+ })
+ })
+
+ describe('minutes', function () {
+ it('1 minute', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 0)
+ )
+ assert(result === '1 minute')
+ })
+
+ it('n minutes', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 35, 0)
+ )
+ assert(result === '3 minutes')
+ })
+ })
+
+ describe('hours', function () {
+ it('1 hour', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 11, 32, 0)
+ )
+ assert(result === '1 hour')
+ })
+
+ it('n hours', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 13, 32, 0)
+ )
+ assert(result === '3 hours')
+ })
+ })
+
+ describe('days', function () {
+ it('1 day', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 5, 10, 32, 0)
+ )
+ assert(result === '1 day')
+ })
+
+ it('n days', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 7, 10, 32, 0)
+ )
+ assert(result === '3 days')
+ })
+ })
+
+ describe('months', function () {
+ it('1 month', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 4, 4, 10, 32, 0)
+ )
+ assert(result === '1 month')
+ })
+
+ it('n months', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 6, 4, 10, 32, 0)
+ )
+ assert(result === '3 months')
+ })
+ })
+
+ describe('years', function () {
+ it('returns `1 year` - see issue 2388', () => {
+ const result = formatDistanceStrict(
+ new Date(2015, 0, 2),
+ new Date(2016, 0, 1)
+ )
+ assert(result === '1 year')
+ })
+
+ it('returns `2 years` - see issue 2388', () => {
+ const result = formatDistanceStrict(
+ new Date(2014, 0, 2),
+ new Date(2016, 0, 1)
+ )
+ assert(result === '2 years')
+ })
+
+ it('1 year', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1987, 3, 4, 10, 32, 0)
+ )
+ assert(result === '1 year')
+ })
+
+ it('n years', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1991, 3, 4, 10, 32, 0)
+ )
+ assert(result === '5 years')
+ })
+ })
+
+ describe('when the unit option is supplied', function () {
+ describe('second', function () {
+ it('0 seconds', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'second' }
+ )
+ assert(result === '0 seconds')
+ })
+
+ it('5 seconds', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 5),
+ { unit: 'second' }
+ )
+ assert(result === '5 seconds')
+ })
+
+ it('120 seconds', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 34, 0),
+ { unit: 'second' }
+ )
+ assert(result === '120 seconds')
+ })
+ })
+
+ describe('minute', function () {
+ it('0 minutes', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'minute' }
+ )
+ assert(result === '0 minutes')
+ })
+
+ it('5 minutes', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 37, 0),
+ { unit: 'minute' }
+ )
+ assert(result === '5 minutes')
+ })
+
+ it('120 minutes', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 12, 32, 0),
+ { unit: 'minute' }
+ )
+ assert(result === '120 minutes')
+ })
+ })
+
+ describe('hour', function () {
+ it('0 hours', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'hour' }
+ )
+ assert(result === '0 hours')
+ })
+
+ it('5 hours', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 15, 32, 0),
+ { unit: 'hour' }
+ )
+ assert(result === '5 hours')
+ })
+
+ it('48 hours', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 6, 10, 32, 0),
+ { unit: 'hour' }
+ )
+ assert(result === '48 hours')
+ })
+ })
+
+ describe('day', function () {
+ it('0 days', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'day' }
+ )
+ assert(result === '0 days')
+ })
+
+ it('5 days', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 9, 10, 32, 0),
+ { unit: 'day' }
+ )
+ assert(result === '5 days')
+ })
+
+ it('60 days', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 5, 3, 10, 32, 0),
+ { unit: 'day' }
+ )
+ assert(result === '60 days')
+ })
+ })
+ describe('month', function () {
+ it('0 months', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'month' }
+ )
+ assert(result === '0 months')
+ })
+
+ it('5 months', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 7, 4, 10, 32, 0),
+ { unit: 'month' }
+ )
+ assert(result === '4 months')
+ })
+
+ it('12 months - see issue 2388', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 7, 4, 10, 32, 0),
+ new Date(1985, 7, 4, 10, 32, 0),
+ { unit: 'month' }
+ )
+ assert(result === '12 months')
+ })
+
+ it('24 months', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1988, 3, 4, 10, 32, 0),
+ { unit: 'month' }
+ )
+ assert(result === '24 months')
+ })
+ })
+
+ describe('year', function () {
+ it('0 years', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'year' }
+ )
+ assert(result === '0 years')
+ })
+
+ it('5 years', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1991, 3, 4, 15, 32, 0),
+ { unit: 'year' }
+ )
+ assert(result === '5 years')
+ })
+ })
+ })
+
+ it('accepts timestamps', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0).getTime(),
+ new Date(1986, 3, 4, 11, 32, 0).getTime()
+ )
+ assert(result === '1 hour')
+ })
+
+ describe('when the addSuffix option is true', function () {
+ it('adds a past suffix', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 25),
+ { addSuffix: true }
+ )
+ assert(result === '25 seconds ago')
+ })
+
+ it('adds a future suffix', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 11, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ { addSuffix: true }
+ )
+ assert(result === 'in 1 hour')
+ })
+ })
+
+ describe('when the roundingMethod option is supplied', function () {
+ it('default is "round"', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 59)
+ )
+ assert(result === '2 minutes')
+ })
+
+ it('"floor"', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 59),
+ { roundingMethod: 'floor' }
+ )
+ assert(result === '1 minute')
+ })
+
+ it('"ceil"', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 1),
+ { roundingMethod: 'ceil' }
+ )
+ assert(result === '2 minutes')
+ })
+
+ it('"round" (down)', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 29),
+ { roundingMethod: 'round' }
+ )
+ assert(result === '1 minute')
+ })
+
+ it('"round" (up)', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 30),
+ { roundingMethod: 'round' }
+ )
+ assert(result === '2 minutes')
+ })
+ })
+
+ describe('implicit conversion of options', function () {
+ it('`options.unit`', function () {
+ // eslint-disable-next-line no-new-wrappers
+ const unit = new String('year')
+
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 0),
+ // @ts-expect-error
+ { unit: unit }
+ )
+ assert(result === '0 years')
+ })
+
+ it('`options.addSuffix`', function () {
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 25),
+ // @ts-expect-error
+ { addSuffix: 1 }
+ )
+ assert(result === '25 seconds ago')
+ })
+
+ it('`options.ceil`', function () {
+ // eslint-disable-next-line no-new-wrappers
+ const roundingMethod = new String('ceil')
+
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 1),
+ // @ts-expect-error
+ { roundingMethod: roundingMethod }
+ )
+ assert(result === '2 minutes')
+ })
+ })
+
+ describe('custom locale', function () {
+ it('can be passed to the function', function () {
+ function localizeDistance(token: string, count: number, options: { addSuffix: boolean; comparison: number }) {
+ assert(token === 'xSeconds')
+ assert(count === 25)
+ assert(options.addSuffix === true)
+ assert(options.comparison < 0)
+ return 'It works!'
+ }
+
+ const customLocale = {
+ formatDistance: localizeDistance,
+ }
+
+ const result = formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 32, 25),
+ // @ts-expect-error
+ { addSuffix: true, locale: customLocale }
+ )
+
+ assert(result === 'It works!')
+ })
+
+ describe('does not contain `formatDistance` property', function () {
+ it('throws `RangeError`', function () {
+ const customLocale = {}
+ // @ts-expect-error
+ const block = formatDistanceStrict.bind(
+ null,
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 37, 0),
+ { unit: 'minute', locale: customLocale }
+ )
+ assert.throws(block, RangeError)
+ })
+ })
+ })
+
+ describe('edge cases', function () {
+ it('detects unit correctly for short months', function () {
+ const result = formatDistanceStrict(
+ new Date(2018, 1 /* Feb */, 1),
+ new Date(2018, 2 /* Mar */, 1)
+ )
+ assert(result === '28 days')
+ })
+ })
+
+ it('throws `RangeError` if the first date is `Invalid Date`', function () {
+ assert.throws(
+ formatDistanceStrict.bind(
+ null,
+ new Date(NaN),
+ new Date(1986, 3, 7, 10, 32, 0)
+ ),
+ RangeError
+ )
+ })
+
+ it('throws `RangeError` if the second date is `Invalid Date`', function () {
+ assert.throws(
+ formatDistanceStrict.bind(
+ null,
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(NaN)
+ ),
+ RangeError
+ )
+ })
+
+ it('throws `RangeError` if the both dates are `Invalid Date`', function () {
+ assert.throws(
+ formatDistanceStrict.bind(null, new Date(NaN), new Date(NaN)),
+ RangeError
+ )
+ })
+
+ it("throws `RangeError` if `options.roundingMethod` is not 'floor', 'ceil', 'round' or undefined", function () {
+ const block = () => formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 29),
+ // @ts-expect-error
+ { roundingMethod: 'foobar' }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it("throws `RangeError` if `options.unit` is not 's', 'm', 'h', 'd', 'M', 'Y' or undefined", function () {
+ const block = () => formatDistanceStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ new Date(1986, 3, 4, 10, 33, 29),
+ // @ts-expect-error
+ { unit: 'foobar' }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ // @ts-expect-error
+ assert.throws(formatDistanceStrict.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(formatDistanceStrict.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/formatDistanceToNow/benchmark.js b/date-fns/src/formatDistanceToNow/benchmark.js
new file mode 100644
index 0000000..8a6f444
--- /dev/null
+++ b/date-fns/src/formatDistanceToNow/benchmark.js
@@ -0,0 +1,25 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import moment from 'moment'
+import formatDistanceToNow from '.'
+
+suite(
+ 'formatDistanceToNow',
+ () => {
+ benchmark('date-fns', function() {
+ return formatDistanceToNow(this.date)
+ })
+
+ benchmark('Moment.js', function() {
+ return this.moment.toNow()
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ this.moment = moment()
+ }
+ }
+)
diff --git a/date-fns/src/formatDistanceToNow/index.d.ts b/date-fns/src/formatDistanceToNow/index.d.ts
new file mode 100644
index 0000000..1d8b750
--- /dev/null
+++ b/date-fns/src/formatDistanceToNow/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistanceToNow } from 'date-fns'
+export default formatDistanceToNow
diff --git a/date-fns/src/formatDistanceToNow/index.js b/date-fns/src/formatDistanceToNow/index.js
new file mode 100644
index 0000000..1df29c1
--- /dev/null
+++ b/date-fns/src/formatDistanceToNow/index.js
@@ -0,0 +1,113 @@
+import distanceInWords from '../formatDistance/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name formatDistanceToNow
+ * @category Common Helpers
+ * @summary Return the distance between the given date and now in words.
+ * @pure false
+ *
+ * @description
+ * Return the distance between the given date and now in words.
+ *
+ * | Distance to now | Result |
+ * |-------------------------------------------------------------------|---------------------|
+ * | 0 ... 30 secs | less than a minute |
+ * | 30 secs ... 1 min 30 secs | 1 minute |
+ * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |
+ * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |
+ * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |
+ * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |
+ * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |
+ * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |
+ * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |
+ * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |
+ * | 1 yr ... 1 yr 3 months | about 1 year |
+ * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |
+ * | 1 yr 9 months ... 2 yrs | almost 2 years |
+ * | N yrs ... N yrs 3 months | about N years |
+ * | N yrs 3 months ... N yrs 9 months | over N years |
+ * | N yrs 9 months ... N+1 yrs | almost N+1 years |
+ *
+ * With `options.includeSeconds == true`:
+ * | Distance to now | Result |
+ * |---------------------|----------------------|
+ * | 0 secs ... 5 secs | less than 5 seconds |
+ * | 5 secs ... 10 secs | less than 10 seconds |
+ * | 10 secs ... 20 secs | less than 20 seconds |
+ * | 20 secs ... 40 secs | half a minute |
+ * | 40 secs ... 60 secs | less than a minute |
+ * | 60 secs ... 90 secs | 1 minute |
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `distanceInWordsToNow ` to `formatDistanceToNow`
+ * to make its name consistent with `format` and `formatRelative`.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * distanceInWordsToNow(new Date(2014, 6, 2), { addSuffix: true })
+ * //=> 'in 6 months'
+ *
+ * // v2.0.0 onward
+ *
+ * formatDistanceToNow(new Date(2014, 6, 2), { addSuffix: true })
+ * //=> 'in 6 months'
+ * ```
+ *
+ * @param {Date|Number} date - the given date
+ * @param {Object} [options] - the object with options
+ * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed
+ * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @returns {String} the distance in words
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `options.locale` must contain `formatDistance` property
+ *
+ * @example
+ * // If today is 1 January 2015, what is the distance to 2 July 2014?
+ * var result = formatDistanceToNow(
+ * new Date(2014, 6, 2)
+ * )
+ * //=> '6 months'
+ *
+ * @example
+ * // If now is 1 January 2015 00:00:00,
+ * // what is the distance to 1 January 2015 00:00:15, including seconds?
+ * var result = formatDistanceToNow(
+ * new Date(2015, 0, 1, 0, 0, 15),
+ * {includeSeconds: true}
+ * )
+ * //=> 'less than 20 seconds'
+ *
+ * @example
+ * // If today is 1 January 2015,
+ * // what is the distance to 1 January 2016, with a suffix?
+ * var result = formatDistanceToNow(
+ * new Date(2016, 0, 1),
+ * {addSuffix: true}
+ * )
+ * //=> 'in about 1 year'
+ *
+ * @example
+ * // If today is 1 January 2015,
+ * // what is the distance to 1 August 2016 in Esperanto?
+ * var eoLocale = require('date-fns/locale/eo')
+ * var result = formatDistanceToNow(
+ * new Date(2016, 7, 1),
+ * {locale: eoLocale}
+ * )
+ * //=> 'pli ol 1 jaro'
+ */
+export default function formatDistanceToNow(dirtyDate, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ return distanceInWords(dirtyDate, Date.now(), dirtyOptions)
+}
diff --git a/date-fns/src/formatDistanceToNow/index.js.flow b/date-fns/src/formatDistanceToNow/index.js.flow
new file mode 100644
index 0000000..08687be
--- /dev/null
+++ b/date-fns/src/formatDistanceToNow/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ includeSeconds?: boolean,
+ addSuffix?: boolean,
+ locale?: Locale,
+ }
+) => string
diff --git a/date-fns/src/formatDistanceToNow/test.js b/date-fns/src/formatDistanceToNow/test.js
new file mode 100644
index 0000000..5d85b18
--- /dev/null
+++ b/date-fns/src/formatDistanceToNow/test.js
@@ -0,0 +1,232 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import formatDistanceToNow from '.'
+
+describe('formatDistanceToNow', () => {
+ let clock
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(1986, 3, 4, 10, 32, 0).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ describe('seconds', () => {
+ describe('when the includeSeconds option is true', () => {
+ it('less than 5 seconds', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 58), {
+ includeSeconds: true,
+ })
+ assert(result === 'less than 5 seconds')
+ })
+
+ it('less than 10 seconds', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 52), {
+ includeSeconds: true,
+ })
+ assert(result === 'less than 10 seconds')
+ })
+
+ it('less than 20 seconds', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 45), {
+ includeSeconds: true,
+ })
+ assert(result === 'less than 20 seconds')
+ })
+
+ it('half a minute', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 35), {
+ includeSeconds: true,
+ })
+ assert(result === 'half a minute')
+ })
+
+ it('less than a minute', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 15), {
+ includeSeconds: true,
+ })
+ assert(result === 'less than a minute')
+ })
+
+ it('1 minute', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 0), {
+ includeSeconds: true,
+ })
+ assert(result === '1 minute')
+ })
+ })
+ })
+
+ describe('minutes', () => {
+ it('less than a minute', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 40))
+ assert(result === 'less than a minute')
+ })
+
+ it('1 minute', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 10))
+ assert(result === '1 minute')
+ })
+
+ it('n minutes', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 29, 10))
+ assert(result === '3 minutes')
+ })
+ })
+
+ describe('hours', () => {
+ it('about 1 hour', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 9, 32, 0))
+ assert(result === 'about 1 hour')
+ })
+
+ it('about n hours', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 7, 32, 0))
+ assert(result === 'about 3 hours')
+ })
+ })
+
+ describe('days', () => {
+ it('1 day', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 3, 10, 32, 0))
+ assert(result === '1 day')
+ })
+
+ it('n days', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 1, 10, 32, 0))
+ assert(result === '3 days')
+ })
+ })
+
+ describe('months', () => {
+ it('about 1 month', () => {
+ const result = formatDistanceToNow(new Date(1986, 2, 4, 10, 32, 0))
+ assert(result === 'about 1 month')
+ })
+
+ it('n months', () => {
+ const result = formatDistanceToNow(new Date(1986, 0, 4, 10, 32, 0))
+ assert(result === '3 months')
+ })
+ })
+
+ describe('years', () => {
+ it('about 1 year', () => {
+ const result = formatDistanceToNow(new Date(1985, 3, 4, 10, 32, 0))
+ assert(result === 'about 1 year')
+ })
+
+ it('over 1 year', () => {
+ const result = formatDistanceToNow(new Date(1984, 10, 4, 10, 32, 0))
+ assert(result === 'over 1 year')
+ })
+
+ it('almost n years', () => {
+ const result = formatDistanceToNow(new Date(1983, 4, 4, 10, 32, 0))
+ assert(result === 'almost 3 years')
+ })
+
+ it('about n years', () => {
+ const result = formatDistanceToNow(new Date(1983, 3, 4, 10, 32, 0))
+ assert(result === 'about 3 years')
+ })
+
+ it('over n years', () => {
+ const result = formatDistanceToNow(new Date(1982, 10, 4, 10, 32, 0))
+ assert(result === 'over 3 years')
+ })
+ })
+
+ it('accepts a timestamp', () => {
+ const result = formatDistanceToNow(
+ new Date(1986, 3, 4, 10, 31, 40).getTime()
+ )
+ assert(result === 'less than a minute')
+ })
+
+ describe('when the addSuffix option is true', () => {
+ it('adds a past suffix', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 10, 31, 35), {
+ includeSeconds: true,
+ addSuffix: true,
+ })
+ assert(result === 'half a minute ago')
+ })
+
+ it('adds a future suffix', () => {
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 11, 32, 0), {
+ addSuffix: true,
+ })
+ assert(result === 'in about 1 hour')
+ })
+ })
+
+ describe('implicit conversion of options', () => {
+ it('`options.includeSeconds`', () => {
+ const result = formatDistanceToNow(
+ new Date(1986, 3, 4, 10, 31, 52),
+ // $ExpectedMistake
+ { includeSeconds: 1 }
+ )
+ assert(result === 'less than 10 seconds')
+ })
+
+ it('`options.addSuffix`', () => {
+ const result = formatDistanceToNow(
+ new Date(1986, 3, 4, 11, 32, 0),
+ // $ExpectedMistake
+ { addSuffix: 1 }
+ )
+ assert(result === 'in about 1 hour')
+ })
+ })
+
+ describe('custom locale', () => {
+ it('can be passed to the function', () => {
+ function localizeDistance(token, count, options) {
+ assert(token === 'aboutXHours')
+ assert(count === 1)
+ assert(options.addSuffix === true)
+ assert(options.comparison > 0)
+ return 'It works!'
+ }
+
+ const customLocale = {
+ formatDistance: localizeDistance,
+ }
+
+ const result = formatDistanceToNow(new Date(1986, 3, 4, 11, 32, 0), {
+ addSuffix: true,
+ // $ExpectedMistake
+ locale: customLocale,
+ })
+
+ assert(result === 'It works!')
+ })
+
+ describe('does not contain `distanceInWords` property', () => {
+ it('throws `RangeError`', function () {
+ const customLocale = {}
+ const block = formatDistanceToNow.bind(
+ null,
+ // $ExpectedMistake
+ new Date(1986, 3, 4, 10, 32, 0),
+ { includeSeconds: true, locale: customLocale }
+ )
+ assert.throws(block, RangeError)
+ })
+ })
+ })
+
+ it('throws RangeError if the passed date is `Invalid Date`', function () {
+ assert.throws(formatDistanceToNow.bind(null, new Date(NaN)), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ assert.throws(formatDistanceToNow.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/formatDistanceToNowStrict/benchmark.js b/date-fns/src/formatDistanceToNowStrict/benchmark.js
new file mode 100644
index 0000000..47d9e08
--- /dev/null
+++ b/date-fns/src/formatDistanceToNowStrict/benchmark.js
@@ -0,0 +1,25 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import formatDistanceToNowStrict from '.'
+import moment from 'moment'
+
+suite(
+ 'formatDistanceToNowStrict',
+ function() {
+ benchmark('date-fns', function() {
+ return formatDistanceToNowStrict(this.date)
+ })
+
+ benchmark('Moment.js', function() {
+ return this.moment.toNow()
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ this.moment = moment()
+ }
+ }
+)
diff --git a/date-fns/src/formatDistanceToNowStrict/index.d.ts b/date-fns/src/formatDistanceToNowStrict/index.d.ts
new file mode 100644
index 0000000..4f00e65
--- /dev/null
+++ b/date-fns/src/formatDistanceToNowStrict/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistanceToNowStrict } from 'date-fns'
+export default formatDistanceToNowStrict
diff --git a/date-fns/src/formatDistanceToNowStrict/index.js b/date-fns/src/formatDistanceToNowStrict/index.js
new file mode 100644
index 0000000..2f61d88
--- /dev/null
+++ b/date-fns/src/formatDistanceToNowStrict/index.js
@@ -0,0 +1,82 @@
+import formatDistanceStrict from '../formatDistanceStrict/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name formatDistanceToNowStrict
+ * @category Common Helpers
+ * @summary Return the distance between the given date and now in words.
+ * @pure false
+ *
+ * @description
+ * Return the distance between the given dates in words, using strict units.
+ * This is like `formatDistance`, but does not use helpers like 'almost', 'over',
+ * 'less than' and the like.
+ *
+ * | Distance between dates | Result |
+ * |------------------------|---------------------|
+ * | 0 ... 59 secs | [0..59] seconds |
+ * | 1 ... 59 mins | [1..59] minutes |
+ * | 1 ... 23 hrs | [1..23] hours |
+ * | 1 ... 29 days | [1..29] days |
+ * | 1 ... 11 months | [1..11] months |
+ * | 1 ... N years | [1..N] years |
+ *
+ * @param {Date|Number} date - the given date
+ * @param {Object} [options] - an object with options.
+ * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first
+ * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit
+ * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @returns {String} the distance in words
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `options.locale` must contain `formatDistance` property
+ *
+ * @example
+ * // If today is 1 January 2015, what is the distance to 2 July 2014?
+ * var result = formatDistanceToNowStrict(
+ * new Date(2014, 6, 2)
+ * )
+ * //=> '6 months'
+ *
+ * @example
+ * // If now is 1 January 2015 00:00:00,
+ * // what is the distance to 1 January 2015 00:00:15, including seconds?
+ * var result = formatDistanceToNowStrict(
+ * new Date(2015, 0, 1, 0, 0, 15)
+ * )
+ * //=> '20 seconds'
+ *
+ * @example
+ * // If today is 1 January 2015,
+ * // what is the distance to 1 January 2016, with a suffix?
+ * var result = formatDistanceToNowStrict(
+ * new Date(2016, 0, 1),
+ * {addSuffix: true}
+ * )
+ * //=> 'in 1 year'
+ *
+ * @example
+ * // If today is 28 January 2015,
+ * // what is the distance to 1 January 2015, in months, rounded up??
+ * var result = formatDistanceToNowStrict(new Date(2015, 0, 1), {
+ * unit: 'month',
+ * roundingMethod: 'ceil'
+ * })
+ * //=> '1 month'
+ *
+ * @example
+ * // If today is 1 January 2015,
+ * // what is the distance to 1 August 2016 in Esperanto?
+ * var eoLocale = require('date-fns/locale/eo')
+ * var result = formatDistanceToNowStrict(
+ * new Date(2016, 7, 1),
+ * {locale: eoLocale}
+ * )
+ * //=> '1 jaro'
+ */
+export default function formatDistanceToNowStrict(dirtyDate, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ return formatDistanceStrict(dirtyDate, Date.now(), dirtyOptions)
+}
diff --git a/date-fns/src/formatDistanceToNowStrict/index.js.flow b/date-fns/src/formatDistanceToNowStrict/index.js.flow
new file mode 100644
index 0000000..49fbade
--- /dev/null
+++ b/date-fns/src/formatDistanceToNowStrict/index.js.flow
@@ -0,0 +1,60 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ locale?: Locale,
+ }
+) => string
diff --git a/date-fns/src/formatDistanceToNowStrict/test.js b/date-fns/src/formatDistanceToNowStrict/test.js
new file mode 100644
index 0000000..016476f
--- /dev/null
+++ b/date-fns/src/formatDistanceToNowStrict/test.js
@@ -0,0 +1,422 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import sinon from 'sinon'
+import formatDistanceToNowStrict from '.'
+
+describe('formatDistanceToNowStrict', function () {
+ let clock
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(1986, 3, 4, 10, 32, 0).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ describe('seconds', function () {
+ describe('when no unit is set', function () {
+ it('0 seconds', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 32, 0))
+ assert(result === '0 seconds')
+ })
+
+ it('5 seconds', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 32, 5))
+ assert(result === '5 seconds')
+ })
+ })
+ })
+
+ describe('minutes', function () {
+ it('1 minute', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 33, 0))
+ assert(result === '1 minute')
+ })
+
+ it('n minutes', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 35, 0))
+ assert(result === '3 minutes')
+ })
+ })
+
+ describe('hours', function () {
+ it('1 hour', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 11, 32, 0))
+ assert(result === '1 hour')
+ })
+
+ it('n hours', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 13, 32, 0))
+ assert(result === '3 hours')
+ })
+ })
+
+ describe('days', function () {
+ it('1 day', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 5, 10, 32, 0))
+ assert(result === '1 day')
+ })
+
+ it('n days', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 7, 10, 32, 0))
+ assert(result === '3 days')
+ })
+ })
+
+ describe('months', function () {
+ it('1 month', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 4, 4, 10, 32, 0))
+ assert(result === '1 month')
+ })
+
+ it('n months', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 6, 4, 10, 32, 0))
+ assert(result === '3 months')
+ })
+ })
+
+ describe('years', function () {
+ it('1 year', function () {
+ var result = formatDistanceToNowStrict(new Date(1987, 3, 4, 10, 32, 0))
+ assert(result === '1 year')
+ })
+
+ it('n years', function () {
+ var result = formatDistanceToNowStrict(new Date(1991, 3, 4, 10, 32, 0))
+ assert(result === '5 years')
+ })
+ })
+
+ describe('when the unit option is supplied', function () {
+ describe('second', function () {
+ it('0 seconds', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'second' }
+ )
+ assert(result === '0 seconds')
+ })
+
+ it('5 seconds', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 5),
+ { unit: 'second' }
+ )
+ assert(result === '5 seconds')
+ })
+
+ it('120 seconds', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 34, 0),
+ { unit: 'second' }
+ )
+ assert(result === '120 seconds')
+ })
+ })
+
+ describe('minute', function () {
+ it('0 minutes', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'minute' }
+ )
+ assert(result === '0 minutes')
+ })
+
+ it('5 minutes', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 37, 0),
+ { unit: 'minute' }
+ )
+ assert(result === '5 minutes')
+ })
+
+ it('120 minutes', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 12, 32, 0),
+ { unit: 'minute' }
+ )
+ assert(result === '120 minutes')
+ })
+ })
+
+ describe('hour', function () {
+ it('0 hours', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'hour' }
+ )
+ assert(result === '0 hours')
+ })
+
+ it('5 hours', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 15, 32, 0),
+ { unit: 'hour' }
+ )
+ assert(result === '5 hours')
+ })
+
+ it('48 hours', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 6, 10, 32, 0),
+ { unit: 'hour' }
+ )
+ assert(result === '48 hours')
+ })
+ })
+
+ describe('day', function () {
+ it('0 days', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'day' }
+ )
+ assert(result === '0 days')
+ })
+
+ it('5 days', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 9, 10, 32, 0),
+ { unit: 'day' }
+ )
+ assert(result === '5 days')
+ })
+
+ it('60 days', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 5, 3, 10, 32, 0),
+ { unit: 'day' }
+ )
+ assert(result === '60 days')
+ })
+ })
+ describe('month', function () {
+ it('0 months', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'month' }
+ )
+ assert(result === '0 months')
+ })
+
+ it('5 months', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 7, 4, 10, 32, 0),
+ { unit: 'month' }
+ )
+ assert(result === '4 months')
+ })
+
+ it('24 months', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1988, 3, 4, 10, 32, 0),
+ { unit: 'month' }
+ )
+ assert(result === '24 months')
+ })
+ })
+
+ describe('year', function () {
+ it('returns `1 year` - see issue 2388', () => {
+ const result = formatDistanceToNowStrict(
+ new Date(1985, 3, 4, 10, 32, 0)
+ )
+ assert(result === '1 year')
+ })
+
+ it('returns `2 years` - see issue 2388', () => {
+ const result = formatDistanceToNowStrict(
+ new Date(1984, 3, 4, 10, 32, 0)
+ )
+ assert(result === '2 years')
+ })
+
+ it('0 years', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ { unit: 'year' }
+ )
+ assert(result === '0 years')
+ })
+
+ it('5 years', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1991, 3, 4, 15, 32, 0),
+ { unit: 'year' }
+ )
+ assert(result === '5 years')
+ })
+ })
+ })
+
+ it('accepts timestamps', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 11, 32, 0).getTime()
+ )
+ assert(result === '1 hour')
+ })
+
+ describe('when the addSuffix option is true', function () {
+ it('adds a past suffix', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 31, 35), {
+ addSuffix: true,
+ })
+ assert(result === '25 seconds ago')
+ })
+
+ it('adds a future suffix', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 11, 32, 0), {
+ addSuffix: true,
+ })
+ assert(result === 'in 1 hour')
+ })
+ })
+
+ describe('when the roundingMethod option is supplied', function () {
+ it('default is "round"', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 33, 59))
+ assert(result === '2 minutes')
+ })
+
+ it('"floor"', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 33, 59), {
+ roundingMethod: 'floor',
+ })
+ assert(result === '1 minute')
+ })
+
+ it('"ceil"', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 33, 1), {
+ roundingMethod: 'ceil',
+ })
+ assert(result === '2 minutes')
+ })
+
+ it('"round" (down)', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 33, 29), {
+ roundingMethod: 'round',
+ })
+ assert(result === '1 minute')
+ })
+
+ it('"round" (up)', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 3, 4, 10, 33, 30), {
+ roundingMethod: 'round',
+ })
+ assert(result === '2 minutes')
+ })
+ })
+
+ describe('implicit conversion of options', function () {
+ it('`options.unit`', function () {
+ // eslint-disable-next-line no-new-wrappers
+ var unit = new String('year')
+
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 32, 0),
+ // $ExpectedMistake
+ { unit: unit }
+ )
+ assert(result === '0 years')
+ })
+
+ it('`options.addSuffix`', function () {
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 31, 35),
+ // $ExpectedMistake
+ { addSuffix: 1 }
+ )
+ assert(result === '25 seconds ago')
+ })
+
+ it('`options.ceil`', function () {
+ // eslint-disable-next-line no-new-wrappers
+ var roundingMethod = new String('ceil')
+
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 33, 1),
+ // $ExpectedMistake
+ { roundingMethod: roundingMethod }
+ )
+ assert(result === '2 minutes')
+ })
+ })
+
+ describe('custom locale', function () {
+ it('can be passed to the function', function () {
+ function localizeDistance(token, count, options) {
+ assert(token === 'xSeconds')
+ assert(count === 15)
+ assert(options.addSuffix === true)
+ assert(options.comparison < 0)
+ return 'It works!'
+ }
+
+ var customLocale = {
+ formatDistance: localizeDistance,
+ }
+
+ var result = formatDistanceToNowStrict(
+ new Date(1986, 3, 4, 10, 31, 45),
+ // $ExpectedMistake
+ { addSuffix: true, locale: customLocale }
+ )
+
+ assert(result === 'It works!')
+ })
+
+ describe('does not contain `formatDistance` property', function () {
+ it('throws `RangeError`', function () {
+ var customLocale = {}
+ var block = formatDistanceToNowStrict.bind(
+ null,
+ // $ExpectedMistake
+ new Date(1986, 3, 4, 10, 37, 0),
+ { unit: 'minute', locale: customLocale }
+ )
+ assert.throws(block, RangeError)
+ })
+ })
+ })
+
+ describe('edge cases', function () {
+ it('detects unit correctly for short months', function () {
+ var result = formatDistanceToNowStrict(new Date(1986, 2 /* Mar */, 7))
+ assert(result === '28 days')
+ })
+ })
+
+ it('throws `RangeError` if the date is `Invalid Date`', function () {
+ assert.throws(
+ formatDistanceToNowStrict.bind(null, new Date(NaN)),
+ RangeError
+ )
+ })
+
+ it("throws `RangeError` if `options.roundingMethod` is not 'floor', 'ceil', 'round' or undefined", function () {
+ var block = formatDistanceToNowStrict.bind(
+ null,
+ new Date(1986, 3, 4, 10, 33, 29),
+ // $ExpectedMistake
+ { roundingMethod: 'foobar' }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it("throws `RangeError` if `options.unit` is not 's', 'm', 'h', 'd', 'M', 'Y' or undefined", function () {
+ var block = formatDistanceToNowStrict.bind(
+ null,
+ new Date(1986, 3, 4, 10, 33, 29),
+ // $ExpectedMistake
+ { unit: 'foobar' }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 arguments', function () {
+ assert.throws(formatDistanceToNowStrict.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/formatDuration/index.d.ts b/date-fns/src/formatDuration/index.d.ts
new file mode 100644
index 0000000..be96776
--- /dev/null
+++ b/date-fns/src/formatDuration/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDuration } from 'date-fns'
+export default formatDuration
diff --git a/date-fns/src/formatDuration/index.js b/date-fns/src/formatDuration/index.js
new file mode 100644
index 0000000..c4130a6
--- /dev/null
+++ b/date-fns/src/formatDuration/index.js
@@ -0,0 +1,100 @@
+import defaultLocale from '../locale/en-US/index'
+
+const defaultFormat = [
+ 'years',
+ 'months',
+ 'weeks',
+ 'days',
+ 'hours',
+ 'minutes',
+ 'seconds',
+]
+
+/**
+ * @name formatDuration
+ * @category Common Helpers
+ * @summary Formats a duration in human-readable format
+ *
+ * @description
+ * Return human-readable duration string i.e. "9 months 2 days"
+ *
+ * @param {Duration} duration - the duration to format
+ * @param {Object} [options] - an object with options.
+
+ * @param {string[]} [options.format=['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']] - the array of units to format
+ * @param {boolean} [options.zero=false] - should be zeros be included in the output?
+ * @param {string} [options.delimiter=' '] - delimiter string
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @returns {string} the formatted date string
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Format full duration
+ * formatDuration({
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30
+ * })
+ * //=> '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds
+ *
+ * @example
+ * // Format partial duration
+ * formatDuration({ months: 9, days: 2 })
+ * //=> '9 months 2 days'
+ *
+ * @example
+ * // Customize the format
+ * formatDuration(
+ * {
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30
+ * },
+ * { format: ['months', 'weeks'] }
+ * ) === '9 months 1 week'
+ *
+ * @example
+ * // Customize the zeros presence
+ * formatDuration({ years: 0, months: 9 })
+ * //=> '9 months'
+ * formatDuration({ years: 0, months: 9 }, { zero: true })
+ * //=> '0 years 9 months'
+ *
+ * @example
+ * // Customize the delimiter
+ * formatDuration({ years: 2, months: 9, weeks: 3 }, { delimiter: ', ' })
+ * //=> '2 years, 9 months, 3 weeks'
+ */
+export default function formatDuration(duration, options) {
+ if (arguments.length < 1) {
+ throw new TypeError(
+ `1 argument required, but only ${arguments.length} present`
+ )
+ }
+
+ const format = options?.format || defaultFormat
+ const locale = options?.locale || defaultLocale
+ const zero = options?.zero || false
+ const delimiter = options?.delimiter || ' '
+
+ const result = format
+ .reduce((acc, unit) => {
+ const token = `x${unit.replace(/(^.)/, (m) => m.toUpperCase())}`
+ const addChunk =
+ typeof duration[unit] === 'number' && (zero || duration[unit])
+ return addChunk
+ ? acc.concat(locale.formatDistance(token, duration[unit]))
+ : acc
+ }, [])
+ .join(delimiter)
+
+ return result
+}
diff --git a/date-fns/src/formatDuration/index.js.flow b/date-fns/src/formatDuration/index.js.flow
new file mode 100644
index 0000000..022ea8e
--- /dev/null
+++ b/date-fns/src/formatDuration/index.js.flow
@@ -0,0 +1,60 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ duration: Duration,
+ options?: {
+ format?: string[],
+ zero?: boolean,
+ delimiter?: string,
+ locale?: Locale,
+ }
+) => string
diff --git a/date-fns/src/formatDuration/test.js b/date-fns/src/formatDuration/test.js
new file mode 100644
index 0000000..f9bb7af
--- /dev/null
+++ b/date-fns/src/formatDuration/test.js
@@ -0,0 +1,80 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import formatDuration from '.'
+
+describe('formatDuration', () => {
+ it('formats full duration', () => {
+ assert(
+ formatDuration({
+ years: 2,
+ months: 9,
+ weeks: 1,
+ days: 7,
+ hours: 5,
+ minutes: 9,
+ seconds: 30
+ }) === '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds'
+ )
+ })
+
+ it('formats partial duration', () => {
+ assert(formatDuration({ months: 9, days: 2 }) === '9 months 2 days')
+ })
+
+ it('allows to customize the format', () => {
+ assert(
+ formatDuration(
+ {
+ years: 2,
+ months: 9,
+ weeks: 1,
+ days: 7,
+ hours: 5,
+ minutes: 9,
+ seconds: 30
+ },
+ { format: ['months', 'weeks'] }
+ ) === '9 months 1 week'
+ )
+ })
+
+ it('does not include zeros by default', () => {
+ assert(
+ formatDuration({
+ years: 0,
+ months: 0,
+ weeks: 1,
+ days: 0,
+ hours: 0,
+ minutes: 0,
+ seconds: 0
+ }) === '1 week'
+ )
+ })
+
+ it('allows to include zeros', () => {
+ assert(
+ formatDuration(
+ {
+ years: 0,
+ months: 0,
+ weeks: 1,
+ days: 0,
+ hours: 0,
+ minutes: 0,
+ seconds: 0
+ },
+ { zero: true }
+ ) === '0 years 0 months 1 week 0 days 0 hours 0 minutes 0 seconds'
+ )
+ })
+
+ it('allows to customize the delimiter', () => {
+ assert(
+ formatDuration({ months: 9, days: 2 }, { delimiter: ', ' }) ===
+ '9 months, 2 days'
+ )
+ })
+})
diff --git a/date-fns/src/formatISO/index.d.ts b/date-fns/src/formatISO/index.d.ts
new file mode 100644
index 0000000..4ed5a00
--- /dev/null
+++ b/date-fns/src/formatISO/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISO } from 'date-fns'
+export default formatISO
diff --git a/date-fns/src/formatISO/index.js b/date-fns/src/formatISO/index.js
new file mode 100644
index 0000000..e12288f
--- /dev/null
+++ b/date-fns/src/formatISO/index.js
@@ -0,0 +1,121 @@
+import toDate from '../toDate/index'
+import isValid from '../isValid/index'
+import addLeadingZeros from '../_lib/addLeadingZeros/index'
+
+/**
+ * @name formatISO
+ * @category Common Helpers
+ * @summary Format the date according to the ISO 8601 standard (http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).
+ *
+ * @description
+ * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.
+ * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with time zone, or both.
+ * @returns {String} the formatted date string
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `options.format` must be 'extended' or 'basic'
+ * @throws {RangeError} `options.represenation` must be 'date', 'time' or 'complete'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 8601 format (UTC):
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))
+ * //=> '2019-09-18T19:00:52Z'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 8601, short format (UTC):
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
+ * //=> '20190918T190052'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 8601 format, date only:
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
+ * //=> '2019-09-18'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 8601 format, time only (UTC):
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
+ * //=> '19:00:52Z'
+ */
+export default function formatISO(dirtyDate, dirtyOptions) {
+ if (arguments.length < 1) {
+ throw new TypeError(
+ `1 argument required, but only ${arguments.length} present`
+ )
+ }
+
+ const originalDate = toDate(dirtyDate)
+
+ if (!isValid(originalDate)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ const options = dirtyOptions || {}
+ const format = options.format == null ? 'extended' : String(options.format)
+ const representation =
+ options.representation == null ? 'complete' : String(options.representation)
+
+ if (format !== 'extended' && format !== 'basic') {
+ throw new RangeError("format must be 'extended' or 'basic'")
+ }
+
+ if (
+ representation !== 'date' &&
+ representation !== 'time' &&
+ representation !== 'complete'
+ ) {
+ throw new RangeError("representation must be 'date', 'time', or 'complete'")
+ }
+
+ let result = ''
+ let tzOffset = ''
+
+ const dateDelimiter = format === 'extended' ? '-' : ''
+ const timeDelimiter = format === 'extended' ? ':' : ''
+
+ // Representation is either 'date' or 'complete'
+ if (representation !== 'time') {
+ const day = addLeadingZeros(originalDate.getDate(), 2)
+ const month = addLeadingZeros(originalDate.getMonth() + 1, 2)
+ const year = addLeadingZeros(originalDate.getFullYear(), 4)
+
+ // yyyyMMdd or yyyy-MM-dd.
+ result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`
+ }
+
+ // Representation is either 'time' or 'complete'
+ if (representation !== 'date') {
+ // Add the timezone.
+ const offset = originalDate.getTimezoneOffset()
+
+ if (offset !== 0) {
+ const absoluteOffset = Math.abs(offset)
+ const hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2)
+ const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2)
+ // If less than 0, the sign is +, because it is ahead of time.
+ const sign = offset < 0 ? '+' : '-'
+
+ tzOffset = `${sign}${hourOffset}:${minuteOffset}`
+ } else {
+ tzOffset = 'Z'
+ }
+
+ const hour = addLeadingZeros(originalDate.getHours(), 2)
+ const minute = addLeadingZeros(originalDate.getMinutes(), 2)
+ const second = addLeadingZeros(originalDate.getSeconds(), 2)
+
+ // If there's also date, separate it with time with 'T'
+ const separator = result === '' ? '' : 'T'
+
+ // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.
+ const time = [hour, minute, second].join(timeDelimiter)
+
+ // HHmmss or HH:mm:ss.
+ result = `${result}${separator}${time}${tzOffset}`
+ }
+
+ return result
+}
diff --git a/date-fns/src/formatISO/index.js.flow b/date-fns/src/formatISO/index.js.flow
new file mode 100644
index 0000000..5d1e860
--- /dev/null
+++ b/date-fns/src/formatISO/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ format?: 'extended' | 'basic',
+ representation?: 'complete' | 'date' | 'time',
+ }
+) => string
diff --git a/date-fns/src/formatISO/test.js b/date-fns/src/formatISO/test.js
new file mode 100644
index 0000000..08193eb
--- /dev/null
+++ b/date-fns/src/formatISO/test.js
@@ -0,0 +1,122 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import formatISO from '.'
+import addLeadingZeros from '../_lib/addLeadingZeros'
+
+// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
+function generateOffset(originalDate) {
+ // Add the timezone.
+ let offset = ''
+ const tzOffset = originalDate.getTimezoneOffset()
+
+ if (tzOffset !== 0) {
+ const absoluteOffset = Math.abs(tzOffset)
+ const hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2)
+ const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2)
+ // If less than 0, the sign is +, because it is ahead of time.
+ const sign = tzOffset < 0 ? '+' : '-'
+
+ offset = `${sign}${hourOffset}:${minuteOffset}`
+ } else {
+ offset = 'Z'
+ }
+
+ return offset
+}
+
+describe('formatISO', () => {
+ it('formats ISO-8601 extended format', () => {
+ const date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123)
+ const tzOffsetExtended = generateOffset(date)
+ assert(formatISO(date) === `2019-03-03T19:00:52${tzOffsetExtended}`)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123).getTime()
+ const tzOffsetExtended = generateOffset(new Date(date))
+ assert(formatISO(date) === `2019-03-03T19:00:52${tzOffsetExtended}`)
+ })
+
+ it('formats ISO-8601 basic format', () => {
+ const date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ const tzOffsetBasic = generateOffset(date)
+ assert(
+ formatISO(date, { format: 'basic' }) === `20191004T123013${tzOffsetBasic}`
+ )
+ })
+
+ it('formats only date', () => {
+ const date = new Date(2019, 11 /* Dec */, 11, 1, 0, 0, 789)
+
+ assert(
+ formatISO(date, { representation: 'date', format: 'extended' }) ===
+ '2019-12-11'
+ )
+ assert(
+ formatISO(date, { representation: 'date', format: 'basic' }) ===
+ '20191211'
+ )
+ })
+
+ it('formats only time', () => {
+ const date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123)
+ const tzOffset = generateOffset(date)
+
+ assert(
+ formatISO(date, { representation: 'time', format: 'extended' }) ===
+ `19:00:52${tzOffset}`
+ )
+ assert(
+ formatISO(date, { representation: 'time', format: 'basic' }) ===
+ `190052${tzOffset}`
+ )
+ })
+
+ describe('implicitly converts options', function() {
+ it('`format`', function() {
+ // eslint-disable-next-line no-new-wrappers
+ var format = new String('basic')
+ var date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ const tzOffsetExtended = generateOffset(date)
+ // $ExpectedMistake
+ var result = formatISO(date, { format: format })
+ assert(result === `20191004T123013${tzOffsetExtended}`)
+ })
+
+ it('`representation`', function() {
+ // eslint-disable-next-line no-new-wrappers
+ var representation = new String('time')
+ var date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ const tzOffsetExtended = generateOffset(date)
+ // $ExpectedMistake
+ var result = formatISO(date, { representation: representation })
+ assert(result === `12:30:13${tzOffsetExtended}`)
+ })
+ })
+
+ it("throws `RangeError` if `options.format` is not 'extended' or 'basic'", function() {
+ // $ExpectedMistake
+ var block = formatISO.bind(null, new Date(2019, 2 /* Mar */, 3), {
+ format: 'something else'
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it("throws `RangeError` if `options.representation` is not 'date', 'time' or 'complete'", function() {
+ // $ExpectedMistake
+ var block = formatISO.bind(null, new Date(2019, 2 /* Mar */, 3), {
+ representation: 'something else'
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws RangeError if the time value is invalid', () => {
+ assert.throws(formatISO.bind(null, new Date(NaN)), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(formatISO.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/formatISO9075/index.d.ts b/date-fns/src/formatISO9075/index.d.ts
new file mode 100644
index 0000000..cc8dc89
--- /dev/null
+++ b/date-fns/src/formatISO9075/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISO9075 } from 'date-fns'
+export default formatISO9075
diff --git a/date-fns/src/formatISO9075/index.js b/date-fns/src/formatISO9075/index.js
new file mode 100644
index 0000000..2b6da7f
--- /dev/null
+++ b/date-fns/src/formatISO9075/index.js
@@ -0,0 +1,102 @@
+import toDate from '../toDate/index'
+import isValid from '../isValid/index'
+import addLeadingZeros from '../_lib/addLeadingZeros/index'
+
+/**
+ * @name formatISO9075
+ * @category Common Helpers
+ * @summary Format the date according to the ISO 9075 standard (https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_get-format).
+ *
+ * @description
+ * Return the formatted date string in ISO 9075 format. Options may be passed to control the parts and notations of the date.
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.
+ * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time, or both.
+ * @returns {String} the formatted date string
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `options.format` must be 'extended' or 'basic'
+ * @throws {RangeError} `options.represenation` must be 'date', 'time' or 'complete'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 9075 format:
+ * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52))
+ * //=> '2019-09-18 19:00:52'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 9075, short format:
+ * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
+ * //=> '20190918 190052'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 9075 format, date only:
+ * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
+ * //=> '2019-09-18'
+ *
+ * @example
+ * // Represent 18 September 2019 in ISO 9075 format, time only:
+ * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
+ * //=> '19:00:52'
+ */
+export default function formatISO9075(dirtyDate, dirtyOptions) {
+ if (arguments.length < 1) {
+ throw new TypeError(
+ `1 argument required, but only ${arguments.length} present`
+ )
+ }
+
+ const originalDate = toDate(dirtyDate)
+
+ if (!isValid(originalDate)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ const options = dirtyOptions || {}
+ const format = options.format == null ? 'extended' : String(options.format)
+ const representation =
+ options.representation == null ? 'complete' : String(options.representation)
+
+ if (format !== 'extended' && format !== 'basic') {
+ throw new RangeError("format must be 'extended' or 'basic'")
+ }
+
+ if (
+ representation !== 'date' &&
+ representation !== 'time' &&
+ representation !== 'complete'
+ ) {
+ throw new RangeError("representation must be 'date', 'time', or 'complete'")
+ }
+
+ let result = ''
+
+ const dateDelimiter = format === 'extended' ? '-' : ''
+ const timeDelimiter = format === 'extended' ? ':' : ''
+
+ // Representation is either 'date' or 'complete'
+ if (representation !== 'time') {
+ const day = addLeadingZeros(originalDate.getDate(), 2)
+ const month = addLeadingZeros(originalDate.getMonth() + 1, 2)
+ const year = addLeadingZeros(originalDate.getFullYear(), 4)
+
+ // yyyyMMdd or yyyy-MM-dd.
+ result = `${year}${dateDelimiter}${month}${dateDelimiter}${day}`
+ }
+
+ // Representation is either 'time' or 'complete'
+ if (representation !== 'date') {
+ const hour = addLeadingZeros(originalDate.getHours(), 2)
+ const minute = addLeadingZeros(originalDate.getMinutes(), 2)
+ const second = addLeadingZeros(originalDate.getSeconds(), 2)
+
+ // If there's also date, separate it with time with a space
+ const separator = result === '' ? '' : ' '
+
+ // HHmmss or HH:mm:ss.
+ result = `${result}${separator}${hour}${timeDelimiter}${minute}${timeDelimiter}${second}`
+ }
+
+ return result
+}
diff --git a/date-fns/src/formatISO9075/index.js.flow b/date-fns/src/formatISO9075/index.js.flow
new file mode 100644
index 0000000..5d1e860
--- /dev/null
+++ b/date-fns/src/formatISO9075/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ format?: 'extended' | 'basic',
+ representation?: 'complete' | 'date' | 'time',
+ }
+) => string
diff --git a/date-fns/src/formatISO9075/test.js b/date-fns/src/formatISO9075/test.js
new file mode 100644
index 0000000..6362e50
--- /dev/null
+++ b/date-fns/src/formatISO9075/test.js
@@ -0,0 +1,90 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import formatISO9075 from '.'
+
+describe('formatISO9075', () => {
+ it('formats ISO-9075 extended date format', () => {
+ const date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123)
+ assert(formatISO9075(date) === '2019-03-03 19:00:52')
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123).getTime()
+ assert(formatISO9075(date) === '2019-03-03 19:00:52')
+ })
+
+ it('formats ISO-8601 basic date format', () => {
+ const date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ assert(formatISO9075(date, { format: 'basic' }) === '20191004 123013')
+ })
+
+ it('formats only date', () => {
+ const date = new Date(2019, 11 /* Dec */, 11, 1, 0, 0, 789)
+ assert(
+ formatISO9075(date, { representation: 'date', format: 'extended' }) ===
+ '2019-12-11'
+ )
+ assert(
+ formatISO9075(date, { representation: 'date', format: 'basic' }) ===
+ '20191211'
+ )
+ })
+
+ it('formats only time', () => {
+ const date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123)
+ assert(
+ formatISO9075(date, { representation: 'time', format: 'extended' }) ===
+ '19:00:52'
+ )
+ assert(
+ formatISO9075(date, { representation: 'time', format: 'basic' }) ===
+ '190052'
+ )
+ })
+
+ describe('implicitly converts options', function() {
+ it('`format`', function() {
+ // eslint-disable-next-line no-new-wrappers
+ var format = new String('basic')
+ var date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ // $ExpectedMistake
+ var result = formatISO9075(date, { format: format })
+ assert(result === '20191004 123013')
+ })
+
+ it('`representation`', function() {
+ // eslint-disable-next-line no-new-wrappers
+ var representation = new String('time')
+ var date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ // $ExpectedMistake
+ var result = formatISO9075(date, { representation: representation })
+ assert(result === '12:30:13')
+ })
+ })
+
+ it("throws `RangeError` if `options.format` is not 'extended' or 'basic'", function() {
+ // $ExpectedMistake
+ var block = formatISO9075.bind(null, new Date(2019, 2 /* Mar */, 3), {
+ format: 'something else'
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it("throws `RangeError` if `options.representation` is not 'date', 'time' or 'complete'", function() {
+ // $ExpectedMistake
+ var block = formatISO9075.bind(null, new Date(2019, 2 /* Mar */, 3), {
+ representation: 'something else'
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws RangeError if the time value is invalid', () => {
+ assert.throws(formatISO9075.bind(null, new Date(NaN)), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(formatISO9075.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/formatISODuration/index.d.ts b/date-fns/src/formatISODuration/index.d.ts
new file mode 100644
index 0000000..dfbd333
--- /dev/null
+++ b/date-fns/src/formatISODuration/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISODuration } from 'date-fns'
+export default formatISODuration
diff --git a/date-fns/src/formatISODuration/index.js b/date-fns/src/formatISODuration/index.js
new file mode 100644
index 0000000..0702457
--- /dev/null
+++ b/date-fns/src/formatISODuration/index.js
@@ -0,0 +1,46 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name formatISODuration
+ * @category Common Helpers
+ * @summary Format a duration object according as ISO 8601 duration string
+ *
+ * @description
+ * Format a duration object according to the ISO 8601 duration standard (https://www.digi.com/resources/documentation/digidocs/90001437-13/reference/r_iso_8601_duration_format.htm)
+ *
+ * @param {Duration} duration - the duration to format
+ *
+ * @returns {String} The ISO 8601 duration string
+ * @throws {TypeError} Requires 1 argument
+ * @throws {Error} Argument must be an object
+ *
+ * @example
+ * // Format the given duration as ISO 8601 string
+ * formatISODuration({
+ * years: 39,
+ * months: 2,
+ * days: 20,
+ * hours: 7,
+ * minutes: 5,
+ * seconds: 0
+ * })
+ * //=> 'P39Y2M20DT0H0M0S'
+ */
+
+export default function formatISODuration(duration) {
+ requiredArgs(1, arguments)
+
+ if (typeof duration !== 'object')
+ throw new Error('Duration must be an object')
+
+ const {
+ years = 0,
+ months = 0,
+ days = 0,
+ hours = 0,
+ minutes = 0,
+ seconds = 0
+ } = duration
+
+ return `P${years}Y${months}M${days}DT${hours}H${minutes}M${seconds}S`
+}
diff --git a/date-fns/src/formatISODuration/index.js.flow b/date-fns/src/formatISODuration/index.js.flow
new file mode 100644
index 0000000..3f8bb2c
--- /dev/null
+++ b/date-fns/src/formatISODuration/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (duration: Duration) => string
diff --git a/date-fns/src/formatISODuration/test.js b/date-fns/src/formatISODuration/test.js
new file mode 100644
index 0000000..ecea358
--- /dev/null
+++ b/date-fns/src/formatISODuration/test.js
@@ -0,0 +1,78 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import formatISODuration from '.'
+import intervalToDuration from '../intervalToDuration'
+
+describe('formatISODuration', function() {
+ it('Everything returns correct duration for arbitrary dates', function() {
+ const start = new Date(1929, 0, 15, 12, 0, 0)
+ const end = new Date(1968, 3, 4, 19, 5, 0)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P39Y2M20DT7H5M0S')
+ })
+ it('Everything returns P1Y1M1DT1H1M1S (1 of everything)', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2021, 3, 2, 13, 1, 1)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P1Y1M1DT1H1M1S')
+ })
+ it('Returns P0Y0M0DT0H0M0S when the dates are the same', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2020, 2, 1, 12, 0, 0)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P0Y0M0DT0H0M0S')
+ })
+ it('Seconds returns P0Y0M0DT0H0M1S (1 second)', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2020, 2, 1, 12, 0, 1)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P0Y0M0DT0H0M1S')
+ })
+ it('Minutes returns P0Y0M0DT0H1M0S (1 minute)', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2020, 2, 1, 12, 1, 0)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P0Y0M0DT0H1M0S')
+ })
+ it('Hours returns P0Y0M0DT1H0M0S (1 hour)', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2020, 2, 1, 13, 0, 0)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P0Y0M0DT1H0M0S')
+ })
+ it('Days returns P0Y0M1DT0H0M0S (1 day)', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2020, 2, 2, 12, 0, 0)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P0Y0M1DT0H0M0S')
+ })
+ it('Months returns P0Y1M0DT0H0M0S (1 month)', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2020, 3, 1, 12, 0, 0)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P0Y1M0DT0H0M0S')
+ })
+ it('Years returns P1Y0M0DT0H0M1S (1 year)', function() {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2021, 2, 1, 12, 0, 0)
+ const result = formatISODuration(intervalToDuration({ start, end }))
+
+ assert(result === 'P1Y0M0DT0H0M0S')
+ })
+
+ it('returns P0Y0M0DT0H0M0S when given an empty object', function() {
+ const result = formatISODuration({})
+
+ assert(result === 'P0Y0M0DT0H0M0S')
+ })
+})
diff --git a/date-fns/src/formatRFC3339/index.d.ts b/date-fns/src/formatRFC3339/index.d.ts
new file mode 100644
index 0000000..2454cd2
--- /dev/null
+++ b/date-fns/src/formatRFC3339/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRFC3339 } from 'date-fns'
+export default formatRFC3339
diff --git a/date-fns/src/formatRFC3339/index.js b/date-fns/src/formatRFC3339/index.js
new file mode 100644
index 0000000..7513ba4
--- /dev/null
+++ b/date-fns/src/formatRFC3339/index.js
@@ -0,0 +1,92 @@
+import toDate from '../toDate/index'
+import isValid from '../isValid/index'
+import addLeadingZeros from '../_lib/addLeadingZeros/index'
+import toInteger from '../_lib/toInteger/index'
+
+/**
+ * @name formatRFC3339
+ * @category Common Helpers
+ * @summary Format the date according to the RFC 3339 standard (https://tools.ietf.org/html/rfc3339#section-5.6).
+ *
+ * @description
+ * Return the formatted date string in RFC 3339 format. Options may be passed to control the parts and notations of the date.
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {0|1|2|3} [options.fractionDigits=0] - number of digits after the decimal point after seconds
+ * @returns {String} the formatted date string
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `options.fractionDigits` must be between 0 and 3
+ *
+ * @example
+ * // Represent 18 September 2019 in RFC 3339 format:
+ * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52))
+ * //=> '2019-09-18T19:00:52Z'
+ *
+ * @example
+ * // Represent 18 September 2019 in RFC 3339 format, 2 digits of second fraction:
+ * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 2 })
+ * //=> '2019-09-18T19:00:52.23Z'
+ *
+ * @example
+ * // Represent 18 September 2019 in RFC 3339 format, 3 digits of second fraction
+ * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 3 })
+ * //=> '2019-09-18T19:00:52.234Z'
+ */
+export default function formatRFC3339(dirtyDate, dirtyOptions) {
+ if (arguments.length < 1) {
+ throw new TypeError(
+ `1 arguments required, but only ${arguments.length} present`
+ )
+ }
+
+ const originalDate = toDate(dirtyDate)
+
+ if (!isValid(originalDate)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ const options = dirtyOptions || {}
+ const fractionDigits =
+ options.fractionDigits == null ? 0 : toInteger(options.fractionDigits)
+
+ // Test if fractionDigits is between 0 and 3 _and_ is not NaN
+ if (!(fractionDigits >= 0 && fractionDigits <= 3)) {
+ throw new RangeError('fractionDigits must be between 0 and 3 inclusively')
+ }
+
+ const day = addLeadingZeros(originalDate.getDate(), 2)
+ const month = addLeadingZeros(originalDate.getMonth() + 1, 2)
+ const year = originalDate.getFullYear()
+
+ const hour = addLeadingZeros(originalDate.getHours(), 2)
+ const minute = addLeadingZeros(originalDate.getMinutes(), 2)
+ const second = addLeadingZeros(originalDate.getSeconds(), 2)
+
+ let fractionalSecond = ''
+ if (fractionDigits > 0) {
+ const milliseconds = originalDate.getMilliseconds()
+ const fractionalSeconds = Math.floor(
+ milliseconds * Math.pow(10, fractionDigits - 3)
+ )
+ fractionalSecond = '.' + addLeadingZeros(fractionalSeconds, fractionDigits)
+ }
+
+ let offset = ''
+ const tzOffset = originalDate.getTimezoneOffset()
+
+ if (tzOffset !== 0) {
+ const absoluteOffset = Math.abs(tzOffset)
+ const hourOffset = addLeadingZeros(toInteger(absoluteOffset / 60), 2)
+ const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2)
+ // If less than 0, the sign is +, because it is ahead of time.
+ const sign = tzOffset < 0 ? '+' : '-'
+
+ offset = `${sign}${hourOffset}:${minuteOffset}`
+ } else {
+ offset = 'Z'
+ }
+
+ return `${year}-${month}-${day}T${hour}:${minute}:${second}${fractionalSecond}${offset}`
+}
diff --git a/date-fns/src/formatRFC3339/index.js.flow b/date-fns/src/formatRFC3339/index.js.flow
new file mode 100644
index 0000000..9bb2748
--- /dev/null
+++ b/date-fns/src/formatRFC3339/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ fractionDigits?: 0 | 1 | 2 | 3,
+ }
+) => string
diff --git a/date-fns/src/formatRFC3339/test.js b/date-fns/src/formatRFC3339/test.js
new file mode 100644
index 0000000..5d9e468
--- /dev/null
+++ b/date-fns/src/formatRFC3339/test.js
@@ -0,0 +1,81 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import formatRFC3339 from '.'
+import toInteger from '../_lib/toInteger/index'
+import addLeadingZeros from '../_lib/addLeadingZeros/index'
+
+// This makes sure we create the consistent offsets across timezones, no matter where these tests are ran.
+function generateOffset(date) {
+ let offset = ''
+ const tzOffset = date.getTimezoneOffset()
+
+ if (tzOffset !== 0) {
+ const absoluteOffset = Math.abs(tzOffset)
+ const hourOffset = addLeadingZeros(toInteger(absoluteOffset / 60), 2)
+ const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2)
+ // If less than 0, the sign is +, because it is ahead of time.
+ const sign = tzOffset < 0 ? '+' : '-'
+
+ offset = `${sign}${hourOffset}:${minuteOffset}`
+ } else {
+ offset = 'Z'
+ }
+
+ return offset
+}
+
+describe('formatRFC3339', () => {
+ it('formats RFC-3339 date string', () => {
+ var date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123)
+ assert(formatRFC3339(date) === `2019-03-03T19:00:52${generateOffset(date)}`)
+ })
+
+ it('accepts a timestamp', function() {
+ var date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ var time = date.getTime()
+ assert(formatRFC3339(time) === `2019-10-04T12:30:13${generateOffset(date)}`)
+ })
+
+ it('allows to specify digits of second fractions', function() {
+ var date = new Date(2019, 11 /* Dec */, 11, 1, 0, 0, 789)
+ assert(
+ formatRFC3339(date, { fractionDigits: 3 }) ===
+ `2019-12-11T01:00:00.789${generateOffset(date)}`
+ )
+ })
+
+ it('works when ms < 100', function() {
+ var date = new Date(2019, 11 /* Dec */, 11, 1, 0, 0, 12)
+ assert(
+ formatRFC3339(date, { fractionDigits: 2 }) ===
+ `2019-12-11T01:00:00.01${generateOffset(date)}`
+ )
+ })
+
+ it('implicitly converts options', function() {
+ var date = new Date(2019, 2 /* Mar */, 3, 19, 0, 52, 123)
+ // $ExpectedMistake
+ var result = formatRFC3339(date, {
+ fractionDigits: '2'
+ })
+ assert.equal(result, `2019-03-03T19:00:52.12${generateOffset(date)}`)
+ })
+
+ it('throws `RangeError` if `options.fractionDigits` is not convertable to 0, 1, 2, 3 or undefined', function() {
+ // $ExpectedMistake
+ var block = formatRFC3339.bind(null, new Date(2019, 2 /* Mar */, 3), {
+ fractionDigits: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws RangeError if the time value is invalid', () => {
+ assert.throws(formatRFC3339.bind(null, new Date(NaN)), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(formatRFC3339.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/formatRFC7231/index.d.ts b/date-fns/src/formatRFC7231/index.d.ts
new file mode 100644
index 0000000..2caa714
--- /dev/null
+++ b/date-fns/src/formatRFC7231/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRFC7231 } from 'date-fns'
+export default formatRFC7231
diff --git a/date-fns/src/formatRFC7231/index.js b/date-fns/src/formatRFC7231/index.js
new file mode 100644
index 0000000..3554e35
--- /dev/null
+++ b/date-fns/src/formatRFC7231/index.js
@@ -0,0 +1,64 @@
+import toDate from '../toDate/index'
+import isValid from '../isValid/index'
+import addLeadingZeros from '../_lib/addLeadingZeros/index'
+
+const days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
+const months = [
+ 'Jan',
+ 'Feb',
+ 'Mar',
+ 'Apr',
+ 'May',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Oct',
+ 'Nov',
+ 'Dec'
+]
+
+/**
+ * @name formatRFC7231
+ * @category Common Helpers
+ * @summary Format the date according to the RFC 7231 standard (https://tools.ietf.org/html/rfc7231#section-7.1.1.1).
+ *
+ * @description
+ * Return the formatted date string in RFC 7231 format.
+ * The result will always be in UTC timezone.
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {String} the formatted date string
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `date` must not be Invalid Date
+ *
+ * @example
+ * // Represent 18 September 2019 in RFC 7231 format:
+ * const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52))
+ * //=> 'Wed, 18 Sep 2019 19:00:52 GMT'
+ */
+export default function formatRFC7231(dirtyDate) {
+ if (arguments.length < 1) {
+ throw new TypeError(
+ `1 arguments required, but only ${arguments.length} present`
+ )
+ }
+
+ const originalDate = toDate(dirtyDate)
+
+ if (!isValid(originalDate)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ const dayName = days[originalDate.getUTCDay()]
+ const dayOfMonth = addLeadingZeros(originalDate.getUTCDate(), 2)
+ const monthName = months[originalDate.getUTCMonth()]
+ const year = originalDate.getUTCFullYear()
+
+ const hour = addLeadingZeros(originalDate.getUTCHours(), 2)
+ const minute = addLeadingZeros(originalDate.getUTCMinutes(), 2)
+ const second = addLeadingZeros(originalDate.getUTCSeconds(), 2)
+
+ // Result variables.
+ return `${dayName}, ${dayOfMonth} ${monthName} ${year} ${hour}:${minute}:${second} GMT`
+}
diff --git a/date-fns/src/formatRFC7231/index.js.flow b/date-fns/src/formatRFC7231/index.js.flow
new file mode 100644
index 0000000..8462b25
--- /dev/null
+++ b/date-fns/src/formatRFC7231/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => string
diff --git a/date-fns/src/formatRFC7231/test.js b/date-fns/src/formatRFC7231/test.js
new file mode 100644
index 0000000..018bbc5
--- /dev/null
+++ b/date-fns/src/formatRFC7231/test.js
@@ -0,0 +1,25 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import formatRFC7231 from '.'
+
+describe('formatRFC7231', () => {
+ it('formats RFC-7231 date string', () => {
+ const date = new Date(Date.UTC(2019, 2, 3, 19, 0, 52))
+ assert(formatRFC7231(date) === 'Sun, 03 Mar 2019 19:00:52 GMT')
+ })
+
+ it('accepts a timestamp', () => {
+ const date = Date.UTC(2019, 9, 4, 12, 30, 13)
+ assert(formatRFC7231(date) === 'Fri, 04 Oct 2019 12:30:13 GMT')
+ })
+
+ it('throws RangeError if the time value is invalid', () => {
+ assert.throws(formatRFC7231.bind(null, new Date(NaN)), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(formatRFC7231.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/formatRelative/benchmark.js b/date-fns/src/formatRelative/benchmark.js
new file mode 100644
index 0000000..be6f7b0
--- /dev/null
+++ b/date-fns/src/formatRelative/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import formatRelative from '.'
+import moment from 'moment'
+
+suite('formatRelative', function () {
+ benchmark('date-fns', function () {
+ return formatRelative(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.calendar(this.momentB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/formatRelative/index.d.ts b/date-fns/src/formatRelative/index.d.ts
new file mode 100644
index 0000000..1c5c739
--- /dev/null
+++ b/date-fns/src/formatRelative/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRelative } from 'date-fns'
+export default formatRelative
diff --git a/date-fns/src/formatRelative/index.js.flow b/date-fns/src/formatRelative/index.js.flow
new file mode 100644
index 0000000..00280b2
--- /dev/null
+++ b/date-fns/src/formatRelative/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ baseDate: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => string
diff --git a/date-fns/src/formatRelative/index.ts b/date-fns/src/formatRelative/index.ts
new file mode 100644
index 0000000..254c945
--- /dev/null
+++ b/date-fns/src/formatRelative/index.ts
@@ -0,0 +1,98 @@
+import differenceInCalendarDays from '../differenceInCalendarDays/index'
+import format from '../format/index'
+import defaultLocale from '../locale/en-US/index'
+import subMilliseconds from '../subMilliseconds/index'
+import toDate from '../toDate/index'
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, WeekStartOptions } from '../types'
+
+/**
+ * @name formatRelative
+ * @category Common Helpers
+ * @summary Represent the date in words relative to the given base date.
+ *
+ * @description
+ * Represent the date in words relative to the given base date.
+ *
+ * | Distance to the base date | Result |
+ * |---------------------------|---------------------------|
+ * | Previous 6 days | last Sunday at 04:30 AM |
+ * | Last day | yesterday at 04:30 AM |
+ * | Same day | today at 04:30 AM |
+ * | Next day | tomorrow at 04:30 AM |
+ * | Next 6 days | Sunday at 04:30 AM |
+ * | Other | 12/31/2017 |
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to format
+ * @param {Date|Number} baseDate - the date to compare with
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {String} the date in words
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `date` must not be Invalid Date
+ * @throws {RangeError} `baseDate` must not be Invalid Date
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.locale` must contain `localize` property
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
+ * @throws {RangeError} `options.locale` must contain `formatRelative` property
+ */
+export default function formatRelative(dirtyDate: Date | number, dirtyBaseDate: Date | number, dirtyOptions?: LocaleOptions & WeekStartOptions): string {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const baseDate = toDate(dirtyBaseDate)
+
+ const {
+ locale = defaultLocale,
+ weekStartsOn = 0,
+ } = dirtyOptions || {}
+
+ if (!locale.localize) {
+ throw new RangeError('locale must contain localize property')
+ }
+
+ if (!locale.formatLong) {
+ throw new RangeError('locale must contain formatLong property')
+ }
+
+ if (!locale.formatRelative) {
+ throw new RangeError('locale must contain formatRelative property')
+ }
+
+ const diff = differenceInCalendarDays(date, baseDate)
+
+ if (isNaN(diff)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ let token
+ if (diff < -6) {
+ token = 'other'
+ } else if (diff < -1) {
+ token = 'lastWeek'
+ } else if (diff < 0) {
+ token = 'yesterday'
+ } else if (diff < 1) {
+ token = 'today'
+ } else if (diff < 2) {
+ token = 'tomorrow'
+ } else if (diff < 7) {
+ token = 'nextWeek'
+ } else {
+ token = 'other'
+ }
+
+ const utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date))
+ const utcBaseDate = subMilliseconds(
+ baseDate,
+ getTimezoneOffsetInMilliseconds(baseDate)
+ )
+ const formatStr = locale.formatRelative(token, utcDate, utcBaseDate, { locale, weekStartsOn })
+ return format(date, formatStr, { locale, weekStartsOn })
+}
diff --git a/date-fns/src/formatRelative/test.ts b/date-fns/src/formatRelative/test.ts
new file mode 100644
index 0000000..608b67d
--- /dev/null
+++ b/date-fns/src/formatRelative/test.ts
@@ -0,0 +1,168 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import formatRelative from '.'
+
+describe('formatRelative', function () {
+ const baseDate = new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 900)
+
+ it('accepts a timestamp', function () {
+ const date = new Date(2014, 3 /* Apr */, 4)
+ assert(formatRelative(date.getTime(), baseDate.getTime()) === '04/04/2014')
+ })
+
+ it('before the last week', function () {
+ const result = formatRelative(
+ new Date(1986, 2 /* Mar */, 28, 16, 50),
+ baseDate
+ )
+ assert(result === '03/28/1986')
+ })
+
+ it('last week', function () {
+ const result = formatRelative(new Date(1986, 3 /* Apr */, 1), baseDate)
+ assert(result === 'last Tuesday at 12:00 AM')
+ })
+
+ it('yesterday', function () {
+ const result = formatRelative(
+ new Date(1986, 3 /* Apr */, 3, 22, 22),
+ baseDate
+ )
+ assert(result === 'yesterday at 10:22 PM')
+ })
+
+ it('today', function () {
+ const result = formatRelative(
+ new Date(1986, 3 /* Apr */, 4, 16, 50),
+ baseDate
+ )
+ assert(result === 'today at 4:50 PM')
+ })
+
+ it('tomorrow', function () {
+ const result = formatRelative(new Date(1986, 3 /* Apr */, 5, 7, 30), baseDate)
+ assert(result === 'tomorrow at 7:30 AM')
+ })
+
+ it('next week', function () {
+ const result = formatRelative(new Date(1986, 3 /* Apr */, 6, 12, 0), baseDate)
+ assert(result === 'Sunday at 12:00 PM')
+ })
+
+ it('after the next week', function () {
+ const result = formatRelative(
+ new Date(1986, 3 /* Apr */, 11, 16, 50),
+ baseDate
+ )
+ assert(result === '04/11/1986')
+ })
+
+ describe('edge cases', function () {
+ it("throws RangeError if the date isn't valid", function () {
+ assert.throws(
+ formatRelative.bind(null, new Date(NaN), baseDate),
+ RangeError
+ )
+ })
+
+ it("throws RangeError if the base date isn't valid", function () {
+ assert.throws(
+ formatRelative.bind(
+ null,
+ new Date(2017, 0 /* Jan */, 1),
+ new Date(NaN)
+ ),
+ RangeError
+ )
+ })
+
+ it("throws RangeError if both dates aren't valid", function () {
+ assert.throws(
+ formatRelative.bind(null, new Date(NaN), new Date(NaN)),
+ RangeError
+ )
+ })
+
+ it('handles dates before 100 AD', function () {
+ const date = new Date(0)
+ date.setFullYear(7, 11 /* Dec */, 31)
+ date.setHours(0, 0, 0, 0)
+ assert(formatRelative(date, baseDate) === '12/31/0007')
+ })
+ })
+
+ describe('custom locale', function () {
+ it('allows to pass a custom locale', function () {
+ const customLocale = {
+ localize: {
+ month: function () {
+ return 'works'
+ }
+ },
+ formatLong: {
+ date: function () {
+ return "'It' MMMM"
+ }
+ },
+ formatRelative: function () {
+ return "P 'perfectly!'"
+ }
+ }
+ const result = formatRelative(
+ new Date(1986, 2 /* Mar */, 28, 16, 50),
+ baseDate,
+ // @ts-expect-error
+ { locale: customLocale }
+ )
+ assert(result === 'It works perfectly!')
+ })
+
+ it("throws `RangeError` if `options.locale` doesn't have `localize` property", function () {
+ const customLocale = {
+ formatLong: {},
+ formatRelative: function () {
+ return ''
+ }
+ }
+ // @ts-expect-error
+ const block = formatRelative.bind(null, new Date(2017, 0, 1), baseDate, {
+ locale: customLocale
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it("throws `RangeError` if `options.locale` doesn't have `formatLong` property", function () {
+ const customLocale = {
+ localize: {},
+ formatRelative: function () {
+ return ''
+ }
+ }
+ // @ts-expect-error
+ const block = formatRelative.bind(null, new Date(2017, 0, 1), baseDate, {
+ locale: customLocale
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it("throws `RangeError` if `options.locale` doesn't have `formatRelative` property", function () {
+ const customLocale = {
+ localize: {},
+ formatLong: {}
+ }
+ // @ts-expect-error
+ const block = formatRelative.bind(null, new Date(2017, 0, 1), baseDate, {
+ locale: customLocale
+ })
+ assert.throws(block, RangeError)
+ })
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ // @ts-expect-error
+ assert.throws(formatRelative.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(formatRelative.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/fp/_lib/convertToFP/index.js b/date-fns/src/fp/_lib/convertToFP/index.js
new file mode 100644
index 0000000..efe0af5
--- /dev/null
+++ b/date-fns/src/fp/_lib/convertToFP/index.js
@@ -0,0 +1,12 @@
+export default function convertToFP (fn, arity, a) {
+ a = a || []
+
+ if (a.length >= arity) {
+ return fn.apply(null, a.slice(0, arity).reverse())
+ }
+
+ return function () {
+ var args = Array.prototype.slice.call(arguments)
+ return convertToFP(fn, arity, a.concat(args))
+ }
+}
diff --git a/date-fns/src/fp/_lib/convertToFP/test.js b/date-fns/src/fp/_lib/convertToFP/test.js
new file mode 100644
index 0000000..e8224d7
--- /dev/null
+++ b/date-fns/src/fp/_lib/convertToFP/test.js
@@ -0,0 +1,69 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import convertToFP from '.'
+
+describe('convertToFP', function () {
+ function fn(a, b, c) {
+ return 'a b c'.replace('a', a).replace('b', b).replace('c', c)
+ }
+
+ describe('arity of converted function === arity of initial function', function () {
+ it('allows arguments to be curried (and reverses their order)', function () {
+ var fpFn = convertToFP(fn, 3)
+ assert(fpFn(3)(2)(1) === '1 2 3')
+ })
+
+ it('allows to group arguments', function () {
+ var fpFn = convertToFP(fn, 3)
+ assert(fpFn(3, 2)(1) === '1 2 3')
+ assert(fpFn(3)(2, 1) === '1 2 3')
+ })
+
+ it('allows the function to be called with all arguments in the reversed order', function () {
+ var fpFn = convertToFP(fn, 3)
+ assert(fpFn(3, 2, 1) === '1 2 3')
+ })
+
+ it('ignores calls without curried arguments', function () {
+ var fpFn = convertToFP(fn, 3)
+ assert(fpFn()()(3, 2)()()(1) === '1 2 3')
+ })
+
+ it('ignores extra curried arguments in the last group', function () {
+ var fpFn = convertToFP(fn, 3)
+ assert(fpFn(3, 2, 1, 0, -1, -2) === '1 2 3')
+ assert(fpFn(3)(2)(1, 0, -1, -2) === '1 2 3')
+ })
+ })
+
+ describe('arity of converted function < arity of initial function', function () {
+ it('calls the initial function with a short list of arguments', function () {
+ var fpFn = convertToFP(fn, 2)
+ assert(fpFn(2)(1) === '1 2 undefined')
+ assert(fpFn(2, 1) === '1 2 undefined')
+ })
+
+ it('ignores extra curried arguments in the last group', function () {
+ var fpFn = convertToFP(fn, 2)
+ assert(fpFn(3)(2, 1) === '2 3 undefined')
+ assert(fpFn(3, 2, 1) === '2 3 undefined')
+ })
+ })
+
+ describe('arity of converted function > arity of initial function', function () {
+ it('works, but ignores the extra arguments', function () {
+ var fpFn = convertToFP(fn, 4)
+ assert(fpFn(4)(3)(2)(1) === '1 2 3')
+ assert(fpFn(4, 3, 2, 1) === '1 2 3')
+ })
+ })
+
+ describe('arity of converted function === 0', function () {
+ it('returns the constant instead of function', function () {
+ var result = convertToFP(fn, 0)
+ assert(result === 'undefined undefined undefined')
+ })
+ })
+})
diff --git a/date-fns/src/fp/add/index.d.ts b/date-fns/src/fp/add/index.d.ts
new file mode 100644
index 0000000..f05edaa
--- /dev/null
+++ b/date-fns/src/fp/add/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { add } from 'date-fns/fp'
+export default add
diff --git a/date-fns/src/fp/add/index.js b/date-fns/src/fp/add/index.js
new file mode 100644
index 0000000..530bac6
--- /dev/null
+++ b/date-fns/src/fp/add/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../add/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var add = convertToFP(fn, 2)
+
+export default add
diff --git a/date-fns/src/fp/add/index.js.flow b/date-fns/src/fp/add/index.js.flow
new file mode 100644
index 0000000..3d4363b
--- /dev/null
+++ b/date-fns/src/fp/add/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Duration, Date | number, Date>
diff --git a/date-fns/src/fp/addBusinessDays/index.d.ts b/date-fns/src/fp/addBusinessDays/index.d.ts
new file mode 100644
index 0000000..dd3b869
--- /dev/null
+++ b/date-fns/src/fp/addBusinessDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addBusinessDays } from 'date-fns/fp'
+export default addBusinessDays
diff --git a/date-fns/src/fp/addBusinessDays/index.js b/date-fns/src/fp/addBusinessDays/index.js
new file mode 100644
index 0000000..d76f1c1
--- /dev/null
+++ b/date-fns/src/fp/addBusinessDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addBusinessDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addBusinessDays = convertToFP(fn, 2)
+
+export default addBusinessDays
diff --git a/date-fns/src/fp/addBusinessDays/index.js.flow b/date-fns/src/fp/addBusinessDays/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addBusinessDays/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addDays/index.d.ts b/date-fns/src/fp/addDays/index.d.ts
new file mode 100644
index 0000000..7ba1ace
--- /dev/null
+++ b/date-fns/src/fp/addDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addDays } from 'date-fns/fp'
+export default addDays
diff --git a/date-fns/src/fp/addDays/index.js b/date-fns/src/fp/addDays/index.js
new file mode 100644
index 0000000..6827194
--- /dev/null
+++ b/date-fns/src/fp/addDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addDays = convertToFP(fn, 2)
+
+export default addDays
diff --git a/date-fns/src/fp/addDays/index.js.flow b/date-fns/src/fp/addDays/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addDays/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addHours/index.d.ts b/date-fns/src/fp/addHours/index.d.ts
new file mode 100644
index 0000000..9b66a88
--- /dev/null
+++ b/date-fns/src/fp/addHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addHours } from 'date-fns/fp'
+export default addHours
diff --git a/date-fns/src/fp/addHours/index.js b/date-fns/src/fp/addHours/index.js
new file mode 100644
index 0000000..04a3f27
--- /dev/null
+++ b/date-fns/src/fp/addHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addHours = convertToFP(fn, 2)
+
+export default addHours
diff --git a/date-fns/src/fp/addHours/index.js.flow b/date-fns/src/fp/addHours/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addHours/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addISOWeekYears/index.d.ts b/date-fns/src/fp/addISOWeekYears/index.d.ts
new file mode 100644
index 0000000..01dab9b
--- /dev/null
+++ b/date-fns/src/fp/addISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addISOWeekYears } from 'date-fns/fp'
+export default addISOWeekYears
diff --git a/date-fns/src/fp/addISOWeekYears/index.js b/date-fns/src/fp/addISOWeekYears/index.js
new file mode 100644
index 0000000..858f7fa
--- /dev/null
+++ b/date-fns/src/fp/addISOWeekYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addISOWeekYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addISOWeekYears = convertToFP(fn, 2)
+
+export default addISOWeekYears
diff --git a/date-fns/src/fp/addISOWeekYears/index.js.flow b/date-fns/src/fp/addISOWeekYears/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addISOWeekYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addMilliseconds/index.d.ts b/date-fns/src/fp/addMilliseconds/index.d.ts
new file mode 100644
index 0000000..7a93c90
--- /dev/null
+++ b/date-fns/src/fp/addMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addMilliseconds } from 'date-fns/fp'
+export default addMilliseconds
diff --git a/date-fns/src/fp/addMilliseconds/index.js b/date-fns/src/fp/addMilliseconds/index.js
new file mode 100644
index 0000000..c4ae505
--- /dev/null
+++ b/date-fns/src/fp/addMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addMilliseconds = convertToFP(fn, 2)
+
+export default addMilliseconds
diff --git a/date-fns/src/fp/addMilliseconds/index.js.flow b/date-fns/src/fp/addMilliseconds/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addMilliseconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addMinutes/index.d.ts b/date-fns/src/fp/addMinutes/index.d.ts
new file mode 100644
index 0000000..fc7b670
--- /dev/null
+++ b/date-fns/src/fp/addMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addMinutes } from 'date-fns/fp'
+export default addMinutes
diff --git a/date-fns/src/fp/addMinutes/index.js b/date-fns/src/fp/addMinutes/index.js
new file mode 100644
index 0000000..1f0b5fe
--- /dev/null
+++ b/date-fns/src/fp/addMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addMinutes = convertToFP(fn, 2)
+
+export default addMinutes
diff --git a/date-fns/src/fp/addMinutes/index.js.flow b/date-fns/src/fp/addMinutes/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addMinutes/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addMonths/index.d.ts b/date-fns/src/fp/addMonths/index.d.ts
new file mode 100644
index 0000000..01f0e2d
--- /dev/null
+++ b/date-fns/src/fp/addMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addMonths } from 'date-fns/fp'
+export default addMonths
diff --git a/date-fns/src/fp/addMonths/index.js b/date-fns/src/fp/addMonths/index.js
new file mode 100644
index 0000000..eeb6a87
--- /dev/null
+++ b/date-fns/src/fp/addMonths/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addMonths/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addMonths = convertToFP(fn, 2)
+
+export default addMonths
diff --git a/date-fns/src/fp/addMonths/index.js.flow b/date-fns/src/fp/addMonths/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addMonths/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addQuarters/index.d.ts b/date-fns/src/fp/addQuarters/index.d.ts
new file mode 100644
index 0000000..f766d56
--- /dev/null
+++ b/date-fns/src/fp/addQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addQuarters } from 'date-fns/fp'
+export default addQuarters
diff --git a/date-fns/src/fp/addQuarters/index.js b/date-fns/src/fp/addQuarters/index.js
new file mode 100644
index 0000000..6e29d3e
--- /dev/null
+++ b/date-fns/src/fp/addQuarters/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addQuarters/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addQuarters = convertToFP(fn, 2)
+
+export default addQuarters
diff --git a/date-fns/src/fp/addQuarters/index.js.flow b/date-fns/src/fp/addQuarters/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addQuarters/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addSeconds/index.d.ts b/date-fns/src/fp/addSeconds/index.d.ts
new file mode 100644
index 0000000..5c7c41c
--- /dev/null
+++ b/date-fns/src/fp/addSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addSeconds } from 'date-fns/fp'
+export default addSeconds
diff --git a/date-fns/src/fp/addSeconds/index.js b/date-fns/src/fp/addSeconds/index.js
new file mode 100644
index 0000000..84d68f3
--- /dev/null
+++ b/date-fns/src/fp/addSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addSeconds = convertToFP(fn, 2)
+
+export default addSeconds
diff --git a/date-fns/src/fp/addSeconds/index.js.flow b/date-fns/src/fp/addSeconds/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addSeconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addWeeks/index.d.ts b/date-fns/src/fp/addWeeks/index.d.ts
new file mode 100644
index 0000000..2703fef
--- /dev/null
+++ b/date-fns/src/fp/addWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addWeeks } from 'date-fns/fp'
+export default addWeeks
diff --git a/date-fns/src/fp/addWeeks/index.js b/date-fns/src/fp/addWeeks/index.js
new file mode 100644
index 0000000..f20ede2
--- /dev/null
+++ b/date-fns/src/fp/addWeeks/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addWeeks/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addWeeks = convertToFP(fn, 2)
+
+export default addWeeks
diff --git a/date-fns/src/fp/addWeeks/index.js.flow b/date-fns/src/fp/addWeeks/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addWeeks/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/addYears/index.d.ts b/date-fns/src/fp/addYears/index.d.ts
new file mode 100644
index 0000000..ff907d4
--- /dev/null
+++ b/date-fns/src/fp/addYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { addYears } from 'date-fns/fp'
+export default addYears
diff --git a/date-fns/src/fp/addYears/index.js b/date-fns/src/fp/addYears/index.js
new file mode 100644
index 0000000..f2f10c6
--- /dev/null
+++ b/date-fns/src/fp/addYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../addYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var addYears = convertToFP(fn, 2)
+
+export default addYears
diff --git a/date-fns/src/fp/addYears/index.js.flow b/date-fns/src/fp/addYears/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/addYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/areIntervalsOverlapping/index.d.ts b/date-fns/src/fp/areIntervalsOverlapping/index.d.ts
new file mode 100644
index 0000000..870f26b
--- /dev/null
+++ b/date-fns/src/fp/areIntervalsOverlapping/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { areIntervalsOverlapping } from 'date-fns/fp'
+export default areIntervalsOverlapping
diff --git a/date-fns/src/fp/areIntervalsOverlapping/index.js b/date-fns/src/fp/areIntervalsOverlapping/index.js
new file mode 100644
index 0000000..97c9ae4
--- /dev/null
+++ b/date-fns/src/fp/areIntervalsOverlapping/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../areIntervalsOverlapping/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var areIntervalsOverlapping = convertToFP(fn, 2)
+
+export default areIntervalsOverlapping
diff --git a/date-fns/src/fp/areIntervalsOverlapping/index.js.flow b/date-fns/src/fp/areIntervalsOverlapping/index.js.flow
new file mode 100644
index 0000000..cd39633
--- /dev/null
+++ b/date-fns/src/fp/areIntervalsOverlapping/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Interval, Interval, boolean>
diff --git a/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.d.ts b/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.d.ts
new file mode 100644
index 0000000..010890a
--- /dev/null
+++ b/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { areIntervalsOverlappingWithOptions } from 'date-fns/fp'
+export default areIntervalsOverlappingWithOptions
diff --git a/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js b/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js
new file mode 100644
index 0000000..3269510
--- /dev/null
+++ b/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../areIntervalsOverlapping/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var areIntervalsOverlappingWithOptions = convertToFP(fn, 3)
+
+export default areIntervalsOverlappingWithOptions
diff --git a/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js.flow b/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js.flow
new file mode 100644
index 0000000..67e7396
--- /dev/null
+++ b/date-fns/src/fp/areIntervalsOverlappingWithOptions/index.js.flow
@@ -0,0 +1,74 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ inclusive?: boolean,
+ },
+ Interval,
+ Interval,
+ boolean
+>
diff --git a/date-fns/src/fp/closestIndexTo/index.d.ts b/date-fns/src/fp/closestIndexTo/index.d.ts
new file mode 100644
index 0000000..562180d
--- /dev/null
+++ b/date-fns/src/fp/closestIndexTo/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { closestIndexTo } from 'date-fns/fp'
+export default closestIndexTo
diff --git a/date-fns/src/fp/closestIndexTo/index.js b/date-fns/src/fp/closestIndexTo/index.js
new file mode 100644
index 0000000..e448ad6
--- /dev/null
+++ b/date-fns/src/fp/closestIndexTo/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../closestIndexTo/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var closestIndexTo = convertToFP(fn, 2)
+
+export default closestIndexTo
diff --git a/date-fns/src/fp/closestIndexTo/index.js.flow b/date-fns/src/fp/closestIndexTo/index.js.flow
new file mode 100644
index 0000000..986c64e
--- /dev/null
+++ b/date-fns/src/fp/closestIndexTo/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<(Date | number)[], Date | number, number>
diff --git a/date-fns/src/fp/closestTo/index.d.ts b/date-fns/src/fp/closestTo/index.d.ts
new file mode 100644
index 0000000..44d10c3
--- /dev/null
+++ b/date-fns/src/fp/closestTo/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { closestTo } from 'date-fns/fp'
+export default closestTo
diff --git a/date-fns/src/fp/closestTo/index.js b/date-fns/src/fp/closestTo/index.js
new file mode 100644
index 0000000..fb0b8fc
--- /dev/null
+++ b/date-fns/src/fp/closestTo/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../closestTo/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var closestTo = convertToFP(fn, 2)
+
+export default closestTo
diff --git a/date-fns/src/fp/closestTo/index.js.flow b/date-fns/src/fp/closestTo/index.js.flow
new file mode 100644
index 0000000..89e8756
--- /dev/null
+++ b/date-fns/src/fp/closestTo/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<(Date | number)[], Date | number, Date>
diff --git a/date-fns/src/fp/compareAsc/index.d.ts b/date-fns/src/fp/compareAsc/index.d.ts
new file mode 100644
index 0000000..77d5c61
--- /dev/null
+++ b/date-fns/src/fp/compareAsc/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { compareAsc } from 'date-fns/fp'
+export default compareAsc
diff --git a/date-fns/src/fp/compareAsc/index.js b/date-fns/src/fp/compareAsc/index.js
new file mode 100644
index 0000000..74e13ff
--- /dev/null
+++ b/date-fns/src/fp/compareAsc/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../compareAsc/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var compareAsc = convertToFP(fn, 2)
+
+export default compareAsc
diff --git a/date-fns/src/fp/compareAsc/index.js.flow b/date-fns/src/fp/compareAsc/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/compareAsc/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/compareDesc/index.d.ts b/date-fns/src/fp/compareDesc/index.d.ts
new file mode 100644
index 0000000..df01367
--- /dev/null
+++ b/date-fns/src/fp/compareDesc/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { compareDesc } from 'date-fns/fp'
+export default compareDesc
diff --git a/date-fns/src/fp/compareDesc/index.js b/date-fns/src/fp/compareDesc/index.js
new file mode 100644
index 0000000..c455234
--- /dev/null
+++ b/date-fns/src/fp/compareDesc/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../compareDesc/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var compareDesc = convertToFP(fn, 2)
+
+export default compareDesc
diff --git a/date-fns/src/fp/compareDesc/index.js.flow b/date-fns/src/fp/compareDesc/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/compareDesc/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/daysToWeeks/index.d.ts b/date-fns/src/fp/daysToWeeks/index.d.ts
new file mode 100644
index 0000000..798a9e1
--- /dev/null
+++ b/date-fns/src/fp/daysToWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { daysToWeeks } from 'date-fns/fp'
+export default daysToWeeks
diff --git a/date-fns/src/fp/daysToWeeks/index.js b/date-fns/src/fp/daysToWeeks/index.js
new file mode 100644
index 0000000..058ab00
--- /dev/null
+++ b/date-fns/src/fp/daysToWeeks/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../daysToWeeks/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var daysToWeeks = convertToFP(fn, 1)
+
+export default daysToWeeks
diff --git a/date-fns/src/fp/daysToWeeks/index.js.flow b/date-fns/src/fp/daysToWeeks/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/daysToWeeks/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/differenceInBusinessDays/index.d.ts b/date-fns/src/fp/differenceInBusinessDays/index.d.ts
new file mode 100644
index 0000000..4ff9890
--- /dev/null
+++ b/date-fns/src/fp/differenceInBusinessDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInBusinessDays } from 'date-fns/fp'
+export default differenceInBusinessDays
diff --git a/date-fns/src/fp/differenceInBusinessDays/index.js b/date-fns/src/fp/differenceInBusinessDays/index.js
new file mode 100644
index 0000000..21c5bc7
--- /dev/null
+++ b/date-fns/src/fp/differenceInBusinessDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInBusinessDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInBusinessDays = convertToFP(fn, 2)
+
+export default differenceInBusinessDays
diff --git a/date-fns/src/fp/differenceInBusinessDays/index.js.flow b/date-fns/src/fp/differenceInBusinessDays/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInBusinessDays/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInCalendarDays/index.d.ts b/date-fns/src/fp/differenceInCalendarDays/index.d.ts
new file mode 100644
index 0000000..b6ae5f5
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarDays } from 'date-fns/fp'
+export default differenceInCalendarDays
diff --git a/date-fns/src/fp/differenceInCalendarDays/index.js b/date-fns/src/fp/differenceInCalendarDays/index.js
new file mode 100644
index 0000000..d99e50d
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarDays = convertToFP(fn, 2)
+
+export default differenceInCalendarDays
diff --git a/date-fns/src/fp/differenceInCalendarDays/index.js.flow b/date-fns/src/fp/differenceInCalendarDays/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarDays/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInCalendarISOWeekYears/index.d.ts b/date-fns/src/fp/differenceInCalendarISOWeekYears/index.d.ts
new file mode 100644
index 0000000..4e21998
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarISOWeekYears } from 'date-fns/fp'
+export default differenceInCalendarISOWeekYears
diff --git a/date-fns/src/fp/differenceInCalendarISOWeekYears/index.js b/date-fns/src/fp/differenceInCalendarISOWeekYears/index.js
new file mode 100644
index 0000000..42bb5e4
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarISOWeekYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarISOWeekYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarISOWeekYears = convertToFP(fn, 2)
+
+export default differenceInCalendarISOWeekYears
diff --git a/date-fns/src/fp/differenceInCalendarISOWeekYears/index.js.flow b/date-fns/src/fp/differenceInCalendarISOWeekYears/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarISOWeekYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInCalendarISOWeeks/index.d.ts b/date-fns/src/fp/differenceInCalendarISOWeeks/index.d.ts
new file mode 100644
index 0000000..7751c6f
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarISOWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarISOWeeks } from 'date-fns/fp'
+export default differenceInCalendarISOWeeks
diff --git a/date-fns/src/fp/differenceInCalendarISOWeeks/index.js b/date-fns/src/fp/differenceInCalendarISOWeeks/index.js
new file mode 100644
index 0000000..d8551a1
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarISOWeeks/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarISOWeeks/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarISOWeeks = convertToFP(fn, 2)
+
+export default differenceInCalendarISOWeeks
diff --git a/date-fns/src/fp/differenceInCalendarISOWeeks/index.js.flow b/date-fns/src/fp/differenceInCalendarISOWeeks/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarISOWeeks/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInCalendarMonths/index.d.ts b/date-fns/src/fp/differenceInCalendarMonths/index.d.ts
new file mode 100644
index 0000000..080ac92
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarMonths } from 'date-fns/fp'
+export default differenceInCalendarMonths
diff --git a/date-fns/src/fp/differenceInCalendarMonths/index.js b/date-fns/src/fp/differenceInCalendarMonths/index.js
new file mode 100644
index 0000000..12edc3c
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarMonths/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarMonths/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarMonths = convertToFP(fn, 2)
+
+export default differenceInCalendarMonths
diff --git a/date-fns/src/fp/differenceInCalendarMonths/index.js.flow b/date-fns/src/fp/differenceInCalendarMonths/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarMonths/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInCalendarQuarters/index.d.ts b/date-fns/src/fp/differenceInCalendarQuarters/index.d.ts
new file mode 100644
index 0000000..7b9208b
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarQuarters } from 'date-fns/fp'
+export default differenceInCalendarQuarters
diff --git a/date-fns/src/fp/differenceInCalendarQuarters/index.js b/date-fns/src/fp/differenceInCalendarQuarters/index.js
new file mode 100644
index 0000000..4c9417c
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarQuarters/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarQuarters/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarQuarters = convertToFP(fn, 2)
+
+export default differenceInCalendarQuarters
diff --git a/date-fns/src/fp/differenceInCalendarQuarters/index.js.flow b/date-fns/src/fp/differenceInCalendarQuarters/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarQuarters/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInCalendarWeeks/index.d.ts b/date-fns/src/fp/differenceInCalendarWeeks/index.d.ts
new file mode 100644
index 0000000..c64709a
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarWeeks } from 'date-fns/fp'
+export default differenceInCalendarWeeks
diff --git a/date-fns/src/fp/differenceInCalendarWeeks/index.js b/date-fns/src/fp/differenceInCalendarWeeks/index.js
new file mode 100644
index 0000000..61190aa
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarWeeks/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarWeeks/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarWeeks = convertToFP(fn, 2)
+
+export default differenceInCalendarWeeks
diff --git a/date-fns/src/fp/differenceInCalendarWeeks/index.js.flow b/date-fns/src/fp/differenceInCalendarWeeks/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarWeeks/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.d.ts b/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.d.ts
new file mode 100644
index 0000000..344e205
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarWeeksWithOptions } from 'date-fns/fp'
+export default differenceInCalendarWeeksWithOptions
diff --git a/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js b/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js
new file mode 100644
index 0000000..1708945
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarWeeks/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarWeeksWithOptions = convertToFP(fn, 3)
+
+export default differenceInCalendarWeeksWithOptions
diff --git a/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js.flow b/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js.flow
new file mode 100644
index 0000000..9ee18fd
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarWeeksWithOptions/index.js.flow
@@ -0,0 +1,75 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date | number,
+ number
+>
diff --git a/date-fns/src/fp/differenceInCalendarYears/index.d.ts b/date-fns/src/fp/differenceInCalendarYears/index.d.ts
new file mode 100644
index 0000000..1390b1f
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInCalendarYears } from 'date-fns/fp'
+export default differenceInCalendarYears
diff --git a/date-fns/src/fp/differenceInCalendarYears/index.js b/date-fns/src/fp/differenceInCalendarYears/index.js
new file mode 100644
index 0000000..fad8b02
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInCalendarYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInCalendarYears = convertToFP(fn, 2)
+
+export default differenceInCalendarYears
diff --git a/date-fns/src/fp/differenceInCalendarYears/index.js.flow b/date-fns/src/fp/differenceInCalendarYears/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInCalendarYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInDays/index.d.ts b/date-fns/src/fp/differenceInDays/index.d.ts
new file mode 100644
index 0000000..b240c6e
--- /dev/null
+++ b/date-fns/src/fp/differenceInDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInDays } from 'date-fns/fp'
+export default differenceInDays
diff --git a/date-fns/src/fp/differenceInDays/index.js b/date-fns/src/fp/differenceInDays/index.js
new file mode 100644
index 0000000..ee7d0d9
--- /dev/null
+++ b/date-fns/src/fp/differenceInDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInDays = convertToFP(fn, 2)
+
+export default differenceInDays
diff --git a/date-fns/src/fp/differenceInDays/index.js.flow b/date-fns/src/fp/differenceInDays/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInDays/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInHours/index.d.ts b/date-fns/src/fp/differenceInHours/index.d.ts
new file mode 100644
index 0000000..4cc2797
--- /dev/null
+++ b/date-fns/src/fp/differenceInHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInHours } from 'date-fns/fp'
+export default differenceInHours
diff --git a/date-fns/src/fp/differenceInHours/index.js b/date-fns/src/fp/differenceInHours/index.js
new file mode 100644
index 0000000..5686bb2
--- /dev/null
+++ b/date-fns/src/fp/differenceInHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInHours = convertToFP(fn, 2)
+
+export default differenceInHours
diff --git a/date-fns/src/fp/differenceInHours/index.js.flow b/date-fns/src/fp/differenceInHours/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInHours/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInISOWeekYears/index.d.ts b/date-fns/src/fp/differenceInISOWeekYears/index.d.ts
new file mode 100644
index 0000000..634591a
--- /dev/null
+++ b/date-fns/src/fp/differenceInISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInISOWeekYears } from 'date-fns/fp'
+export default differenceInISOWeekYears
diff --git a/date-fns/src/fp/differenceInISOWeekYears/index.js b/date-fns/src/fp/differenceInISOWeekYears/index.js
new file mode 100644
index 0000000..1a60642
--- /dev/null
+++ b/date-fns/src/fp/differenceInISOWeekYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInISOWeekYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInISOWeekYears = convertToFP(fn, 2)
+
+export default differenceInISOWeekYears
diff --git a/date-fns/src/fp/differenceInISOWeekYears/index.js.flow b/date-fns/src/fp/differenceInISOWeekYears/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInISOWeekYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInMilliseconds/index.d.ts b/date-fns/src/fp/differenceInMilliseconds/index.d.ts
new file mode 100644
index 0000000..23924cb
--- /dev/null
+++ b/date-fns/src/fp/differenceInMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInMilliseconds } from 'date-fns/fp'
+export default differenceInMilliseconds
diff --git a/date-fns/src/fp/differenceInMilliseconds/index.js b/date-fns/src/fp/differenceInMilliseconds/index.js
new file mode 100644
index 0000000..2d82792
--- /dev/null
+++ b/date-fns/src/fp/differenceInMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInMilliseconds = convertToFP(fn, 2)
+
+export default differenceInMilliseconds
diff --git a/date-fns/src/fp/differenceInMilliseconds/index.js.flow b/date-fns/src/fp/differenceInMilliseconds/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInMilliseconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInMinutes/index.d.ts b/date-fns/src/fp/differenceInMinutes/index.d.ts
new file mode 100644
index 0000000..6d00d34
--- /dev/null
+++ b/date-fns/src/fp/differenceInMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInMinutes } from 'date-fns/fp'
+export default differenceInMinutes
diff --git a/date-fns/src/fp/differenceInMinutes/index.js b/date-fns/src/fp/differenceInMinutes/index.js
new file mode 100644
index 0000000..4184936
--- /dev/null
+++ b/date-fns/src/fp/differenceInMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInMinutes = convertToFP(fn, 2)
+
+export default differenceInMinutes
diff --git a/date-fns/src/fp/differenceInMinutes/index.js.flow b/date-fns/src/fp/differenceInMinutes/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInMinutes/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInMonths/index.d.ts b/date-fns/src/fp/differenceInMonths/index.d.ts
new file mode 100644
index 0000000..17bdd4e
--- /dev/null
+++ b/date-fns/src/fp/differenceInMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInMonths } from 'date-fns/fp'
+export default differenceInMonths
diff --git a/date-fns/src/fp/differenceInMonths/index.js b/date-fns/src/fp/differenceInMonths/index.js
new file mode 100644
index 0000000..ad89d12
--- /dev/null
+++ b/date-fns/src/fp/differenceInMonths/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInMonths/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInMonths = convertToFP(fn, 2)
+
+export default differenceInMonths
diff --git a/date-fns/src/fp/differenceInMonths/index.js.flow b/date-fns/src/fp/differenceInMonths/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInMonths/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInQuarters/index.d.ts b/date-fns/src/fp/differenceInQuarters/index.d.ts
new file mode 100644
index 0000000..649f21d
--- /dev/null
+++ b/date-fns/src/fp/differenceInQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInQuarters } from 'date-fns/fp'
+export default differenceInQuarters
diff --git a/date-fns/src/fp/differenceInQuarters/index.js b/date-fns/src/fp/differenceInQuarters/index.js
new file mode 100644
index 0000000..9283c20
--- /dev/null
+++ b/date-fns/src/fp/differenceInQuarters/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInQuarters/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInQuarters = convertToFP(fn, 2)
+
+export default differenceInQuarters
diff --git a/date-fns/src/fp/differenceInQuarters/index.js.flow b/date-fns/src/fp/differenceInQuarters/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInQuarters/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInSeconds/index.d.ts b/date-fns/src/fp/differenceInSeconds/index.d.ts
new file mode 100644
index 0000000..1dded51
--- /dev/null
+++ b/date-fns/src/fp/differenceInSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInSeconds } from 'date-fns/fp'
+export default differenceInSeconds
diff --git a/date-fns/src/fp/differenceInSeconds/index.js b/date-fns/src/fp/differenceInSeconds/index.js
new file mode 100644
index 0000000..408b754
--- /dev/null
+++ b/date-fns/src/fp/differenceInSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInSeconds = convertToFP(fn, 2)
+
+export default differenceInSeconds
diff --git a/date-fns/src/fp/differenceInSeconds/index.js.flow b/date-fns/src/fp/differenceInSeconds/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInSeconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInWeeks/index.d.ts b/date-fns/src/fp/differenceInWeeks/index.d.ts
new file mode 100644
index 0000000..52d5220
--- /dev/null
+++ b/date-fns/src/fp/differenceInWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInWeeks } from 'date-fns/fp'
+export default differenceInWeeks
diff --git a/date-fns/src/fp/differenceInWeeks/index.js b/date-fns/src/fp/differenceInWeeks/index.js
new file mode 100644
index 0000000..ff0e3a4
--- /dev/null
+++ b/date-fns/src/fp/differenceInWeeks/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInWeeks/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInWeeks = convertToFP(fn, 2)
+
+export default differenceInWeeks
diff --git a/date-fns/src/fp/differenceInWeeks/index.js.flow b/date-fns/src/fp/differenceInWeeks/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInWeeks/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/differenceInYears/index.d.ts b/date-fns/src/fp/differenceInYears/index.d.ts
new file mode 100644
index 0000000..20fd164
--- /dev/null
+++ b/date-fns/src/fp/differenceInYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { differenceInYears } from 'date-fns/fp'
+export default differenceInYears
diff --git a/date-fns/src/fp/differenceInYears/index.js b/date-fns/src/fp/differenceInYears/index.js
new file mode 100644
index 0000000..cfa3274
--- /dev/null
+++ b/date-fns/src/fp/differenceInYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../differenceInYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var differenceInYears = convertToFP(fn, 2)
+
+export default differenceInYears
diff --git a/date-fns/src/fp/differenceInYears/index.js.flow b/date-fns/src/fp/differenceInYears/index.js.flow
new file mode 100644
index 0000000..78c45ae
--- /dev/null
+++ b/date-fns/src/fp/differenceInYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, number>
diff --git a/date-fns/src/fp/eachDayOfInterval/index.d.ts b/date-fns/src/fp/eachDayOfInterval/index.d.ts
new file mode 100644
index 0000000..e878e76
--- /dev/null
+++ b/date-fns/src/fp/eachDayOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachDayOfInterval } from 'date-fns/fp'
+export default eachDayOfInterval
diff --git a/date-fns/src/fp/eachDayOfInterval/index.js b/date-fns/src/fp/eachDayOfInterval/index.js
new file mode 100644
index 0000000..e10f89a
--- /dev/null
+++ b/date-fns/src/fp/eachDayOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachDayOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachDayOfInterval = convertToFP(fn, 1)
+
+export default eachDayOfInterval
diff --git a/date-fns/src/fp/eachDayOfInterval/index.js.flow b/date-fns/src/fp/eachDayOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachDayOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/eachDayOfIntervalWithOptions/index.d.ts b/date-fns/src/fp/eachDayOfIntervalWithOptions/index.d.ts
new file mode 100644
index 0000000..5862284
--- /dev/null
+++ b/date-fns/src/fp/eachDayOfIntervalWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachDayOfIntervalWithOptions } from 'date-fns/fp'
+export default eachDayOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachDayOfIntervalWithOptions/index.js b/date-fns/src/fp/eachDayOfIntervalWithOptions/index.js
new file mode 100644
index 0000000..5f83f92
--- /dev/null
+++ b/date-fns/src/fp/eachDayOfIntervalWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachDayOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachDayOfIntervalWithOptions = convertToFP(fn, 2)
+
+export default eachDayOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachDayOfIntervalWithOptions/index.js.flow b/date-fns/src/fp/eachDayOfIntervalWithOptions/index.js.flow
new file mode 100644
index 0000000..bedeb21
--- /dev/null
+++ b/date-fns/src/fp/eachDayOfIntervalWithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ step?: number,
+ },
+ Interval,
+ Date[]
+>
diff --git a/date-fns/src/fp/eachHourOfInterval/index.d.ts b/date-fns/src/fp/eachHourOfInterval/index.d.ts
new file mode 100644
index 0000000..055ab32
--- /dev/null
+++ b/date-fns/src/fp/eachHourOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachHourOfInterval } from 'date-fns/fp'
+export default eachHourOfInterval
diff --git a/date-fns/src/fp/eachHourOfInterval/index.js b/date-fns/src/fp/eachHourOfInterval/index.js
new file mode 100644
index 0000000..8025213
--- /dev/null
+++ b/date-fns/src/fp/eachHourOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachHourOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachHourOfInterval = convertToFP(fn, 1)
+
+export default eachHourOfInterval
diff --git a/date-fns/src/fp/eachHourOfInterval/index.js.flow b/date-fns/src/fp/eachHourOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachHourOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/eachHourOfIntervalWithOptions/index.d.ts b/date-fns/src/fp/eachHourOfIntervalWithOptions/index.d.ts
new file mode 100644
index 0000000..7b781f9
--- /dev/null
+++ b/date-fns/src/fp/eachHourOfIntervalWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachHourOfIntervalWithOptions } from 'date-fns/fp'
+export default eachHourOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachHourOfIntervalWithOptions/index.js b/date-fns/src/fp/eachHourOfIntervalWithOptions/index.js
new file mode 100644
index 0000000..ab52bb3
--- /dev/null
+++ b/date-fns/src/fp/eachHourOfIntervalWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachHourOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachHourOfIntervalWithOptions = convertToFP(fn, 2)
+
+export default eachHourOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachHourOfIntervalWithOptions/index.js.flow b/date-fns/src/fp/eachHourOfIntervalWithOptions/index.js.flow
new file mode 100644
index 0000000..bedeb21
--- /dev/null
+++ b/date-fns/src/fp/eachHourOfIntervalWithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ step?: number,
+ },
+ Interval,
+ Date[]
+>
diff --git a/date-fns/src/fp/eachMinuteOfInterval/index.d.ts b/date-fns/src/fp/eachMinuteOfInterval/index.d.ts
new file mode 100644
index 0000000..243185f
--- /dev/null
+++ b/date-fns/src/fp/eachMinuteOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachMinuteOfInterval } from 'date-fns/fp'
+export default eachMinuteOfInterval
diff --git a/date-fns/src/fp/eachMinuteOfInterval/index.js b/date-fns/src/fp/eachMinuteOfInterval/index.js
new file mode 100644
index 0000000..b56e0dd
--- /dev/null
+++ b/date-fns/src/fp/eachMinuteOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachMinuteOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachMinuteOfInterval = convertToFP(fn, 1)
+
+export default eachMinuteOfInterval
diff --git a/date-fns/src/fp/eachMinuteOfInterval/index.js.flow b/date-fns/src/fp/eachMinuteOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachMinuteOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.d.ts b/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.d.ts
new file mode 100644
index 0000000..716aa44
--- /dev/null
+++ b/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachMinuteOfIntervalWithOptions } from 'date-fns/fp'
+export default eachMinuteOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js b/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js
new file mode 100644
index 0000000..e4d6702
--- /dev/null
+++ b/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachMinuteOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachMinuteOfIntervalWithOptions = convertToFP(fn, 2)
+
+export default eachMinuteOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js.flow b/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js.flow
new file mode 100644
index 0000000..bedeb21
--- /dev/null
+++ b/date-fns/src/fp/eachMinuteOfIntervalWithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ step?: number,
+ },
+ Interval,
+ Date[]
+>
diff --git a/date-fns/src/fp/eachMonthOfInterval/index.d.ts b/date-fns/src/fp/eachMonthOfInterval/index.d.ts
new file mode 100644
index 0000000..1f3cae5
--- /dev/null
+++ b/date-fns/src/fp/eachMonthOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachMonthOfInterval } from 'date-fns/fp'
+export default eachMonthOfInterval
diff --git a/date-fns/src/fp/eachMonthOfInterval/index.js b/date-fns/src/fp/eachMonthOfInterval/index.js
new file mode 100644
index 0000000..91cf896
--- /dev/null
+++ b/date-fns/src/fp/eachMonthOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachMonthOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachMonthOfInterval = convertToFP(fn, 1)
+
+export default eachMonthOfInterval
diff --git a/date-fns/src/fp/eachMonthOfInterval/index.js.flow b/date-fns/src/fp/eachMonthOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachMonthOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/eachQuarterOfInterval/index.d.ts b/date-fns/src/fp/eachQuarterOfInterval/index.d.ts
new file mode 100644
index 0000000..8a81f63
--- /dev/null
+++ b/date-fns/src/fp/eachQuarterOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachQuarterOfInterval } from 'date-fns/fp'
+export default eachQuarterOfInterval
diff --git a/date-fns/src/fp/eachQuarterOfInterval/index.js b/date-fns/src/fp/eachQuarterOfInterval/index.js
new file mode 100644
index 0000000..ca236bc
--- /dev/null
+++ b/date-fns/src/fp/eachQuarterOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachQuarterOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachQuarterOfInterval = convertToFP(fn, 1)
+
+export default eachQuarterOfInterval
diff --git a/date-fns/src/fp/eachQuarterOfInterval/index.js.flow b/date-fns/src/fp/eachQuarterOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachQuarterOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/eachWeekOfInterval/index.d.ts b/date-fns/src/fp/eachWeekOfInterval/index.d.ts
new file mode 100644
index 0000000..ab5d4b4
--- /dev/null
+++ b/date-fns/src/fp/eachWeekOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekOfInterval } from 'date-fns/fp'
+export default eachWeekOfInterval
diff --git a/date-fns/src/fp/eachWeekOfInterval/index.js b/date-fns/src/fp/eachWeekOfInterval/index.js
new file mode 100644
index 0000000..e6e9820
--- /dev/null
+++ b/date-fns/src/fp/eachWeekOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachWeekOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachWeekOfInterval = convertToFP(fn, 1)
+
+export default eachWeekOfInterval
diff --git a/date-fns/src/fp/eachWeekOfInterval/index.js.flow b/date-fns/src/fp/eachWeekOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachWeekOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.d.ts b/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.d.ts
new file mode 100644
index 0000000..def43ab
--- /dev/null
+++ b/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekOfIntervalWithOptions } from 'date-fns/fp'
+export default eachWeekOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js b/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js
new file mode 100644
index 0000000..396d3db
--- /dev/null
+++ b/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachWeekOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachWeekOfIntervalWithOptions = convertToFP(fn, 2)
+
+export default eachWeekOfIntervalWithOptions
diff --git a/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js.flow b/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js.flow
new file mode 100644
index 0000000..3aca218
--- /dev/null
+++ b/date-fns/src/fp/eachWeekOfIntervalWithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Interval,
+ Date[]
+>
diff --git a/date-fns/src/fp/eachWeekendOfInterval/index.d.ts b/date-fns/src/fp/eachWeekendOfInterval/index.d.ts
new file mode 100644
index 0000000..961eff7
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekendOfInterval } from 'date-fns/fp'
+export default eachWeekendOfInterval
diff --git a/date-fns/src/fp/eachWeekendOfInterval/index.js b/date-fns/src/fp/eachWeekendOfInterval/index.js
new file mode 100644
index 0000000..85c2578
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachWeekendOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachWeekendOfInterval = convertToFP(fn, 1)
+
+export default eachWeekendOfInterval
diff --git a/date-fns/src/fp/eachWeekendOfInterval/index.js.flow b/date-fns/src/fp/eachWeekendOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/eachWeekendOfMonth/index.d.ts b/date-fns/src/fp/eachWeekendOfMonth/index.d.ts
new file mode 100644
index 0000000..2501a05
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekendOfMonth } from 'date-fns/fp'
+export default eachWeekendOfMonth
diff --git a/date-fns/src/fp/eachWeekendOfMonth/index.js b/date-fns/src/fp/eachWeekendOfMonth/index.js
new file mode 100644
index 0000000..c51f15c
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachWeekendOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachWeekendOfMonth = convertToFP(fn, 1)
+
+export default eachWeekendOfMonth
diff --git a/date-fns/src/fp/eachWeekendOfMonth/index.js.flow b/date-fns/src/fp/eachWeekendOfMonth/index.js.flow
new file mode 100644
index 0000000..9736b40
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date[]>
diff --git a/date-fns/src/fp/eachWeekendOfYear/index.d.ts b/date-fns/src/fp/eachWeekendOfYear/index.d.ts
new file mode 100644
index 0000000..8554541
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachWeekendOfYear } from 'date-fns/fp'
+export default eachWeekendOfYear
diff --git a/date-fns/src/fp/eachWeekendOfYear/index.js b/date-fns/src/fp/eachWeekendOfYear/index.js
new file mode 100644
index 0000000..176c513
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachWeekendOfYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachWeekendOfYear = convertToFP(fn, 1)
+
+export default eachWeekendOfYear
diff --git a/date-fns/src/fp/eachWeekendOfYear/index.js.flow b/date-fns/src/fp/eachWeekendOfYear/index.js.flow
new file mode 100644
index 0000000..9736b40
--- /dev/null
+++ b/date-fns/src/fp/eachWeekendOfYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date[]>
diff --git a/date-fns/src/fp/eachYearOfInterval/index.d.ts b/date-fns/src/fp/eachYearOfInterval/index.d.ts
new file mode 100644
index 0000000..51e093b
--- /dev/null
+++ b/date-fns/src/fp/eachYearOfInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eachYearOfInterval } from 'date-fns/fp'
+export default eachYearOfInterval
diff --git a/date-fns/src/fp/eachYearOfInterval/index.js b/date-fns/src/fp/eachYearOfInterval/index.js
new file mode 100644
index 0000000..9b4bc3f
--- /dev/null
+++ b/date-fns/src/fp/eachYearOfInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../eachYearOfInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var eachYearOfInterval = convertToFP(fn, 1)
+
+export default eachYearOfInterval
diff --git a/date-fns/src/fp/eachYearOfInterval/index.js.flow b/date-fns/src/fp/eachYearOfInterval/index.js.flow
new file mode 100644
index 0000000..c5f2d6a
--- /dev/null
+++ b/date-fns/src/fp/eachYearOfInterval/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Date[]>
diff --git a/date-fns/src/fp/endOfDay/index.d.ts b/date-fns/src/fp/endOfDay/index.d.ts
new file mode 100644
index 0000000..2db665f
--- /dev/null
+++ b/date-fns/src/fp/endOfDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfDay } from 'date-fns/fp'
+export default endOfDay
diff --git a/date-fns/src/fp/endOfDay/index.js b/date-fns/src/fp/endOfDay/index.js
new file mode 100644
index 0000000..d4cd1c6
--- /dev/null
+++ b/date-fns/src/fp/endOfDay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfDay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfDay = convertToFP(fn, 1)
+
+export default endOfDay
diff --git a/date-fns/src/fp/endOfDay/index.js.flow b/date-fns/src/fp/endOfDay/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfDay/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfDecade/index.d.ts b/date-fns/src/fp/endOfDecade/index.d.ts
new file mode 100644
index 0000000..f3a7e8c
--- /dev/null
+++ b/date-fns/src/fp/endOfDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfDecade } from 'date-fns/fp'
+export default endOfDecade
diff --git a/date-fns/src/fp/endOfDecade/index.js b/date-fns/src/fp/endOfDecade/index.js
new file mode 100644
index 0000000..7bd4446
--- /dev/null
+++ b/date-fns/src/fp/endOfDecade/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfDecade/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfDecade = convertToFP(fn, 1)
+
+export default endOfDecade
diff --git a/date-fns/src/fp/endOfDecade/index.js.flow b/date-fns/src/fp/endOfDecade/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfDecade/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfDecadeWithOptions/index.d.ts b/date-fns/src/fp/endOfDecadeWithOptions/index.d.ts
new file mode 100644
index 0000000..cad60da
--- /dev/null
+++ b/date-fns/src/fp/endOfDecadeWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfDecadeWithOptions } from 'date-fns/fp'
+export default endOfDecadeWithOptions
diff --git a/date-fns/src/fp/endOfDecadeWithOptions/index.js b/date-fns/src/fp/endOfDecadeWithOptions/index.js
new file mode 100644
index 0000000..fcef2a4
--- /dev/null
+++ b/date-fns/src/fp/endOfDecadeWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfDecade/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfDecadeWithOptions = convertToFP(fn, 2)
+
+export default endOfDecadeWithOptions
diff --git a/date-fns/src/fp/endOfDecadeWithOptions/index.js.flow b/date-fns/src/fp/endOfDecadeWithOptions/index.js.flow
new file mode 100644
index 0000000..4b6d0d4
--- /dev/null
+++ b/date-fns/src/fp/endOfDecadeWithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ additionalDigits?: 0 | 1 | 2,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/endOfHour/index.d.ts b/date-fns/src/fp/endOfHour/index.d.ts
new file mode 100644
index 0000000..fb7b319
--- /dev/null
+++ b/date-fns/src/fp/endOfHour/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfHour } from 'date-fns/fp'
+export default endOfHour
diff --git a/date-fns/src/fp/endOfHour/index.js b/date-fns/src/fp/endOfHour/index.js
new file mode 100644
index 0000000..896ebf9
--- /dev/null
+++ b/date-fns/src/fp/endOfHour/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfHour/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfHour = convertToFP(fn, 1)
+
+export default endOfHour
diff --git a/date-fns/src/fp/endOfHour/index.js.flow b/date-fns/src/fp/endOfHour/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfHour/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfISOWeek/index.d.ts b/date-fns/src/fp/endOfISOWeek/index.d.ts
new file mode 100644
index 0000000..64f0b2e
--- /dev/null
+++ b/date-fns/src/fp/endOfISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfISOWeek } from 'date-fns/fp'
+export default endOfISOWeek
diff --git a/date-fns/src/fp/endOfISOWeek/index.js b/date-fns/src/fp/endOfISOWeek/index.js
new file mode 100644
index 0000000..12817f7
--- /dev/null
+++ b/date-fns/src/fp/endOfISOWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfISOWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfISOWeek = convertToFP(fn, 1)
+
+export default endOfISOWeek
diff --git a/date-fns/src/fp/endOfISOWeek/index.js.flow b/date-fns/src/fp/endOfISOWeek/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfISOWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfISOWeekYear/index.d.ts b/date-fns/src/fp/endOfISOWeekYear/index.d.ts
new file mode 100644
index 0000000..9782d7f
--- /dev/null
+++ b/date-fns/src/fp/endOfISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfISOWeekYear } from 'date-fns/fp'
+export default endOfISOWeekYear
diff --git a/date-fns/src/fp/endOfISOWeekYear/index.js b/date-fns/src/fp/endOfISOWeekYear/index.js
new file mode 100644
index 0000000..e8dca89
--- /dev/null
+++ b/date-fns/src/fp/endOfISOWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfISOWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfISOWeekYear = convertToFP(fn, 1)
+
+export default endOfISOWeekYear
diff --git a/date-fns/src/fp/endOfISOWeekYear/index.js.flow b/date-fns/src/fp/endOfISOWeekYear/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfISOWeekYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfMinute/index.d.ts b/date-fns/src/fp/endOfMinute/index.d.ts
new file mode 100644
index 0000000..78e8a19
--- /dev/null
+++ b/date-fns/src/fp/endOfMinute/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfMinute } from 'date-fns/fp'
+export default endOfMinute
diff --git a/date-fns/src/fp/endOfMinute/index.js b/date-fns/src/fp/endOfMinute/index.js
new file mode 100644
index 0000000..66489bd
--- /dev/null
+++ b/date-fns/src/fp/endOfMinute/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfMinute/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfMinute = convertToFP(fn, 1)
+
+export default endOfMinute
diff --git a/date-fns/src/fp/endOfMinute/index.js.flow b/date-fns/src/fp/endOfMinute/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfMinute/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfMonth/index.d.ts b/date-fns/src/fp/endOfMonth/index.d.ts
new file mode 100644
index 0000000..0c23957
--- /dev/null
+++ b/date-fns/src/fp/endOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfMonth } from 'date-fns/fp'
+export default endOfMonth
diff --git a/date-fns/src/fp/endOfMonth/index.js b/date-fns/src/fp/endOfMonth/index.js
new file mode 100644
index 0000000..6e54f05
--- /dev/null
+++ b/date-fns/src/fp/endOfMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfMonth = convertToFP(fn, 1)
+
+export default endOfMonth
diff --git a/date-fns/src/fp/endOfMonth/index.js.flow b/date-fns/src/fp/endOfMonth/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfQuarter/index.d.ts b/date-fns/src/fp/endOfQuarter/index.d.ts
new file mode 100644
index 0000000..24e729b
--- /dev/null
+++ b/date-fns/src/fp/endOfQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfQuarter } from 'date-fns/fp'
+export default endOfQuarter
diff --git a/date-fns/src/fp/endOfQuarter/index.js b/date-fns/src/fp/endOfQuarter/index.js
new file mode 100644
index 0000000..0f5dc0b
--- /dev/null
+++ b/date-fns/src/fp/endOfQuarter/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfQuarter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfQuarter = convertToFP(fn, 1)
+
+export default endOfQuarter
diff --git a/date-fns/src/fp/endOfQuarter/index.js.flow b/date-fns/src/fp/endOfQuarter/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfQuarter/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfSecond/index.d.ts b/date-fns/src/fp/endOfSecond/index.d.ts
new file mode 100644
index 0000000..6b5d624
--- /dev/null
+++ b/date-fns/src/fp/endOfSecond/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfSecond } from 'date-fns/fp'
+export default endOfSecond
diff --git a/date-fns/src/fp/endOfSecond/index.js b/date-fns/src/fp/endOfSecond/index.js
new file mode 100644
index 0000000..6b58bd8
--- /dev/null
+++ b/date-fns/src/fp/endOfSecond/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfSecond/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfSecond = convertToFP(fn, 1)
+
+export default endOfSecond
diff --git a/date-fns/src/fp/endOfSecond/index.js.flow b/date-fns/src/fp/endOfSecond/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfSecond/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfWeek/index.d.ts b/date-fns/src/fp/endOfWeek/index.d.ts
new file mode 100644
index 0000000..0aa4d10
--- /dev/null
+++ b/date-fns/src/fp/endOfWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfWeek } from 'date-fns/fp'
+export default endOfWeek
diff --git a/date-fns/src/fp/endOfWeek/index.js b/date-fns/src/fp/endOfWeek/index.js
new file mode 100644
index 0000000..256588b
--- /dev/null
+++ b/date-fns/src/fp/endOfWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfWeek = convertToFP(fn, 1)
+
+export default endOfWeek
diff --git a/date-fns/src/fp/endOfWeek/index.js.flow b/date-fns/src/fp/endOfWeek/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/endOfWeekWithOptions/index.d.ts b/date-fns/src/fp/endOfWeekWithOptions/index.d.ts
new file mode 100644
index 0000000..0ddcbf6
--- /dev/null
+++ b/date-fns/src/fp/endOfWeekWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfWeekWithOptions } from 'date-fns/fp'
+export default endOfWeekWithOptions
diff --git a/date-fns/src/fp/endOfWeekWithOptions/index.js b/date-fns/src/fp/endOfWeekWithOptions/index.js
new file mode 100644
index 0000000..49fe42b
--- /dev/null
+++ b/date-fns/src/fp/endOfWeekWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfWeekWithOptions = convertToFP(fn, 2)
+
+export default endOfWeekWithOptions
diff --git a/date-fns/src/fp/endOfWeekWithOptions/index.js.flow b/date-fns/src/fp/endOfWeekWithOptions/index.js.flow
new file mode 100644
index 0000000..9821646
--- /dev/null
+++ b/date-fns/src/fp/endOfWeekWithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/endOfYear/index.d.ts b/date-fns/src/fp/endOfYear/index.d.ts
new file mode 100644
index 0000000..b4e5904
--- /dev/null
+++ b/date-fns/src/fp/endOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { endOfYear } from 'date-fns/fp'
+export default endOfYear
diff --git a/date-fns/src/fp/endOfYear/index.js b/date-fns/src/fp/endOfYear/index.js
new file mode 100644
index 0000000..a66dd9f
--- /dev/null
+++ b/date-fns/src/fp/endOfYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../endOfYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var endOfYear = convertToFP(fn, 1)
+
+export default endOfYear
diff --git a/date-fns/src/fp/endOfYear/index.js.flow b/date-fns/src/fp/endOfYear/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/endOfYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/format/index.d.ts b/date-fns/src/fp/format/index.d.ts
new file mode 100644
index 0000000..bf0c948
--- /dev/null
+++ b/date-fns/src/fp/format/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { format } from 'date-fns/fp'
+export default format
diff --git a/date-fns/src/fp/format/index.js b/date-fns/src/fp/format/index.js
new file mode 100644
index 0000000..6125b0a
--- /dev/null
+++ b/date-fns/src/fp/format/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../format/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var format = convertToFP(fn, 2)
+
+export default format
diff --git a/date-fns/src/fp/format/index.js.flow b/date-fns/src/fp/format/index.js.flow
new file mode 100644
index 0000000..013f277
--- /dev/null
+++ b/date-fns/src/fp/format/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<string, Date | number, string>
diff --git a/date-fns/src/fp/formatDistance/index.d.ts b/date-fns/src/fp/formatDistance/index.d.ts
new file mode 100644
index 0000000..029daa4
--- /dev/null
+++ b/date-fns/src/fp/formatDistance/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistance } from 'date-fns/fp'
+export default formatDistance
diff --git a/date-fns/src/fp/formatDistance/index.js b/date-fns/src/fp/formatDistance/index.js
new file mode 100644
index 0000000..2b61a59
--- /dev/null
+++ b/date-fns/src/fp/formatDistance/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatDistance/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatDistance = convertToFP(fn, 2)
+
+export default formatDistance
diff --git a/date-fns/src/fp/formatDistance/index.js.flow b/date-fns/src/fp/formatDistance/index.js.flow
new file mode 100644
index 0000000..c4ef9a8
--- /dev/null
+++ b/date-fns/src/fp/formatDistance/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, string>
diff --git a/date-fns/src/fp/formatDistanceStrict/index.d.ts b/date-fns/src/fp/formatDistanceStrict/index.d.ts
new file mode 100644
index 0000000..dd41fb8
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceStrict/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistanceStrict } from 'date-fns/fp'
+export default formatDistanceStrict
diff --git a/date-fns/src/fp/formatDistanceStrict/index.js b/date-fns/src/fp/formatDistanceStrict/index.js
new file mode 100644
index 0000000..2fe195c
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceStrict/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatDistanceStrict/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatDistanceStrict = convertToFP(fn, 2)
+
+export default formatDistanceStrict
diff --git a/date-fns/src/fp/formatDistanceStrict/index.js.flow b/date-fns/src/fp/formatDistanceStrict/index.js.flow
new file mode 100644
index 0000000..c4ef9a8
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceStrict/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, string>
diff --git a/date-fns/src/fp/formatDistanceStrictWithOptions/index.d.ts b/date-fns/src/fp/formatDistanceStrictWithOptions/index.d.ts
new file mode 100644
index 0000000..2e626c4
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceStrictWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistanceStrictWithOptions } from 'date-fns/fp'
+export default formatDistanceStrictWithOptions
diff --git a/date-fns/src/fp/formatDistanceStrictWithOptions/index.js b/date-fns/src/fp/formatDistanceStrictWithOptions/index.js
new file mode 100644
index 0000000..e2494e4
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceStrictWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatDistanceStrict/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatDistanceStrictWithOptions = convertToFP(fn, 3)
+
+export default formatDistanceStrictWithOptions
diff --git a/date-fns/src/fp/formatDistanceStrictWithOptions/index.js.flow b/date-fns/src/fp/formatDistanceStrictWithOptions/index.js.flow
new file mode 100644
index 0000000..b021da2
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceStrictWithOptions/index.js.flow
@@ -0,0 +1,77 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ locale?: Locale,
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ addSuffix?: boolean,
+ },
+ Date | number,
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/formatDistanceWithOptions/index.d.ts b/date-fns/src/fp/formatDistanceWithOptions/index.d.ts
new file mode 100644
index 0000000..62f0849
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDistanceWithOptions } from 'date-fns/fp'
+export default formatDistanceWithOptions
diff --git a/date-fns/src/fp/formatDistanceWithOptions/index.js b/date-fns/src/fp/formatDistanceWithOptions/index.js
new file mode 100644
index 0000000..8e97fdc
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatDistance/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatDistanceWithOptions = convertToFP(fn, 3)
+
+export default formatDistanceWithOptions
diff --git a/date-fns/src/fp/formatDistanceWithOptions/index.js.flow b/date-fns/src/fp/formatDistanceWithOptions/index.js.flow
new file mode 100644
index 0000000..5904311
--- /dev/null
+++ b/date-fns/src/fp/formatDistanceWithOptions/index.js.flow
@@ -0,0 +1,76 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ locale?: Locale,
+ addSuffix?: boolean,
+ includeSeconds?: boolean,
+ },
+ Date | number,
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/formatDuration/index.d.ts b/date-fns/src/fp/formatDuration/index.d.ts
new file mode 100644
index 0000000..3b184cc
--- /dev/null
+++ b/date-fns/src/fp/formatDuration/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDuration } from 'date-fns/fp'
+export default formatDuration
diff --git a/date-fns/src/fp/formatDuration/index.js b/date-fns/src/fp/formatDuration/index.js
new file mode 100644
index 0000000..45dde95
--- /dev/null
+++ b/date-fns/src/fp/formatDuration/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatDuration/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatDuration = convertToFP(fn, 1)
+
+export default formatDuration
diff --git a/date-fns/src/fp/formatDuration/index.js.flow b/date-fns/src/fp/formatDuration/index.js.flow
new file mode 100644
index 0000000..da71564
--- /dev/null
+++ b/date-fns/src/fp/formatDuration/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Duration, string>
diff --git a/date-fns/src/fp/formatDurationWithOptions/index.d.ts b/date-fns/src/fp/formatDurationWithOptions/index.d.ts
new file mode 100644
index 0000000..6331517
--- /dev/null
+++ b/date-fns/src/fp/formatDurationWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatDurationWithOptions } from 'date-fns/fp'
+export default formatDurationWithOptions
diff --git a/date-fns/src/fp/formatDurationWithOptions/index.js b/date-fns/src/fp/formatDurationWithOptions/index.js
new file mode 100644
index 0000000..9add43f
--- /dev/null
+++ b/date-fns/src/fp/formatDurationWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatDuration/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatDurationWithOptions = convertToFP(fn, 2)
+
+export default formatDurationWithOptions
diff --git a/date-fns/src/fp/formatDurationWithOptions/index.js.flow b/date-fns/src/fp/formatDurationWithOptions/index.js.flow
new file mode 100644
index 0000000..72f2910
--- /dev/null
+++ b/date-fns/src/fp/formatDurationWithOptions/index.js.flow
@@ -0,0 +1,67 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ locale?: Locale,
+ delimiter?: string,
+ zero?: boolean,
+ format?: string[],
+ },
+ Duration,
+ string
+>
diff --git a/date-fns/src/fp/formatISO/index.d.ts b/date-fns/src/fp/formatISO/index.d.ts
new file mode 100644
index 0000000..6f3ba60
--- /dev/null
+++ b/date-fns/src/fp/formatISO/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISO } from 'date-fns/fp'
+export default formatISO
diff --git a/date-fns/src/fp/formatISO/index.js b/date-fns/src/fp/formatISO/index.js
new file mode 100644
index 0000000..c59aeb5
--- /dev/null
+++ b/date-fns/src/fp/formatISO/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatISO/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatISO = convertToFP(fn, 1)
+
+export default formatISO
diff --git a/date-fns/src/fp/formatISO/index.js.flow b/date-fns/src/fp/formatISO/index.js.flow
new file mode 100644
index 0000000..a2b1a3a
--- /dev/null
+++ b/date-fns/src/fp/formatISO/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, string>
diff --git a/date-fns/src/fp/formatISO9075/index.d.ts b/date-fns/src/fp/formatISO9075/index.d.ts
new file mode 100644
index 0000000..171e2b7
--- /dev/null
+++ b/date-fns/src/fp/formatISO9075/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISO9075 } from 'date-fns/fp'
+export default formatISO9075
diff --git a/date-fns/src/fp/formatISO9075/index.js b/date-fns/src/fp/formatISO9075/index.js
new file mode 100644
index 0000000..f7e3f44
--- /dev/null
+++ b/date-fns/src/fp/formatISO9075/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatISO9075/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatISO9075 = convertToFP(fn, 1)
+
+export default formatISO9075
diff --git a/date-fns/src/fp/formatISO9075/index.js.flow b/date-fns/src/fp/formatISO9075/index.js.flow
new file mode 100644
index 0000000..a2b1a3a
--- /dev/null
+++ b/date-fns/src/fp/formatISO9075/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, string>
diff --git a/date-fns/src/fp/formatISO9075WithOptions/index.d.ts b/date-fns/src/fp/formatISO9075WithOptions/index.d.ts
new file mode 100644
index 0000000..3000885
--- /dev/null
+++ b/date-fns/src/fp/formatISO9075WithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISO9075WithOptions } from 'date-fns/fp'
+export default formatISO9075WithOptions
diff --git a/date-fns/src/fp/formatISO9075WithOptions/index.js b/date-fns/src/fp/formatISO9075WithOptions/index.js
new file mode 100644
index 0000000..aa642a6
--- /dev/null
+++ b/date-fns/src/fp/formatISO9075WithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatISO9075/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatISO9075WithOptions = convertToFP(fn, 2)
+
+export default formatISO9075WithOptions
diff --git a/date-fns/src/fp/formatISO9075WithOptions/index.js.flow b/date-fns/src/fp/formatISO9075WithOptions/index.js.flow
new file mode 100644
index 0000000..fd294f1
--- /dev/null
+++ b/date-fns/src/fp/formatISO9075WithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ representation?: 'complete' | 'date' | 'time',
+ format?: 'extended' | 'basic',
+ },
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/formatISODuration/index.d.ts b/date-fns/src/fp/formatISODuration/index.d.ts
new file mode 100644
index 0000000..aedd086
--- /dev/null
+++ b/date-fns/src/fp/formatISODuration/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISODuration } from 'date-fns/fp'
+export default formatISODuration
diff --git a/date-fns/src/fp/formatISODuration/index.js b/date-fns/src/fp/formatISODuration/index.js
new file mode 100644
index 0000000..21010c7
--- /dev/null
+++ b/date-fns/src/fp/formatISODuration/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatISODuration/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatISODuration = convertToFP(fn, 1)
+
+export default formatISODuration
diff --git a/date-fns/src/fp/formatISODuration/index.js.flow b/date-fns/src/fp/formatISODuration/index.js.flow
new file mode 100644
index 0000000..da71564
--- /dev/null
+++ b/date-fns/src/fp/formatISODuration/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Duration, string>
diff --git a/date-fns/src/fp/formatISOWithOptions/index.d.ts b/date-fns/src/fp/formatISOWithOptions/index.d.ts
new file mode 100644
index 0000000..286813e
--- /dev/null
+++ b/date-fns/src/fp/formatISOWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatISOWithOptions } from 'date-fns/fp'
+export default formatISOWithOptions
diff --git a/date-fns/src/fp/formatISOWithOptions/index.js b/date-fns/src/fp/formatISOWithOptions/index.js
new file mode 100644
index 0000000..273bc4c
--- /dev/null
+++ b/date-fns/src/fp/formatISOWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatISO/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatISOWithOptions = convertToFP(fn, 2)
+
+export default formatISOWithOptions
diff --git a/date-fns/src/fp/formatISOWithOptions/index.js.flow b/date-fns/src/fp/formatISOWithOptions/index.js.flow
new file mode 100644
index 0000000..fd294f1
--- /dev/null
+++ b/date-fns/src/fp/formatISOWithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ representation?: 'complete' | 'date' | 'time',
+ format?: 'extended' | 'basic',
+ },
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/formatRFC3339/index.d.ts b/date-fns/src/fp/formatRFC3339/index.d.ts
new file mode 100644
index 0000000..c1ac827
--- /dev/null
+++ b/date-fns/src/fp/formatRFC3339/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRFC3339 } from 'date-fns/fp'
+export default formatRFC3339
diff --git a/date-fns/src/fp/formatRFC3339/index.js b/date-fns/src/fp/formatRFC3339/index.js
new file mode 100644
index 0000000..f570155
--- /dev/null
+++ b/date-fns/src/fp/formatRFC3339/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatRFC3339/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatRFC3339 = convertToFP(fn, 1)
+
+export default formatRFC3339
diff --git a/date-fns/src/fp/formatRFC3339/index.js.flow b/date-fns/src/fp/formatRFC3339/index.js.flow
new file mode 100644
index 0000000..a2b1a3a
--- /dev/null
+++ b/date-fns/src/fp/formatRFC3339/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, string>
diff --git a/date-fns/src/fp/formatRFC3339WithOptions/index.d.ts b/date-fns/src/fp/formatRFC3339WithOptions/index.d.ts
new file mode 100644
index 0000000..b274531
--- /dev/null
+++ b/date-fns/src/fp/formatRFC3339WithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRFC3339WithOptions } from 'date-fns/fp'
+export default formatRFC3339WithOptions
diff --git a/date-fns/src/fp/formatRFC3339WithOptions/index.js b/date-fns/src/fp/formatRFC3339WithOptions/index.js
new file mode 100644
index 0000000..6db8e3b
--- /dev/null
+++ b/date-fns/src/fp/formatRFC3339WithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatRFC3339/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatRFC3339WithOptions = convertToFP(fn, 2)
+
+export default formatRFC3339WithOptions
diff --git a/date-fns/src/fp/formatRFC3339WithOptions/index.js.flow b/date-fns/src/fp/formatRFC3339WithOptions/index.js.flow
new file mode 100644
index 0000000..77fba59
--- /dev/null
+++ b/date-fns/src/fp/formatRFC3339WithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ fractionDigits?: 0 | 1 | 2 | 3,
+ },
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/formatRFC7231/index.d.ts b/date-fns/src/fp/formatRFC7231/index.d.ts
new file mode 100644
index 0000000..ca45e43
--- /dev/null
+++ b/date-fns/src/fp/formatRFC7231/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRFC7231 } from 'date-fns/fp'
+export default formatRFC7231
diff --git a/date-fns/src/fp/formatRFC7231/index.js b/date-fns/src/fp/formatRFC7231/index.js
new file mode 100644
index 0000000..ef3b46f
--- /dev/null
+++ b/date-fns/src/fp/formatRFC7231/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatRFC7231/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatRFC7231 = convertToFP(fn, 1)
+
+export default formatRFC7231
diff --git a/date-fns/src/fp/formatRFC7231/index.js.flow b/date-fns/src/fp/formatRFC7231/index.js.flow
new file mode 100644
index 0000000..a2b1a3a
--- /dev/null
+++ b/date-fns/src/fp/formatRFC7231/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, string>
diff --git a/date-fns/src/fp/formatRelative/index.d.ts b/date-fns/src/fp/formatRelative/index.d.ts
new file mode 100644
index 0000000..927a300
--- /dev/null
+++ b/date-fns/src/fp/formatRelative/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRelative } from 'date-fns/fp'
+export default formatRelative
diff --git a/date-fns/src/fp/formatRelative/index.js b/date-fns/src/fp/formatRelative/index.js
new file mode 100644
index 0000000..dc9e35f
--- /dev/null
+++ b/date-fns/src/fp/formatRelative/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatRelative/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatRelative = convertToFP(fn, 2)
+
+export default formatRelative
diff --git a/date-fns/src/fp/formatRelative/index.js.flow b/date-fns/src/fp/formatRelative/index.js.flow
new file mode 100644
index 0000000..c4ef9a8
--- /dev/null
+++ b/date-fns/src/fp/formatRelative/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, string>
diff --git a/date-fns/src/fp/formatRelativeWithOptions/index.d.ts b/date-fns/src/fp/formatRelativeWithOptions/index.d.ts
new file mode 100644
index 0000000..5bea41a
--- /dev/null
+++ b/date-fns/src/fp/formatRelativeWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatRelativeWithOptions } from 'date-fns/fp'
+export default formatRelativeWithOptions
diff --git a/date-fns/src/fp/formatRelativeWithOptions/index.js b/date-fns/src/fp/formatRelativeWithOptions/index.js
new file mode 100644
index 0000000..3ee8a1b
--- /dev/null
+++ b/date-fns/src/fp/formatRelativeWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../formatRelative/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatRelativeWithOptions = convertToFP(fn, 3)
+
+export default formatRelativeWithOptions
diff --git a/date-fns/src/fp/formatRelativeWithOptions/index.js.flow b/date-fns/src/fp/formatRelativeWithOptions/index.js.flow
new file mode 100644
index 0000000..cb51d97
--- /dev/null
+++ b/date-fns/src/fp/formatRelativeWithOptions/index.js.flow
@@ -0,0 +1,75 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/formatWithOptions/index.d.ts b/date-fns/src/fp/formatWithOptions/index.d.ts
new file mode 100644
index 0000000..cd59897
--- /dev/null
+++ b/date-fns/src/fp/formatWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { formatWithOptions } from 'date-fns/fp'
+export default formatWithOptions
diff --git a/date-fns/src/fp/formatWithOptions/index.js b/date-fns/src/fp/formatWithOptions/index.js
new file mode 100644
index 0000000..9c0a819
--- /dev/null
+++ b/date-fns/src/fp/formatWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../format/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var formatWithOptions = convertToFP(fn, 3)
+
+export default formatWithOptions
diff --git a/date-fns/src/fp/formatWithOptions/index.js.flow b/date-fns/src/fp/formatWithOptions/index.js.flow
new file mode 100644
index 0000000..757f95a
--- /dev/null
+++ b/date-fns/src/fp/formatWithOptions/index.js.flow
@@ -0,0 +1,78 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ useAdditionalDayOfYearTokens?: boolean,
+ useAdditionalWeekYearTokens?: boolean,
+ firstWeekContainsDate?: number,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ string,
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/fromUnixTime/index.d.ts b/date-fns/src/fp/fromUnixTime/index.d.ts
new file mode 100644
index 0000000..e6cbce3
--- /dev/null
+++ b/date-fns/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 default fromUnixTime
diff --git a/date-fns/src/fp/fromUnixTime/index.js b/date-fns/src/fp/fromUnixTime/index.js
new file mode 100644
index 0000000..a0c8bf6
--- /dev/null
+++ b/date-fns/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'
+import convertToFP from '../_lib/convertToFP/index'
+
+var fromUnixTime = convertToFP(fn, 1)
+
+export default fromUnixTime
diff --git a/date-fns/src/fp/fromUnixTime/index.js.flow b/date-fns/src/fp/fromUnixTime/index.js.flow
new file mode 100644
index 0000000..27fa886
--- /dev/null
+++ b/date-fns/src/fp/fromUnixTime/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, Date>
diff --git a/date-fns/src/fp/getDate/index.d.ts b/date-fns/src/fp/getDate/index.d.ts
new file mode 100644
index 0000000..879f12c
--- /dev/null
+++ b/date-fns/src/fp/getDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDate } from 'date-fns/fp'
+export default getDate
diff --git a/date-fns/src/fp/getDate/index.js b/date-fns/src/fp/getDate/index.js
new file mode 100644
index 0000000..57b92e6
--- /dev/null
+++ b/date-fns/src/fp/getDate/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getDate/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getDate = convertToFP(fn, 1)
+
+export default getDate
diff --git a/date-fns/src/fp/getDate/index.js.flow b/date-fns/src/fp/getDate/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getDate/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getDay/index.d.ts b/date-fns/src/fp/getDay/index.d.ts
new file mode 100644
index 0000000..e1bccbb
--- /dev/null
+++ b/date-fns/src/fp/getDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDay } from 'date-fns/fp'
+export default getDay
diff --git a/date-fns/src/fp/getDay/index.js b/date-fns/src/fp/getDay/index.js
new file mode 100644
index 0000000..a50b4c7
--- /dev/null
+++ b/date-fns/src/fp/getDay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getDay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getDay = convertToFP(fn, 1)
+
+export default getDay
diff --git a/date-fns/src/fp/getDay/index.js.flow b/date-fns/src/fp/getDay/index.js.flow
new file mode 100644
index 0000000..8971f41
--- /dev/null
+++ b/date-fns/src/fp/getDay/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, 0 | 1 | 2 | 3 | 4 | 5 | 6>
diff --git a/date-fns/src/fp/getDayOfYear/index.d.ts b/date-fns/src/fp/getDayOfYear/index.d.ts
new file mode 100644
index 0000000..ccc88e1
--- /dev/null
+++ b/date-fns/src/fp/getDayOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDayOfYear } from 'date-fns/fp'
+export default getDayOfYear
diff --git a/date-fns/src/fp/getDayOfYear/index.js b/date-fns/src/fp/getDayOfYear/index.js
new file mode 100644
index 0000000..601b20f
--- /dev/null
+++ b/date-fns/src/fp/getDayOfYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getDayOfYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getDayOfYear = convertToFP(fn, 1)
+
+export default getDayOfYear
diff --git a/date-fns/src/fp/getDayOfYear/index.js.flow b/date-fns/src/fp/getDayOfYear/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getDayOfYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getDaysInMonth/index.d.ts b/date-fns/src/fp/getDaysInMonth/index.d.ts
new file mode 100644
index 0000000..2ca8445
--- /dev/null
+++ b/date-fns/src/fp/getDaysInMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDaysInMonth } from 'date-fns/fp'
+export default getDaysInMonth
diff --git a/date-fns/src/fp/getDaysInMonth/index.js b/date-fns/src/fp/getDaysInMonth/index.js
new file mode 100644
index 0000000..b18dd45
--- /dev/null
+++ b/date-fns/src/fp/getDaysInMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getDaysInMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getDaysInMonth = convertToFP(fn, 1)
+
+export default getDaysInMonth
diff --git a/date-fns/src/fp/getDaysInMonth/index.js.flow b/date-fns/src/fp/getDaysInMonth/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getDaysInMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getDaysInYear/index.d.ts b/date-fns/src/fp/getDaysInYear/index.d.ts
new file mode 100644
index 0000000..599213f
--- /dev/null
+++ b/date-fns/src/fp/getDaysInYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDaysInYear } from 'date-fns/fp'
+export default getDaysInYear
diff --git a/date-fns/src/fp/getDaysInYear/index.js b/date-fns/src/fp/getDaysInYear/index.js
new file mode 100644
index 0000000..793b00d
--- /dev/null
+++ b/date-fns/src/fp/getDaysInYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getDaysInYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getDaysInYear = convertToFP(fn, 1)
+
+export default getDaysInYear
diff --git a/date-fns/src/fp/getDaysInYear/index.js.flow b/date-fns/src/fp/getDaysInYear/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getDaysInYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getDecade/index.d.ts b/date-fns/src/fp/getDecade/index.d.ts
new file mode 100644
index 0000000..ca1c9c5
--- /dev/null
+++ b/date-fns/src/fp/getDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDecade } from 'date-fns/fp'
+export default getDecade
diff --git a/date-fns/src/fp/getDecade/index.js b/date-fns/src/fp/getDecade/index.js
new file mode 100644
index 0000000..6845b32
--- /dev/null
+++ b/date-fns/src/fp/getDecade/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getDecade/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getDecade = convertToFP(fn, 1)
+
+export default getDecade
diff --git a/date-fns/src/fp/getDecade/index.js.flow b/date-fns/src/fp/getDecade/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getDecade/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getHours/index.d.ts b/date-fns/src/fp/getHours/index.d.ts
new file mode 100644
index 0000000..9daea8a
--- /dev/null
+++ b/date-fns/src/fp/getHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getHours } from 'date-fns/fp'
+export default getHours
diff --git a/date-fns/src/fp/getHours/index.js b/date-fns/src/fp/getHours/index.js
new file mode 100644
index 0000000..107c1db
--- /dev/null
+++ b/date-fns/src/fp/getHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getHours = convertToFP(fn, 1)
+
+export default getHours
diff --git a/date-fns/src/fp/getHours/index.js.flow b/date-fns/src/fp/getHours/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getHours/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getISODay/index.d.ts b/date-fns/src/fp/getISODay/index.d.ts
new file mode 100644
index 0000000..c85663e
--- /dev/null
+++ b/date-fns/src/fp/getISODay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISODay } from 'date-fns/fp'
+export default getISODay
diff --git a/date-fns/src/fp/getISODay/index.js b/date-fns/src/fp/getISODay/index.js
new file mode 100644
index 0000000..f7e8751
--- /dev/null
+++ b/date-fns/src/fp/getISODay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getISODay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getISODay = convertToFP(fn, 1)
+
+export default getISODay
diff --git a/date-fns/src/fp/getISODay/index.js.flow b/date-fns/src/fp/getISODay/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getISODay/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getISOWeek/index.d.ts b/date-fns/src/fp/getISOWeek/index.d.ts
new file mode 100644
index 0000000..2574d71
--- /dev/null
+++ b/date-fns/src/fp/getISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISOWeek } from 'date-fns/fp'
+export default getISOWeek
diff --git a/date-fns/src/fp/getISOWeek/index.js b/date-fns/src/fp/getISOWeek/index.js
new file mode 100644
index 0000000..00fc0bf
--- /dev/null
+++ b/date-fns/src/fp/getISOWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getISOWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getISOWeek = convertToFP(fn, 1)
+
+export default getISOWeek
diff --git a/date-fns/src/fp/getISOWeek/index.js.flow b/date-fns/src/fp/getISOWeek/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getISOWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getISOWeekYear/index.d.ts b/date-fns/src/fp/getISOWeekYear/index.d.ts
new file mode 100644
index 0000000..b0cfad8
--- /dev/null
+++ b/date-fns/src/fp/getISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISOWeekYear } from 'date-fns/fp'
+export default getISOWeekYear
diff --git a/date-fns/src/fp/getISOWeekYear/index.js b/date-fns/src/fp/getISOWeekYear/index.js
new file mode 100644
index 0000000..5ef6bad
--- /dev/null
+++ b/date-fns/src/fp/getISOWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getISOWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getISOWeekYear = convertToFP(fn, 1)
+
+export default getISOWeekYear
diff --git a/date-fns/src/fp/getISOWeekYear/index.js.flow b/date-fns/src/fp/getISOWeekYear/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getISOWeekYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getISOWeeksInYear/index.d.ts b/date-fns/src/fp/getISOWeeksInYear/index.d.ts
new file mode 100644
index 0000000..3a1d6af
--- /dev/null
+++ b/date-fns/src/fp/getISOWeeksInYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISOWeeksInYear } from 'date-fns/fp'
+export default getISOWeeksInYear
diff --git a/date-fns/src/fp/getISOWeeksInYear/index.js b/date-fns/src/fp/getISOWeeksInYear/index.js
new file mode 100644
index 0000000..c83b12c
--- /dev/null
+++ b/date-fns/src/fp/getISOWeeksInYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getISOWeeksInYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getISOWeeksInYear = convertToFP(fn, 1)
+
+export default getISOWeeksInYear
diff --git a/date-fns/src/fp/getISOWeeksInYear/index.js.flow b/date-fns/src/fp/getISOWeeksInYear/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getISOWeeksInYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getMilliseconds/index.d.ts b/date-fns/src/fp/getMilliseconds/index.d.ts
new file mode 100644
index 0000000..c125962
--- /dev/null
+++ b/date-fns/src/fp/getMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getMilliseconds } from 'date-fns/fp'
+export default getMilliseconds
diff --git a/date-fns/src/fp/getMilliseconds/index.js b/date-fns/src/fp/getMilliseconds/index.js
new file mode 100644
index 0000000..09a4e8c
--- /dev/null
+++ b/date-fns/src/fp/getMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getMilliseconds = convertToFP(fn, 1)
+
+export default getMilliseconds
diff --git a/date-fns/src/fp/getMilliseconds/index.js.flow b/date-fns/src/fp/getMilliseconds/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getMilliseconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getMinutes/index.d.ts b/date-fns/src/fp/getMinutes/index.d.ts
new file mode 100644
index 0000000..14b6b04
--- /dev/null
+++ b/date-fns/src/fp/getMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getMinutes } from 'date-fns/fp'
+export default getMinutes
diff --git a/date-fns/src/fp/getMinutes/index.js b/date-fns/src/fp/getMinutes/index.js
new file mode 100644
index 0000000..9603744
--- /dev/null
+++ b/date-fns/src/fp/getMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getMinutes = convertToFP(fn, 1)
+
+export default getMinutes
diff --git a/date-fns/src/fp/getMinutes/index.js.flow b/date-fns/src/fp/getMinutes/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getMinutes/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getMonth/index.d.ts b/date-fns/src/fp/getMonth/index.d.ts
new file mode 100644
index 0000000..a7c696a
--- /dev/null
+++ b/date-fns/src/fp/getMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getMonth } from 'date-fns/fp'
+export default getMonth
diff --git a/date-fns/src/fp/getMonth/index.js b/date-fns/src/fp/getMonth/index.js
new file mode 100644
index 0000000..f80288a
--- /dev/null
+++ b/date-fns/src/fp/getMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getMonth = convertToFP(fn, 1)
+
+export default getMonth
diff --git a/date-fns/src/fp/getMonth/index.js.flow b/date-fns/src/fp/getMonth/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getOverlappingDaysInIntervals/index.d.ts b/date-fns/src/fp/getOverlappingDaysInIntervals/index.d.ts
new file mode 100644
index 0000000..de0b970
--- /dev/null
+++ b/date-fns/src/fp/getOverlappingDaysInIntervals/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getOverlappingDaysInIntervals } from 'date-fns/fp'
+export default getOverlappingDaysInIntervals
diff --git a/date-fns/src/fp/getOverlappingDaysInIntervals/index.js b/date-fns/src/fp/getOverlappingDaysInIntervals/index.js
new file mode 100644
index 0000000..9ac2f66
--- /dev/null
+++ b/date-fns/src/fp/getOverlappingDaysInIntervals/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getOverlappingDaysInIntervals/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getOverlappingDaysInIntervals = convertToFP(fn, 2)
+
+export default getOverlappingDaysInIntervals
diff --git a/date-fns/src/fp/getOverlappingDaysInIntervals/index.js.flow b/date-fns/src/fp/getOverlappingDaysInIntervals/index.js.flow
new file mode 100644
index 0000000..f640837
--- /dev/null
+++ b/date-fns/src/fp/getOverlappingDaysInIntervals/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Interval, Interval, number>
diff --git a/date-fns/src/fp/getQuarter/index.d.ts b/date-fns/src/fp/getQuarter/index.d.ts
new file mode 100644
index 0000000..50f13f6
--- /dev/null
+++ b/date-fns/src/fp/getQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getQuarter } from 'date-fns/fp'
+export default getQuarter
diff --git a/date-fns/src/fp/getQuarter/index.js b/date-fns/src/fp/getQuarter/index.js
new file mode 100644
index 0000000..722e70b
--- /dev/null
+++ b/date-fns/src/fp/getQuarter/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getQuarter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getQuarter = convertToFP(fn, 1)
+
+export default getQuarter
diff --git a/date-fns/src/fp/getQuarter/index.js.flow b/date-fns/src/fp/getQuarter/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getQuarter/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getSeconds/index.d.ts b/date-fns/src/fp/getSeconds/index.d.ts
new file mode 100644
index 0000000..1f6c233
--- /dev/null
+++ b/date-fns/src/fp/getSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getSeconds } from 'date-fns/fp'
+export default getSeconds
diff --git a/date-fns/src/fp/getSeconds/index.js b/date-fns/src/fp/getSeconds/index.js
new file mode 100644
index 0000000..7fe1b75
--- /dev/null
+++ b/date-fns/src/fp/getSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getSeconds = convertToFP(fn, 1)
+
+export default getSeconds
diff --git a/date-fns/src/fp/getSeconds/index.js.flow b/date-fns/src/fp/getSeconds/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getSeconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getTime/index.d.ts b/date-fns/src/fp/getTime/index.d.ts
new file mode 100644
index 0000000..7bfc8ce
--- /dev/null
+++ b/date-fns/src/fp/getTime/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getTime } from 'date-fns/fp'
+export default getTime
diff --git a/date-fns/src/fp/getTime/index.js b/date-fns/src/fp/getTime/index.js
new file mode 100644
index 0000000..7754b5d
--- /dev/null
+++ b/date-fns/src/fp/getTime/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getTime/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getTime = convertToFP(fn, 1)
+
+export default getTime
diff --git a/date-fns/src/fp/getTime/index.js.flow b/date-fns/src/fp/getTime/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getTime/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getUnixTime/index.d.ts b/date-fns/src/fp/getUnixTime/index.d.ts
new file mode 100644
index 0000000..7fb0dac
--- /dev/null
+++ b/date-fns/src/fp/getUnixTime/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getUnixTime } from 'date-fns/fp'
+export default getUnixTime
diff --git a/date-fns/src/fp/getUnixTime/index.js b/date-fns/src/fp/getUnixTime/index.js
new file mode 100644
index 0000000..d7e27b9
--- /dev/null
+++ b/date-fns/src/fp/getUnixTime/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getUnixTime/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getUnixTime = convertToFP(fn, 1)
+
+export default getUnixTime
diff --git a/date-fns/src/fp/getUnixTime/index.js.flow b/date-fns/src/fp/getUnixTime/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getUnixTime/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getWeek/index.d.ts b/date-fns/src/fp/getWeek/index.d.ts
new file mode 100644
index 0000000..2b3b4ee
--- /dev/null
+++ b/date-fns/src/fp/getWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeek } from 'date-fns/fp'
+export default getWeek
diff --git a/date-fns/src/fp/getWeek/index.js b/date-fns/src/fp/getWeek/index.js
new file mode 100644
index 0000000..a4197e5
--- /dev/null
+++ b/date-fns/src/fp/getWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeek = convertToFP(fn, 1)
+
+export default getWeek
diff --git a/date-fns/src/fp/getWeek/index.js.flow b/date-fns/src/fp/getWeek/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getWeekOfMonth/index.d.ts b/date-fns/src/fp/getWeekOfMonth/index.d.ts
new file mode 100644
index 0000000..1fd925f
--- /dev/null
+++ b/date-fns/src/fp/getWeekOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeekOfMonth } from 'date-fns/fp'
+export default getWeekOfMonth
diff --git a/date-fns/src/fp/getWeekOfMonth/index.js b/date-fns/src/fp/getWeekOfMonth/index.js
new file mode 100644
index 0000000..ad01383
--- /dev/null
+++ b/date-fns/src/fp/getWeekOfMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeekOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeekOfMonth = convertToFP(fn, 1)
+
+export default getWeekOfMonth
diff --git a/date-fns/src/fp/getWeekOfMonth/index.js.flow b/date-fns/src/fp/getWeekOfMonth/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getWeekOfMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getWeekOfMonthWithOptions/index.d.ts b/date-fns/src/fp/getWeekOfMonthWithOptions/index.d.ts
new file mode 100644
index 0000000..0bcf9e4
--- /dev/null
+++ b/date-fns/src/fp/getWeekOfMonthWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeekOfMonthWithOptions } from 'date-fns/fp'
+export default getWeekOfMonthWithOptions
diff --git a/date-fns/src/fp/getWeekOfMonthWithOptions/index.js b/date-fns/src/fp/getWeekOfMonthWithOptions/index.js
new file mode 100644
index 0000000..66297e5
--- /dev/null
+++ b/date-fns/src/fp/getWeekOfMonthWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeekOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeekOfMonthWithOptions = convertToFP(fn, 2)
+
+export default getWeekOfMonthWithOptions
diff --git a/date-fns/src/fp/getWeekOfMonthWithOptions/index.js.flow b/date-fns/src/fp/getWeekOfMonthWithOptions/index.js.flow
new file mode 100644
index 0000000..d1b5c20
--- /dev/null
+++ b/date-fns/src/fp/getWeekOfMonthWithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+>
diff --git a/date-fns/src/fp/getWeekWithOptions/index.d.ts b/date-fns/src/fp/getWeekWithOptions/index.d.ts
new file mode 100644
index 0000000..6f2de40
--- /dev/null
+++ b/date-fns/src/fp/getWeekWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeekWithOptions } from 'date-fns/fp'
+export default getWeekWithOptions
diff --git a/date-fns/src/fp/getWeekWithOptions/index.js b/date-fns/src/fp/getWeekWithOptions/index.js
new file mode 100644
index 0000000..a7e0c84
--- /dev/null
+++ b/date-fns/src/fp/getWeekWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeekWithOptions = convertToFP(fn, 2)
+
+export default getWeekWithOptions
diff --git a/date-fns/src/fp/getWeekWithOptions/index.js.flow b/date-fns/src/fp/getWeekWithOptions/index.js.flow
new file mode 100644
index 0000000..970a659
--- /dev/null
+++ b/date-fns/src/fp/getWeekWithOptions/index.js.flow
@@ -0,0 +1,66 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+>
diff --git a/date-fns/src/fp/getWeekYear/index.d.ts b/date-fns/src/fp/getWeekYear/index.d.ts
new file mode 100644
index 0000000..7cf37e0
--- /dev/null
+++ b/date-fns/src/fp/getWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeekYear } from 'date-fns/fp'
+export default getWeekYear
diff --git a/date-fns/src/fp/getWeekYear/index.js b/date-fns/src/fp/getWeekYear/index.js
new file mode 100644
index 0000000..7396dac
--- /dev/null
+++ b/date-fns/src/fp/getWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeekYear = convertToFP(fn, 1)
+
+export default getWeekYear
diff --git a/date-fns/src/fp/getWeekYear/index.js.flow b/date-fns/src/fp/getWeekYear/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getWeekYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getWeekYearWithOptions/index.d.ts b/date-fns/src/fp/getWeekYearWithOptions/index.d.ts
new file mode 100644
index 0000000..d33a37a
--- /dev/null
+++ b/date-fns/src/fp/getWeekYearWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeekYearWithOptions } from 'date-fns/fp'
+export default getWeekYearWithOptions
diff --git a/date-fns/src/fp/getWeekYearWithOptions/index.js b/date-fns/src/fp/getWeekYearWithOptions/index.js
new file mode 100644
index 0000000..86888f0
--- /dev/null
+++ b/date-fns/src/fp/getWeekYearWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeekYearWithOptions = convertToFP(fn, 2)
+
+export default getWeekYearWithOptions
diff --git a/date-fns/src/fp/getWeekYearWithOptions/index.js.flow b/date-fns/src/fp/getWeekYearWithOptions/index.js.flow
new file mode 100644
index 0000000..970a659
--- /dev/null
+++ b/date-fns/src/fp/getWeekYearWithOptions/index.js.flow
@@ -0,0 +1,66 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+>
diff --git a/date-fns/src/fp/getWeeksInMonth/index.d.ts b/date-fns/src/fp/getWeeksInMonth/index.d.ts
new file mode 100644
index 0000000..2de5a9c
--- /dev/null
+++ b/date-fns/src/fp/getWeeksInMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeeksInMonth } from 'date-fns/fp'
+export default getWeeksInMonth
diff --git a/date-fns/src/fp/getWeeksInMonth/index.js b/date-fns/src/fp/getWeeksInMonth/index.js
new file mode 100644
index 0000000..e757062
--- /dev/null
+++ b/date-fns/src/fp/getWeeksInMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeeksInMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeeksInMonth = convertToFP(fn, 1)
+
+export default getWeeksInMonth
diff --git a/date-fns/src/fp/getWeeksInMonth/index.js.flow b/date-fns/src/fp/getWeeksInMonth/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getWeeksInMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/getWeeksInMonthWithOptions/index.d.ts b/date-fns/src/fp/getWeeksInMonthWithOptions/index.d.ts
new file mode 100644
index 0000000..9016970
--- /dev/null
+++ b/date-fns/src/fp/getWeeksInMonthWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeeksInMonthWithOptions } from 'date-fns/fp'
+export default getWeeksInMonthWithOptions
diff --git a/date-fns/src/fp/getWeeksInMonthWithOptions/index.js b/date-fns/src/fp/getWeeksInMonthWithOptions/index.js
new file mode 100644
index 0000000..086072f
--- /dev/null
+++ b/date-fns/src/fp/getWeeksInMonthWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getWeeksInMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getWeeksInMonthWithOptions = convertToFP(fn, 2)
+
+export default getWeeksInMonthWithOptions
diff --git a/date-fns/src/fp/getWeeksInMonthWithOptions/index.js.flow b/date-fns/src/fp/getWeeksInMonthWithOptions/index.js.flow
new file mode 100644
index 0000000..d1b5c20
--- /dev/null
+++ b/date-fns/src/fp/getWeeksInMonthWithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+>
diff --git a/date-fns/src/fp/getYear/index.d.ts b/date-fns/src/fp/getYear/index.d.ts
new file mode 100644
index 0000000..603dc71
--- /dev/null
+++ b/date-fns/src/fp/getYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getYear } from 'date-fns/fp'
+export default getYear
diff --git a/date-fns/src/fp/getYear/index.js b/date-fns/src/fp/getYear/index.js
new file mode 100644
index 0000000..60af7f3
--- /dev/null
+++ b/date-fns/src/fp/getYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../getYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var getYear = convertToFP(fn, 1)
+
+export default getYear
diff --git a/date-fns/src/fp/getYear/index.js.flow b/date-fns/src/fp/getYear/index.js.flow
new file mode 100644
index 0000000..7a34c65
--- /dev/null
+++ b/date-fns/src/fp/getYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, number>
diff --git a/date-fns/src/fp/hoursToMilliseconds/index.d.ts b/date-fns/src/fp/hoursToMilliseconds/index.d.ts
new file mode 100644
index 0000000..14caeac
--- /dev/null
+++ b/date-fns/src/fp/hoursToMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hoursToMilliseconds } from 'date-fns/fp'
+export default hoursToMilliseconds
diff --git a/date-fns/src/fp/hoursToMilliseconds/index.js b/date-fns/src/fp/hoursToMilliseconds/index.js
new file mode 100644
index 0000000..103efa8
--- /dev/null
+++ b/date-fns/src/fp/hoursToMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../hoursToMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var hoursToMilliseconds = convertToFP(fn, 1)
+
+export default hoursToMilliseconds
diff --git a/date-fns/src/fp/hoursToMilliseconds/index.js.flow b/date-fns/src/fp/hoursToMilliseconds/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/hoursToMilliseconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/hoursToMinutes/index.d.ts b/date-fns/src/fp/hoursToMinutes/index.d.ts
new file mode 100644
index 0000000..e834de4
--- /dev/null
+++ b/date-fns/src/fp/hoursToMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hoursToMinutes } from 'date-fns/fp'
+export default hoursToMinutes
diff --git a/date-fns/src/fp/hoursToMinutes/index.js b/date-fns/src/fp/hoursToMinutes/index.js
new file mode 100644
index 0000000..dd50115
--- /dev/null
+++ b/date-fns/src/fp/hoursToMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../hoursToMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var hoursToMinutes = convertToFP(fn, 1)
+
+export default hoursToMinutes
diff --git a/date-fns/src/fp/hoursToMinutes/index.js.flow b/date-fns/src/fp/hoursToMinutes/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/hoursToMinutes/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/hoursToSeconds/index.d.ts b/date-fns/src/fp/hoursToSeconds/index.d.ts
new file mode 100644
index 0000000..35a5bfd
--- /dev/null
+++ b/date-fns/src/fp/hoursToSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hoursToSeconds } from 'date-fns/fp'
+export default hoursToSeconds
diff --git a/date-fns/src/fp/hoursToSeconds/index.js b/date-fns/src/fp/hoursToSeconds/index.js
new file mode 100644
index 0000000..f24c47d
--- /dev/null
+++ b/date-fns/src/fp/hoursToSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../hoursToSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var hoursToSeconds = convertToFP(fn, 1)
+
+export default hoursToSeconds
diff --git a/date-fns/src/fp/hoursToSeconds/index.js.flow b/date-fns/src/fp/hoursToSeconds/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/hoursToSeconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/index.js b/date-fns/src/fp/index.js
new file mode 100644
index 0000000..2caa61c
--- /dev/null
+++ b/date-fns/src/fp/index.js
@@ -0,0 +1,241 @@
+// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.
+
+export { default as add } from './add/index'
+export { default as addBusinessDays } from './addBusinessDays/index'
+export { default as addDays } from './addDays/index'
+export { default as addHours } from './addHours/index'
+export { default as addISOWeekYears } from './addISOWeekYears/index'
+export { default as addMilliseconds } from './addMilliseconds/index'
+export { default as addMinutes } from './addMinutes/index'
+export { default as addMonths } from './addMonths/index'
+export { default as addQuarters } from './addQuarters/index'
+export { default as addSeconds } from './addSeconds/index'
+export { default as addWeeks } from './addWeeks/index'
+export { default as addYears } from './addYears/index'
+export { default as areIntervalsOverlapping } from './areIntervalsOverlapping/index'
+export { default as areIntervalsOverlappingWithOptions } from './areIntervalsOverlappingWithOptions/index'
+export { default as closestIndexTo } from './closestIndexTo/index'
+export { default as closestTo } from './closestTo/index'
+export { default as compareAsc } from './compareAsc/index'
+export { default as compareDesc } from './compareDesc/index'
+export { default as daysToWeeks } from './daysToWeeks/index'
+export { default as differenceInBusinessDays } from './differenceInBusinessDays/index'
+export { default as differenceInCalendarDays } from './differenceInCalendarDays/index'
+export { default as differenceInCalendarISOWeekYears } from './differenceInCalendarISOWeekYears/index'
+export { default as differenceInCalendarISOWeeks } from './differenceInCalendarISOWeeks/index'
+export { default as differenceInCalendarMonths } from './differenceInCalendarMonths/index'
+export { default as differenceInCalendarQuarters } from './differenceInCalendarQuarters/index'
+export { default as differenceInCalendarWeeks } from './differenceInCalendarWeeks/index'
+export { default as differenceInCalendarWeeksWithOptions } from './differenceInCalendarWeeksWithOptions/index'
+export { default as differenceInCalendarYears } from './differenceInCalendarYears/index'
+export { default as differenceInDays } from './differenceInDays/index'
+export { default as differenceInHours } from './differenceInHours/index'
+export { default as differenceInISOWeekYears } from './differenceInISOWeekYears/index'
+export { default as differenceInMilliseconds } from './differenceInMilliseconds/index'
+export { default as differenceInMinutes } from './differenceInMinutes/index'
+export { default as differenceInMonths } from './differenceInMonths/index'
+export { default as differenceInQuarters } from './differenceInQuarters/index'
+export { default as differenceInSeconds } from './differenceInSeconds/index'
+export { default as differenceInWeeks } from './differenceInWeeks/index'
+export { default as differenceInYears } from './differenceInYears/index'
+export { default as eachDayOfInterval } from './eachDayOfInterval/index'
+export { default as eachDayOfIntervalWithOptions } from './eachDayOfIntervalWithOptions/index'
+export { default as eachHourOfInterval } from './eachHourOfInterval/index'
+export { default as eachHourOfIntervalWithOptions } from './eachHourOfIntervalWithOptions/index'
+export { default as eachMinuteOfInterval } from './eachMinuteOfInterval/index'
+export { default as eachMinuteOfIntervalWithOptions } from './eachMinuteOfIntervalWithOptions/index'
+export { default as eachMonthOfInterval } from './eachMonthOfInterval/index'
+export { default as eachQuarterOfInterval } from './eachQuarterOfInterval/index'
+export { default as eachWeekOfInterval } from './eachWeekOfInterval/index'
+export { default as eachWeekOfIntervalWithOptions } from './eachWeekOfIntervalWithOptions/index'
+export { default as eachWeekendOfInterval } from './eachWeekendOfInterval/index'
+export { default as eachWeekendOfMonth } from './eachWeekendOfMonth/index'
+export { default as eachWeekendOfYear } from './eachWeekendOfYear/index'
+export { default as eachYearOfInterval } from './eachYearOfInterval/index'
+export { default as endOfDay } from './endOfDay/index'
+export { default as endOfDecade } from './endOfDecade/index'
+export { default as endOfDecadeWithOptions } from './endOfDecadeWithOptions/index'
+export { default as endOfHour } from './endOfHour/index'
+export { default as endOfISOWeek } from './endOfISOWeek/index'
+export { default as endOfISOWeekYear } from './endOfISOWeekYear/index'
+export { default as endOfMinute } from './endOfMinute/index'
+export { default as endOfMonth } from './endOfMonth/index'
+export { default as endOfQuarter } from './endOfQuarter/index'
+export { default as endOfSecond } from './endOfSecond/index'
+export { default as endOfWeek } from './endOfWeek/index'
+export { default as endOfWeekWithOptions } from './endOfWeekWithOptions/index'
+export { default as endOfYear } from './endOfYear/index'
+export { default as format } from './format/index'
+export { default as formatDistance } from './formatDistance/index'
+export { default as formatDistanceStrict } from './formatDistanceStrict/index'
+export { default as formatDistanceStrictWithOptions } from './formatDistanceStrictWithOptions/index'
+export { default as formatDistanceWithOptions } from './formatDistanceWithOptions/index'
+export { default as formatDuration } from './formatDuration/index'
+export { default as formatDurationWithOptions } from './formatDurationWithOptions/index'
+export { default as formatISO } from './formatISO/index'
+export { default as formatISO9075 } from './formatISO9075/index'
+export { default as formatISO9075WithOptions } from './formatISO9075WithOptions/index'
+export { default as formatISODuration } from './formatISODuration/index'
+export { default as formatISOWithOptions } from './formatISOWithOptions/index'
+export { default as formatRFC3339 } from './formatRFC3339/index'
+export { default as formatRFC3339WithOptions } from './formatRFC3339WithOptions/index'
+export { default as formatRFC7231 } from './formatRFC7231/index'
+export { default as formatRelative } from './formatRelative/index'
+export { default as formatRelativeWithOptions } from './formatRelativeWithOptions/index'
+export { default as formatWithOptions } from './formatWithOptions/index'
+export { default as fromUnixTime } from './fromUnixTime/index'
+export { default as getDate } from './getDate/index'
+export { default as getDay } from './getDay/index'
+export { default as getDayOfYear } from './getDayOfYear/index'
+export { default as getDaysInMonth } from './getDaysInMonth/index'
+export { default as getDaysInYear } from './getDaysInYear/index'
+export { default as getDecade } from './getDecade/index'
+export { default as getHours } from './getHours/index'
+export { default as getISODay } from './getISODay/index'
+export { default as getISOWeek } from './getISOWeek/index'
+export { default as getISOWeekYear } from './getISOWeekYear/index'
+export { default as getISOWeeksInYear } from './getISOWeeksInYear/index'
+export { default as getMilliseconds } from './getMilliseconds/index'
+export { default as getMinutes } from './getMinutes/index'
+export { default as getMonth } from './getMonth/index'
+export { default as getOverlappingDaysInIntervals } from './getOverlappingDaysInIntervals/index'
+export { default as getQuarter } from './getQuarter/index'
+export { default as getSeconds } from './getSeconds/index'
+export { default as getTime } from './getTime/index'
+export { default as getUnixTime } from './getUnixTime/index'
+export { default as getWeek } from './getWeek/index'
+export { default as getWeekOfMonth } from './getWeekOfMonth/index'
+export { default as getWeekOfMonthWithOptions } from './getWeekOfMonthWithOptions/index'
+export { default as getWeekWithOptions } from './getWeekWithOptions/index'
+export { default as getWeekYear } from './getWeekYear/index'
+export { default as getWeekYearWithOptions } from './getWeekYearWithOptions/index'
+export { default as getWeeksInMonth } from './getWeeksInMonth/index'
+export { default as getWeeksInMonthWithOptions } from './getWeeksInMonthWithOptions/index'
+export { default as getYear } from './getYear/index'
+export { default as hoursToMilliseconds } from './hoursToMilliseconds/index'
+export { default as hoursToMinutes } from './hoursToMinutes/index'
+export { default as hoursToSeconds } from './hoursToSeconds/index'
+export { default as intervalToDuration } from './intervalToDuration/index'
+export { default as intlFormat } from './intlFormat/index'
+export { default as isAfter } from './isAfter/index'
+export { default as isBefore } from './isBefore/index'
+export { default as isDate } from './isDate/index'
+export { default as isEqual } from './isEqual/index'
+export { default as isExists } from './isExists/index'
+export { default as isFirstDayOfMonth } from './isFirstDayOfMonth/index'
+export { default as isFriday } from './isFriday/index'
+export { default as isLastDayOfMonth } from './isLastDayOfMonth/index'
+export { default as isLeapYear } from './isLeapYear/index'
+export { default as isMatch } from './isMatch/index'
+export { default as isMatchWithOptions } from './isMatchWithOptions/index'
+export { default as isMonday } from './isMonday/index'
+export { default as isSameDay } from './isSameDay/index'
+export { default as isSameHour } from './isSameHour/index'
+export { default as isSameISOWeek } from './isSameISOWeek/index'
+export { default as isSameISOWeekYear } from './isSameISOWeekYear/index'
+export { default as isSameMinute } from './isSameMinute/index'
+export { default as isSameMonth } from './isSameMonth/index'
+export { default as isSameQuarter } from './isSameQuarter/index'
+export { default as isSameSecond } from './isSameSecond/index'
+export { default as isSameWeek } from './isSameWeek/index'
+export { default as isSameWeekWithOptions } from './isSameWeekWithOptions/index'
+export { default as isSameYear } from './isSameYear/index'
+export { default as isSaturday } from './isSaturday/index'
+export { default as isSunday } from './isSunday/index'
+export { default as isThursday } from './isThursday/index'
+export { default as isTuesday } from './isTuesday/index'
+export { default as isValid } from './isValid/index'
+export { default as isWednesday } from './isWednesday/index'
+export { default as isWeekend } from './isWeekend/index'
+export { default as isWithinInterval } from './isWithinInterval/index'
+export { default as lastDayOfDecade } from './lastDayOfDecade/index'
+export { default as lastDayOfISOWeek } from './lastDayOfISOWeek/index'
+export { default as lastDayOfISOWeekYear } from './lastDayOfISOWeekYear/index'
+export { default as lastDayOfMonth } from './lastDayOfMonth/index'
+export { default as lastDayOfQuarter } from './lastDayOfQuarter/index'
+export { default as lastDayOfQuarterWithOptions } from './lastDayOfQuarterWithOptions/index'
+export { default as lastDayOfWeek } from './lastDayOfWeek/index'
+export { default as lastDayOfWeekWithOptions } from './lastDayOfWeekWithOptions/index'
+export { default as lastDayOfYear } from './lastDayOfYear/index'
+export { default as lightFormat } from './lightFormat/index'
+export { default as max } from './max/index'
+export { default as milliseconds } from './milliseconds/index'
+export { default as millisecondsToHours } from './millisecondsToHours/index'
+export { default as millisecondsToMinutes } from './millisecondsToMinutes/index'
+export { default as millisecondsToSeconds } from './millisecondsToSeconds/index'
+export { default as min } from './min/index'
+export { default as minutesToHours } from './minutesToHours/index'
+export { default as minutesToMilliseconds } from './minutesToMilliseconds/index'
+export { default as minutesToSeconds } from './minutesToSeconds/index'
+export { default as monthsToQuarters } from './monthsToQuarters/index'
+export { default as monthsToYears } from './monthsToYears/index'
+export { default as nextDay } from './nextDay/index'
+export { default as nextFriday } from './nextFriday/index'
+export { default as nextMonday } from './nextMonday/index'
+export { default as nextSaturday } from './nextSaturday/index'
+export { default as nextSunday } from './nextSunday/index'
+export { default as nextThursday } from './nextThursday/index'
+export { default as nextTuesday } from './nextTuesday/index'
+export { default as nextWednesday } from './nextWednesday/index'
+export { default as parse } from './parse/index'
+export { default as parseISO } from './parseISO/index'
+export { default as parseISOWithOptions } from './parseISOWithOptions/index'
+export { default as parseJSON } from './parseJSON/index'
+export { default as parseWithOptions } from './parseWithOptions/index'
+export { default as quartersToMonths } from './quartersToMonths/index'
+export { default as quartersToYears } from './quartersToYears/index'
+export { default as roundToNearestMinutes } from './roundToNearestMinutes/index'
+export { default as roundToNearestMinutesWithOptions } from './roundToNearestMinutesWithOptions/index'
+export { default as secondsToHours } from './secondsToHours/index'
+export { default as secondsToMilliseconds } from './secondsToMilliseconds/index'
+export { default as secondsToMinutes } from './secondsToMinutes/index'
+export { default as set } from './set/index'
+export { default as setDate } from './setDate/index'
+export { default as setDay } from './setDay/index'
+export { default as setDayOfYear } from './setDayOfYear/index'
+export { default as setDayWithOptions } from './setDayWithOptions/index'
+export { default as setHours } from './setHours/index'
+export { default as setISODay } from './setISODay/index'
+export { default as setISOWeek } from './setISOWeek/index'
+export { default as setISOWeekYear } from './setISOWeekYear/index'
+export { default as setMilliseconds } from './setMilliseconds/index'
+export { default as setMinutes } from './setMinutes/index'
+export { default as setMonth } from './setMonth/index'
+export { default as setQuarter } from './setQuarter/index'
+export { default as setSeconds } from './setSeconds/index'
+export { default as setWeek } from './setWeek/index'
+export { default as setWeekWithOptions } from './setWeekWithOptions/index'
+export { default as setWeekYear } from './setWeekYear/index'
+export { default as setWeekYearWithOptions } from './setWeekYearWithOptions/index'
+export { default as setYear } from './setYear/index'
+export { default as startOfDay } from './startOfDay/index'
+export { default as startOfDecade } from './startOfDecade/index'
+export { default as startOfHour } from './startOfHour/index'
+export { default as startOfISOWeek } from './startOfISOWeek/index'
+export { default as startOfISOWeekYear } from './startOfISOWeekYear/index'
+export { default as startOfMinute } from './startOfMinute/index'
+export { default as startOfMonth } from './startOfMonth/index'
+export { default as startOfQuarter } from './startOfQuarter/index'
+export { default as startOfSecond } from './startOfSecond/index'
+export { default as startOfWeek } from './startOfWeek/index'
+export { default as startOfWeekWithOptions } from './startOfWeekWithOptions/index'
+export { default as startOfWeekYear } from './startOfWeekYear/index'
+export { default as startOfWeekYearWithOptions } from './startOfWeekYearWithOptions/index'
+export { default as startOfYear } from './startOfYear/index'
+export { default as sub } from './sub/index'
+export { default as subBusinessDays } from './subBusinessDays/index'
+export { default as subDays } from './subDays/index'
+export { default as subHours } from './subHours/index'
+export { default as subISOWeekYears } from './subISOWeekYears/index'
+export { default as subMilliseconds } from './subMilliseconds/index'
+export { default as subMinutes } from './subMinutes/index'
+export { default as subMonths } from './subMonths/index'
+export { default as subQuarters } from './subQuarters/index'
+export { default as subSeconds } from './subSeconds/index'
+export { default as subWeeks } from './subWeeks/index'
+export { default as subYears } from './subYears/index'
+export { default as toDate } from './toDate/index'
+export { default as weeksToDays } from './weeksToDays/index'
+export { default as yearsToMonths } from './yearsToMonths/index'
+export { default as yearsToQuarters } from './yearsToQuarters/index'
+export * from '../constants/index'
diff --git a/date-fns/src/fp/index.js.flow b/date-fns/src/fp/index.js.flow
new file mode 100644
index 0000000..1db8a1d
--- /dev/null
+++ b/date-fns/src/fp/index.js.flow
@@ -0,0 +1,625 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+type CurriedFn4<A, B, C, D, R> = <A>(
+ a: A
+) =>
+ | CurriedFn3<B, C, D, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) =>
+ | CurriedFn2<C, D, R>
+ | (<A, B, C>(
+ a: A,
+ b: B,
+ c: C
+ ) => CurriedFn1<D, R> | (<A, B, C, D>(a: A, b: B, c: C, d: D) => R)))
+
+declare module.exports: {
+ add: CurriedFn2<Duration, Date | number, Date>,
+ addBusinessDays: CurriedFn2<number, Date | number, Date>,
+ addDays: CurriedFn2<number, Date | number, Date>,
+ addHours: CurriedFn2<number, Date | number, Date>,
+ addISOWeekYears: CurriedFn2<number, Date | number, Date>,
+ addMilliseconds: CurriedFn2<number, Date | number, Date>,
+ addMinutes: CurriedFn2<number, Date | number, Date>,
+ addMonths: CurriedFn2<number, Date | number, Date>,
+ addQuarters: CurriedFn2<number, Date | number, Date>,
+ addSeconds: CurriedFn2<number, Date | number, Date>,
+ addWeeks: CurriedFn2<number, Date | number, Date>,
+ addYears: CurriedFn2<number, Date | number, Date>,
+ areIntervalsOverlapping: CurriedFn2<Interval, Interval, boolean>,
+ areIntervalsOverlappingWithOptions: CurriedFn3<
+ {
+ inclusive?: boolean,
+ },
+ Interval,
+ Interval,
+ boolean
+ >,
+ closestIndexTo: CurriedFn2<(Date | number)[], Date | number, number>,
+ closestTo: CurriedFn2<(Date | number)[], Date | number, Date>,
+ compareAsc: CurriedFn2<Date | number, Date | number, number>,
+ compareDesc: CurriedFn2<Date | number, Date | number, number>,
+ daysToWeeks: CurriedFn1<number, number>,
+ differenceInBusinessDays: CurriedFn2<Date | number, Date | number, number>,
+ differenceInCalendarDays: CurriedFn2<Date | number, Date | number, number>,
+ differenceInCalendarISOWeeks: CurriedFn2<
+ Date | number,
+ Date | number,
+ number
+ >,
+ differenceInCalendarISOWeekYears: CurriedFn2<
+ Date | number,
+ Date | number,
+ number
+ >,
+ differenceInCalendarMonths: CurriedFn2<Date | number, Date | number, number>,
+ differenceInCalendarQuarters: CurriedFn2<
+ Date | number,
+ Date | number,
+ number
+ >,
+ differenceInCalendarWeeks: CurriedFn2<Date | number, Date | number, number>,
+ differenceInCalendarWeeksWithOptions: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date | number,
+ number
+ >,
+ differenceInCalendarYears: CurriedFn2<Date | number, Date | number, number>,
+ differenceInDays: CurriedFn2<Date | number, Date | number, number>,
+ differenceInHours: CurriedFn2<Date | number, Date | number, number>,
+ differenceInISOWeekYears: CurriedFn2<Date | number, Date | number, number>,
+ differenceInMilliseconds: CurriedFn2<Date | number, Date | number, number>,
+ differenceInMinutes: CurriedFn2<Date | number, Date | number, number>,
+ differenceInMonths: CurriedFn2<Date | number, Date | number, number>,
+ differenceInQuarters: CurriedFn2<Date | number, Date | number, number>,
+ differenceInSeconds: CurriedFn2<Date | number, Date | number, number>,
+ differenceInWeeks: CurriedFn2<Date | number, Date | number, number>,
+ differenceInYears: CurriedFn2<Date | number, Date | number, number>,
+ eachDayOfInterval: CurriedFn1<Interval, Date[]>,
+ eachDayOfIntervalWithOptions: CurriedFn2<
+ {
+ step?: number,
+ },
+ Interval,
+ Date[]
+ >,
+ eachHourOfInterval: CurriedFn1<Interval, Date[]>,
+ eachHourOfIntervalWithOptions: CurriedFn2<
+ {
+ step?: number,
+ },
+ Interval,
+ Date[]
+ >,
+ eachMinuteOfInterval: CurriedFn1<Interval, Date[]>,
+ eachMinuteOfIntervalWithOptions: CurriedFn2<
+ {
+ step?: number,
+ },
+ Interval,
+ Date[]
+ >,
+ eachMonthOfInterval: CurriedFn1<Interval, Date[]>,
+ eachQuarterOfInterval: CurriedFn1<Interval, Date[]>,
+ eachWeekendOfInterval: CurriedFn1<Interval, Date[]>,
+ eachWeekendOfMonth: CurriedFn1<Date | number, Date[]>,
+ eachWeekendOfYear: CurriedFn1<Date | number, Date[]>,
+ eachWeekOfInterval: CurriedFn1<Interval, Date[]>,
+ eachWeekOfIntervalWithOptions: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Interval,
+ Date[]
+ >,
+ eachYearOfInterval: CurriedFn1<Interval, Date[]>,
+ endOfDay: CurriedFn1<Date | number, Date>,
+ endOfDecade: CurriedFn1<Date | number, Date>,
+ endOfDecadeWithOptions: CurriedFn2<
+ {
+ additionalDigits?: 0 | 1 | 2,
+ },
+ Date | number,
+ Date
+ >,
+ endOfHour: CurriedFn1<Date | number, Date>,
+ endOfISOWeek: CurriedFn1<Date | number, Date>,
+ endOfISOWeekYear: CurriedFn1<Date | number, Date>,
+ endOfMinute: CurriedFn1<Date | number, Date>,
+ endOfMonth: CurriedFn1<Date | number, Date>,
+ endOfQuarter: CurriedFn1<Date | number, Date>,
+ endOfSecond: CurriedFn1<Date | number, Date>,
+ endOfWeek: CurriedFn1<Date | number, Date>,
+ endOfWeekWithOptions: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+ >,
+ endOfYear: CurriedFn1<Date | number, Date>,
+ format: CurriedFn2<string, Date | number, string>,
+ formatDistance: CurriedFn2<Date | number, Date | number, string>,
+ formatDistanceStrict: CurriedFn2<Date | number, Date | number, string>,
+ formatDistanceStrictWithOptions: CurriedFn3<
+ {
+ locale?: Locale,
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ addSuffix?: boolean,
+ },
+ Date | number,
+ Date | number,
+ string
+ >,
+ formatDistanceWithOptions: CurriedFn3<
+ {
+ locale?: Locale,
+ addSuffix?: boolean,
+ includeSeconds?: boolean,
+ },
+ Date | number,
+ Date | number,
+ string
+ >,
+ formatDuration: CurriedFn1<Duration, string>,
+ formatDurationWithOptions: CurriedFn2<
+ {
+ locale?: Locale,
+ delimiter?: string,
+ zero?: boolean,
+ format?: string[],
+ },
+ Duration,
+ string
+ >,
+ formatISO: CurriedFn1<Date | number, string>,
+ formatISO9075: CurriedFn1<Date | number, string>,
+ formatISO9075WithOptions: CurriedFn2<
+ {
+ representation?: 'complete' | 'date' | 'time',
+ format?: 'extended' | 'basic',
+ },
+ Date | number,
+ string
+ >,
+ formatISODuration: CurriedFn1<Duration, string>,
+ formatISOWithOptions: CurriedFn2<
+ {
+ representation?: 'complete' | 'date' | 'time',
+ format?: 'extended' | 'basic',
+ },
+ Date | number,
+ string
+ >,
+ formatRelative: CurriedFn2<Date | number, Date | number, string>,
+ formatRelativeWithOptions: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date | number,
+ string
+ >,
+ formatRFC3339: CurriedFn1<Date | number, string>,
+ formatRFC3339WithOptions: CurriedFn2<
+ {
+ fractionDigits?: 0 | 1 | 2 | 3,
+ },
+ Date | number,
+ string
+ >,
+ formatRFC7231: CurriedFn1<Date | number, string>,
+ formatWithOptions: CurriedFn3<
+ {
+ useAdditionalDayOfYearTokens?: boolean,
+ useAdditionalWeekYearTokens?: boolean,
+ firstWeekContainsDate?: number,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ string,
+ Date | number,
+ string
+ >,
+ fromUnixTime: CurriedFn1<number, Date>,
+ getDate: CurriedFn1<Date | number, number>,
+ getDay: CurriedFn1<Date | number, 0 | 1 | 2 | 3 | 4 | 5 | 6>,
+ getDayOfYear: CurriedFn1<Date | number, number>,
+ getDaysInMonth: CurriedFn1<Date | number, number>,
+ getDaysInYear: CurriedFn1<Date | number, number>,
+ getDecade: CurriedFn1<Date | number, number>,
+ getHours: CurriedFn1<Date | number, number>,
+ getISODay: CurriedFn1<Date | number, number>,
+ getISOWeek: CurriedFn1<Date | number, number>,
+ getISOWeeksInYear: CurriedFn1<Date | number, number>,
+ getISOWeekYear: CurriedFn1<Date | number, number>,
+ getMilliseconds: CurriedFn1<Date | number, number>,
+ getMinutes: CurriedFn1<Date | number, number>,
+ getMonth: CurriedFn1<Date | number, number>,
+ getOverlappingDaysInIntervals: CurriedFn2<Interval, Interval, number>,
+ getQuarter: CurriedFn1<Date | number, number>,
+ getSeconds: CurriedFn1<Date | number, number>,
+ getTime: CurriedFn1<Date | number, number>,
+ getUnixTime: CurriedFn1<Date | number, number>,
+ getWeek: CurriedFn1<Date | number, number>,
+ getWeekOfMonth: CurriedFn1<Date | number, number>,
+ getWeekOfMonthWithOptions: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+ >,
+ getWeeksInMonth: CurriedFn1<Date | number, number>,
+ getWeeksInMonthWithOptions: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+ >,
+ getWeekWithOptions: CurriedFn2<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+ >,
+ getWeekYear: CurriedFn1<Date | number, number>,
+ getWeekYearWithOptions: CurriedFn2<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ number
+ >,
+ getYear: CurriedFn1<Date | number, number>,
+ hoursToMilliseconds: CurriedFn1<number, number>,
+ hoursToMinutes: CurriedFn1<number, number>,
+ hoursToSeconds: CurriedFn1<number, number>,
+ intervalToDuration: CurriedFn1<Interval, Duration>,
+ intlFormat: CurriedFn3<
+ {
+ locale?: string | string[],
+ },
+ {
+ timeZone?: string,
+ hour12?: boolean,
+ formatMatcher?: 'basic' | 'best fit',
+ timeZoneName?: 'short' | 'long',
+ second?: 'numeric' | '2-digit',
+ minute?: 'numeric' | '2-digit',
+ hour?: 'numeric' | '2-digit',
+ day?: 'numeric' | '2-digit',
+ month?: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long',
+ year?: 'numeric' | '2-digit',
+ era?: 'narrow' | 'short' | 'long',
+ weekday?: 'narrow' | 'short' | 'long',
+ localeMatcher?: 'lookup' | 'best fit',
+ },
+ Date | number,
+ string
+ >,
+ isAfter: CurriedFn2<Date | number, Date | number, boolean>,
+ isBefore: CurriedFn2<Date | number, Date | number, boolean>,
+ isDate: CurriedFn1<any, boolean>,
+ isEqual: CurriedFn2<Date | number, Date | number, boolean>,
+ isExists: CurriedFn3<number, number, number, boolean>,
+ isFirstDayOfMonth: CurriedFn1<Date | number, boolean>,
+ isFriday: CurriedFn1<Date | number, boolean>,
+ isLastDayOfMonth: CurriedFn1<Date | number, boolean>,
+ isLeapYear: CurriedFn1<Date | number, boolean>,
+ isMatch: CurriedFn2<string, string, boolean>,
+ isMatchWithOptions: CurriedFn3<
+ {
+ useAdditionalDayOfYearTokens?: boolean,
+ useAdditionalWeekYearTokens?: boolean,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ string,
+ string,
+ boolean
+ >,
+ isMonday: CurriedFn1<Date | number, boolean>,
+ isSameDay: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameHour: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameISOWeek: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameISOWeekYear: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameMinute: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameMonth: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameQuarter: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameSecond: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameWeek: CurriedFn2<Date | number, Date | number, boolean>,
+ isSameWeekWithOptions: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date | number,
+ boolean
+ >,
+ isSameYear: CurriedFn2<Date | number, Date | number, boolean>,
+ isSaturday: CurriedFn1<Date | number, boolean>,
+ isSunday: CurriedFn1<Date | number, boolean>,
+ isThursday: CurriedFn1<Date | number, boolean>,
+ isTuesday: CurriedFn1<Date | number, boolean>,
+ isValid: CurriedFn1<any, boolean>,
+ isWednesday: CurriedFn1<Date | number, boolean>,
+ isWeekend: CurriedFn1<Date | number, boolean>,
+ isWithinInterval: CurriedFn2<Interval, Date | number, boolean>,
+ lastDayOfDecade: CurriedFn1<Date | number, Date>,
+ lastDayOfISOWeek: CurriedFn1<Date | number, Date>,
+ lastDayOfISOWeekYear: CurriedFn1<Date | number, Date>,
+ lastDayOfMonth: CurriedFn1<Date | number, Date>,
+ lastDayOfQuarter: CurriedFn1<Date | number, Date>,
+ lastDayOfQuarterWithOptions: CurriedFn2<
+ {
+ additionalDigits?: 0 | 1 | 2,
+ },
+ Date | number,
+ Date
+ >,
+ lastDayOfWeek: CurriedFn1<Date | number, Date>,
+ lastDayOfWeekWithOptions: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+ >,
+ lastDayOfYear: CurriedFn1<Date | number, Date>,
+ lightFormat: CurriedFn2<string, Date | number, string>,
+ max: CurriedFn1<(Date | number)[], Date>,
+ milliseconds: CurriedFn1<Duration, number>,
+ millisecondsToHours: CurriedFn1<number, number>,
+ millisecondsToMinutes: CurriedFn1<number, number>,
+ millisecondsToSeconds: CurriedFn1<number, number>,
+ min: CurriedFn1<(Date | number)[], Date>,
+ minutesToHours: CurriedFn1<number, number>,
+ minutesToMilliseconds: CurriedFn1<number, number>,
+ minutesToSeconds: CurriedFn1<number, number>,
+ monthsToQuarters: CurriedFn1<number, number>,
+ monthsToYears: CurriedFn1<number, number>,
+ nextDay: CurriedFn2<Day, Date | number, Date>,
+ nextFriday: CurriedFn1<Date | number, Date>,
+ nextMonday: CurriedFn1<Date | number, Date>,
+ nextSaturday: CurriedFn1<Date | number, Date>,
+ nextSunday: CurriedFn1<Date | number, Date>,
+ nextThursday: CurriedFn1<Date | number, Date>,
+ nextTuesday: CurriedFn1<Date | number, Date>,
+ nextWednesday: CurriedFn1<Date | number, Date>,
+ parse: CurriedFn3<Date | number, string, string, Date>,
+ parseISO: CurriedFn1<string, Date>,
+ parseISOWithOptions: CurriedFn2<
+ {
+ additionalDigits?: 0 | 1 | 2,
+ },
+ string,
+ Date
+ >,
+ parseJSON: CurriedFn1<string | number | Date, Date>,
+ parseWithOptions: CurriedFn4<
+ {
+ useAdditionalDayOfYearTokens?: boolean,
+ useAdditionalWeekYearTokens?: boolean,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ string,
+ string,
+ Date
+ >,
+ quartersToMonths: CurriedFn1<number, number>,
+ quartersToYears: CurriedFn1<number, number>,
+ roundToNearestMinutes: CurriedFn1<Date | number, Date>,
+ roundToNearestMinutesWithOptions: CurriedFn2<
+ {
+ nearestTo?: number,
+ },
+ Date | number,
+ Date
+ >,
+ secondsToHours: CurriedFn1<number, number>,
+ secondsToMilliseconds: CurriedFn1<number, number>,
+ secondsToMinutes: CurriedFn1<number, number>,
+ set: CurriedFn2<
+ {
+ milliseconds?: number,
+ seconds?: number,
+ minutes?: number,
+ hours?: number,
+ date?: number,
+ month?: number,
+ year?: number,
+ },
+ Date | number,
+ Date
+ >,
+ setDate: CurriedFn2<number, Date | number, Date>,
+ setDay: CurriedFn2<number, Date | number, Date>,
+ setDayOfYear: CurriedFn2<number, Date | number, Date>,
+ setDayWithOptions: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ number,
+ Date | number,
+ Date
+ >,
+ setHours: CurriedFn2<number, Date | number, Date>,
+ setISODay: CurriedFn2<number, Date | number, Date>,
+ setISOWeek: CurriedFn2<number, Date | number, Date>,
+ setISOWeekYear: CurriedFn2<number, Date | number, Date>,
+ setMilliseconds: CurriedFn2<number, Date | number, Date>,
+ setMinutes: CurriedFn2<number, Date | number, Date>,
+ setMonth: CurriedFn2<number, Date | number, Date>,
+ setQuarter: CurriedFn2<number, Date | number, Date>,
+ setSeconds: CurriedFn2<number, Date | number, Date>,
+ setWeek: CurriedFn2<number, Date | number, Date>,
+ setWeekWithOptions: CurriedFn3<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ number,
+ Date | number,
+ Date
+ >,
+ setWeekYear: CurriedFn2<number, Date | number, Date>,
+ setWeekYearWithOptions: CurriedFn3<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ number,
+ Date | number,
+ Date
+ >,
+ setYear: CurriedFn2<number, Date | number, Date>,
+ startOfDay: CurriedFn1<Date | number, Date>,
+ startOfDecade: CurriedFn1<Date | number, Date>,
+ startOfHour: CurriedFn1<Date | number, Date>,
+ startOfISOWeek: CurriedFn1<Date | number, Date>,
+ startOfISOWeekYear: CurriedFn1<Date | number, Date>,
+ startOfMinute: CurriedFn1<Date | number, Date>,
+ startOfMonth: CurriedFn1<Date | number, Date>,
+ startOfQuarter: CurriedFn1<Date | number, Date>,
+ startOfSecond: CurriedFn1<Date | number, Date>,
+ startOfWeek: CurriedFn1<Date | number, Date>,
+ startOfWeekWithOptions: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+ >,
+ startOfWeekYear: CurriedFn1<Date | number, Date>,
+ startOfWeekYearWithOptions: CurriedFn2<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+ >,
+ startOfYear: CurriedFn1<Date | number, Date>,
+ sub: CurriedFn2<Duration, Date | number, Date>,
+ subBusinessDays: CurriedFn2<number, Date | number, Date>,
+ subDays: CurriedFn2<number, Date | number, Date>,
+ subHours: CurriedFn2<number, Date | number, Date>,
+ subISOWeekYears: CurriedFn2<number, Date | number, Date>,
+ subMilliseconds: CurriedFn2<number, Date | number, Date>,
+ subMinutes: CurriedFn2<number, Date | number, Date>,
+ subMonths: CurriedFn2<number, Date | number, Date>,
+ subQuarters: CurriedFn2<number, Date | number, Date>,
+ subSeconds: CurriedFn2<number, Date | number, Date>,
+ subWeeks: CurriedFn2<number, Date | number, Date>,
+ subYears: CurriedFn2<number, Date | number, Date>,
+ toDate: CurriedFn1<Date | number, Date>,
+ weeksToDays: CurriedFn1<number, number>,
+ yearsToMonths: CurriedFn1<number, number>,
+ yearsToQuarters: CurriedFn1<number, number>,
+ daysInWeek: number,
+ maxTime: number,
+ millisecondsInMinute: number,
+ millisecondsInHour: number,
+ millisecondsInSecond: number,
+ minTime: number,
+ minutesInHour: number,
+ monthsInQuarter: number,
+ monthsInYear: number,
+ quartersInYear: number,
+ secondsInHour: number,
+ secondsInMinute: number,
+}
diff --git a/date-fns/src/fp/intervalToDuration/index.d.ts b/date-fns/src/fp/intervalToDuration/index.d.ts
new file mode 100644
index 0000000..4b2381d
--- /dev/null
+++ b/date-fns/src/fp/intervalToDuration/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { intervalToDuration } from 'date-fns/fp'
+export default intervalToDuration
diff --git a/date-fns/src/fp/intervalToDuration/index.js b/date-fns/src/fp/intervalToDuration/index.js
new file mode 100644
index 0000000..d596acc
--- /dev/null
+++ b/date-fns/src/fp/intervalToDuration/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../intervalToDuration/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var intervalToDuration = convertToFP(fn, 1)
+
+export default intervalToDuration
diff --git a/date-fns/src/fp/intervalToDuration/index.js.flow b/date-fns/src/fp/intervalToDuration/index.js.flow
new file mode 100644
index 0000000..88f6ff0
--- /dev/null
+++ b/date-fns/src/fp/intervalToDuration/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Interval, Duration>
diff --git a/date-fns/src/fp/intlFormat/index.d.ts b/date-fns/src/fp/intlFormat/index.d.ts
new file mode 100644
index 0000000..38f78a7
--- /dev/null
+++ b/date-fns/src/fp/intlFormat/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { intlFormat } from 'date-fns/fp'
+export default intlFormat
diff --git a/date-fns/src/fp/intlFormat/index.js b/date-fns/src/fp/intlFormat/index.js
new file mode 100644
index 0000000..8bd9e7c
--- /dev/null
+++ b/date-fns/src/fp/intlFormat/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../intlFormat/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var intlFormat = convertToFP(fn, 3)
+
+export default intlFormat
diff --git a/date-fns/src/fp/intlFormat/index.js.flow b/date-fns/src/fp/intlFormat/index.js.flow
new file mode 100644
index 0000000..c104dcf
--- /dev/null
+++ b/date-fns/src/fp/intlFormat/index.js.flow
@@ -0,0 +1,88 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ locale?: string | string[],
+ },
+ {
+ timeZone?: string,
+ hour12?: boolean,
+ formatMatcher?: 'basic' | 'best fit',
+ timeZoneName?: 'short' | 'long',
+ second?: 'numeric' | '2-digit',
+ minute?: 'numeric' | '2-digit',
+ hour?: 'numeric' | '2-digit',
+ day?: 'numeric' | '2-digit',
+ month?: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long',
+ year?: 'numeric' | '2-digit',
+ era?: 'narrow' | 'short' | 'long',
+ weekday?: 'narrow' | 'short' | 'long',
+ localeMatcher?: 'lookup' | 'best fit',
+ },
+ Date | number,
+ string
+>
diff --git a/date-fns/src/fp/isAfter/index.d.ts b/date-fns/src/fp/isAfter/index.d.ts
new file mode 100644
index 0000000..de8ba72
--- /dev/null
+++ b/date-fns/src/fp/isAfter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isAfter } from 'date-fns/fp'
+export default isAfter
diff --git a/date-fns/src/fp/isAfter/index.js b/date-fns/src/fp/isAfter/index.js
new file mode 100644
index 0000000..a754322
--- /dev/null
+++ b/date-fns/src/fp/isAfter/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isAfter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isAfter = convertToFP(fn, 2)
+
+export default isAfter
diff --git a/date-fns/src/fp/isAfter/index.js.flow b/date-fns/src/fp/isAfter/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isAfter/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isBefore/index.d.ts b/date-fns/src/fp/isBefore/index.d.ts
new file mode 100644
index 0000000..d289198
--- /dev/null
+++ b/date-fns/src/fp/isBefore/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isBefore } from 'date-fns/fp'
+export default isBefore
diff --git a/date-fns/src/fp/isBefore/index.js b/date-fns/src/fp/isBefore/index.js
new file mode 100644
index 0000000..4b9ec17
--- /dev/null
+++ b/date-fns/src/fp/isBefore/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isBefore/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isBefore = convertToFP(fn, 2)
+
+export default isBefore
diff --git a/date-fns/src/fp/isBefore/index.js.flow b/date-fns/src/fp/isBefore/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isBefore/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isDate/index.d.ts b/date-fns/src/fp/isDate/index.d.ts
new file mode 100644
index 0000000..6f120ce
--- /dev/null
+++ b/date-fns/src/fp/isDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isDate } from 'date-fns/fp'
+export default isDate
diff --git a/date-fns/src/fp/isDate/index.js b/date-fns/src/fp/isDate/index.js
new file mode 100644
index 0000000..77f01e7
--- /dev/null
+++ b/date-fns/src/fp/isDate/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isDate/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isDate = convertToFP(fn, 1)
+
+export default isDate
diff --git a/date-fns/src/fp/isDate/index.js.flow b/date-fns/src/fp/isDate/index.js.flow
new file mode 100644
index 0000000..62e70e2
--- /dev/null
+++ b/date-fns/src/fp/isDate/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<any, boolean>
diff --git a/date-fns/src/fp/isEqual/index.d.ts b/date-fns/src/fp/isEqual/index.d.ts
new file mode 100644
index 0000000..b21d398
--- /dev/null
+++ b/date-fns/src/fp/isEqual/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isEqual } from 'date-fns/fp'
+export default isEqual
diff --git a/date-fns/src/fp/isEqual/index.js b/date-fns/src/fp/isEqual/index.js
new file mode 100644
index 0000000..bdc4dec
--- /dev/null
+++ b/date-fns/src/fp/isEqual/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isEqual/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isEqual = convertToFP(fn, 2)
+
+export default isEqual
diff --git a/date-fns/src/fp/isEqual/index.js.flow b/date-fns/src/fp/isEqual/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isEqual/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isExists/index.d.ts b/date-fns/src/fp/isExists/index.d.ts
new file mode 100644
index 0000000..e4ccb78
--- /dev/null
+++ b/date-fns/src/fp/isExists/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isExists } from 'date-fns/fp'
+export default isExists
diff --git a/date-fns/src/fp/isExists/index.js b/date-fns/src/fp/isExists/index.js
new file mode 100644
index 0000000..70789f2
--- /dev/null
+++ b/date-fns/src/fp/isExists/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isExists/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isExists = convertToFP(fn, 3)
+
+export default isExists
diff --git a/date-fns/src/fp/isExists/index.js.flow b/date-fns/src/fp/isExists/index.js.flow
new file mode 100644
index 0000000..2af9fe9
--- /dev/null
+++ b/date-fns/src/fp/isExists/index.js.flow
@@ -0,0 +1,67 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<number, number, number, boolean>
diff --git a/date-fns/src/fp/isFirstDayOfMonth/index.d.ts b/date-fns/src/fp/isFirstDayOfMonth/index.d.ts
new file mode 100644
index 0000000..e097310
--- /dev/null
+++ b/date-fns/src/fp/isFirstDayOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isFirstDayOfMonth } from 'date-fns/fp'
+export default isFirstDayOfMonth
diff --git a/date-fns/src/fp/isFirstDayOfMonth/index.js b/date-fns/src/fp/isFirstDayOfMonth/index.js
new file mode 100644
index 0000000..84365f8
--- /dev/null
+++ b/date-fns/src/fp/isFirstDayOfMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isFirstDayOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isFirstDayOfMonth = convertToFP(fn, 1)
+
+export default isFirstDayOfMonth
diff --git a/date-fns/src/fp/isFirstDayOfMonth/index.js.flow b/date-fns/src/fp/isFirstDayOfMonth/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isFirstDayOfMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isFriday/index.d.ts b/date-fns/src/fp/isFriday/index.d.ts
new file mode 100644
index 0000000..cdab1b1
--- /dev/null
+++ b/date-fns/src/fp/isFriday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isFriday } from 'date-fns/fp'
+export default isFriday
diff --git a/date-fns/src/fp/isFriday/index.js b/date-fns/src/fp/isFriday/index.js
new file mode 100644
index 0000000..01314a7
--- /dev/null
+++ b/date-fns/src/fp/isFriday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isFriday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isFriday = convertToFP(fn, 1)
+
+export default isFriday
diff --git a/date-fns/src/fp/isFriday/index.js.flow b/date-fns/src/fp/isFriday/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isFriday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isLastDayOfMonth/index.d.ts b/date-fns/src/fp/isLastDayOfMonth/index.d.ts
new file mode 100644
index 0000000..33750f0
--- /dev/null
+++ b/date-fns/src/fp/isLastDayOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isLastDayOfMonth } from 'date-fns/fp'
+export default isLastDayOfMonth
diff --git a/date-fns/src/fp/isLastDayOfMonth/index.js b/date-fns/src/fp/isLastDayOfMonth/index.js
new file mode 100644
index 0000000..58bf400
--- /dev/null
+++ b/date-fns/src/fp/isLastDayOfMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isLastDayOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isLastDayOfMonth = convertToFP(fn, 1)
+
+export default isLastDayOfMonth
diff --git a/date-fns/src/fp/isLastDayOfMonth/index.js.flow b/date-fns/src/fp/isLastDayOfMonth/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isLastDayOfMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isLeapYear/index.d.ts b/date-fns/src/fp/isLeapYear/index.d.ts
new file mode 100644
index 0000000..c92bce3
--- /dev/null
+++ b/date-fns/src/fp/isLeapYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isLeapYear } from 'date-fns/fp'
+export default isLeapYear
diff --git a/date-fns/src/fp/isLeapYear/index.js b/date-fns/src/fp/isLeapYear/index.js
new file mode 100644
index 0000000..babf413
--- /dev/null
+++ b/date-fns/src/fp/isLeapYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isLeapYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isLeapYear = convertToFP(fn, 1)
+
+export default isLeapYear
diff --git a/date-fns/src/fp/isLeapYear/index.js.flow b/date-fns/src/fp/isLeapYear/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isLeapYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isMatch/index.d.ts b/date-fns/src/fp/isMatch/index.d.ts
new file mode 100644
index 0000000..5085afa
--- /dev/null
+++ b/date-fns/src/fp/isMatch/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isMatch } from 'date-fns/fp'
+export default isMatch
diff --git a/date-fns/src/fp/isMatch/index.js b/date-fns/src/fp/isMatch/index.js
new file mode 100644
index 0000000..95e8e25
--- /dev/null
+++ b/date-fns/src/fp/isMatch/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isMatch/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isMatch = convertToFP(fn, 2)
+
+export default isMatch
diff --git a/date-fns/src/fp/isMatch/index.js.flow b/date-fns/src/fp/isMatch/index.js.flow
new file mode 100644
index 0000000..9eb7ae0
--- /dev/null
+++ b/date-fns/src/fp/isMatch/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<string, string, boolean>
diff --git a/date-fns/src/fp/isMatchWithOptions/index.d.ts b/date-fns/src/fp/isMatchWithOptions/index.d.ts
new file mode 100644
index 0000000..4645250
--- /dev/null
+++ b/date-fns/src/fp/isMatchWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isMatchWithOptions } from 'date-fns/fp'
+export default isMatchWithOptions
diff --git a/date-fns/src/fp/isMatchWithOptions/index.js b/date-fns/src/fp/isMatchWithOptions/index.js
new file mode 100644
index 0000000..a894b20
--- /dev/null
+++ b/date-fns/src/fp/isMatchWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isMatch/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isMatchWithOptions = convertToFP(fn, 3)
+
+export default isMatchWithOptions
diff --git a/date-fns/src/fp/isMatchWithOptions/index.js.flow b/date-fns/src/fp/isMatchWithOptions/index.js.flow
new file mode 100644
index 0000000..5b2b869
--- /dev/null
+++ b/date-fns/src/fp/isMatchWithOptions/index.js.flow
@@ -0,0 +1,78 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ useAdditionalDayOfYearTokens?: boolean,
+ useAdditionalWeekYearTokens?: boolean,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ string,
+ string,
+ boolean
+>
diff --git a/date-fns/src/fp/isMonday/index.d.ts b/date-fns/src/fp/isMonday/index.d.ts
new file mode 100644
index 0000000..550bbb0
--- /dev/null
+++ b/date-fns/src/fp/isMonday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isMonday } from 'date-fns/fp'
+export default isMonday
diff --git a/date-fns/src/fp/isMonday/index.js b/date-fns/src/fp/isMonday/index.js
new file mode 100644
index 0000000..e801cce
--- /dev/null
+++ b/date-fns/src/fp/isMonday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isMonday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isMonday = convertToFP(fn, 1)
+
+export default isMonday
diff --git a/date-fns/src/fp/isMonday/index.js.flow b/date-fns/src/fp/isMonday/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isMonday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isSameDay/index.d.ts b/date-fns/src/fp/isSameDay/index.d.ts
new file mode 100644
index 0000000..d7c74c7
--- /dev/null
+++ b/date-fns/src/fp/isSameDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameDay } from 'date-fns/fp'
+export default isSameDay
diff --git a/date-fns/src/fp/isSameDay/index.js b/date-fns/src/fp/isSameDay/index.js
new file mode 100644
index 0000000..cefc370
--- /dev/null
+++ b/date-fns/src/fp/isSameDay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameDay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameDay = convertToFP(fn, 2)
+
+export default isSameDay
diff --git a/date-fns/src/fp/isSameDay/index.js.flow b/date-fns/src/fp/isSameDay/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameDay/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameHour/index.d.ts b/date-fns/src/fp/isSameHour/index.d.ts
new file mode 100644
index 0000000..ff4dacb
--- /dev/null
+++ b/date-fns/src/fp/isSameHour/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameHour } from 'date-fns/fp'
+export default isSameHour
diff --git a/date-fns/src/fp/isSameHour/index.js b/date-fns/src/fp/isSameHour/index.js
new file mode 100644
index 0000000..5412fb3
--- /dev/null
+++ b/date-fns/src/fp/isSameHour/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameHour/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameHour = convertToFP(fn, 2)
+
+export default isSameHour
diff --git a/date-fns/src/fp/isSameHour/index.js.flow b/date-fns/src/fp/isSameHour/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameHour/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameISOWeek/index.d.ts b/date-fns/src/fp/isSameISOWeek/index.d.ts
new file mode 100644
index 0000000..41c5426
--- /dev/null
+++ b/date-fns/src/fp/isSameISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameISOWeek } from 'date-fns/fp'
+export default isSameISOWeek
diff --git a/date-fns/src/fp/isSameISOWeek/index.js b/date-fns/src/fp/isSameISOWeek/index.js
new file mode 100644
index 0000000..5d80c9c
--- /dev/null
+++ b/date-fns/src/fp/isSameISOWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameISOWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameISOWeek = convertToFP(fn, 2)
+
+export default isSameISOWeek
diff --git a/date-fns/src/fp/isSameISOWeek/index.js.flow b/date-fns/src/fp/isSameISOWeek/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameISOWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameISOWeekYear/index.d.ts b/date-fns/src/fp/isSameISOWeekYear/index.d.ts
new file mode 100644
index 0000000..f9f65c0
--- /dev/null
+++ b/date-fns/src/fp/isSameISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameISOWeekYear } from 'date-fns/fp'
+export default isSameISOWeekYear
diff --git a/date-fns/src/fp/isSameISOWeekYear/index.js b/date-fns/src/fp/isSameISOWeekYear/index.js
new file mode 100644
index 0000000..0a14d31
--- /dev/null
+++ b/date-fns/src/fp/isSameISOWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameISOWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameISOWeekYear = convertToFP(fn, 2)
+
+export default isSameISOWeekYear
diff --git a/date-fns/src/fp/isSameISOWeekYear/index.js.flow b/date-fns/src/fp/isSameISOWeekYear/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameISOWeekYear/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameMinute/index.d.ts b/date-fns/src/fp/isSameMinute/index.d.ts
new file mode 100644
index 0000000..b19be2a
--- /dev/null
+++ b/date-fns/src/fp/isSameMinute/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameMinute } from 'date-fns/fp'
+export default isSameMinute
diff --git a/date-fns/src/fp/isSameMinute/index.js b/date-fns/src/fp/isSameMinute/index.js
new file mode 100644
index 0000000..f664f96
--- /dev/null
+++ b/date-fns/src/fp/isSameMinute/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameMinute/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameMinute = convertToFP(fn, 2)
+
+export default isSameMinute
diff --git a/date-fns/src/fp/isSameMinute/index.js.flow b/date-fns/src/fp/isSameMinute/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameMinute/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameMonth/index.d.ts b/date-fns/src/fp/isSameMonth/index.d.ts
new file mode 100644
index 0000000..1c29c87
--- /dev/null
+++ b/date-fns/src/fp/isSameMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameMonth } from 'date-fns/fp'
+export default isSameMonth
diff --git a/date-fns/src/fp/isSameMonth/index.js b/date-fns/src/fp/isSameMonth/index.js
new file mode 100644
index 0000000..0479c45
--- /dev/null
+++ b/date-fns/src/fp/isSameMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameMonth = convertToFP(fn, 2)
+
+export default isSameMonth
diff --git a/date-fns/src/fp/isSameMonth/index.js.flow b/date-fns/src/fp/isSameMonth/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameMonth/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameQuarter/index.d.ts b/date-fns/src/fp/isSameQuarter/index.d.ts
new file mode 100644
index 0000000..6fe36a5
--- /dev/null
+++ b/date-fns/src/fp/isSameQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameQuarter } from 'date-fns/fp'
+export default isSameQuarter
diff --git a/date-fns/src/fp/isSameQuarter/index.js b/date-fns/src/fp/isSameQuarter/index.js
new file mode 100644
index 0000000..1fcb783
--- /dev/null
+++ b/date-fns/src/fp/isSameQuarter/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameQuarter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameQuarter = convertToFP(fn, 2)
+
+export default isSameQuarter
diff --git a/date-fns/src/fp/isSameQuarter/index.js.flow b/date-fns/src/fp/isSameQuarter/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameQuarter/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameSecond/index.d.ts b/date-fns/src/fp/isSameSecond/index.d.ts
new file mode 100644
index 0000000..b65413a
--- /dev/null
+++ b/date-fns/src/fp/isSameSecond/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameSecond } from 'date-fns/fp'
+export default isSameSecond
diff --git a/date-fns/src/fp/isSameSecond/index.js b/date-fns/src/fp/isSameSecond/index.js
new file mode 100644
index 0000000..976a012
--- /dev/null
+++ b/date-fns/src/fp/isSameSecond/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameSecond/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameSecond = convertToFP(fn, 2)
+
+export default isSameSecond
diff --git a/date-fns/src/fp/isSameSecond/index.js.flow b/date-fns/src/fp/isSameSecond/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameSecond/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameWeek/index.d.ts b/date-fns/src/fp/isSameWeek/index.d.ts
new file mode 100644
index 0000000..e6b37fa
--- /dev/null
+++ b/date-fns/src/fp/isSameWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameWeek } from 'date-fns/fp'
+export default isSameWeek
diff --git a/date-fns/src/fp/isSameWeek/index.js b/date-fns/src/fp/isSameWeek/index.js
new file mode 100644
index 0000000..043f63e
--- /dev/null
+++ b/date-fns/src/fp/isSameWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameWeek = convertToFP(fn, 2)
+
+export default isSameWeek
diff --git a/date-fns/src/fp/isSameWeek/index.js.flow b/date-fns/src/fp/isSameWeek/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSameWeekWithOptions/index.d.ts b/date-fns/src/fp/isSameWeekWithOptions/index.d.ts
new file mode 100644
index 0000000..240b654
--- /dev/null
+++ b/date-fns/src/fp/isSameWeekWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameWeekWithOptions } from 'date-fns/fp'
+export default isSameWeekWithOptions
diff --git a/date-fns/src/fp/isSameWeekWithOptions/index.js b/date-fns/src/fp/isSameWeekWithOptions/index.js
new file mode 100644
index 0000000..a05210f
--- /dev/null
+++ b/date-fns/src/fp/isSameWeekWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameWeekWithOptions = convertToFP(fn, 3)
+
+export default isSameWeekWithOptions
diff --git a/date-fns/src/fp/isSameWeekWithOptions/index.js.flow b/date-fns/src/fp/isSameWeekWithOptions/index.js.flow
new file mode 100644
index 0000000..154b894
--- /dev/null
+++ b/date-fns/src/fp/isSameWeekWithOptions/index.js.flow
@@ -0,0 +1,75 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date | number,
+ boolean
+>
diff --git a/date-fns/src/fp/isSameYear/index.d.ts b/date-fns/src/fp/isSameYear/index.d.ts
new file mode 100644
index 0000000..da9db07
--- /dev/null
+++ b/date-fns/src/fp/isSameYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameYear } from 'date-fns/fp'
+export default isSameYear
diff --git a/date-fns/src/fp/isSameYear/index.js b/date-fns/src/fp/isSameYear/index.js
new file mode 100644
index 0000000..06b5ec4
--- /dev/null
+++ b/date-fns/src/fp/isSameYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSameYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSameYear = convertToFP(fn, 2)
+
+export default isSameYear
diff --git a/date-fns/src/fp/isSameYear/index.js.flow b/date-fns/src/fp/isSameYear/index.js.flow
new file mode 100644
index 0000000..38638c4
--- /dev/null
+++ b/date-fns/src/fp/isSameYear/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Date | number, Date | number, boolean>
diff --git a/date-fns/src/fp/isSaturday/index.d.ts b/date-fns/src/fp/isSaturday/index.d.ts
new file mode 100644
index 0000000..d6c100a
--- /dev/null
+++ b/date-fns/src/fp/isSaturday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSaturday } from 'date-fns/fp'
+export default isSaturday
diff --git a/date-fns/src/fp/isSaturday/index.js b/date-fns/src/fp/isSaturday/index.js
new file mode 100644
index 0000000..7fb3394
--- /dev/null
+++ b/date-fns/src/fp/isSaturday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSaturday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSaturday = convertToFP(fn, 1)
+
+export default isSaturday
diff --git a/date-fns/src/fp/isSaturday/index.js.flow b/date-fns/src/fp/isSaturday/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isSaturday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isSunday/index.d.ts b/date-fns/src/fp/isSunday/index.d.ts
new file mode 100644
index 0000000..d5ff84f
--- /dev/null
+++ b/date-fns/src/fp/isSunday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSunday } from 'date-fns/fp'
+export default isSunday
diff --git a/date-fns/src/fp/isSunday/index.js b/date-fns/src/fp/isSunday/index.js
new file mode 100644
index 0000000..b37f29f
--- /dev/null
+++ b/date-fns/src/fp/isSunday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isSunday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isSunday = convertToFP(fn, 1)
+
+export default isSunday
diff --git a/date-fns/src/fp/isSunday/index.js.flow b/date-fns/src/fp/isSunday/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isSunday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isThursday/index.d.ts b/date-fns/src/fp/isThursday/index.d.ts
new file mode 100644
index 0000000..5f7c57c
--- /dev/null
+++ b/date-fns/src/fp/isThursday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThursday } from 'date-fns/fp'
+export default isThursday
diff --git a/date-fns/src/fp/isThursday/index.js b/date-fns/src/fp/isThursday/index.js
new file mode 100644
index 0000000..d5c87d1
--- /dev/null
+++ b/date-fns/src/fp/isThursday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isThursday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isThursday = convertToFP(fn, 1)
+
+export default isThursday
diff --git a/date-fns/src/fp/isThursday/index.js.flow b/date-fns/src/fp/isThursday/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isThursday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isTuesday/index.d.ts b/date-fns/src/fp/isTuesday/index.d.ts
new file mode 100644
index 0000000..3a652b6
--- /dev/null
+++ b/date-fns/src/fp/isTuesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isTuesday } from 'date-fns/fp'
+export default isTuesday
diff --git a/date-fns/src/fp/isTuesday/index.js b/date-fns/src/fp/isTuesday/index.js
new file mode 100644
index 0000000..d7da6f0
--- /dev/null
+++ b/date-fns/src/fp/isTuesday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isTuesday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isTuesday = convertToFP(fn, 1)
+
+export default isTuesday
diff --git a/date-fns/src/fp/isTuesday/index.js.flow b/date-fns/src/fp/isTuesday/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isTuesday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isValid/index.d.ts b/date-fns/src/fp/isValid/index.d.ts
new file mode 100644
index 0000000..42a8432
--- /dev/null
+++ b/date-fns/src/fp/isValid/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isValid } from 'date-fns/fp'
+export default isValid
diff --git a/date-fns/src/fp/isValid/index.js b/date-fns/src/fp/isValid/index.js
new file mode 100644
index 0000000..da5b3d2
--- /dev/null
+++ b/date-fns/src/fp/isValid/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isValid/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isValid = convertToFP(fn, 1)
+
+export default isValid
diff --git a/date-fns/src/fp/isValid/index.js.flow b/date-fns/src/fp/isValid/index.js.flow
new file mode 100644
index 0000000..62e70e2
--- /dev/null
+++ b/date-fns/src/fp/isValid/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<any, boolean>
diff --git a/date-fns/src/fp/isWednesday/index.d.ts b/date-fns/src/fp/isWednesday/index.d.ts
new file mode 100644
index 0000000..9752d6a
--- /dev/null
+++ b/date-fns/src/fp/isWednesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isWednesday } from 'date-fns/fp'
+export default isWednesday
diff --git a/date-fns/src/fp/isWednesday/index.js b/date-fns/src/fp/isWednesday/index.js
new file mode 100644
index 0000000..b2fa123
--- /dev/null
+++ b/date-fns/src/fp/isWednesday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isWednesday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isWednesday = convertToFP(fn, 1)
+
+export default isWednesday
diff --git a/date-fns/src/fp/isWednesday/index.js.flow b/date-fns/src/fp/isWednesday/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isWednesday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isWeekend/index.d.ts b/date-fns/src/fp/isWeekend/index.d.ts
new file mode 100644
index 0000000..ff6c8a3
--- /dev/null
+++ b/date-fns/src/fp/isWeekend/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isWeekend } from 'date-fns/fp'
+export default isWeekend
diff --git a/date-fns/src/fp/isWeekend/index.js b/date-fns/src/fp/isWeekend/index.js
new file mode 100644
index 0000000..31a08f3
--- /dev/null
+++ b/date-fns/src/fp/isWeekend/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isWeekend/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isWeekend = convertToFP(fn, 1)
+
+export default isWeekend
diff --git a/date-fns/src/fp/isWeekend/index.js.flow b/date-fns/src/fp/isWeekend/index.js.flow
new file mode 100644
index 0000000..8f53be6
--- /dev/null
+++ b/date-fns/src/fp/isWeekend/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, boolean>
diff --git a/date-fns/src/fp/isWithinInterval/index.d.ts b/date-fns/src/fp/isWithinInterval/index.d.ts
new file mode 100644
index 0000000..c3b3c9b
--- /dev/null
+++ b/date-fns/src/fp/isWithinInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isWithinInterval } from 'date-fns/fp'
+export default isWithinInterval
diff --git a/date-fns/src/fp/isWithinInterval/index.js b/date-fns/src/fp/isWithinInterval/index.js
new file mode 100644
index 0000000..88167ff
--- /dev/null
+++ b/date-fns/src/fp/isWithinInterval/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../isWithinInterval/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var isWithinInterval = convertToFP(fn, 2)
+
+export default isWithinInterval
diff --git a/date-fns/src/fp/isWithinInterval/index.js.flow b/date-fns/src/fp/isWithinInterval/index.js.flow
new file mode 100644
index 0000000..8b45a5e
--- /dev/null
+++ b/date-fns/src/fp/isWithinInterval/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Interval, Date | number, boolean>
diff --git a/date-fns/src/fp/lastDayOfDecade/index.d.ts b/date-fns/src/fp/lastDayOfDecade/index.d.ts
new file mode 100644
index 0000000..6b32f46
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfDecade } from 'date-fns/fp'
+export default lastDayOfDecade
diff --git a/date-fns/src/fp/lastDayOfDecade/index.js b/date-fns/src/fp/lastDayOfDecade/index.js
new file mode 100644
index 0000000..e2afa78
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfDecade/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfDecade/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfDecade = convertToFP(fn, 1)
+
+export default lastDayOfDecade
diff --git a/date-fns/src/fp/lastDayOfDecade/index.js.flow b/date-fns/src/fp/lastDayOfDecade/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfDecade/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/lastDayOfISOWeek/index.d.ts b/date-fns/src/fp/lastDayOfISOWeek/index.d.ts
new file mode 100644
index 0000000..13d7cbe
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfISOWeek } from 'date-fns/fp'
+export default lastDayOfISOWeek
diff --git a/date-fns/src/fp/lastDayOfISOWeek/index.js b/date-fns/src/fp/lastDayOfISOWeek/index.js
new file mode 100644
index 0000000..3c03939
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfISOWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfISOWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfISOWeek = convertToFP(fn, 1)
+
+export default lastDayOfISOWeek
diff --git a/date-fns/src/fp/lastDayOfISOWeek/index.js.flow b/date-fns/src/fp/lastDayOfISOWeek/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfISOWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/lastDayOfISOWeekYear/index.d.ts b/date-fns/src/fp/lastDayOfISOWeekYear/index.d.ts
new file mode 100644
index 0000000..8e75ca7
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfISOWeekYear } from 'date-fns/fp'
+export default lastDayOfISOWeekYear
diff --git a/date-fns/src/fp/lastDayOfISOWeekYear/index.js b/date-fns/src/fp/lastDayOfISOWeekYear/index.js
new file mode 100644
index 0000000..7227cb1
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfISOWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfISOWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfISOWeekYear = convertToFP(fn, 1)
+
+export default lastDayOfISOWeekYear
diff --git a/date-fns/src/fp/lastDayOfISOWeekYear/index.js.flow b/date-fns/src/fp/lastDayOfISOWeekYear/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfISOWeekYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/lastDayOfMonth/index.d.ts b/date-fns/src/fp/lastDayOfMonth/index.d.ts
new file mode 100644
index 0000000..1a65a14
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfMonth } from 'date-fns/fp'
+export default lastDayOfMonth
diff --git a/date-fns/src/fp/lastDayOfMonth/index.js b/date-fns/src/fp/lastDayOfMonth/index.js
new file mode 100644
index 0000000..1da2a17
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfMonth = convertToFP(fn, 1)
+
+export default lastDayOfMonth
diff --git a/date-fns/src/fp/lastDayOfMonth/index.js.flow b/date-fns/src/fp/lastDayOfMonth/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/lastDayOfQuarter/index.d.ts b/date-fns/src/fp/lastDayOfQuarter/index.d.ts
new file mode 100644
index 0000000..27f41a8
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfQuarter } from 'date-fns/fp'
+export default lastDayOfQuarter
diff --git a/date-fns/src/fp/lastDayOfQuarter/index.js b/date-fns/src/fp/lastDayOfQuarter/index.js
new file mode 100644
index 0000000..c8b7f6b
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfQuarter/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfQuarter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfQuarter = convertToFP(fn, 1)
+
+export default lastDayOfQuarter
diff --git a/date-fns/src/fp/lastDayOfQuarter/index.js.flow b/date-fns/src/fp/lastDayOfQuarter/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfQuarter/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/lastDayOfQuarterWithOptions/index.d.ts b/date-fns/src/fp/lastDayOfQuarterWithOptions/index.d.ts
new file mode 100644
index 0000000..4327d12
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfQuarterWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfQuarterWithOptions } from 'date-fns/fp'
+export default lastDayOfQuarterWithOptions
diff --git a/date-fns/src/fp/lastDayOfQuarterWithOptions/index.js b/date-fns/src/fp/lastDayOfQuarterWithOptions/index.js
new file mode 100644
index 0000000..a6ef4bd
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfQuarterWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfQuarter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfQuarterWithOptions = convertToFP(fn, 2)
+
+export default lastDayOfQuarterWithOptions
diff --git a/date-fns/src/fp/lastDayOfQuarterWithOptions/index.js.flow b/date-fns/src/fp/lastDayOfQuarterWithOptions/index.js.flow
new file mode 100644
index 0000000..4b6d0d4
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfQuarterWithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ additionalDigits?: 0 | 1 | 2,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/lastDayOfWeek/index.d.ts b/date-fns/src/fp/lastDayOfWeek/index.d.ts
new file mode 100644
index 0000000..0d79da7
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfWeek } from 'date-fns/fp'
+export default lastDayOfWeek
diff --git a/date-fns/src/fp/lastDayOfWeek/index.js b/date-fns/src/fp/lastDayOfWeek/index.js
new file mode 100644
index 0000000..0407263
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfWeek = convertToFP(fn, 1)
+
+export default lastDayOfWeek
diff --git a/date-fns/src/fp/lastDayOfWeek/index.js.flow b/date-fns/src/fp/lastDayOfWeek/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/lastDayOfWeekWithOptions/index.d.ts b/date-fns/src/fp/lastDayOfWeekWithOptions/index.d.ts
new file mode 100644
index 0000000..5719524
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfWeekWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfWeekWithOptions } from 'date-fns/fp'
+export default lastDayOfWeekWithOptions
diff --git a/date-fns/src/fp/lastDayOfWeekWithOptions/index.js b/date-fns/src/fp/lastDayOfWeekWithOptions/index.js
new file mode 100644
index 0000000..4d758bb
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfWeekWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfWeekWithOptions = convertToFP(fn, 2)
+
+export default lastDayOfWeekWithOptions
diff --git a/date-fns/src/fp/lastDayOfWeekWithOptions/index.js.flow b/date-fns/src/fp/lastDayOfWeekWithOptions/index.js.flow
new file mode 100644
index 0000000..9821646
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfWeekWithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/lastDayOfYear/index.d.ts b/date-fns/src/fp/lastDayOfYear/index.d.ts
new file mode 100644
index 0000000..340473e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfYear } from 'date-fns/fp'
+export default lastDayOfYear
diff --git a/date-fns/src/fp/lastDayOfYear/index.js b/date-fns/src/fp/lastDayOfYear/index.js
new file mode 100644
index 0000000..faf5d62
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lastDayOfYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lastDayOfYear = convertToFP(fn, 1)
+
+export default lastDayOfYear
diff --git a/date-fns/src/fp/lastDayOfYear/index.js.flow b/date-fns/src/fp/lastDayOfYear/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/lastDayOfYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/lightFormat/index.d.ts b/date-fns/src/fp/lightFormat/index.d.ts
new file mode 100644
index 0000000..843b7fd
--- /dev/null
+++ b/date-fns/src/fp/lightFormat/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lightFormat } from 'date-fns/fp'
+export default lightFormat
diff --git a/date-fns/src/fp/lightFormat/index.js b/date-fns/src/fp/lightFormat/index.js
new file mode 100644
index 0000000..da69f3c
--- /dev/null
+++ b/date-fns/src/fp/lightFormat/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../lightFormat/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var lightFormat = convertToFP(fn, 2)
+
+export default lightFormat
diff --git a/date-fns/src/fp/lightFormat/index.js.flow b/date-fns/src/fp/lightFormat/index.js.flow
new file mode 100644
index 0000000..013f277
--- /dev/null
+++ b/date-fns/src/fp/lightFormat/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<string, Date | number, string>
diff --git a/date-fns/src/fp/max/index.d.ts b/date-fns/src/fp/max/index.d.ts
new file mode 100644
index 0000000..000bf1d
--- /dev/null
+++ b/date-fns/src/fp/max/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { max } from 'date-fns/fp'
+export default max
diff --git a/date-fns/src/fp/max/index.js b/date-fns/src/fp/max/index.js
new file mode 100644
index 0000000..388ee28
--- /dev/null
+++ b/date-fns/src/fp/max/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../max/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var max = convertToFP(fn, 1)
+
+export default max
diff --git a/date-fns/src/fp/max/index.js.flow b/date-fns/src/fp/max/index.js.flow
new file mode 100644
index 0000000..dc66689
--- /dev/null
+++ b/date-fns/src/fp/max/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<(Date | number)[], Date>
diff --git a/date-fns/src/fp/milliseconds/index.d.ts b/date-fns/src/fp/milliseconds/index.d.ts
new file mode 100644
index 0000000..2552885
--- /dev/null
+++ b/date-fns/src/fp/milliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { milliseconds } from 'date-fns/fp'
+export default milliseconds
diff --git a/date-fns/src/fp/milliseconds/index.js b/date-fns/src/fp/milliseconds/index.js
new file mode 100644
index 0000000..3cd2b2c
--- /dev/null
+++ b/date-fns/src/fp/milliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../milliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var milliseconds = convertToFP(fn, 1)
+
+export default milliseconds
diff --git a/date-fns/src/fp/milliseconds/index.js.flow b/date-fns/src/fp/milliseconds/index.js.flow
new file mode 100644
index 0000000..a025a67
--- /dev/null
+++ b/date-fns/src/fp/milliseconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Duration, number>
diff --git a/date-fns/src/fp/millisecondsToHours/index.d.ts b/date-fns/src/fp/millisecondsToHours/index.d.ts
new file mode 100644
index 0000000..0ee6863
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { millisecondsToHours } from 'date-fns/fp'
+export default millisecondsToHours
diff --git a/date-fns/src/fp/millisecondsToHours/index.js b/date-fns/src/fp/millisecondsToHours/index.js
new file mode 100644
index 0000000..8d74476
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../millisecondsToHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var millisecondsToHours = convertToFP(fn, 1)
+
+export default millisecondsToHours
diff --git a/date-fns/src/fp/millisecondsToHours/index.js.flow b/date-fns/src/fp/millisecondsToHours/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToHours/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/millisecondsToMinutes/index.d.ts b/date-fns/src/fp/millisecondsToMinutes/index.d.ts
new file mode 100644
index 0000000..de84700
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { millisecondsToMinutes } from 'date-fns/fp'
+export default millisecondsToMinutes
diff --git a/date-fns/src/fp/millisecondsToMinutes/index.js b/date-fns/src/fp/millisecondsToMinutes/index.js
new file mode 100644
index 0000000..d9c64f1
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../millisecondsToMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var millisecondsToMinutes = convertToFP(fn, 1)
+
+export default millisecondsToMinutes
diff --git a/date-fns/src/fp/millisecondsToMinutes/index.js.flow b/date-fns/src/fp/millisecondsToMinutes/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToMinutes/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/millisecondsToSeconds/index.d.ts b/date-fns/src/fp/millisecondsToSeconds/index.d.ts
new file mode 100644
index 0000000..99736c4
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { millisecondsToSeconds } from 'date-fns/fp'
+export default millisecondsToSeconds
diff --git a/date-fns/src/fp/millisecondsToSeconds/index.js b/date-fns/src/fp/millisecondsToSeconds/index.js
new file mode 100644
index 0000000..3d59f18
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../millisecondsToSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var millisecondsToSeconds = convertToFP(fn, 1)
+
+export default millisecondsToSeconds
diff --git a/date-fns/src/fp/millisecondsToSeconds/index.js.flow b/date-fns/src/fp/millisecondsToSeconds/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/millisecondsToSeconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/min/index.d.ts b/date-fns/src/fp/min/index.d.ts
new file mode 100644
index 0000000..b666165
--- /dev/null
+++ b/date-fns/src/fp/min/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { min } from 'date-fns/fp'
+export default min
diff --git a/date-fns/src/fp/min/index.js b/date-fns/src/fp/min/index.js
new file mode 100644
index 0000000..70bd2f1
--- /dev/null
+++ b/date-fns/src/fp/min/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../min/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var min = convertToFP(fn, 1)
+
+export default min
diff --git a/date-fns/src/fp/min/index.js.flow b/date-fns/src/fp/min/index.js.flow
new file mode 100644
index 0000000..dc66689
--- /dev/null
+++ b/date-fns/src/fp/min/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<(Date | number)[], Date>
diff --git a/date-fns/src/fp/minutesToHours/index.d.ts b/date-fns/src/fp/minutesToHours/index.d.ts
new file mode 100644
index 0000000..15aeb30
--- /dev/null
+++ b/date-fns/src/fp/minutesToHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { minutesToHours } from 'date-fns/fp'
+export default minutesToHours
diff --git a/date-fns/src/fp/minutesToHours/index.js b/date-fns/src/fp/minutesToHours/index.js
new file mode 100644
index 0000000..d125abc
--- /dev/null
+++ b/date-fns/src/fp/minutesToHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../minutesToHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var minutesToHours = convertToFP(fn, 1)
+
+export default minutesToHours
diff --git a/date-fns/src/fp/minutesToHours/index.js.flow b/date-fns/src/fp/minutesToHours/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/minutesToHours/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/minutesToMilliseconds/index.d.ts b/date-fns/src/fp/minutesToMilliseconds/index.d.ts
new file mode 100644
index 0000000..0b19d01
--- /dev/null
+++ b/date-fns/src/fp/minutesToMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { minutesToMilliseconds } from 'date-fns/fp'
+export default minutesToMilliseconds
diff --git a/date-fns/src/fp/minutesToMilliseconds/index.js b/date-fns/src/fp/minutesToMilliseconds/index.js
new file mode 100644
index 0000000..1c54f4f
--- /dev/null
+++ b/date-fns/src/fp/minutesToMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../minutesToMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var minutesToMilliseconds = convertToFP(fn, 1)
+
+export default minutesToMilliseconds
diff --git a/date-fns/src/fp/minutesToMilliseconds/index.js.flow b/date-fns/src/fp/minutesToMilliseconds/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/minutesToMilliseconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/minutesToSeconds/index.d.ts b/date-fns/src/fp/minutesToSeconds/index.d.ts
new file mode 100644
index 0000000..bc47b3f
--- /dev/null
+++ b/date-fns/src/fp/minutesToSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { minutesToSeconds } from 'date-fns/fp'
+export default minutesToSeconds
diff --git a/date-fns/src/fp/minutesToSeconds/index.js b/date-fns/src/fp/minutesToSeconds/index.js
new file mode 100644
index 0000000..cd15bc1
--- /dev/null
+++ b/date-fns/src/fp/minutesToSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../minutesToSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var minutesToSeconds = convertToFP(fn, 1)
+
+export default minutesToSeconds
diff --git a/date-fns/src/fp/minutesToSeconds/index.js.flow b/date-fns/src/fp/minutesToSeconds/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/minutesToSeconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/monthsToQuarters/index.d.ts b/date-fns/src/fp/monthsToQuarters/index.d.ts
new file mode 100644
index 0000000..05ae53c
--- /dev/null
+++ b/date-fns/src/fp/monthsToQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { monthsToQuarters } from 'date-fns/fp'
+export default monthsToQuarters
diff --git a/date-fns/src/fp/monthsToQuarters/index.js b/date-fns/src/fp/monthsToQuarters/index.js
new file mode 100644
index 0000000..a06e630
--- /dev/null
+++ b/date-fns/src/fp/monthsToQuarters/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../monthsToQuarters/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var monthsToQuarters = convertToFP(fn, 1)
+
+export default monthsToQuarters
diff --git a/date-fns/src/fp/monthsToQuarters/index.js.flow b/date-fns/src/fp/monthsToQuarters/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/monthsToQuarters/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/monthsToYears/index.d.ts b/date-fns/src/fp/monthsToYears/index.d.ts
new file mode 100644
index 0000000..bc5f113
--- /dev/null
+++ b/date-fns/src/fp/monthsToYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { monthsToYears } from 'date-fns/fp'
+export default monthsToYears
diff --git a/date-fns/src/fp/monthsToYears/index.js b/date-fns/src/fp/monthsToYears/index.js
new file mode 100644
index 0000000..771bfa9
--- /dev/null
+++ b/date-fns/src/fp/monthsToYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../monthsToYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var monthsToYears = convertToFP(fn, 1)
+
+export default monthsToYears
diff --git a/date-fns/src/fp/monthsToYears/index.js.flow b/date-fns/src/fp/monthsToYears/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/monthsToYears/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/nextDay/index.d.ts b/date-fns/src/fp/nextDay/index.d.ts
new file mode 100644
index 0000000..dc6cd80
--- /dev/null
+++ b/date-fns/src/fp/nextDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextDay } from 'date-fns/fp'
+export default nextDay
diff --git a/date-fns/src/fp/nextDay/index.js b/date-fns/src/fp/nextDay/index.js
new file mode 100644
index 0000000..78f62f4
--- /dev/null
+++ b/date-fns/src/fp/nextDay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextDay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextDay = convertToFP(fn, 2)
+
+export default nextDay
diff --git a/date-fns/src/fp/nextDay/index.js.flow b/date-fns/src/fp/nextDay/index.js.flow
new file mode 100644
index 0000000..3d001b2
--- /dev/null
+++ b/date-fns/src/fp/nextDay/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Day, Date | number, Date>
diff --git a/date-fns/src/fp/nextFriday/index.d.ts b/date-fns/src/fp/nextFriday/index.d.ts
new file mode 100644
index 0000000..48e88cc
--- /dev/null
+++ b/date-fns/src/fp/nextFriday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextFriday } from 'date-fns/fp'
+export default nextFriday
diff --git a/date-fns/src/fp/nextFriday/index.js b/date-fns/src/fp/nextFriday/index.js
new file mode 100644
index 0000000..277d482
--- /dev/null
+++ b/date-fns/src/fp/nextFriday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextFriday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextFriday = convertToFP(fn, 1)
+
+export default nextFriday
diff --git a/date-fns/src/fp/nextFriday/index.js.flow b/date-fns/src/fp/nextFriday/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/nextFriday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/nextMonday/index.d.ts b/date-fns/src/fp/nextMonday/index.d.ts
new file mode 100644
index 0000000..50926c4
--- /dev/null
+++ b/date-fns/src/fp/nextMonday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextMonday } from 'date-fns/fp'
+export default nextMonday
diff --git a/date-fns/src/fp/nextMonday/index.js b/date-fns/src/fp/nextMonday/index.js
new file mode 100644
index 0000000..a09c1e0
--- /dev/null
+++ b/date-fns/src/fp/nextMonday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextMonday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextMonday = convertToFP(fn, 1)
+
+export default nextMonday
diff --git a/date-fns/src/fp/nextMonday/index.js.flow b/date-fns/src/fp/nextMonday/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/nextMonday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/nextSaturday/index.d.ts b/date-fns/src/fp/nextSaturday/index.d.ts
new file mode 100644
index 0000000..5774aa5
--- /dev/null
+++ b/date-fns/src/fp/nextSaturday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextSaturday } from 'date-fns/fp'
+export default nextSaturday
diff --git a/date-fns/src/fp/nextSaturday/index.js b/date-fns/src/fp/nextSaturday/index.js
new file mode 100644
index 0000000..145813f
--- /dev/null
+++ b/date-fns/src/fp/nextSaturday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextSaturday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextSaturday = convertToFP(fn, 1)
+
+export default nextSaturday
diff --git a/date-fns/src/fp/nextSaturday/index.js.flow b/date-fns/src/fp/nextSaturday/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/nextSaturday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/nextSunday/index.d.ts b/date-fns/src/fp/nextSunday/index.d.ts
new file mode 100644
index 0000000..acd1202
--- /dev/null
+++ b/date-fns/src/fp/nextSunday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextSunday } from 'date-fns/fp'
+export default nextSunday
diff --git a/date-fns/src/fp/nextSunday/index.js b/date-fns/src/fp/nextSunday/index.js
new file mode 100644
index 0000000..cb21ec9
--- /dev/null
+++ b/date-fns/src/fp/nextSunday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextSunday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextSunday = convertToFP(fn, 1)
+
+export default nextSunday
diff --git a/date-fns/src/fp/nextSunday/index.js.flow b/date-fns/src/fp/nextSunday/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/nextSunday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/nextThursday/index.d.ts b/date-fns/src/fp/nextThursday/index.d.ts
new file mode 100644
index 0000000..1f2dcf0
--- /dev/null
+++ b/date-fns/src/fp/nextThursday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextThursday } from 'date-fns/fp'
+export default nextThursday
diff --git a/date-fns/src/fp/nextThursday/index.js b/date-fns/src/fp/nextThursday/index.js
new file mode 100644
index 0000000..9e22adf
--- /dev/null
+++ b/date-fns/src/fp/nextThursday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextThursday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextThursday = convertToFP(fn, 1)
+
+export default nextThursday
diff --git a/date-fns/src/fp/nextThursday/index.js.flow b/date-fns/src/fp/nextThursday/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/nextThursday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/nextTuesday/index.d.ts b/date-fns/src/fp/nextTuesday/index.d.ts
new file mode 100644
index 0000000..4842cc0
--- /dev/null
+++ b/date-fns/src/fp/nextTuesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextTuesday } from 'date-fns/fp'
+export default nextTuesday
diff --git a/date-fns/src/fp/nextTuesday/index.js b/date-fns/src/fp/nextTuesday/index.js
new file mode 100644
index 0000000..648bcc8
--- /dev/null
+++ b/date-fns/src/fp/nextTuesday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextTuesday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextTuesday = convertToFP(fn, 1)
+
+export default nextTuesday
diff --git a/date-fns/src/fp/nextTuesday/index.js.flow b/date-fns/src/fp/nextTuesday/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/nextTuesday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/nextWednesday/index.d.ts b/date-fns/src/fp/nextWednesday/index.d.ts
new file mode 100644
index 0000000..800d5a5
--- /dev/null
+++ b/date-fns/src/fp/nextWednesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextWednesday } from 'date-fns/fp'
+export default nextWednesday
diff --git a/date-fns/src/fp/nextWednesday/index.js b/date-fns/src/fp/nextWednesday/index.js
new file mode 100644
index 0000000..007100f
--- /dev/null
+++ b/date-fns/src/fp/nextWednesday/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../nextWednesday/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var nextWednesday = convertToFP(fn, 1)
+
+export default nextWednesday
diff --git a/date-fns/src/fp/nextWednesday/index.js.flow b/date-fns/src/fp/nextWednesday/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/nextWednesday/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/parse/index.d.ts b/date-fns/src/fp/parse/index.d.ts
new file mode 100644
index 0000000..0d42228
--- /dev/null
+++ b/date-fns/src/fp/parse/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parse } from 'date-fns/fp'
+export default parse
diff --git a/date-fns/src/fp/parse/index.js b/date-fns/src/fp/parse/index.js
new file mode 100644
index 0000000..3a34a83
--- /dev/null
+++ b/date-fns/src/fp/parse/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../parse/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var parse = convertToFP(fn, 3)
+
+export default parse
diff --git a/date-fns/src/fp/parse/index.js.flow b/date-fns/src/fp/parse/index.js.flow
new file mode 100644
index 0000000..7146666
--- /dev/null
+++ b/date-fns/src/fp/parse/index.js.flow
@@ -0,0 +1,67 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<Date | number, string, string, Date>
diff --git a/date-fns/src/fp/parseISO/index.d.ts b/date-fns/src/fp/parseISO/index.d.ts
new file mode 100644
index 0000000..f89741c
--- /dev/null
+++ b/date-fns/src/fp/parseISO/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parseISO } from 'date-fns/fp'
+export default parseISO
diff --git a/date-fns/src/fp/parseISO/index.js b/date-fns/src/fp/parseISO/index.js
new file mode 100644
index 0000000..2b6c652
--- /dev/null
+++ b/date-fns/src/fp/parseISO/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../parseISO/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var parseISO = convertToFP(fn, 1)
+
+export default parseISO
diff --git a/date-fns/src/fp/parseISO/index.js.flow b/date-fns/src/fp/parseISO/index.js.flow
new file mode 100644
index 0000000..4d84593
--- /dev/null
+++ b/date-fns/src/fp/parseISO/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<string, Date>
diff --git a/date-fns/src/fp/parseISOWithOptions/index.d.ts b/date-fns/src/fp/parseISOWithOptions/index.d.ts
new file mode 100644
index 0000000..b90cbd3
--- /dev/null
+++ b/date-fns/src/fp/parseISOWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parseISOWithOptions } from 'date-fns/fp'
+export default parseISOWithOptions
diff --git a/date-fns/src/fp/parseISOWithOptions/index.js b/date-fns/src/fp/parseISOWithOptions/index.js
new file mode 100644
index 0000000..8927125
--- /dev/null
+++ b/date-fns/src/fp/parseISOWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../parseISO/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var parseISOWithOptions = convertToFP(fn, 2)
+
+export default parseISOWithOptions
diff --git a/date-fns/src/fp/parseISOWithOptions/index.js.flow b/date-fns/src/fp/parseISOWithOptions/index.js.flow
new file mode 100644
index 0000000..d2d80ca
--- /dev/null
+++ b/date-fns/src/fp/parseISOWithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ additionalDigits?: 0 | 1 | 2,
+ },
+ string,
+ Date
+>
diff --git a/date-fns/src/fp/parseJSON/index.d.ts b/date-fns/src/fp/parseJSON/index.d.ts
new file mode 100644
index 0000000..dd64334
--- /dev/null
+++ b/date-fns/src/fp/parseJSON/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parseJSON } from 'date-fns/fp'
+export default parseJSON
diff --git a/date-fns/src/fp/parseJSON/index.js b/date-fns/src/fp/parseJSON/index.js
new file mode 100644
index 0000000..115c5e8
--- /dev/null
+++ b/date-fns/src/fp/parseJSON/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../parseJSON/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var parseJSON = convertToFP(fn, 1)
+
+export default parseJSON
diff --git a/date-fns/src/fp/parseJSON/index.js.flow b/date-fns/src/fp/parseJSON/index.js.flow
new file mode 100644
index 0000000..9b7f47a
--- /dev/null
+++ b/date-fns/src/fp/parseJSON/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<string | number | Date, Date>
diff --git a/date-fns/src/fp/parseWithOptions/index.d.ts b/date-fns/src/fp/parseWithOptions/index.d.ts
new file mode 100644
index 0000000..d33b4ae
--- /dev/null
+++ b/date-fns/src/fp/parseWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parseWithOptions } from 'date-fns/fp'
+export default parseWithOptions
diff --git a/date-fns/src/fp/parseWithOptions/index.js b/date-fns/src/fp/parseWithOptions/index.js
new file mode 100644
index 0000000..1a4d39a
--- /dev/null
+++ b/date-fns/src/fp/parseWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../parse/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var parseWithOptions = convertToFP(fn, 4)
+
+export default parseWithOptions
diff --git a/date-fns/src/fp/parseWithOptions/index.js.flow b/date-fns/src/fp/parseWithOptions/index.js.flow
new file mode 100644
index 0000000..e767e62
--- /dev/null
+++ b/date-fns/src/fp/parseWithOptions/index.js.flow
@@ -0,0 +1,94 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+type CurriedFn4<A, B, C, D, R> = <A>(
+ a: A
+) =>
+ | CurriedFn3<B, C, D, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) =>
+ | CurriedFn2<C, D, R>
+ | (<A, B, C>(
+ a: A,
+ b: B,
+ c: C
+ ) => CurriedFn1<D, R> | (<A, B, C, D>(a: A, b: B, c: C, d: D) => R)))
+
+declare module.exports: CurriedFn4<
+ {
+ useAdditionalDayOfYearTokens?: boolean,
+ useAdditionalWeekYearTokens?: boolean,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ string,
+ string,
+ Date
+>
diff --git a/date-fns/src/fp/quartersToMonths/index.d.ts b/date-fns/src/fp/quartersToMonths/index.d.ts
new file mode 100644
index 0000000..07220e8
--- /dev/null
+++ b/date-fns/src/fp/quartersToMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { quartersToMonths } from 'date-fns/fp'
+export default quartersToMonths
diff --git a/date-fns/src/fp/quartersToMonths/index.js b/date-fns/src/fp/quartersToMonths/index.js
new file mode 100644
index 0000000..d804e23
--- /dev/null
+++ b/date-fns/src/fp/quartersToMonths/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../quartersToMonths/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var quartersToMonths = convertToFP(fn, 1)
+
+export default quartersToMonths
diff --git a/date-fns/src/fp/quartersToMonths/index.js.flow b/date-fns/src/fp/quartersToMonths/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/quartersToMonths/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/quartersToYears/index.d.ts b/date-fns/src/fp/quartersToYears/index.d.ts
new file mode 100644
index 0000000..6613aeb
--- /dev/null
+++ b/date-fns/src/fp/quartersToYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { quartersToYears } from 'date-fns/fp'
+export default quartersToYears
diff --git a/date-fns/src/fp/quartersToYears/index.js b/date-fns/src/fp/quartersToYears/index.js
new file mode 100644
index 0000000..9d28be7
--- /dev/null
+++ b/date-fns/src/fp/quartersToYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../quartersToYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var quartersToYears = convertToFP(fn, 1)
+
+export default quartersToYears
diff --git a/date-fns/src/fp/quartersToYears/index.js.flow b/date-fns/src/fp/quartersToYears/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/quartersToYears/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/roundToNearestMinutes/index.d.ts b/date-fns/src/fp/roundToNearestMinutes/index.d.ts
new file mode 100644
index 0000000..7777ce2
--- /dev/null
+++ b/date-fns/src/fp/roundToNearestMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { roundToNearestMinutes } from 'date-fns/fp'
+export default roundToNearestMinutes
diff --git a/date-fns/src/fp/roundToNearestMinutes/index.js b/date-fns/src/fp/roundToNearestMinutes/index.js
new file mode 100644
index 0000000..b2e0264
--- /dev/null
+++ b/date-fns/src/fp/roundToNearestMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../roundToNearestMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var roundToNearestMinutes = convertToFP(fn, 1)
+
+export default roundToNearestMinutes
diff --git a/date-fns/src/fp/roundToNearestMinutes/index.js.flow b/date-fns/src/fp/roundToNearestMinutes/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/roundToNearestMinutes/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/roundToNearestMinutesWithOptions/index.d.ts b/date-fns/src/fp/roundToNearestMinutesWithOptions/index.d.ts
new file mode 100644
index 0000000..fcd4df4
--- /dev/null
+++ b/date-fns/src/fp/roundToNearestMinutesWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { roundToNearestMinutesWithOptions } from 'date-fns/fp'
+export default roundToNearestMinutesWithOptions
diff --git a/date-fns/src/fp/roundToNearestMinutesWithOptions/index.js b/date-fns/src/fp/roundToNearestMinutesWithOptions/index.js
new file mode 100644
index 0000000..921eacc
--- /dev/null
+++ b/date-fns/src/fp/roundToNearestMinutesWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../roundToNearestMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var roundToNearestMinutesWithOptions = convertToFP(fn, 2)
+
+export default roundToNearestMinutesWithOptions
diff --git a/date-fns/src/fp/roundToNearestMinutesWithOptions/index.js.flow b/date-fns/src/fp/roundToNearestMinutesWithOptions/index.js.flow
new file mode 100644
index 0000000..b19bdb5
--- /dev/null
+++ b/date-fns/src/fp/roundToNearestMinutesWithOptions/index.js.flow
@@ -0,0 +1,64 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ nearestTo?: number,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/secondsToHours/index.d.ts b/date-fns/src/fp/secondsToHours/index.d.ts
new file mode 100644
index 0000000..931f3a7
--- /dev/null
+++ b/date-fns/src/fp/secondsToHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { secondsToHours } from 'date-fns/fp'
+export default secondsToHours
diff --git a/date-fns/src/fp/secondsToHours/index.js b/date-fns/src/fp/secondsToHours/index.js
new file mode 100644
index 0000000..3e789d6
--- /dev/null
+++ b/date-fns/src/fp/secondsToHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../secondsToHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var secondsToHours = convertToFP(fn, 1)
+
+export default secondsToHours
diff --git a/date-fns/src/fp/secondsToHours/index.js.flow b/date-fns/src/fp/secondsToHours/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/secondsToHours/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/secondsToMilliseconds/index.d.ts b/date-fns/src/fp/secondsToMilliseconds/index.d.ts
new file mode 100644
index 0000000..98df8f2
--- /dev/null
+++ b/date-fns/src/fp/secondsToMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { secondsToMilliseconds } from 'date-fns/fp'
+export default secondsToMilliseconds
diff --git a/date-fns/src/fp/secondsToMilliseconds/index.js b/date-fns/src/fp/secondsToMilliseconds/index.js
new file mode 100644
index 0000000..daafff0
--- /dev/null
+++ b/date-fns/src/fp/secondsToMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../secondsToMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var secondsToMilliseconds = convertToFP(fn, 1)
+
+export default secondsToMilliseconds
diff --git a/date-fns/src/fp/secondsToMilliseconds/index.js.flow b/date-fns/src/fp/secondsToMilliseconds/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/secondsToMilliseconds/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/secondsToMinutes/index.d.ts b/date-fns/src/fp/secondsToMinutes/index.d.ts
new file mode 100644
index 0000000..e22b528
--- /dev/null
+++ b/date-fns/src/fp/secondsToMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { secondsToMinutes } from 'date-fns/fp'
+export default secondsToMinutes
diff --git a/date-fns/src/fp/secondsToMinutes/index.js b/date-fns/src/fp/secondsToMinutes/index.js
new file mode 100644
index 0000000..9aacc97
--- /dev/null
+++ b/date-fns/src/fp/secondsToMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../secondsToMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var secondsToMinutes = convertToFP(fn, 1)
+
+export default secondsToMinutes
diff --git a/date-fns/src/fp/secondsToMinutes/index.js.flow b/date-fns/src/fp/secondsToMinutes/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/secondsToMinutes/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/set/index.d.ts b/date-fns/src/fp/set/index.d.ts
new file mode 100644
index 0000000..601f00b
--- /dev/null
+++ b/date-fns/src/fp/set/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { set } from 'date-fns/fp'
+export default set
diff --git a/date-fns/src/fp/set/index.js b/date-fns/src/fp/set/index.js
new file mode 100644
index 0000000..8a17025
--- /dev/null
+++ b/date-fns/src/fp/set/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../set/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var set = convertToFP(fn, 2)
+
+export default set
diff --git a/date-fns/src/fp/set/index.js.flow b/date-fns/src/fp/set/index.js.flow
new file mode 100644
index 0000000..ccc5aca
--- /dev/null
+++ b/date-fns/src/fp/set/index.js.flow
@@ -0,0 +1,70 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ milliseconds?: number,
+ seconds?: number,
+ minutes?: number,
+ hours?: number,
+ date?: number,
+ month?: number,
+ year?: number,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/setDate/index.d.ts b/date-fns/src/fp/setDate/index.d.ts
new file mode 100644
index 0000000..1d6343e
--- /dev/null
+++ b/date-fns/src/fp/setDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setDate } from 'date-fns/fp'
+export default setDate
diff --git a/date-fns/src/fp/setDate/index.js b/date-fns/src/fp/setDate/index.js
new file mode 100644
index 0000000..6548221
--- /dev/null
+++ b/date-fns/src/fp/setDate/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setDate/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setDate = convertToFP(fn, 2)
+
+export default setDate
diff --git a/date-fns/src/fp/setDate/index.js.flow b/date-fns/src/fp/setDate/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setDate/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setDay/index.d.ts b/date-fns/src/fp/setDay/index.d.ts
new file mode 100644
index 0000000..aa37dd9
--- /dev/null
+++ b/date-fns/src/fp/setDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setDay } from 'date-fns/fp'
+export default setDay
diff --git a/date-fns/src/fp/setDay/index.js b/date-fns/src/fp/setDay/index.js
new file mode 100644
index 0000000..3a7b804
--- /dev/null
+++ b/date-fns/src/fp/setDay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setDay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setDay = convertToFP(fn, 2)
+
+export default setDay
diff --git a/date-fns/src/fp/setDay/index.js.flow b/date-fns/src/fp/setDay/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setDay/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setDayOfYear/index.d.ts b/date-fns/src/fp/setDayOfYear/index.d.ts
new file mode 100644
index 0000000..4453a59
--- /dev/null
+++ b/date-fns/src/fp/setDayOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setDayOfYear } from 'date-fns/fp'
+export default setDayOfYear
diff --git a/date-fns/src/fp/setDayOfYear/index.js b/date-fns/src/fp/setDayOfYear/index.js
new file mode 100644
index 0000000..f1af2c7
--- /dev/null
+++ b/date-fns/src/fp/setDayOfYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setDayOfYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setDayOfYear = convertToFP(fn, 2)
+
+export default setDayOfYear
diff --git a/date-fns/src/fp/setDayOfYear/index.js.flow b/date-fns/src/fp/setDayOfYear/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setDayOfYear/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setDayWithOptions/index.d.ts b/date-fns/src/fp/setDayWithOptions/index.d.ts
new file mode 100644
index 0000000..537c230
--- /dev/null
+++ b/date-fns/src/fp/setDayWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setDayWithOptions } from 'date-fns/fp'
+export default setDayWithOptions
diff --git a/date-fns/src/fp/setDayWithOptions/index.js b/date-fns/src/fp/setDayWithOptions/index.js
new file mode 100644
index 0000000..44a02c6
--- /dev/null
+++ b/date-fns/src/fp/setDayWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setDay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setDayWithOptions = convertToFP(fn, 3)
+
+export default setDayWithOptions
diff --git a/date-fns/src/fp/setDayWithOptions/index.js.flow b/date-fns/src/fp/setDayWithOptions/index.js.flow
new file mode 100644
index 0000000..62d0e5e
--- /dev/null
+++ b/date-fns/src/fp/setDayWithOptions/index.js.flow
@@ -0,0 +1,75 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ number,
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/setHours/index.d.ts b/date-fns/src/fp/setHours/index.d.ts
new file mode 100644
index 0000000..4ca8a06
--- /dev/null
+++ b/date-fns/src/fp/setHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setHours } from 'date-fns/fp'
+export default setHours
diff --git a/date-fns/src/fp/setHours/index.js b/date-fns/src/fp/setHours/index.js
new file mode 100644
index 0000000..81688bf
--- /dev/null
+++ b/date-fns/src/fp/setHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setHours = convertToFP(fn, 2)
+
+export default setHours
diff --git a/date-fns/src/fp/setHours/index.js.flow b/date-fns/src/fp/setHours/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setHours/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setISODay/index.d.ts b/date-fns/src/fp/setISODay/index.d.ts
new file mode 100644
index 0000000..7319d5a
--- /dev/null
+++ b/date-fns/src/fp/setISODay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setISODay } from 'date-fns/fp'
+export default setISODay
diff --git a/date-fns/src/fp/setISODay/index.js b/date-fns/src/fp/setISODay/index.js
new file mode 100644
index 0000000..0807db1
--- /dev/null
+++ b/date-fns/src/fp/setISODay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setISODay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setISODay = convertToFP(fn, 2)
+
+export default setISODay
diff --git a/date-fns/src/fp/setISODay/index.js.flow b/date-fns/src/fp/setISODay/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setISODay/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setISOWeek/index.d.ts b/date-fns/src/fp/setISOWeek/index.d.ts
new file mode 100644
index 0000000..ca354ce
--- /dev/null
+++ b/date-fns/src/fp/setISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setISOWeek } from 'date-fns/fp'
+export default setISOWeek
diff --git a/date-fns/src/fp/setISOWeek/index.js b/date-fns/src/fp/setISOWeek/index.js
new file mode 100644
index 0000000..e7823d2
--- /dev/null
+++ b/date-fns/src/fp/setISOWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setISOWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setISOWeek = convertToFP(fn, 2)
+
+export default setISOWeek
diff --git a/date-fns/src/fp/setISOWeek/index.js.flow b/date-fns/src/fp/setISOWeek/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setISOWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setISOWeekYear/index.d.ts b/date-fns/src/fp/setISOWeekYear/index.d.ts
new file mode 100644
index 0000000..7e1fc21
--- /dev/null
+++ b/date-fns/src/fp/setISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setISOWeekYear } from 'date-fns/fp'
+export default setISOWeekYear
diff --git a/date-fns/src/fp/setISOWeekYear/index.js b/date-fns/src/fp/setISOWeekYear/index.js
new file mode 100644
index 0000000..94234f1
--- /dev/null
+++ b/date-fns/src/fp/setISOWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setISOWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setISOWeekYear = convertToFP(fn, 2)
+
+export default setISOWeekYear
diff --git a/date-fns/src/fp/setISOWeekYear/index.js.flow b/date-fns/src/fp/setISOWeekYear/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setISOWeekYear/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setMilliseconds/index.d.ts b/date-fns/src/fp/setMilliseconds/index.d.ts
new file mode 100644
index 0000000..0ee89fa
--- /dev/null
+++ b/date-fns/src/fp/setMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setMilliseconds } from 'date-fns/fp'
+export default setMilliseconds
diff --git a/date-fns/src/fp/setMilliseconds/index.js b/date-fns/src/fp/setMilliseconds/index.js
new file mode 100644
index 0000000..32e1a47
--- /dev/null
+++ b/date-fns/src/fp/setMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setMilliseconds = convertToFP(fn, 2)
+
+export default setMilliseconds
diff --git a/date-fns/src/fp/setMilliseconds/index.js.flow b/date-fns/src/fp/setMilliseconds/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setMilliseconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setMinutes/index.d.ts b/date-fns/src/fp/setMinutes/index.d.ts
new file mode 100644
index 0000000..9e8d636
--- /dev/null
+++ b/date-fns/src/fp/setMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setMinutes } from 'date-fns/fp'
+export default setMinutes
diff --git a/date-fns/src/fp/setMinutes/index.js b/date-fns/src/fp/setMinutes/index.js
new file mode 100644
index 0000000..a22b6c1
--- /dev/null
+++ b/date-fns/src/fp/setMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setMinutes = convertToFP(fn, 2)
+
+export default setMinutes
diff --git a/date-fns/src/fp/setMinutes/index.js.flow b/date-fns/src/fp/setMinutes/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setMinutes/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setMonth/index.d.ts b/date-fns/src/fp/setMonth/index.d.ts
new file mode 100644
index 0000000..c9647b1
--- /dev/null
+++ b/date-fns/src/fp/setMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setMonth } from 'date-fns/fp'
+export default setMonth
diff --git a/date-fns/src/fp/setMonth/index.js b/date-fns/src/fp/setMonth/index.js
new file mode 100644
index 0000000..16de856
--- /dev/null
+++ b/date-fns/src/fp/setMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setMonth = convertToFP(fn, 2)
+
+export default setMonth
diff --git a/date-fns/src/fp/setMonth/index.js.flow b/date-fns/src/fp/setMonth/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setMonth/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setQuarter/index.d.ts b/date-fns/src/fp/setQuarter/index.d.ts
new file mode 100644
index 0000000..b94ff08
--- /dev/null
+++ b/date-fns/src/fp/setQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setQuarter } from 'date-fns/fp'
+export default setQuarter
diff --git a/date-fns/src/fp/setQuarter/index.js b/date-fns/src/fp/setQuarter/index.js
new file mode 100644
index 0000000..8834f9f
--- /dev/null
+++ b/date-fns/src/fp/setQuarter/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setQuarter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setQuarter = convertToFP(fn, 2)
+
+export default setQuarter
diff --git a/date-fns/src/fp/setQuarter/index.js.flow b/date-fns/src/fp/setQuarter/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setQuarter/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setSeconds/index.d.ts b/date-fns/src/fp/setSeconds/index.d.ts
new file mode 100644
index 0000000..fbfa77e
--- /dev/null
+++ b/date-fns/src/fp/setSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setSeconds } from 'date-fns/fp'
+export default setSeconds
diff --git a/date-fns/src/fp/setSeconds/index.js b/date-fns/src/fp/setSeconds/index.js
new file mode 100644
index 0000000..2568487
--- /dev/null
+++ b/date-fns/src/fp/setSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setSeconds = convertToFP(fn, 2)
+
+export default setSeconds
diff --git a/date-fns/src/fp/setSeconds/index.js.flow b/date-fns/src/fp/setSeconds/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setSeconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setWeek/index.d.ts b/date-fns/src/fp/setWeek/index.d.ts
new file mode 100644
index 0000000..d9edcaa
--- /dev/null
+++ b/date-fns/src/fp/setWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setWeek } from 'date-fns/fp'
+export default setWeek
diff --git a/date-fns/src/fp/setWeek/index.js b/date-fns/src/fp/setWeek/index.js
new file mode 100644
index 0000000..b1788fc
--- /dev/null
+++ b/date-fns/src/fp/setWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setWeek = convertToFP(fn, 2)
+
+export default setWeek
diff --git a/date-fns/src/fp/setWeek/index.js.flow b/date-fns/src/fp/setWeek/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setWeekWithOptions/index.d.ts b/date-fns/src/fp/setWeekWithOptions/index.d.ts
new file mode 100644
index 0000000..2971c7a
--- /dev/null
+++ b/date-fns/src/fp/setWeekWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setWeekWithOptions } from 'date-fns/fp'
+export default setWeekWithOptions
diff --git a/date-fns/src/fp/setWeekWithOptions/index.js b/date-fns/src/fp/setWeekWithOptions/index.js
new file mode 100644
index 0000000..bbbb2ea
--- /dev/null
+++ b/date-fns/src/fp/setWeekWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setWeekWithOptions = convertToFP(fn, 3)
+
+export default setWeekWithOptions
diff --git a/date-fns/src/fp/setWeekWithOptions/index.js.flow b/date-fns/src/fp/setWeekWithOptions/index.js.flow
new file mode 100644
index 0000000..ffea29c
--- /dev/null
+++ b/date-fns/src/fp/setWeekWithOptions/index.js.flow
@@ -0,0 +1,76 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ number,
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/setWeekYear/index.d.ts b/date-fns/src/fp/setWeekYear/index.d.ts
new file mode 100644
index 0000000..7d2c6cc
--- /dev/null
+++ b/date-fns/src/fp/setWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setWeekYear } from 'date-fns/fp'
+export default setWeekYear
diff --git a/date-fns/src/fp/setWeekYear/index.js b/date-fns/src/fp/setWeekYear/index.js
new file mode 100644
index 0000000..2b34888
--- /dev/null
+++ b/date-fns/src/fp/setWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setWeekYear = convertToFP(fn, 2)
+
+export default setWeekYear
diff --git a/date-fns/src/fp/setWeekYear/index.js.flow b/date-fns/src/fp/setWeekYear/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setWeekYear/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/setWeekYearWithOptions/index.d.ts b/date-fns/src/fp/setWeekYearWithOptions/index.d.ts
new file mode 100644
index 0000000..5d52f8f
--- /dev/null
+++ b/date-fns/src/fp/setWeekYearWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setWeekYearWithOptions } from 'date-fns/fp'
+export default setWeekYearWithOptions
diff --git a/date-fns/src/fp/setWeekYearWithOptions/index.js b/date-fns/src/fp/setWeekYearWithOptions/index.js
new file mode 100644
index 0000000..2f13647
--- /dev/null
+++ b/date-fns/src/fp/setWeekYearWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setWeekYearWithOptions = convertToFP(fn, 3)
+
+export default setWeekYearWithOptions
diff --git a/date-fns/src/fp/setWeekYearWithOptions/index.js.flow b/date-fns/src/fp/setWeekYearWithOptions/index.js.flow
new file mode 100644
index 0000000..ffea29c
--- /dev/null
+++ b/date-fns/src/fp/setWeekYearWithOptions/index.js.flow
@@ -0,0 +1,76 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+type CurriedFn3<A, B, C, R> = <A>(
+ a: A
+) =>
+ | CurriedFn2<B, C, R>
+ | (<A, B>(
+ a: A,
+ b: B
+ ) => CurriedFn1<C, R> | (<A, B, C>(a: A, b: B, c: C) => R))
+
+declare module.exports: CurriedFn3<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ number,
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/setYear/index.d.ts b/date-fns/src/fp/setYear/index.d.ts
new file mode 100644
index 0000000..be24ce0
--- /dev/null
+++ b/date-fns/src/fp/setYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setYear } from 'date-fns/fp'
+export default setYear
diff --git a/date-fns/src/fp/setYear/index.js b/date-fns/src/fp/setYear/index.js
new file mode 100644
index 0000000..edd0e1c
--- /dev/null
+++ b/date-fns/src/fp/setYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../setYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var setYear = convertToFP(fn, 2)
+
+export default setYear
diff --git a/date-fns/src/fp/setYear/index.js.flow b/date-fns/src/fp/setYear/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/setYear/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/startOfDay/index.d.ts b/date-fns/src/fp/startOfDay/index.d.ts
new file mode 100644
index 0000000..fed6b05
--- /dev/null
+++ b/date-fns/src/fp/startOfDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfDay } from 'date-fns/fp'
+export default startOfDay
diff --git a/date-fns/src/fp/startOfDay/index.js b/date-fns/src/fp/startOfDay/index.js
new file mode 100644
index 0000000..2347aef
--- /dev/null
+++ b/date-fns/src/fp/startOfDay/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfDay/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfDay = convertToFP(fn, 1)
+
+export default startOfDay
diff --git a/date-fns/src/fp/startOfDay/index.js.flow b/date-fns/src/fp/startOfDay/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfDay/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfDecade/index.d.ts b/date-fns/src/fp/startOfDecade/index.d.ts
new file mode 100644
index 0000000..127c156
--- /dev/null
+++ b/date-fns/src/fp/startOfDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfDecade } from 'date-fns/fp'
+export default startOfDecade
diff --git a/date-fns/src/fp/startOfDecade/index.js b/date-fns/src/fp/startOfDecade/index.js
new file mode 100644
index 0000000..a051c74
--- /dev/null
+++ b/date-fns/src/fp/startOfDecade/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfDecade/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfDecade = convertToFP(fn, 1)
+
+export default startOfDecade
diff --git a/date-fns/src/fp/startOfDecade/index.js.flow b/date-fns/src/fp/startOfDecade/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfDecade/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfHour/index.d.ts b/date-fns/src/fp/startOfHour/index.d.ts
new file mode 100644
index 0000000..9a1905e
--- /dev/null
+++ b/date-fns/src/fp/startOfHour/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfHour } from 'date-fns/fp'
+export default startOfHour
diff --git a/date-fns/src/fp/startOfHour/index.js b/date-fns/src/fp/startOfHour/index.js
new file mode 100644
index 0000000..33d20e6
--- /dev/null
+++ b/date-fns/src/fp/startOfHour/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfHour/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfHour = convertToFP(fn, 1)
+
+export default startOfHour
diff --git a/date-fns/src/fp/startOfHour/index.js.flow b/date-fns/src/fp/startOfHour/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfHour/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfISOWeek/index.d.ts b/date-fns/src/fp/startOfISOWeek/index.d.ts
new file mode 100644
index 0000000..008f896
--- /dev/null
+++ b/date-fns/src/fp/startOfISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfISOWeek } from 'date-fns/fp'
+export default startOfISOWeek
diff --git a/date-fns/src/fp/startOfISOWeek/index.js b/date-fns/src/fp/startOfISOWeek/index.js
new file mode 100644
index 0000000..e84f988
--- /dev/null
+++ b/date-fns/src/fp/startOfISOWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfISOWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfISOWeek = convertToFP(fn, 1)
+
+export default startOfISOWeek
diff --git a/date-fns/src/fp/startOfISOWeek/index.js.flow b/date-fns/src/fp/startOfISOWeek/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfISOWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfISOWeekYear/index.d.ts b/date-fns/src/fp/startOfISOWeekYear/index.d.ts
new file mode 100644
index 0000000..aab0b5a
--- /dev/null
+++ b/date-fns/src/fp/startOfISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfISOWeekYear } from 'date-fns/fp'
+export default startOfISOWeekYear
diff --git a/date-fns/src/fp/startOfISOWeekYear/index.js b/date-fns/src/fp/startOfISOWeekYear/index.js
new file mode 100644
index 0000000..e33f0ed
--- /dev/null
+++ b/date-fns/src/fp/startOfISOWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfISOWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfISOWeekYear = convertToFP(fn, 1)
+
+export default startOfISOWeekYear
diff --git a/date-fns/src/fp/startOfISOWeekYear/index.js.flow b/date-fns/src/fp/startOfISOWeekYear/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfISOWeekYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfMinute/index.d.ts b/date-fns/src/fp/startOfMinute/index.d.ts
new file mode 100644
index 0000000..013f3a4
--- /dev/null
+++ b/date-fns/src/fp/startOfMinute/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfMinute } from 'date-fns/fp'
+export default startOfMinute
diff --git a/date-fns/src/fp/startOfMinute/index.js b/date-fns/src/fp/startOfMinute/index.js
new file mode 100644
index 0000000..e7d001d
--- /dev/null
+++ b/date-fns/src/fp/startOfMinute/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfMinute/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfMinute = convertToFP(fn, 1)
+
+export default startOfMinute
diff --git a/date-fns/src/fp/startOfMinute/index.js.flow b/date-fns/src/fp/startOfMinute/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfMinute/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfMonth/index.d.ts b/date-fns/src/fp/startOfMonth/index.d.ts
new file mode 100644
index 0000000..edbb15f
--- /dev/null
+++ b/date-fns/src/fp/startOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfMonth } from 'date-fns/fp'
+export default startOfMonth
diff --git a/date-fns/src/fp/startOfMonth/index.js b/date-fns/src/fp/startOfMonth/index.js
new file mode 100644
index 0000000..fafef31
--- /dev/null
+++ b/date-fns/src/fp/startOfMonth/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfMonth/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfMonth = convertToFP(fn, 1)
+
+export default startOfMonth
diff --git a/date-fns/src/fp/startOfMonth/index.js.flow b/date-fns/src/fp/startOfMonth/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfMonth/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfQuarter/index.d.ts b/date-fns/src/fp/startOfQuarter/index.d.ts
new file mode 100644
index 0000000..1c3b602
--- /dev/null
+++ b/date-fns/src/fp/startOfQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfQuarter } from 'date-fns/fp'
+export default startOfQuarter
diff --git a/date-fns/src/fp/startOfQuarter/index.js b/date-fns/src/fp/startOfQuarter/index.js
new file mode 100644
index 0000000..8a57f8f
--- /dev/null
+++ b/date-fns/src/fp/startOfQuarter/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfQuarter/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfQuarter = convertToFP(fn, 1)
+
+export default startOfQuarter
diff --git a/date-fns/src/fp/startOfQuarter/index.js.flow b/date-fns/src/fp/startOfQuarter/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfQuarter/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfSecond/index.d.ts b/date-fns/src/fp/startOfSecond/index.d.ts
new file mode 100644
index 0000000..866aa6f
--- /dev/null
+++ b/date-fns/src/fp/startOfSecond/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfSecond } from 'date-fns/fp'
+export default startOfSecond
diff --git a/date-fns/src/fp/startOfSecond/index.js b/date-fns/src/fp/startOfSecond/index.js
new file mode 100644
index 0000000..91548ab
--- /dev/null
+++ b/date-fns/src/fp/startOfSecond/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfSecond/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfSecond = convertToFP(fn, 1)
+
+export default startOfSecond
diff --git a/date-fns/src/fp/startOfSecond/index.js.flow b/date-fns/src/fp/startOfSecond/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfSecond/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfWeek/index.d.ts b/date-fns/src/fp/startOfWeek/index.d.ts
new file mode 100644
index 0000000..ab17841
--- /dev/null
+++ b/date-fns/src/fp/startOfWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfWeek } from 'date-fns/fp'
+export default startOfWeek
diff --git a/date-fns/src/fp/startOfWeek/index.js b/date-fns/src/fp/startOfWeek/index.js
new file mode 100644
index 0000000..7de56af
--- /dev/null
+++ b/date-fns/src/fp/startOfWeek/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfWeek = convertToFP(fn, 1)
+
+export default startOfWeek
diff --git a/date-fns/src/fp/startOfWeek/index.js.flow b/date-fns/src/fp/startOfWeek/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfWeek/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfWeekWithOptions/index.d.ts b/date-fns/src/fp/startOfWeekWithOptions/index.d.ts
new file mode 100644
index 0000000..0bd5568
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfWeekWithOptions } from 'date-fns/fp'
+export default startOfWeekWithOptions
diff --git a/date-fns/src/fp/startOfWeekWithOptions/index.js b/date-fns/src/fp/startOfWeekWithOptions/index.js
new file mode 100644
index 0000000..22b45ed
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfWeek/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfWeekWithOptions = convertToFP(fn, 2)
+
+export default startOfWeekWithOptions
diff --git a/date-fns/src/fp/startOfWeekWithOptions/index.js.flow b/date-fns/src/fp/startOfWeekWithOptions/index.js.flow
new file mode 100644
index 0000000..9821646
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekWithOptions/index.js.flow
@@ -0,0 +1,65 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/startOfWeekYear/index.d.ts b/date-fns/src/fp/startOfWeekYear/index.d.ts
new file mode 100644
index 0000000..17ce1cb
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfWeekYear } from 'date-fns/fp'
+export default startOfWeekYear
diff --git a/date-fns/src/fp/startOfWeekYear/index.js b/date-fns/src/fp/startOfWeekYear/index.js
new file mode 100644
index 0000000..aeb28a6
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfWeekYear = convertToFP(fn, 1)
+
+export default startOfWeekYear
diff --git a/date-fns/src/fp/startOfWeekYear/index.js.flow b/date-fns/src/fp/startOfWeekYear/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/startOfWeekYearWithOptions/index.d.ts b/date-fns/src/fp/startOfWeekYearWithOptions/index.d.ts
new file mode 100644
index 0000000..26f9e80
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekYearWithOptions/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfWeekYearWithOptions } from 'date-fns/fp'
+export default startOfWeekYearWithOptions
diff --git a/date-fns/src/fp/startOfWeekYearWithOptions/index.js b/date-fns/src/fp/startOfWeekYearWithOptions/index.js
new file mode 100644
index 0000000..a2c4107
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekYearWithOptions/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfWeekYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfWeekYearWithOptions = convertToFP(fn, 2)
+
+export default startOfWeekYearWithOptions
diff --git a/date-fns/src/fp/startOfWeekYearWithOptions/index.js.flow b/date-fns/src/fp/startOfWeekYearWithOptions/index.js.flow
new file mode 100644
index 0000000..236eaa5
--- /dev/null
+++ b/date-fns/src/fp/startOfWeekYearWithOptions/index.js.flow
@@ -0,0 +1,66 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<
+ {
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ locale?: Locale,
+ },
+ Date | number,
+ Date
+>
diff --git a/date-fns/src/fp/startOfYear/index.d.ts b/date-fns/src/fp/startOfYear/index.d.ts
new file mode 100644
index 0000000..6e94924
--- /dev/null
+++ b/date-fns/src/fp/startOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfYear } from 'date-fns/fp'
+export default startOfYear
diff --git a/date-fns/src/fp/startOfYear/index.js b/date-fns/src/fp/startOfYear/index.js
new file mode 100644
index 0000000..2f7559b
--- /dev/null
+++ b/date-fns/src/fp/startOfYear/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../startOfYear/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var startOfYear = convertToFP(fn, 1)
+
+export default startOfYear
diff --git a/date-fns/src/fp/startOfYear/index.js.flow b/date-fns/src/fp/startOfYear/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/startOfYear/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/sub/index.d.ts b/date-fns/src/fp/sub/index.d.ts
new file mode 100644
index 0000000..c50f32f
--- /dev/null
+++ b/date-fns/src/fp/sub/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { sub } from 'date-fns/fp'
+export default sub
diff --git a/date-fns/src/fp/sub/index.js b/date-fns/src/fp/sub/index.js
new file mode 100644
index 0000000..cc93525
--- /dev/null
+++ b/date-fns/src/fp/sub/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../sub/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var sub = convertToFP(fn, 2)
+
+export default sub
diff --git a/date-fns/src/fp/sub/index.js.flow b/date-fns/src/fp/sub/index.js.flow
new file mode 100644
index 0000000..3d4363b
--- /dev/null
+++ b/date-fns/src/fp/sub/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<Duration, Date | number, Date>
diff --git a/date-fns/src/fp/subBusinessDays/index.d.ts b/date-fns/src/fp/subBusinessDays/index.d.ts
new file mode 100644
index 0000000..6f7c95a
--- /dev/null
+++ b/date-fns/src/fp/subBusinessDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subBusinessDays } from 'date-fns/fp'
+export default subBusinessDays
diff --git a/date-fns/src/fp/subBusinessDays/index.js b/date-fns/src/fp/subBusinessDays/index.js
new file mode 100644
index 0000000..805c008
--- /dev/null
+++ b/date-fns/src/fp/subBusinessDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subBusinessDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subBusinessDays = convertToFP(fn, 2)
+
+export default subBusinessDays
diff --git a/date-fns/src/fp/subBusinessDays/index.js.flow b/date-fns/src/fp/subBusinessDays/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subBusinessDays/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subDays/index.d.ts b/date-fns/src/fp/subDays/index.d.ts
new file mode 100644
index 0000000..8a72d43
--- /dev/null
+++ b/date-fns/src/fp/subDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subDays } from 'date-fns/fp'
+export default subDays
diff --git a/date-fns/src/fp/subDays/index.js b/date-fns/src/fp/subDays/index.js
new file mode 100644
index 0000000..2b5d109
--- /dev/null
+++ b/date-fns/src/fp/subDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subDays = convertToFP(fn, 2)
+
+export default subDays
diff --git a/date-fns/src/fp/subDays/index.js.flow b/date-fns/src/fp/subDays/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subDays/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subHours/index.d.ts b/date-fns/src/fp/subHours/index.d.ts
new file mode 100644
index 0000000..6fcfa1f
--- /dev/null
+++ b/date-fns/src/fp/subHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subHours } from 'date-fns/fp'
+export default subHours
diff --git a/date-fns/src/fp/subHours/index.js b/date-fns/src/fp/subHours/index.js
new file mode 100644
index 0000000..6048270
--- /dev/null
+++ b/date-fns/src/fp/subHours/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subHours/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subHours = convertToFP(fn, 2)
+
+export default subHours
diff --git a/date-fns/src/fp/subHours/index.js.flow b/date-fns/src/fp/subHours/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subHours/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subISOWeekYears/index.d.ts b/date-fns/src/fp/subISOWeekYears/index.d.ts
new file mode 100644
index 0000000..430fca4
--- /dev/null
+++ b/date-fns/src/fp/subISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subISOWeekYears } from 'date-fns/fp'
+export default subISOWeekYears
diff --git a/date-fns/src/fp/subISOWeekYears/index.js b/date-fns/src/fp/subISOWeekYears/index.js
new file mode 100644
index 0000000..af21ed1
--- /dev/null
+++ b/date-fns/src/fp/subISOWeekYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subISOWeekYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subISOWeekYears = convertToFP(fn, 2)
+
+export default subISOWeekYears
diff --git a/date-fns/src/fp/subISOWeekYears/index.js.flow b/date-fns/src/fp/subISOWeekYears/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subISOWeekYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subMilliseconds/index.d.ts b/date-fns/src/fp/subMilliseconds/index.d.ts
new file mode 100644
index 0000000..9310a1c
--- /dev/null
+++ b/date-fns/src/fp/subMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subMilliseconds } from 'date-fns/fp'
+export default subMilliseconds
diff --git a/date-fns/src/fp/subMilliseconds/index.js b/date-fns/src/fp/subMilliseconds/index.js
new file mode 100644
index 0000000..4d1cfb4
--- /dev/null
+++ b/date-fns/src/fp/subMilliseconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subMilliseconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subMilliseconds = convertToFP(fn, 2)
+
+export default subMilliseconds
diff --git a/date-fns/src/fp/subMilliseconds/index.js.flow b/date-fns/src/fp/subMilliseconds/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subMilliseconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subMinutes/index.d.ts b/date-fns/src/fp/subMinutes/index.d.ts
new file mode 100644
index 0000000..0b7db10
--- /dev/null
+++ b/date-fns/src/fp/subMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subMinutes } from 'date-fns/fp'
+export default subMinutes
diff --git a/date-fns/src/fp/subMinutes/index.js b/date-fns/src/fp/subMinutes/index.js
new file mode 100644
index 0000000..de68341
--- /dev/null
+++ b/date-fns/src/fp/subMinutes/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subMinutes/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subMinutes = convertToFP(fn, 2)
+
+export default subMinutes
diff --git a/date-fns/src/fp/subMinutes/index.js.flow b/date-fns/src/fp/subMinutes/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subMinutes/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subMonths/index.d.ts b/date-fns/src/fp/subMonths/index.d.ts
new file mode 100644
index 0000000..3d03d27
--- /dev/null
+++ b/date-fns/src/fp/subMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subMonths } from 'date-fns/fp'
+export default subMonths
diff --git a/date-fns/src/fp/subMonths/index.js b/date-fns/src/fp/subMonths/index.js
new file mode 100644
index 0000000..328a912
--- /dev/null
+++ b/date-fns/src/fp/subMonths/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subMonths/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subMonths = convertToFP(fn, 2)
+
+export default subMonths
diff --git a/date-fns/src/fp/subMonths/index.js.flow b/date-fns/src/fp/subMonths/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subMonths/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subQuarters/index.d.ts b/date-fns/src/fp/subQuarters/index.d.ts
new file mode 100644
index 0000000..6362cec
--- /dev/null
+++ b/date-fns/src/fp/subQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subQuarters } from 'date-fns/fp'
+export default subQuarters
diff --git a/date-fns/src/fp/subQuarters/index.js b/date-fns/src/fp/subQuarters/index.js
new file mode 100644
index 0000000..ae7cfd7
--- /dev/null
+++ b/date-fns/src/fp/subQuarters/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subQuarters/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subQuarters = convertToFP(fn, 2)
+
+export default subQuarters
diff --git a/date-fns/src/fp/subQuarters/index.js.flow b/date-fns/src/fp/subQuarters/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subQuarters/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subSeconds/index.d.ts b/date-fns/src/fp/subSeconds/index.d.ts
new file mode 100644
index 0000000..c5c6635
--- /dev/null
+++ b/date-fns/src/fp/subSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subSeconds } from 'date-fns/fp'
+export default subSeconds
diff --git a/date-fns/src/fp/subSeconds/index.js b/date-fns/src/fp/subSeconds/index.js
new file mode 100644
index 0000000..5e70757
--- /dev/null
+++ b/date-fns/src/fp/subSeconds/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subSeconds/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subSeconds = convertToFP(fn, 2)
+
+export default subSeconds
diff --git a/date-fns/src/fp/subSeconds/index.js.flow b/date-fns/src/fp/subSeconds/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subSeconds/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subWeeks/index.d.ts b/date-fns/src/fp/subWeeks/index.d.ts
new file mode 100644
index 0000000..18eebcb
--- /dev/null
+++ b/date-fns/src/fp/subWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subWeeks } from 'date-fns/fp'
+export default subWeeks
diff --git a/date-fns/src/fp/subWeeks/index.js b/date-fns/src/fp/subWeeks/index.js
new file mode 100644
index 0000000..496a43a
--- /dev/null
+++ b/date-fns/src/fp/subWeeks/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subWeeks/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subWeeks = convertToFP(fn, 2)
+
+export default subWeeks
diff --git a/date-fns/src/fp/subWeeks/index.js.flow b/date-fns/src/fp/subWeeks/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subWeeks/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/subYears/index.d.ts b/date-fns/src/fp/subYears/index.d.ts
new file mode 100644
index 0000000..55abb01
--- /dev/null
+++ b/date-fns/src/fp/subYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subYears } from 'date-fns/fp'
+export default subYears
diff --git a/date-fns/src/fp/subYears/index.js b/date-fns/src/fp/subYears/index.js
new file mode 100644
index 0000000..5ae0b22
--- /dev/null
+++ b/date-fns/src/fp/subYears/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../subYears/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var subYears = convertToFP(fn, 2)
+
+export default subYears
diff --git a/date-fns/src/fp/subYears/index.js.flow b/date-fns/src/fp/subYears/index.js.flow
new file mode 100644
index 0000000..75c22e2
--- /dev/null
+++ b/date-fns/src/fp/subYears/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+type CurriedFn2<A, B, R> = <A>(
+ a: A
+) => CurriedFn1<B, R> | (<A, B>(a: A, b: B) => R)
+
+declare module.exports: CurriedFn2<number, Date | number, Date>
diff --git a/date-fns/src/fp/test.js b/date-fns/src/fp/test.js
new file mode 100644
index 0000000..cb69259
--- /dev/null
+++ b/date-fns/src/fp/test.js
@@ -0,0 +1,1045 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import * as fp from '.'
+
+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('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('addISOWeekYears', function() {
+ var result = fp.addISOWeekYears(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)
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 750))
+ })
+
+ 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('addMonths', function() {
+ var result = fp.addMonths(5)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2015, 1 /* Feb */, 1))
+ })
+
+ it('addQuarters', function() {
+ var result = fp.addQuarters(1)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1))
+ })
+
+ 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('addWeeks', function() {
+ var result = fp.addWeeks(4)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 29))
+ })
+
+ it('addYears', function() {
+ var result = fp.addYears(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)
+ }
+
+ var result = fp.areIntervalsOverlapping(rightInterval)(leftInterval)
+ assert(result === true)
+ })
+
+ it('closestIndexTo', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = fp.closestIndexTo([
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(2012, 6 /* Jul */, 2)
+ ])(date)
+ assert.equal(result, 0)
+ })
+
+ it('closestTo', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ var result = fp.closestTo([
+ new Date(2015, 7 /* Aug */, 31),
+ new Date(2012, 6 /* Jul */, 2)
+ ])(date)
+ 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)
+ )
+ assert(result === -1)
+ })
+
+ it('compareDesc', function() {
+ var result = fp.compareDesc(new Date(1989, 6 /* Jul */, 10))(
+ new Date(1987, 1 /* Feb */, 11)
+ )
+ assert(result === 1)
+ })
+
+ it('differenceInCalendarDays', function() {
+ var result = fp.differenceInCalendarDays(
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
+ assert(result === 366)
+ })
+
+ it('differenceInCalendarISOWeeks', function() {
+ var result = fp.differenceInCalendarISOWeeks(
+ new Date(2014, 5 /* Jun */, 29, 6, 0)
+ )(new Date(2014, 6 /* Jul */, 8, 18, 0))
+ assert(result === 2)
+ })
+
+ it('differenceInCalendarISOWeekYears', function() {
+ var result = fp.differenceInCalendarISOWeekYears(
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
+ assert(result === 1)
+ })
+
+ it('differenceInCalendarMonths', function() {
+ var result = fp.differenceInCalendarMonths(
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
+ assert(result === 12)
+ })
+
+ it('differenceInCalendarQuarters', function() {
+ var result = fp.differenceInCalendarQuarters(
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
+ assert(result === 4)
+ })
+
+ it('differenceInCalendarWeeks', function() {
+ var result = fp.differenceInCalendarWeeks(
+ new Date(2014, 5 /* Jun */, 29, 6, 0)
+ )(new Date(2014, 6 /* Jul */, 8, 18, 0))
+ assert(result === 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))
+ assert(result === 2)
+ })
+
+ it('differenceInCalendarYears', function() {
+ var result = fp.differenceInCalendarYears(
+ new Date(2011, 6 /* Jul */, 2, 6, 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))(
+ 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))(
+ new Date(2014, 6 /* Jul */, 2, 20, 0)
+ )
+ assert(result === 14)
+ })
+
+ it('differenceInISOWeekYears', function() {
+ var result = fp.differenceInISOWeekYears(
+ new Date(2011, 6 /* Jul */, 2, 6, 0)
+ )(new Date(2012, 6 /* Jul */, 2, 18, 0))
+ assert(result === 1)
+ })
+
+ 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))
+ assert(result === 100)
+ })
+
+ 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('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('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('differenceInSeconds', function() {
+ var result = fp.differenceInSeconds(
+ new Date(2014, 6 /* Jul */, 2, 12, 30, 6)
+ )(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))(
+ 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))(
+ 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)
+ }
+ var result = fp.eachDayOfInterval(interval)
+ assert.deepEqual(result, [
+ new Date(2014, 9 /* Oct */, 6),
+ new Date(2014, 9 /* Oct */, 7),
+ new Date(2014, 9 /* Oct */, 8),
+ new Date(2014, 9 /* Oct */, 9),
+ new Date(2014, 9 /* Oct */, 10),
+ new Date(2014, 9 /* Oct */, 11),
+ new Date(2014, 9 /* Oct */, 12)
+ ])
+ })
+
+ 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),
+ new Date(2014, 9 /* Oct */, 12),
+ new Date(2014, 9 /* Oct */, 19),
+ new Date(2014, 9 /* Oct */, 26),
+ new Date(2014, 10 /* Nov */, 2),
+ new Date(2014, 10 /* Nov */, 9),
+ new Date(2014, 10 /* Nov */, 16),
+ new Date(2014, 10 /* Nov */, 23)
+ ])
+ })
+
+ 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),
+ new Date(2014, 9 /* Oct */, 14),
+ new Date(2014, 9 /* Oct */, 21),
+ new Date(2014, 9 /* Oct */, 28),
+ new Date(2014, 10 /* Nov */, 4),
+ new Date(2014, 10 /* Nov */, 11),
+ new Date(2014, 10 /* Nov */, 18)
+ ])
+ })
+
+ 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('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('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('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('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('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('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('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('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() {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ var result = fp.endOfWeekWithOptions({ weekStartsOn: 2 })(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 8, 23, 59, 59, 999))
+ })
+
+ 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('format', function() {
+ var date = new Date(2014, 3, 4)
+ var result = fp.format('yyyy-MM-dd')(date)
+ assert(result === '2014-04-04')
+ })
+
+ it('formatWithOptions', function() {
+ var date = new Date(2014, 3, 4)
+ 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))(
+ new Date(1986, 3, 4, 10, 32, 0)
+ )
+ assert(result === '3 minutes')
+ })
+
+ 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))
+ assert(result === 'less than 5 seconds')
+ })
+
+ 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 })(
+ new Date(1986, 3, 4, 10, 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)
+ )
+ 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))
+ assert(result === '03/28/1986')
+ })
+
+ it('fromUnixTime', function() {
+ var result = fp.fromUnixTime(1330515499)
+ assert(result.getTime() === 1330515499000)
+ })
+
+ it('getDate', function() {
+ var result = fp.getDate(new Date(2012, 1 /* Feb */, 29))
+ assert(result === 29)
+ })
+
+ it('getDay', function() {
+ var result = fp.getDay(new Date(2012, 1 /* Feb */, 29))
+ assert(result === 3)
+ })
+
+ it('getDayOfYear', function() {
+ var result = fp.getDayOfYear(new Date(2014, 6 /* Jul */, 2))
+ assert(result === 183)
+ })
+
+ it('getDaysInMonth', function() {
+ var result = fp.getDaysInMonth(new Date(2100, 1 /* Feb */, 11))
+ assert(result === 28)
+ })
+
+ it('getDaysInYear', function() {
+ var result = fp.getDaysInYear(new Date(2012, 6 /* Jul */, 2))
+ assert(result === 366)
+ })
+
+ it('getHours', function() {
+ var result = fp.getHours(new Date(2012, 1 /* Feb */, 29, 11, 45))
+ assert(result === 11)
+ })
+
+ it('getISODay', function() {
+ var result = fp.getISODay(new Date(2012, 1 /* Feb */, 29))
+ assert(result === 3)
+ })
+
+ it('getISOWeek', function() {
+ var result = fp.getISOWeek(new Date(2005, 0 /* Jan */, 2))
+ assert(result === 53)
+ })
+
+ it('getISOWeeksInYear', function() {
+ var result = fp.getISOWeeksInYear(new Date(2015, 1 /* Feb */, 11))
+ assert(result === 53)
+ })
+
+ it('getISOWeekYear', function() {
+ var result = fp.getISOWeekYear(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)
+ )
+ assert(result === 123)
+ })
+
+ it('getMinutes', function() {
+ var result = fp.getMinutes(new Date(2012, 1 /* Feb */, 29, 11, 45, 5))
+ assert(result === 45)
+ })
+
+ it('getMonth', function() {
+ var result = fp.getMonth(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
+ )
+ assert(numOverlappingDays === 24)
+ })
+
+ it('getQuarter', function() {
+ var result = fp.getQuarter(new Date(2014, 6 /* Jul */, 2))
+ assert(result === 3)
+ })
+
+ it('getSeconds', function() {
+ var result = fp.getSeconds(new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123))
+ assert(result === 5)
+ })
+
+ it('getTime', function() {
+ var timestamp = 1483228800000
+ var result = fp.getTime(new Date(timestamp))
+ assert(result === timestamp)
+ })
+
+ it('getWeek', function() {
+ var result = fp.getWeek(new Date(2005, 0 /* Jan */, 2))
+ assert(result === 2)
+ })
+
+ 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)
+ )
+ assert(result === 6)
+ })
+
+ 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)
+ )
+ assert(result === 1)
+ })
+
+ 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))
+ assert(result === 2004)
+ })
+
+ it('getYear', function() {
+ var result = fp.getYear(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)
+ )
+ assert(result === true)
+ })
+
+ it('isBefore', function() {
+ var result = fp.isBefore(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)
+ )
+ assert(result === true)
+ })
+
+ it('isFirstDayOfMonth', function() {
+ var result = fp.isFirstDayOfMonth(new Date(2014, 9 /* Oct */, 1))
+ assert(result === true)
+ })
+
+ it('isFriday', function() {
+ var result = fp.isFriday(new Date(2014, 8 /* Sep */, 26))
+ assert(result === true)
+ })
+
+ it('isLastDayOfMonth', function() {
+ var result = fp.isLastDayOfMonth(new Date(2014, 9 /* Oct */, 31))
+ assert(result === true)
+ })
+
+ it('isLeapYear', function() {
+ var result = fp.isLeapYear(new Date(2012, 6 /* Jul */, 2))
+ assert(result === true)
+ })
+
+ it('isMonday', function() {
+ var result = fp.isMonday(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)
+ )
+ 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)
+ )
+ assert(result === true)
+ })
+
+ it('isSameISOWeek', function() {
+ var result = fp.isSameISOWeek(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)
+ )
+ 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)
+ )
+ assert(result === true)
+ })
+
+ it('isSameMonth', function() {
+ var result = fp.isSameMonth(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)
+ )
+ 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))
+ assert(result === true)
+ })
+
+ 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))
+ assert(result === false)
+ })
+
+ it('isSameYear', function() {
+ var result = fp.isSameYear(new Date(2014, 8 /* Sep */, 25))(
+ new Date(2014, 8 /* Sep */, 2)
+ )
+ assert(result === true)
+ })
+
+ it('isSaturday', function() {
+ var result = fp.isSaturday(new Date(2014, 8 /* Sep */, 27))
+ assert(result === true)
+ })
+
+ it('isSunday', function() {
+ var result = fp.isSunday(new Date(2014, 8 /* Sep */, 21))
+ assert(result === true)
+ })
+
+ it('isThursday', function() {
+ var result = fp.isThursday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === true)
+ })
+
+ it('isTuesday', function() {
+ var result = fp.isTuesday(new Date(2014, 8 /* Sep */, 23))
+ assert(result === true)
+ })
+
+ it('isValid', function() {
+ var result = fp.isValid(new Date())
+ assert(result === true)
+ })
+
+ it('isWednesday', function() {
+ var result = fp.isWednesday(new Date(2014, 8 /* Sep */, 24))
+ assert(result === true)
+ })
+
+ it('isWeekend', function() {
+ var result = fp.isWeekend(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)
+ }
+ var result = fp.isWithinInterval(interval)(new Date(2014, 9 /* Oct */, 31))
+ assert(result === true)
+ })
+
+ 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('lastDayOfISOWeekYear', function() {
+ var result = fp.lastDayOfISOWeekYear(new Date(2009, 0 /* Jan */, 1, 16, 0))
+ assert.deepEqual(result, new Date(2010, 0 /* Jan */, 3))
+ })
+
+ 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('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('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() {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ var result = fp.lastDayOfWeekWithOptions({ weekStartsOn: 1 })(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ 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('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('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('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() {
+ var baseDate = new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 900)
+ 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(
+ new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99)
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 12))
+ })
+
+ it('roundToNearestMinutesWithOptions', function() {
+ const resultA = fp.roundToNearestMinutesWithOptions({ nearestTo: 5 })(
+ new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99)
+ )
+ assert.deepEqual(resultA, new Date(2014, 6 /* Jul */, 10, 12, 10))
+
+ const resultB = fp.roundToNearestMinutesWithOptions({})(
+ new Date(2014, 6 /* Jul */, 10, 12, 11, 34, 99)
+ )
+ assert.deepEqual(resultB, new Date(2014, 6 /* Jul */, 10, 12, 12))
+ })
+
+ it('setDate', function() {
+ var result = fp.setDate(30)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('setDay', function() {
+ var result = fp.setDay(0)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
+ })
+
+ it('setDayOfYear', function() {
+ var result = fp.setDayOfYear(2)(new Date(2014, 6 /* Jul */, 2))
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
+ })
+
+ 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('setISODay', function() {
+ var result = fp.setISODay(3)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
+ })
+
+ it('setISOWeek', function() {
+ var result = fp.setISOWeek(53)(new Date(2004, 7 /* Aug */, 7))
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('setISOWeekYear', function() {
+ var result = fp.setISOWeekYear(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)
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 300))
+ })
+
+ 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('setMonth', function() {
+ var result = fp.setMonth(1)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 1))
+ })
+
+ it('setQuarter', function() {
+ var result = fp.setQuarter(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)
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 45, 500))
+ })
+
+ 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))
+ assert.deepEqual(result, new Date(2004, 0 /* Jan */, 4))
+ })
+
+ 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))
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('setYear', function() {
+ var result = fp.setYear(2013)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2013, 8 /* Sep */, 1))
+ })
+
+ 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('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('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('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('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('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('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('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('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() {
+ var date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ var result = fp.startOfWeekWithOptions({ weekStartsOn: 1 })(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ 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))
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 3, 0, 0, 0, 0))
+ })
+
+ 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('subDays', function() {
+ var result = fp.subDays(10)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 22))
+ })
+
+ 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('subISOWeekYears', function() {
+ var result = fp.subISOWeekYears(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)
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 29, 250))
+ })
+
+ 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('subMonths', function() {
+ var result = fp.subMonths(5)(new Date(2015, 1 /* Feb */, 1))
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('subQuarters', function() {
+ var result = fp.subQuarters(3)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2013, 11 /* Dec */, 1))
+ })
+
+ 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('subWeeks', function() {
+ var result = fp.subWeeks(4)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 4))
+ })
+
+ it('subYears', function() {
+ var result = fp.subYears(5)(new Date(2014, 8 /* Sep */, 1))
+ assert.deepEqual(result, new Date(2009, 8 /* Sep */, 1))
+ })
+
+ it('parseISO', function() {
+ var result = fp.parseISO('2014-10-25T13:46:20+07:00')
+ assert.deepEqual(result, new Date('2014-10-25T13:46:20+07:00'))
+ })
+
+ it('parseISOWithOptions', function() {
+ var result = fp.parseISOWithOptions({ additionalDigits: 0 })('+12340702')
+ assert.deepEqual(result, new Date(1234, 6 /* Jul */, 2))
+ })
+})
diff --git a/date-fns/src/fp/toDate/index.d.ts b/date-fns/src/fp/toDate/index.d.ts
new file mode 100644
index 0000000..2bbca80
--- /dev/null
+++ b/date-fns/src/fp/toDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { toDate } from 'date-fns/fp'
+export default toDate
diff --git a/date-fns/src/fp/toDate/index.js b/date-fns/src/fp/toDate/index.js
new file mode 100644
index 0000000..7cb0cb0
--- /dev/null
+++ b/date-fns/src/fp/toDate/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../toDate/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var toDate = convertToFP(fn, 1)
+
+export default toDate
diff --git a/date-fns/src/fp/toDate/index.js.flow b/date-fns/src/fp/toDate/index.js.flow
new file mode 100644
index 0000000..1fc072e
--- /dev/null
+++ b/date-fns/src/fp/toDate/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<Date | number, Date>
diff --git a/date-fns/src/fp/weeksToDays/index.d.ts b/date-fns/src/fp/weeksToDays/index.d.ts
new file mode 100644
index 0000000..df68239
--- /dev/null
+++ b/date-fns/src/fp/weeksToDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { weeksToDays } from 'date-fns/fp'
+export default weeksToDays
diff --git a/date-fns/src/fp/weeksToDays/index.js b/date-fns/src/fp/weeksToDays/index.js
new file mode 100644
index 0000000..1b42884
--- /dev/null
+++ b/date-fns/src/fp/weeksToDays/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../weeksToDays/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var weeksToDays = convertToFP(fn, 1)
+
+export default weeksToDays
diff --git a/date-fns/src/fp/weeksToDays/index.js.flow b/date-fns/src/fp/weeksToDays/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/weeksToDays/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/yearsToMonths/index.d.ts b/date-fns/src/fp/yearsToMonths/index.d.ts
new file mode 100644
index 0000000..39cd773
--- /dev/null
+++ b/date-fns/src/fp/yearsToMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { yearsToMonths } from 'date-fns/fp'
+export default yearsToMonths
diff --git a/date-fns/src/fp/yearsToMonths/index.js b/date-fns/src/fp/yearsToMonths/index.js
new file mode 100644
index 0000000..0a58b71
--- /dev/null
+++ b/date-fns/src/fp/yearsToMonths/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../yearsToMonths/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var yearsToMonths = convertToFP(fn, 1)
+
+export default yearsToMonths
diff --git a/date-fns/src/fp/yearsToMonths/index.js.flow b/date-fns/src/fp/yearsToMonths/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/yearsToMonths/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fp/yearsToQuarters/index.d.ts b/date-fns/src/fp/yearsToQuarters/index.d.ts
new file mode 100644
index 0000000..cbb664d
--- /dev/null
+++ b/date-fns/src/fp/yearsToQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { yearsToQuarters } from 'date-fns/fp'
+export default yearsToQuarters
diff --git a/date-fns/src/fp/yearsToQuarters/index.js b/date-fns/src/fp/yearsToQuarters/index.js
new file mode 100644
index 0000000..e9051b5
--- /dev/null
+++ b/date-fns/src/fp/yearsToQuarters/index.js
@@ -0,0 +1,8 @@
+// This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
+
+import fn from '../../yearsToQuarters/index'
+import convertToFP from '../_lib/convertToFP/index'
+
+var yearsToQuarters = convertToFP(fn, 1)
+
+export default yearsToQuarters
diff --git a/date-fns/src/fp/yearsToQuarters/index.js.flow b/date-fns/src/fp/yearsToQuarters/index.js.flow
new file mode 100644
index 0000000..aa51b5f
--- /dev/null
+++ b/date-fns/src/fp/yearsToQuarters/index.js.flow
@@ -0,0 +1,54 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+type CurriedFn1<A, R> = <A>(a: A) => R
+
+declare module.exports: CurriedFn1<number, number>
diff --git a/date-fns/src/fromUnixTime/index.d.ts b/date-fns/src/fromUnixTime/index.d.ts
new file mode 100644
index 0000000..a88920d
--- /dev/null
+++ b/date-fns/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 default fromUnixTime
diff --git a/date-fns/src/fromUnixTime/index.js b/date-fns/src/fromUnixTime/index.js
new file mode 100644
index 0000000..f3b2f82
--- /dev/null
+++ b/date-fns/src/fromUnixTime/index.js
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name fromUnixTime
+ * @category Timestamp Helpers
+ * @summary Create a date from a Unix timestamp.
+ *
+ * @description
+ * Create a date from a Unix timestamp.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Number} unixTime - the given Unix timestamp
+ * @returns {Date} the date
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Create the date 29 February 2012 11:45:05:
+ * var result = fromUnixTime(1330515905)
+ * //=> Wed Feb 29 2012 11:45:05
+ */
+export default function fromUnixTime(dirtyUnixTime) {
+ requiredArgs(1, arguments)
+
+ var unixTime = toInteger(dirtyUnixTime)
+
+ return toDate(unixTime * 1000)
+}
diff --git a/date-fns/src/fromUnixTime/index.js.flow b/date-fns/src/fromUnixTime/index.js.flow
new file mode 100644
index 0000000..a286bdf
--- /dev/null
+++ b/date-fns/src/fromUnixTime/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (unixTime: number) => Date
diff --git a/date-fns/src/fromUnixTime/test.js b/date-fns/src/fromUnixTime/test.js
new file mode 100644
index 0000000..a5b529f
--- /dev/null
+++ b/date-fns/src/fromUnixTime/test.js
@@ -0,0 +1,21 @@
+// @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 TypeError exception if passed less than 1 argument', function() {
+ assert.throws(fromUnixTime.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getDate/benchmark.js b/date-fns/src/getDate/benchmark.js
new file mode 100644
index 0000000..e59b2a9
--- /dev/null
+++ b/date-fns/src/getDate/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getDate from '.'
+import moment from 'moment'
+
+suite('getDate', function () {
+ benchmark('date-fns', function () {
+ return getDate(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.date()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getDate/index.d.ts b/date-fns/src/getDate/index.d.ts
new file mode 100644
index 0000000..cb86441
--- /dev/null
+++ b/date-fns/src/getDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDate } from 'date-fns'
+export default getDate
diff --git a/date-fns/src/getDate/index.js.flow b/date-fns/src/getDate/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getDate/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getDate/index.ts b/date-fns/src/getDate/index.ts
new file mode 100644
index 0000000..4db3697
--- /dev/null
+++ b/date-fns/src/getDate/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getDate
+ * @category Day Helpers
+ * @summary Get the day of the month of the given date.
+ *
+ * @description
+ * Get the day of the month of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the day of month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which day of the month is 29 February 2012?
+ * const result = getDate(new Date(2012, 1, 29))
+ * //=> 29
+ */
+export default function getDate(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const dayOfMonth = date.getDate()
+ return dayOfMonth
+}
diff --git a/date-fns/src/getDate/test.ts b/date-fns/src/getDate/test.ts
new file mode 100644
index 0000000..c2ed37e
--- /dev/null
+++ b/date-fns/src/getDate/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getDate from '.'
+
+describe('getDate', function() {
+ it('returns the day of the month of the given date', function() {
+ const result = getDate(new Date(2012, 1 /* Feb */, 29))
+ assert(result === 29)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getDate(new Date(2014, 11 /* Dec */, 31).getTime())
+ assert(result === 31)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getDate(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getDate.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getDay/benchmark.js b/date-fns/src/getDay/benchmark.js
new file mode 100644
index 0000000..1d3bbd5
--- /dev/null
+++ b/date-fns/src/getDay/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getDay from '.'
+import moment from 'moment'
+
+suite('getDay', function () {
+ benchmark('date-fns', function () {
+ return getDay(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.day()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getDay/index.d.ts b/date-fns/src/getDay/index.d.ts
new file mode 100644
index 0000000..5ea22c0
--- /dev/null
+++ b/date-fns/src/getDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDay } from 'date-fns'
+export default getDay
diff --git a/date-fns/src/getDay/index.js.flow b/date-fns/src/getDay/index.js.flow
new file mode 100644
index 0000000..6ff2a54
--- /dev/null
+++ b/date-fns/src/getDay/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => 0 | 1 | 2 | 3 | 4 | 5 | 6
diff --git a/date-fns/src/getDay/index.ts b/date-fns/src/getDay/index.ts
new file mode 100644
index 0000000..becc949
--- /dev/null
+++ b/date-fns/src/getDay/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getDay
+ * @category Weekday Helpers
+ * @summary Get the day of the week of the given date.
+ *
+ * @description
+ * Get the day of the week of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {0|1|2|3|4|5|6} the day of week, 0 represents Sunday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which day of the week is 29 February 2012?
+ * const result = getDay(new Date(2012, 1, 29))
+ * //=> 3
+ */
+export default function getDay(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const day = date.getDay()
+ return day
+}
diff --git a/date-fns/src/getDay/test.ts b/date-fns/src/getDay/test.ts
new file mode 100644
index 0000000..fdd1078
--- /dev/null
+++ b/date-fns/src/getDay/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getDay from '.'
+
+describe('getDay', function() {
+ it('returns the day of the week of the given date', function() {
+ const result = getDay(new Date(2012, 1 /* Feb */, 29))
+ assert(result === 3)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getDay(new Date(2014, 5 /* Jun */, 1).getTime())
+ assert(result === 0)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getDay(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getDay.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getDayOfYear/benchmark.js b/date-fns/src/getDayOfYear/benchmark.js
new file mode 100644
index 0000000..4179185
--- /dev/null
+++ b/date-fns/src/getDayOfYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getDayOfYear from '.'
+import moment from 'moment'
+
+suite('getDayOfYear', function () {
+ benchmark('date-fns', function () {
+ return getDayOfYear(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.dayOfYear()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getDayOfYear/index.d.ts b/date-fns/src/getDayOfYear/index.d.ts
new file mode 100644
index 0000000..ec58442
--- /dev/null
+++ b/date-fns/src/getDayOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDayOfYear } from 'date-fns'
+export default getDayOfYear
diff --git a/date-fns/src/getDayOfYear/index.js.flow b/date-fns/src/getDayOfYear/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getDayOfYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getDayOfYear/index.ts b/date-fns/src/getDayOfYear/index.ts
new file mode 100644
index 0000000..e43dd02
--- /dev/null
+++ b/date-fns/src/getDayOfYear/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import startOfYear from '../startOfYear/index'
+import differenceInCalendarDays from '../differenceInCalendarDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getDayOfYear
+ * @category Day Helpers
+ * @summary Get the day of the year of the given date.
+ *
+ * @description
+ * Get the day of the year of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the day of year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which day of the year is 2 July 2014?
+ * const result = getDayOfYear(new Date(2014, 6, 2))
+ * //=> 183
+ */
+export default function getDayOfYear(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const diff = differenceInCalendarDays(date, startOfYear(date))
+ const dayOfYear = diff + 1
+ return dayOfYear
+}
diff --git a/date-fns/src/getDayOfYear/test.ts b/date-fns/src/getDayOfYear/test.ts
new file mode 100644
index 0000000..527c0a5
--- /dev/null
+++ b/date-fns/src/getDayOfYear/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getDayOfYear from '.'
+
+describe('getDayOfYear', function() {
+ it('returns the day of the year of the given date', function() {
+ const result = getDayOfYear(new Date(2014, 6 /* Jul */, 2))
+ assert(result === 183)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getDayOfYear(new Date(2014, 0 /* Jan */, 2).getTime())
+ assert(result === 2)
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(0, 11 /* Dec */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ const result = getDayOfYear(initialDate)
+ assert(result === 366)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getDayOfYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getDayOfYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getDaysInMonth/benchmark.js b/date-fns/src/getDaysInMonth/benchmark.js
new file mode 100644
index 0000000..2e2eb87
--- /dev/null
+++ b/date-fns/src/getDaysInMonth/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getDaysInMonth from '.'
+import moment from 'moment'
+
+suite('getDaysInMonth', function () {
+ benchmark('date-fns', function () {
+ return getDaysInMonth(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.daysInMonth()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getDaysInMonth/index.d.ts b/date-fns/src/getDaysInMonth/index.d.ts
new file mode 100644
index 0000000..6b69dae
--- /dev/null
+++ b/date-fns/src/getDaysInMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDaysInMonth } from 'date-fns'
+export default getDaysInMonth
diff --git a/date-fns/src/getDaysInMonth/index.js.flow b/date-fns/src/getDaysInMonth/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getDaysInMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getDaysInMonth/index.ts b/date-fns/src/getDaysInMonth/index.ts
new file mode 100644
index 0000000..f0959bb
--- /dev/null
+++ b/date-fns/src/getDaysInMonth/index.ts
@@ -0,0 +1,35 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getDaysInMonth
+ * @category Month Helpers
+ * @summary Get the number of days in a month of the given date.
+ *
+ * @description
+ * Get the number of days in a month of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the number of days in a month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // How many days are in February 2000?
+ * const result = getDaysInMonth(new Date(2000, 1))
+ * //=> 29
+ */
+export default function getDaysInMonth(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ const monthIndex = date.getMonth()
+ const lastDayOfMonth = new Date(0)
+ lastDayOfMonth.setFullYear(year, monthIndex + 1, 0)
+ lastDayOfMonth.setHours(0, 0, 0, 0)
+ return lastDayOfMonth.getDate()
+}
diff --git a/date-fns/src/getDaysInMonth/test.ts b/date-fns/src/getDaysInMonth/test.ts
new file mode 100644
index 0000000..02c35f4
--- /dev/null
+++ b/date-fns/src/getDaysInMonth/test.ts
@@ -0,0 +1,40 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getDaysInMonth from '.'
+
+describe('getDaysInMonth', function() {
+ it('returns the number of days in the month of the given date', function() {
+ const result = getDaysInMonth(new Date(2100, 1 /* Feb */, 11))
+ assert(result === 28)
+ })
+
+ it('works for the February of a leap year', function() {
+ const result = getDaysInMonth(new Date(2000, 1 /* Feb */, 11))
+ assert(result === 29)
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 6 /* Jul */, 2).getTime()
+ const result = getDaysInMonth(date)
+ assert(result === 31)
+ })
+
+ it('handles dates before 100 AD', function() {
+ const date = new Date(0)
+ date.setFullYear(0, 1 /* Feb */, 15)
+ date.setHours(0, 0, 0, 0)
+ const result = getDaysInMonth(date)
+ assert(result === 29)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getDaysInMonth(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getDaysInMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getDaysInYear/benchmark.js b/date-fns/src/getDaysInYear/benchmark.js
new file mode 100644
index 0000000..b076dc8
--- /dev/null
+++ b/date-fns/src/getDaysInYear/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getDaysInYear from '.'
+
+suite('getDaysInYear', function () {
+ benchmark('date-fns', function () {
+ return getDaysInYear(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/getDaysInYear/index.d.ts b/date-fns/src/getDaysInYear/index.d.ts
new file mode 100644
index 0000000..053d44b
--- /dev/null
+++ b/date-fns/src/getDaysInYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDaysInYear } from 'date-fns'
+export default getDaysInYear
diff --git a/date-fns/src/getDaysInYear/index.js.flow b/date-fns/src/getDaysInYear/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getDaysInYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getDaysInYear/index.ts b/date-fns/src/getDaysInYear/index.ts
new file mode 100644
index 0000000..c374a8f
--- /dev/null
+++ b/date-fns/src/getDaysInYear/index.ts
@@ -0,0 +1,36 @@
+import toDate from '../toDate/index'
+import isLeapYear from '../isLeapYear/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getDaysInYear
+ * @category Year Helpers
+ * @summary Get the number of days in a year of the given date.
+ *
+ * @description
+ * Get the number of days in a year of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the number of days in a year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // How many days are in 2012?
+ * const result = getDaysInYear(new Date(2012, 0, 1))
+ * //=> 366
+ */
+export default function getDaysInYear(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+
+ if (String(new Date(date)) === 'Invalid Date') {
+ return NaN
+ }
+
+ return isLeapYear(date) ? 366 : 365
+}
diff --git a/date-fns/src/getDaysInYear/test.ts b/date-fns/src/getDaysInYear/test.ts
new file mode 100644
index 0000000..8cf2918
--- /dev/null
+++ b/date-fns/src/getDaysInYear/test.ts
@@ -0,0 +1,42 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getDaysInYear from '.'
+
+describe('getDaysInYear', function() {
+ it('returns the number of days in the year of the given date', function() {
+ const result = getDaysInYear(new Date(2014, 6 /* Jul */, 2))
+ assert(result === 365)
+ })
+
+ it('works for a leap year', function() {
+ const result = getDaysInYear(new Date(2012, 6 /* Jul */, 2))
+ assert(result === 366)
+ })
+
+ it('works for the years divisible by 100 but not by 400', function() {
+ const result = getDaysInYear(new Date(2100, 6 /* Jul */, 2))
+ assert(result === 365)
+ })
+
+ it('works for the years divisible by 400', function() {
+ const result = getDaysInYear(new Date(2000, 6 /* Jul */, 2))
+ assert(result === 366)
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2012, 6 /* Jul */, 2).getTime()
+ const result = getDaysInYear(date)
+ assert(result === 366)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getDaysInYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getDaysInYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getDecade/benchmark.js b/date-fns/src/getDecade/benchmark.js
new file mode 100644
index 0000000..bc0dc18
--- /dev/null
+++ b/date-fns/src/getDecade/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getDecade from '.'
+import moment from 'moment'
+
+suite('getDecade', function () {
+ benchmark('date-fns', function () {
+ return getDecade(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return Math.floor(this.moment.year() / 10) * 10
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getDecade/index.d.ts b/date-fns/src/getDecade/index.d.ts
new file mode 100644
index 0000000..dfa8961
--- /dev/null
+++ b/date-fns/src/getDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getDecade } from 'date-fns'
+export default getDecade
diff --git a/date-fns/src/getDecade/index.js.flow b/date-fns/src/getDecade/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getDecade/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getDecade/index.ts b/date-fns/src/getDecade/index.ts
new file mode 100644
index 0000000..fa89270
--- /dev/null
+++ b/date-fns/src/getDecade/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getDecade
+ * @category Decade Helpers
+ * @summary Get the decade of the given date.
+ *
+ * @description
+ * Get the decade of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the year of decade
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which decade belongs 27 November 1942?
+ * const result = getDecade(new Date(1942, 10, 27))
+ * //=> 1940
+ */
+export default function getDecade(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ const decade = Math.floor(year / 10) * 10
+ return decade
+}
diff --git a/date-fns/src/getDecade/test.ts b/date-fns/src/getDecade/test.ts
new file mode 100644
index 0000000..8e93bb7
--- /dev/null
+++ b/date-fns/src/getDecade/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getDecade from '.'
+
+describe('getDecade', function() {
+ it('returns the decade for a the given date', function() {
+ const result = getDecade(new Date(1971, 10 /* Nov */, 8))
+ assert(result === 1970)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getDecade(new Date(1969, 6 /* Jul */, 20).getTime())
+ assert(result === 1960)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getDecade(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getDecade.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getHours/benchmark.js b/date-fns/src/getHours/benchmark.js
new file mode 100644
index 0000000..c50326e
--- /dev/null
+++ b/date-fns/src/getHours/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getHours from '.'
+import moment from 'moment'
+
+suite('getHours', function () {
+ benchmark('date-fns', function () {
+ return getHours(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.hours()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getHours/index.d.ts b/date-fns/src/getHours/index.d.ts
new file mode 100644
index 0000000..1ef4909
--- /dev/null
+++ b/date-fns/src/getHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getHours } from 'date-fns'
+export default getHours
diff --git a/date-fns/src/getHours/index.js.flow b/date-fns/src/getHours/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getHours/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getHours/index.ts b/date-fns/src/getHours/index.ts
new file mode 100644
index 0000000..ed69c73
--- /dev/null
+++ b/date-fns/src/getHours/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getHours
+ * @category Hour Helpers
+ * @summary Get the hours of the given date.
+ *
+ * @description
+ * Get the hours of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the hours
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Get the hours of 29 February 2012 11:45:00:
+ * const result = getHours(new Date(2012, 1, 29, 11, 45))
+ * //=> 11
+ */
+export default function getHours(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const hours = date.getHours()
+ return hours
+}
diff --git a/date-fns/src/getHours/test.ts b/date-fns/src/getHours/test.ts
new file mode 100644
index 0000000..5b8082b
--- /dev/null
+++ b/date-fns/src/getHours/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getHours from '.'
+
+describe('getHours', function() {
+ it('returns the hours of the given date', function() {
+ const result = getHours(new Date(2012, 1 /* Feb */, 29, 11, 45))
+ assert(result === 11)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getHours(new Date(2014, 3 /* Apr */, 2, 23, 30).getTime())
+ assert(result === 23)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getHours(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getHours.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getISODay/benchmark.js b/date-fns/src/getISODay/benchmark.js
new file mode 100644
index 0000000..cb9a406
--- /dev/null
+++ b/date-fns/src/getISODay/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getISODay from '.'
+import moment from 'moment'
+
+suite('getISODay', function () {
+ benchmark('date-fns', function () {
+ return getISODay(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isoWeekday()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getISODay/index.d.ts b/date-fns/src/getISODay/index.d.ts
new file mode 100644
index 0000000..fef7587
--- /dev/null
+++ b/date-fns/src/getISODay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISODay } from 'date-fns'
+export default getISODay
diff --git a/date-fns/src/getISODay/index.js.flow b/date-fns/src/getISODay/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getISODay/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getISODay/index.ts b/date-fns/src/getISODay/index.ts
new file mode 100644
index 0000000..24e5c5b
--- /dev/null
+++ b/date-fns/src/getISODay/index.ts
@@ -0,0 +1,39 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getISODay
+ * @category Weekday Helpers
+ * @summary Get the day of the ISO week of the given date.
+ *
+ * @description
+ * Get the day of the ISO week of the given date,
+ * which is 7 for Sunday, 1 for Monday etc.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the day of ISO week
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which day of the ISO week is 26 February 2012?
+ * const result = getISODay(new Date(2012, 1, 26))
+ * //=> 7
+ */
+export default function getISODay(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ let day = date.getDay()
+
+ if (day === 0) {
+ day = 7
+ }
+
+ return day
+}
diff --git a/date-fns/src/getISODay/test.ts b/date-fns/src/getISODay/test.ts
new file mode 100644
index 0000000..79a72fd
--- /dev/null
+++ b/date-fns/src/getISODay/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getISODay from '.'
+
+describe('getISODay', function() {
+ it('returns the day of the ISO week of the given date', function() {
+ const result = getISODay(new Date(2012, 1 /* Feb */, 29))
+ assert(result === 3)
+ })
+
+ it('returns 7 if the given day is Sunday', function() {
+ const result = getISODay(new Date(2014, 5 /* Jun */, 1))
+ assert(result === 7)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getISODay(new Date(2014, 5 /* Jun */, 1).getTime())
+ assert(result === 7)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getISODay(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getISODay.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getISOWeek/benchmark.js b/date-fns/src/getISOWeek/benchmark.js
new file mode 100644
index 0000000..33e863a
--- /dev/null
+++ b/date-fns/src/getISOWeek/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getISOWeek from '.'
+import moment from 'moment'
+
+suite('getISOWeek', function () {
+ benchmark('date-fns', function () {
+ return getISOWeek(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isoWeek()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getISOWeek/index.d.ts b/date-fns/src/getISOWeek/index.d.ts
new file mode 100644
index 0000000..f24419b
--- /dev/null
+++ b/date-fns/src/getISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISOWeek } from 'date-fns'
+export default getISOWeek
diff --git a/date-fns/src/getISOWeek/index.js.flow b/date-fns/src/getISOWeek/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getISOWeek/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getISOWeek/index.ts b/date-fns/src/getISOWeek/index.ts
new file mode 100644
index 0000000..b4635e9
--- /dev/null
+++ b/date-fns/src/getISOWeek/index.ts
@@ -0,0 +1,41 @@
+import toDate from '../toDate/index'
+import startOfISOWeek from '../startOfISOWeek/index'
+import startOfISOWeekYear from '../startOfISOWeekYear/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+const MILLISECONDS_IN_WEEK = 604800000
+
+/**
+ * @name getISOWeek
+ * @category ISO Week Helpers
+ * @summary Get the ISO week of the given date.
+ *
+ * @description
+ * Get the ISO week of the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the ISO week
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which week of the ISO-week numbering year is 2 January 2005?
+ * const result = getISOWeek(new Date(2005, 0, 2))
+ * //=> 53
+ */
+export default function getISOWeek(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const diff = startOfISOWeek(date).getTime() - startOfISOWeekYear(date).getTime()
+
+ // Round the number of days to the nearest integer
+ // because the number of milliseconds in a week is not constant
+ // (e.g. it's different in the week of the daylight saving time clock shift)
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1
+}
diff --git a/date-fns/src/getISOWeek/test.ts b/date-fns/src/getISOWeek/test.ts
new file mode 100644
index 0000000..10a739b
--- /dev/null
+++ b/date-fns/src/getISOWeek/test.ts
@@ -0,0 +1,56 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getISOWeek from '.'
+
+describe('getISOWeek', function() {
+ it('returns the ISO week of the given date', function() {
+ const result = getISOWeek(new Date(2005, 0 /* Jan */, 2))
+ assert(result === 53)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getISOWeek(new Date(2008, 11 /* Dec */, 29).getTime())
+ assert(result === 1)
+ })
+
+ describe('edge cases', function() {
+ it('returns the ISO week at 1 January 2016', function() {
+ const result = getISOWeek(new Date(2016, 0 /* Jan */, 1))
+ assert(result === 53)
+ })
+
+ it('returns the ISO week at 1 May 2016', function() {
+ const result = getISOWeek(new Date(2016, 4 /* May */, 1))
+ assert(result === 17)
+ })
+
+ it('returns the ISO week at 2 May 2016', function() {
+ const result = getISOWeek(new Date(2016, 4 /* May */, 2))
+ assert(result === 18)
+ })
+
+ it('returns the ISO week at 31 May 2016', function() {
+ const result = getISOWeek(new Date(2016, 4 /* May */, 31))
+ assert(result === 22)
+ })
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(7, 11 /* Dec */, 30)
+ initialDate.setHours(0, 0, 0, 0)
+ const result = getISOWeek(initialDate)
+ assert(result === 52)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getISOWeek(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getISOWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getISOWeekYear/benchmark.js b/date-fns/src/getISOWeekYear/benchmark.js
new file mode 100644
index 0000000..6261d01
--- /dev/null
+++ b/date-fns/src/getISOWeekYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getISOWeekYear from '.'
+import moment from 'moment'
+
+suite('getISOWeekYear', function () {
+ benchmark('date-fns', function () {
+ return getISOWeekYear(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isoWeekYear()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getISOWeekYear/index.d.ts b/date-fns/src/getISOWeekYear/index.d.ts
new file mode 100644
index 0000000..018d0c8
--- /dev/null
+++ b/date-fns/src/getISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISOWeekYear } from 'date-fns'
+export default getISOWeekYear
diff --git a/date-fns/src/getISOWeekYear/index.js.flow b/date-fns/src/getISOWeekYear/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getISOWeekYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getISOWeekYear/index.ts b/date-fns/src/getISOWeekYear/index.ts
new file mode 100644
index 0000000..84366cf
--- /dev/null
+++ b/date-fns/src/getISOWeekYear/index.ts
@@ -0,0 +1,57 @@
+import toDate from '../toDate/index'
+import startOfISOWeek from '../startOfISOWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Get the ISO week-numbering year of the given date.
+ *
+ * @description
+ * Get the ISO week-numbering year of the given date,
+ * which always starts 3 days before the year's first Thursday.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `getISOYear` to `getISOWeekYear`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the ISO week-numbering year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which ISO-week numbering year is 2 January 2005?
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
+ * //=> 2004
+ */
+export default function getISOWeekYear(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+
+ const fourthOfJanuaryOfNextYear = new Date(0)
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4)
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0)
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear)
+
+ const fourthOfJanuaryOfThisYear = new Date(0)
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4)
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0)
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear)
+
+ if (date.getTime() >= startOfNextYear.getTime()) {
+ return year + 1
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
+ return year
+ } else {
+ return year - 1
+ }
+}
diff --git a/date-fns/src/getISOWeekYear/test.ts b/date-fns/src/getISOWeekYear/test.ts
new file mode 100644
index 0000000..64a05db
--- /dev/null
+++ b/date-fns/src/getISOWeekYear/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getISOWeekYear from '.'
+
+describe('getISOWeekYear', function() {
+ it('returns the ISO week-numbering year of the given date', function() {
+ const result = getISOWeekYear(new Date(2007, 11 /* Dec */, 31))
+ assert(result === 2008)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getISOWeekYear(new Date(2005, 0 /* Jan */, 1).getTime())
+ assert(result === 2004)
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(7, 11 /* Dec */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ const result = getISOWeekYear(initialDate)
+ assert(result === 8)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getISOWeekYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getISOWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getISOWeeksInYear/benchmark.js b/date-fns/src/getISOWeeksInYear/benchmark.js
new file mode 100644
index 0000000..ad36737
--- /dev/null
+++ b/date-fns/src/getISOWeeksInYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getISOWeeksInYear from '.'
+import moment from 'moment'
+
+suite('getISOWeeksInYear', function () {
+ benchmark('date-fns', function () {
+ return getISOWeeksInYear(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isoWeeksInYear()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getISOWeeksInYear/index.d.ts b/date-fns/src/getISOWeeksInYear/index.d.ts
new file mode 100644
index 0000000..5d3ee66
--- /dev/null
+++ b/date-fns/src/getISOWeeksInYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getISOWeeksInYear } from 'date-fns'
+export default getISOWeeksInYear
diff --git a/date-fns/src/getISOWeeksInYear/index.js.flow b/date-fns/src/getISOWeeksInYear/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getISOWeeksInYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getISOWeeksInYear/index.ts b/date-fns/src/getISOWeeksInYear/index.ts
new file mode 100644
index 0000000..698abdf
--- /dev/null
+++ b/date-fns/src/getISOWeeksInYear/index.ts
@@ -0,0 +1,40 @@
+import startOfISOWeekYear from '../startOfISOWeekYear/index'
+import addWeeks from '../addWeeks/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+const MILLISECONDS_IN_WEEK = 604800000
+
+/**
+ * @name getISOWeeksInYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Get the number of weeks in an ISO week-numbering year of the given date.
+ *
+ * @description
+ * Get the number of weeks in an ISO week-numbering year of the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the number of ISO weeks in a year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // How many weeks are in ISO week-numbering year 2015?
+ * const result = getISOWeeksInYear(new Date(2015, 1, 11))
+ * //=> 53
+ */
+export default function getISOWeeksInYear(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const thisYear = startOfISOWeekYear(dirtyDate)
+ const nextYear = startOfISOWeekYear(addWeeks(thisYear, 60))
+ const diff = nextYear.valueOf() - thisYear.valueOf()
+ // Round the number of weeks to the nearest integer
+ // because the number of milliseconds in a week is not constant
+ // (e.g. it's different in the week of the daylight saving time clock shift)
+ return Math.round(diff / MILLISECONDS_IN_WEEK)
+}
diff --git a/date-fns/src/getISOWeeksInYear/test.ts b/date-fns/src/getISOWeeksInYear/test.ts
new file mode 100644
index 0000000..043409a
--- /dev/null
+++ b/date-fns/src/getISOWeeksInYear/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getISOWeeksInYear from '.'
+
+describe('getISOWeeksInYear', function() {
+ it('returns the number of ISO weeks in the ISO week-numbering year of the given date', function() {
+ const result = getISOWeeksInYear(new Date(2015, 1 /* Feb */, 11))
+ assert(result === 53)
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2003, 11 /* Dec */, 30).getTime()
+ const result = getISOWeeksInYear(date)
+ assert(result === 53)
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(4, 0 /* Jan */, 4)
+ initialDate.setHours(0, 0, 0, 0)
+ const result = getISOWeeksInYear(initialDate)
+ assert(result === 53)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getISOWeeksInYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getISOWeeksInYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getMilliseconds/benchmark.js b/date-fns/src/getMilliseconds/benchmark.js
new file mode 100644
index 0000000..4aa97d8
--- /dev/null
+++ b/date-fns/src/getMilliseconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getMilliseconds from '.'
+import moment from 'moment'
+
+suite('getMilliseconds', function () {
+ benchmark('date-fns', function () {
+ return getMilliseconds(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.milliseconds()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getMilliseconds/index.d.ts b/date-fns/src/getMilliseconds/index.d.ts
new file mode 100644
index 0000000..7476168
--- /dev/null
+++ b/date-fns/src/getMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getMilliseconds } from 'date-fns'
+export default getMilliseconds
diff --git a/date-fns/src/getMilliseconds/index.js.flow b/date-fns/src/getMilliseconds/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getMilliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getMilliseconds/index.ts b/date-fns/src/getMilliseconds/index.ts
new file mode 100644
index 0000000..bd3803d
--- /dev/null
+++ b/date-fns/src/getMilliseconds/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getMilliseconds
+ * @category Millisecond Helpers
+ * @summary Get the milliseconds of the given date.
+ *
+ * @description
+ * Get the milliseconds of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the milliseconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Get the milliseconds of 29 February 2012 11:45:05.123:
+ * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))
+ * //=> 123
+ */
+export default function getMilliseconds(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const milliseconds = date.getMilliseconds()
+ return milliseconds
+}
diff --git a/date-fns/src/getMilliseconds/test.ts b/date-fns/src/getMilliseconds/test.ts
new file mode 100644
index 0000000..428e113
--- /dev/null
+++ b/date-fns/src/getMilliseconds/test.ts
@@ -0,0 +1,30 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getMilliseconds from '.'
+
+describe('getMilliseconds', function() {
+ it('returns the milliseconds of the given date', function() {
+ const result = getMilliseconds(
+ new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123)
+ )
+ assert(result === 123)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getMilliseconds(
+ new Date(2014, 3 /* Apr */, 2, 23, 30, 42, 500).getTime()
+ )
+ assert(result === 500)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getMilliseconds(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getMilliseconds.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getMinutes/benchmark.js b/date-fns/src/getMinutes/benchmark.js
new file mode 100644
index 0000000..1bd822d
--- /dev/null
+++ b/date-fns/src/getMinutes/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getMinutes from '.'
+import moment from 'moment'
+
+suite('getMinutes', function () {
+ benchmark('date-fns', function () {
+ return getMinutes(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.minutes()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getMinutes/index.d.ts b/date-fns/src/getMinutes/index.d.ts
new file mode 100644
index 0000000..e6a9284
--- /dev/null
+++ b/date-fns/src/getMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getMinutes } from 'date-fns'
+export default getMinutes
diff --git a/date-fns/src/getMinutes/index.js.flow b/date-fns/src/getMinutes/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getMinutes/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getMinutes/index.ts b/date-fns/src/getMinutes/index.ts
new file mode 100644
index 0000000..12bdab7
--- /dev/null
+++ b/date-fns/src/getMinutes/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getMinutes
+ * @category Minute Helpers
+ * @summary Get the minutes of the given date.
+ *
+ * @description
+ * Get the minutes of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the minutes
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Get the minutes of 29 February 2012 11:45:05:
+ * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))
+ * //=> 45
+ */
+export default function getMinutes(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const minutes = date.getMinutes()
+ return minutes
+}
diff --git a/date-fns/src/getMinutes/test.ts b/date-fns/src/getMinutes/test.ts
new file mode 100644
index 0000000..f47e3cf
--- /dev/null
+++ b/date-fns/src/getMinutes/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getMinutes from '.'
+
+describe('getMinutes', function() {
+ it('returns the minutes of the given date', function() {
+ const result = getMinutes(new Date(2012, 1 /* Feb */, 29, 11, 45, 5))
+ assert(result === 45)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getMinutes(new Date(2014, 3 /* Apr */, 2, 23, 30).getTime())
+ assert(result === 30)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getMinutes(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getMinutes.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getMonth/benchmark.js b/date-fns/src/getMonth/benchmark.js
new file mode 100644
index 0000000..5c4ba43
--- /dev/null
+++ b/date-fns/src/getMonth/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getMonth from '.'
+import moment from 'moment'
+
+suite('getMonth', function () {
+ benchmark('date-fns', function () {
+ return getMonth(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.month()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getMonth/index.d.ts b/date-fns/src/getMonth/index.d.ts
new file mode 100644
index 0000000..e0b6217
--- /dev/null
+++ b/date-fns/src/getMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getMonth } from 'date-fns'
+export default getMonth
diff --git a/date-fns/src/getMonth/index.js.flow b/date-fns/src/getMonth/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getMonth/index.ts b/date-fns/src/getMonth/index.ts
new file mode 100644
index 0000000..d7b4571
--- /dev/null
+++ b/date-fns/src/getMonth/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getMonth
+ * @category Month Helpers
+ * @summary Get the month of the given date.
+ *
+ * @description
+ * Get the month of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which month is 29 February 2012?
+ * const result = getMonth(new Date(2012, 1, 29))
+ * //=> 1
+ */
+export default function getMonth(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const month = date.getMonth()
+ return month
+}
diff --git a/date-fns/src/getMonth/test.ts b/date-fns/src/getMonth/test.ts
new file mode 100644
index 0000000..a34f2a2
--- /dev/null
+++ b/date-fns/src/getMonth/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getMonth from '.'
+
+describe('getMonth', function() {
+ it('returns the month of the given date', function() {
+ const result = getMonth(new Date(2012, 1 /* Feb */, 29))
+ assert(result === 1)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getMonth(new Date(2014, 3 /* Apr */, 2).getTime())
+ assert(result === 3)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getMonth(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getOverlappingDaysInIntervals/index.d.ts b/date-fns/src/getOverlappingDaysInIntervals/index.d.ts
new file mode 100644
index 0000000..e309ff9
--- /dev/null
+++ b/date-fns/src/getOverlappingDaysInIntervals/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getOverlappingDaysInIntervals } from 'date-fns'
+export default getOverlappingDaysInIntervals
diff --git a/date-fns/src/getOverlappingDaysInIntervals/index.js.flow b/date-fns/src/getOverlappingDaysInIntervals/index.js.flow
new file mode 100644
index 0000000..9c0f272
--- /dev/null
+++ b/date-fns/src/getOverlappingDaysInIntervals/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ intervalLeft: Interval,
+ intervalRight: Interval
+) => number
diff --git a/date-fns/src/getOverlappingDaysInIntervals/index.ts b/date-fns/src/getOverlappingDaysInIntervals/index.ts
new file mode 100644
index 0000000..aa5dc63
--- /dev/null
+++ b/date-fns/src/getOverlappingDaysInIntervals/index.ts
@@ -0,0 +1,106 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { Interval } from '../types'
+
+const MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000
+
+/**
+ * @name getOverlappingDaysInIntervals
+ * @category Interval Helpers
+ * @summary Get the number of days that overlap in two time intervals
+ *
+ * @description
+ * Get the number of days that overlap in two time intervals
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `getOverlappingDaysInRanges` to `getOverlappingDaysInIntervals`.
+ * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology:
+ *
+ * ```
+ * 2.1.3
+ * time interval
+ * part of the time axis limited by two instants
+ * ```
+ *
+ * Also, this function now accepts an object with `start` and `end` properties
+ * instead of two arguments as an interval.
+ * This function now throws `RangeError` if the start of the interval is after its end
+ * or if any date in the interval is `Invalid Date`.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * getOverlappingDaysInRanges(
+ * new Date(2014, 0, 10), new Date(2014, 0, 20),
+ * new Date(2014, 0, 17), new Date(2014, 0, 21)
+ * )
+ *
+ * // v2.0.0 onward
+ *
+ * getOverlappingDaysInIntervals(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * ```
+ *
+ * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/Interval}
+ * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/Interval}
+ * @returns {Number} the number of days that overlap in two time intervals
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // For overlapping time intervals adds 1 for each started overlapping day:
+ * getOverlappingDaysInIntervals(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }
+ * )
+ * //=> 3
+ *
+ * @example
+ * // For non-overlapping time intervals returns 0:
+ * getOverlappingDaysInIntervals(
+ * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },
+ * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }
+ * )
+ * //=> 0
+ */
+
+export default function getOverlappingDaysInIntervals(
+ dirtyIntervalLeft: Interval,
+ dirtyIntervalRight: Interval
+): number {
+ requiredArgs(2, arguments)
+
+ const intervalLeft = dirtyIntervalLeft || {}
+ const intervalRight = dirtyIntervalRight || {}
+ const leftStartTime = toDate(intervalLeft.start).getTime()
+ const leftEndTime = toDate(intervalLeft.end).getTime()
+ const rightStartTime = toDate(intervalRight.start).getTime()
+ const rightEndTime = toDate(intervalRight.end).getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ const isOverlapping =
+ leftStartTime < rightEndTime && rightStartTime < leftEndTime
+
+ if (!isOverlapping) {
+ return 0
+ }
+
+ const overlapStartDate =
+ rightStartTime < leftStartTime ? leftStartTime : rightStartTime
+
+ const overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime
+
+ const differenceInMs = overlapEndDate - overlapStartDate
+
+ return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY)
+}
diff --git a/date-fns/src/getOverlappingDaysInIntervals/test.ts b/date-fns/src/getOverlappingDaysInIntervals/test.ts
new file mode 100644
index 0000000..b39672f
--- /dev/null
+++ b/date-fns/src/getOverlappingDaysInIntervals/test.ts
@@ -0,0 +1,240 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getOverlappingDaysInIntervals from '.'
+
+describe('getOverlappingDaysInIntervals', function() {
+ const initialIntervalStart = new Date(2016, 10, 10, 13, 0, 0)
+ const initialIntervalEnd = new Date(2016, 11, 3, 15, 0, 0)
+
+ describe("when the time intervals don't overlap", function() {
+ it('returns 0 for a valid non overlapping interval before another interval', function() {
+ const earlierIntervalStart = new Date(2016, 9, 25)
+ const earlierIntervalEnd = new Date(2016, 10, 9)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: earlierIntervalStart, end: earlierIntervalEnd }
+ )
+ assert(numOverlappingDays === 0)
+ })
+
+ it('returns 0 for a valid non overlapping interval after another interval', function() {
+ const laterIntervalStart = new Date(2016, 11, 4)
+ const laterIntervalEnd = new Date(2016, 11, 9)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: laterIntervalStart, end: laterIntervalEnd }
+ )
+ assert(numOverlappingDays === 0)
+ })
+
+ it('returns 0 for a non overlapping same-day interval', function() {
+ const sameDayIntervalStart = new Date(2016, 11, 4, 9, 0, 0)
+ const sameDayIntervalEnd = new Date(2016, 11, 4, 18, 0, 0)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: sameDayIntervalStart, end: sameDayIntervalEnd }
+ )
+ assert(numOverlappingDays === 0)
+ })
+
+ it('returns 0 for an interval differing by a few hours', function() {
+ const oneDayOverlappingIntervalStart = new Date(2016, 11, 3, 18, 0, 0)
+ const oneDayOverlappingIntervalEnd = new Date(2016, 11, 14, 13, 0, 0)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ {
+ start: oneDayOverlappingIntervalStart,
+ end: oneDayOverlappingIntervalEnd
+ }
+ )
+ assert(numOverlappingDays === 0)
+ })
+
+ it("returns 0 for an interval with the same startDateTime as the initial time intervals's endDateTime", function() {
+ const oneDayOverlapIntervalStart = new Date(2016, 11, 3, 15, 0, 0)
+ const oneDayOverlapIntervalEnd = new Date(2016, 11, 14, 13, 0, 0)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: oneDayOverlapIntervalStart, end: oneDayOverlapIntervalEnd }
+ )
+ assert(numOverlappingDays === 0)
+ })
+
+ it("returns 0 for an interval with the same endDateTime as the initial time interval's startDateTime", function() {
+ const oneDayOverlapIntervalStart = new Date(2016, 10, 3, 15, 0, 0)
+ const oneDayOverlapIntervalEnd = new Date(2016, 10, 10, 13, 0, 0)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: oneDayOverlapIntervalStart, end: oneDayOverlapIntervalEnd }
+ )
+ assert(numOverlappingDays === 0)
+ })
+ })
+
+ describe('when the time intervals overlap', function() {
+ it('rounds up the result to include each started overlapping day', function() {
+ const includedIntervalStart = new Date(2016, 10, 14, 9, 0, 0)
+ const includedIntervalEnd = new Date(2016, 10, 15, 18, 0, 0)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: includedIntervalStart, end: includedIntervalEnd }
+ )
+ assert(numOverlappingDays === 2)
+ })
+
+ it('returns the correct value for an interval included within another interval', function() {
+ const includedIntervalStart = new Date(2016, 10, 14)
+ const includedIntervalEnd = new Date(2016, 10, 15)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: includedIntervalStart, end: includedIntervalEnd }
+ )
+ assert(numOverlappingDays === 1)
+ })
+
+ it('returns the correct value for an interval overlapping at the end', function() {
+ const endOverlappingIntervalStart = new Date(2016, 10, 5)
+ const endOverlappingIntervalEnd = new Date(2016, 10, 14)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: endOverlappingIntervalStart, end: endOverlappingIntervalEnd }
+ )
+ assert(numOverlappingDays === 4)
+ })
+
+ it('returns the correct value for an interval overlapping at the beginning', function() {
+ const startOverlappingIntervalStart = new Date(2016, 10, 20)
+ const startOverlappingIntervalEnd = new Date(2016, 11, 14)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ {
+ start: startOverlappingIntervalStart,
+ end: startOverlappingIntervalEnd
+ }
+ )
+ assert(numOverlappingDays === 14)
+ })
+
+ it('returns the correct value for an interval including another interval', function() {
+ const includingIntervalStart = new Date(2016, 10, 5)
+ const includingIntervalEnd = new Date(2016, 11, 15)
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: includingIntervalStart, end: includingIntervalEnd }
+ )
+ assert(numOverlappingDays === 24)
+ })
+ })
+
+ it('accepts a timestamp', function() {
+ const initialIntervalStart = new Date(2016, 10, 10, 13, 0, 0).getTime()
+ const initialIntervalEnd = new Date(2016, 11, 3, 15, 0, 0).getTime()
+
+ const endOverlappingIntervalStart = new Date(2016, 10, 5).getTime()
+ const endOverlappingIntervalEnd = new Date(2016, 10, 14).getTime()
+
+ const numOverlappingDays = getOverlappingDaysInIntervals(
+ { start: initialIntervalStart, end: initialIntervalEnd },
+ { start: endOverlappingIntervalStart, end: endOverlappingIntervalEnd }
+ )
+ assert(numOverlappingDays === 4)
+ })
+
+ it('throws an exception if the start date of the initial time interval is after the end date', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ { start: new Date(2016, 10, 7), end: new Date(2016, 10, 3) },
+ { start: new Date(2016, 10, 5), end: new Date(2016, 10, 15) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date of the compared time interval is after the end date', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ { start: new Date(2016, 10, 15), end: new Date(2016, 10, 5) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the initial interval is undefined', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ // $ExpectedMistake
+ //@ts-expect-error
+ undefined,
+ { start: new Date(2016, 10, 5), end: new Date(2016, 10, 15) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the compared interval is undefined', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ // $ExpectedMistake
+ //@ts-expect-error
+ undefined
+ )
+ assert.throws(block, RangeError)
+ })
+
+ describe('one of the dates is `Invalid Date`', function() {
+ it('throws an exception if the start date of the initial time interval is `Invalid Date`', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ { start: new Date(NaN), end: new Date(2016, 10, 3) },
+ { start: new Date(2016, 10, 5), end: new Date(2016, 10, 15) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date of the initial time interval is `Invalid Date`', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(NaN) },
+ { start: new Date(2016, 10, 5), end: new Date(2016, 10, 15) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the start date of the compared time interval is `Invalid Date`', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ { start: new Date(NaN), end: new Date(2016, 10, 5) }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date of the compared time interval is `Invalid Date`', function() {
+ const block = getOverlappingDaysInIntervals.bind(
+ null,
+ { start: new Date(2016, 10, 3), end: new Date(2016, 10, 7) },
+ { start: new Date(2016, 10, 5), end: new Date(NaN) }
+ )
+ assert.throws(block, RangeError)
+ })
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(getOverlappingDaysInIntervals.bind(null), TypeError)
+ // $ExpectedMistake
+ //@ts-expect-error
+ assert.throws(getOverlappingDaysInIntervals.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/getQuarter/benchmark.js b/date-fns/src/getQuarter/benchmark.js
new file mode 100644
index 0000000..d83e7c2
--- /dev/null
+++ b/date-fns/src/getQuarter/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getQuarter from '.'
+import moment from 'moment'
+
+suite('getQuarter', function () {
+ benchmark('date-fns', function () {
+ return getQuarter(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.quarter()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getQuarter/index.d.ts b/date-fns/src/getQuarter/index.d.ts
new file mode 100644
index 0000000..6434ba0
--- /dev/null
+++ b/date-fns/src/getQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getQuarter } from 'date-fns'
+export default getQuarter
diff --git a/date-fns/src/getQuarter/index.js.flow b/date-fns/src/getQuarter/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getQuarter/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getQuarter/index.ts b/date-fns/src/getQuarter/index.ts
new file mode 100644
index 0000000..2dc72f3
--- /dev/null
+++ b/date-fns/src/getQuarter/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getQuarter
+ * @category Quarter Helpers
+ * @summary Get the year quarter of the given date.
+ *
+ * @description
+ * Get the year quarter of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the quarter
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which quarter is 2 July 2014?
+ * const result = getQuarter(new Date(2014, 6, 2))
+ * //=> 3
+ */
+export default function getQuarter(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const quarter = Math.floor(date.getMonth() / 3) + 1
+ return quarter
+}
diff --git a/date-fns/src/getQuarter/test.ts b/date-fns/src/getQuarter/test.ts
new file mode 100644
index 0000000..9876622
--- /dev/null
+++ b/date-fns/src/getQuarter/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getQuarter from '.'
+
+describe('getQuarter', function() {
+ it('returns the quarter of the given date', function() {
+ const result = getQuarter(new Date(2014, 6 /* Jul */, 2))
+ assert(result === 3)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getQuarter(new Date(2014, 3 /* Apr */, 2).getTime())
+ assert(result === 2)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getQuarter(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getQuarter.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getSeconds/benchmark.js b/date-fns/src/getSeconds/benchmark.js
new file mode 100644
index 0000000..239fbe7
--- /dev/null
+++ b/date-fns/src/getSeconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getSeconds from '.'
+import moment from 'moment'
+
+suite('getSeconds', function () {
+ benchmark('date-fns', function () {
+ return getSeconds(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.seconds()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getSeconds/index.d.ts b/date-fns/src/getSeconds/index.d.ts
new file mode 100644
index 0000000..7b60944
--- /dev/null
+++ b/date-fns/src/getSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getSeconds } from 'date-fns'
+export default getSeconds
diff --git a/date-fns/src/getSeconds/index.js.flow b/date-fns/src/getSeconds/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getSeconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getSeconds/index.ts b/date-fns/src/getSeconds/index.ts
new file mode 100644
index 0000000..58ba042
--- /dev/null
+++ b/date-fns/src/getSeconds/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getSeconds
+ * @category Second Helpers
+ * @summary Get the seconds of the given date.
+ *
+ * @description
+ * Get the seconds of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the seconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Get the seconds of 29 February 2012 11:45:05.123:
+ * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))
+ * //=> 5
+ */
+export default function getSeconds(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const seconds = date.getSeconds()
+ return seconds
+}
diff --git a/date-fns/src/getSeconds/test.ts b/date-fns/src/getSeconds/test.ts
new file mode 100644
index 0000000..bcc1c38
--- /dev/null
+++ b/date-fns/src/getSeconds/test.ts
@@ -0,0 +1,28 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getSeconds from '.'
+
+describe('getSeconds', function() {
+ it('returns the seconds of the given date', function() {
+ const result = getSeconds(new Date(2012, 1 /* Feb */, 29, 11, 45, 5, 123))
+ assert(result === 5)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getSeconds(
+ new Date(2014, 3 /* Apr */, 2, 23, 30, 42).getTime()
+ )
+ assert(result === 42)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getSeconds(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getSeconds.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getTime/benchmark.js b/date-fns/src/getTime/benchmark.js
new file mode 100644
index 0000000..8a65fd9
--- /dev/null
+++ b/date-fns/src/getTime/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getTime from '.'
+import moment from 'moment'
+
+suite('getTime', function () {
+ benchmark('date-fns', function () {
+ return getTime(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.valueOf()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getTime/index.d.ts b/date-fns/src/getTime/index.d.ts
new file mode 100644
index 0000000..87c958e
--- /dev/null
+++ b/date-fns/src/getTime/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getTime } from 'date-fns'
+export default getTime
diff --git a/date-fns/src/getTime/index.js.flow b/date-fns/src/getTime/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getTime/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getTime/index.ts b/date-fns/src/getTime/index.ts
new file mode 100644
index 0000000..09dffb3
--- /dev/null
+++ b/date-fns/src/getTime/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getTime
+ * @category Timestamp Helpers
+ * @summary Get the milliseconds timestamp of the given date.
+ *
+ * @description
+ * Get the milliseconds timestamp of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the timestamp
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Get the timestamp of 29 February 2012 11:45:05.123:
+ * const result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123))
+ * //=> 1330515905123
+ */
+export default function getTime(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const timestamp = date.getTime()
+ return timestamp
+}
diff --git a/date-fns/src/getTime/test.ts b/date-fns/src/getTime/test.ts
new file mode 100644
index 0000000..56bab04
--- /dev/null
+++ b/date-fns/src/getTime/test.ts
@@ -0,0 +1,28 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getTime from '.'
+
+describe('getTime', function() {
+ it('returns the timestamp of the given date', function() {
+ const timestamp = 1483228800000
+ const result = getTime(new Date(timestamp))
+ assert(result === timestamp)
+ })
+
+ it('accepts a timestamp (and returns it unchanged)', function() {
+ const timestamp = 804643200000
+ const result = getTime(timestamp)
+ assert(result === timestamp)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getTime(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getTime.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getUnixTime/benchmark.js b/date-fns/src/getUnixTime/benchmark.js
new file mode 100644
index 0000000..dcb0ae0
--- /dev/null
+++ b/date-fns/src/getUnixTime/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getUnixTime from '.'
+import moment from 'moment'
+
+suite('getTime', function () {
+ benchmark('date-fns', function () {
+ return getUnixTime(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.unix()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getUnixTime/index.d.ts b/date-fns/src/getUnixTime/index.d.ts
new file mode 100644
index 0000000..8f85a12
--- /dev/null
+++ b/date-fns/src/getUnixTime/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getUnixTime } from 'date-fns'
+export default getUnixTime
diff --git a/date-fns/src/getUnixTime/index.js.flow b/date-fns/src/getUnixTime/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getUnixTime/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getUnixTime/index.ts b/date-fns/src/getUnixTime/index.ts
new file mode 100644
index 0000000..0577542
--- /dev/null
+++ b/date-fns/src/getUnixTime/index.ts
@@ -0,0 +1,29 @@
+import getTime from '../getTime/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getUnixTime
+ * @category Timestamp Helpers
+ * @summary Get the seconds timestamp of the given date.
+ *
+ * @description
+ * Get the seconds timestamp of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the timestamp
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Get the timestamp of 29 February 2012 11:45:05 CET:
+ * const result = getUnixTime(new Date(2012, 1, 29, 11, 45, 5))
+ * //=> 1330512305
+ */
+export default function getUnixTime(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ return Math.floor(getTime(dirtyDate) / 1000)
+}
diff --git a/date-fns/src/getUnixTime/test.ts b/date-fns/src/getUnixTime/test.ts
new file mode 100644
index 0000000..6109677
--- /dev/null
+++ b/date-fns/src/getUnixTime/test.ts
@@ -0,0 +1,28 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getUnixTime from '.'
+
+describe('getUnixTime', function() {
+ it('returns the timestamp of the given date', function() {
+ const timestamp = 1483228800000
+ const result = getUnixTime(new Date(timestamp))
+ assert(result === Math.floor(timestamp / 1000))
+ })
+
+ it('accepts a timestamp (and returns it unchanged)', function() {
+ const timestamp = 804643200000
+ const result = getUnixTime(timestamp)
+ assert(result === Math.floor(timestamp / 1000))
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getUnixTime(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getUnixTime.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getWeek/index.d.ts b/date-fns/src/getWeek/index.d.ts
new file mode 100644
index 0000000..dfa1327
--- /dev/null
+++ b/date-fns/src/getWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeek } from 'date-fns'
+export default getWeek
diff --git a/date-fns/src/getWeek/index.js.flow b/date-fns/src/getWeek/index.js.flow
new file mode 100644
index 0000000..2c948ae
--- /dev/null
+++ b/date-fns/src/getWeek/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+) => number
diff --git a/date-fns/src/getWeek/index.ts b/date-fns/src/getWeek/index.ts
new file mode 100644
index 0000000..af13a84
--- /dev/null
+++ b/date-fns/src/getWeek/index.ts
@@ -0,0 +1,64 @@
+import startOfWeek from '../startOfWeek/index'
+import startOfWeekYear from '../startOfWeekYear/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, WeekStartOptions, FirstWeekContainsDateOptions } from '../types'
+
+const MILLISECONDS_IN_WEEK = 604800000
+
+/**
+ * @name getWeek
+ * @category Week Helpers
+ * @summary Get the local week index of the given date.
+ *
+ * @description
+ * Get the local week index of the given date.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
+ * @returns {Number} the week
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ *
+ * @example
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
+ * const result = getISOWeek(new Date(2005, 0, 2))
+ * //=> 2
+ *
+ * // Which week of the local week numbering year is 2 January 2005,
+ * // if Monday is the first day of the week,
+ * // and the first week of the year always contains 4 January?
+ * const result = getISOWeek(new Date(2005, 0, 2), {
+ * weekStartsOn: 1,
+ * firstWeekContainsDate: 4
+ * })
+ * //=> 53
+ */
+
+export default function getWeek(dirtyDate: Date | number, options?: LocaleOptions & WeekStartOptions & FirstWeekContainsDateOptions): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const diff =
+ startOfWeek(date, options).getTime() -
+ startOfWeekYear(date, options).getTime()
+
+ // Round the number of days to the nearest integer
+ // because the number of milliseconds in a week is not constant
+ // (e.g. it's different in the week of the daylight saving time clock shift)
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1
+}
diff --git a/date-fns/src/getWeek/test.ts b/date-fns/src/getWeek/test.ts
new file mode 100644
index 0000000..48baf41
--- /dev/null
+++ b/date-fns/src/getWeek/test.ts
@@ -0,0 +1,73 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getWeek from '.'
+
+describe('getWeek', function () {
+ it('returns the local week of year of the given date', function () {
+ const result = getWeek(new Date(2005, 0 /* Jan */, 2))
+ assert(result === 2)
+ })
+
+ it('accepts a timestamp', function () {
+ const result = getWeek(new Date(2008, 11 /* Dec */, 29).getTime())
+ assert(result === 1)
+ })
+
+ it('handles dates before 100 AD', function () {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(7, 11 /* Dec */, 30)
+ initialDate.setHours(0, 0, 0, 0)
+ const result = getWeek(initialDate)
+ assert(result === 1)
+ })
+
+ it('returns NaN if the given date is invalid', function () {
+ const result = getWeek(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function () {
+ const date = new Date(2005, 0 /* Jan */, 2)
+ // @ts-expect-error
+ const result = getWeek(date, {
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert(result === 53)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ const date = new Date(2005, 0 /* Jan */, 2)
+ const result = getWeek(date, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert(result === 53)
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ // @ts-expect-error
+ const block = getWeek.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ weekStartsOn: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function () {
+ // @ts-expect-error
+ const block = getWeek.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ firstWeekContainsDate: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(getWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getWeekOfMonth/benchmark.js b/date-fns/src/getWeekOfMonth/benchmark.js
new file mode 100644
index 0000000..a7384b6
--- /dev/null
+++ b/date-fns/src/getWeekOfMonth/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getWeekOfMonth from '.'
+
+suite('getWeekOfMonth', function () {
+ benchmark('date-fns', function () {
+ return getWeekOfMonth(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/getWeekOfMonth/index.d.ts b/date-fns/src/getWeekOfMonth/index.d.ts
new file mode 100644
index 0000000..781b2ad
--- /dev/null
+++ b/date-fns/src/getWeekOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeekOfMonth } from 'date-fns'
+export default getWeekOfMonth
diff --git a/date-fns/src/getWeekOfMonth/index.js b/date-fns/src/getWeekOfMonth/index.js
new file mode 100644
index 0000000..1c69d86
--- /dev/null
+++ b/date-fns/src/getWeekOfMonth/index.js
@@ -0,0 +1,72 @@
+import getDate from '../getDate/index'
+import getDay from '../getDay/index'
+import startOfMonth from '../startOfMonth/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getWeekOfMonth
+ * @category Week Helpers
+ * @summary Get the week of the month of the given date.
+ *
+ * @description
+ * Get the week of the month of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Number} the week of month
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // Which week of the month is 9 November 2017?
+ * var result = getWeekOfMonth(new Date(2017, 10, 9))
+ * //=> 2
+ */
+export default function getWeekOfMonth(date, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeWeekStartsOn =
+ locale && locale.options && locale.options.weekStartsOn
+ var defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ var weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ var currentDayOfMonth = getDate(date)
+ if (isNaN(currentDayOfMonth)) {
+ return currentDayOfMonth
+ }
+
+ var startWeekDay = getDay(startOfMonth(date))
+ var lastDayOfFirstWeek = 0
+
+ if (startWeekDay >= weekStartsOn) {
+ lastDayOfFirstWeek = weekStartsOn + 7 - startWeekDay
+ } else {
+ lastDayOfFirstWeek = weekStartsOn - startWeekDay
+ }
+
+ var weekNumber = 1
+
+ if (currentDayOfMonth > lastDayOfFirstWeek) {
+ var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek
+ weekNumber = weekNumber + Math.ceil(remainingDaysAfterFirstWeek / 7)
+ }
+ return weekNumber
+}
diff --git a/date-fns/src/getWeekOfMonth/index.js.flow b/date-fns/src/getWeekOfMonth/index.js.flow
new file mode 100644
index 0000000..1115f28
--- /dev/null
+++ b/date-fns/src/getWeekOfMonth/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => number
diff --git a/date-fns/src/getWeekOfMonth/test.js b/date-fns/src/getWeekOfMonth/test.js
new file mode 100644
index 0000000..5996cae
--- /dev/null
+++ b/date-fns/src/getWeekOfMonth/test.js
@@ -0,0 +1,84 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getWeekOfMonth from '.'
+
+describe('getWeekOfMonth', function () {
+ it('returns the week of the month of the given date', function () {
+ var result = getWeekOfMonth(new Date(2017, 10 /* Nov */, 15))
+ assert(result === 3)
+ })
+
+ describe('edge cases', function () {
+ describe('when the given day is the first of a month', function () {
+ it('returns the week of the month of the given date', function () {
+ var result = getWeekOfMonth(new Date(2017, 10 /* Nov */, 1))
+ assert(result === 1)
+ })
+ })
+
+ describe('when the given day is the last of a month #1', function () {
+ it('returns the week of the month of the given date', function () {
+ var result = getWeekOfMonth(new Date(2017, 10 /* Nov */, 30))
+ assert(result === 5)
+ })
+ })
+
+ describe('when the given day is the last of a month #2', function () {
+ it('returns the week of the month of the given date', function () {
+ var result = getWeekOfMonth(new Date(2017, 9 /* Oct */, 31))
+ assert(result === 5)
+ })
+ })
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = getWeekOfMonth(new Date(2017, 9 /* Oct */, 1), {
+ weekStartsOn: 1,
+ })
+ assert(result === 1)
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ var result = getWeekOfMonth(new Date(2017, 9 /* Oct */, 31), {
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ })
+ assert(result === 6)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ var result = getWeekOfMonth(new Date(2017, 10 /* Nov */, 13), {
+ weekStartsOn: 1,
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ })
+ assert(result === 3)
+ })
+
+ it('accepts a timestamp', function () {
+ var result = getWeekOfMonth(new Date(2017, 10 /* Nov */, 1).getTime())
+ assert(result === 1)
+ })
+
+ it('returns NaN if the given date is invalid', function () {
+ var result = getWeekOfMonth(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(getWeekOfMonth.bind(null), TypeError)
+ })
+
+ it('returns the week of the month of the given date, when the given date is sunday', function () {
+ var result = getWeekOfMonth(new Date(2019, 4 /* May */, 5), {
+ weekStartsOn: 1,
+ })
+ assert(result === 1)
+ })
+})
diff --git a/date-fns/src/getWeekYear/index.d.ts b/date-fns/src/getWeekYear/index.d.ts
new file mode 100644
index 0000000..c8fc528
--- /dev/null
+++ b/date-fns/src/getWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeekYear } from 'date-fns'
+export default getWeekYear
diff --git a/date-fns/src/getWeekYear/index.js.flow b/date-fns/src/getWeekYear/index.js.flow
new file mode 100644
index 0000000..2c948ae
--- /dev/null
+++ b/date-fns/src/getWeekYear/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+) => number
diff --git a/date-fns/src/getWeekYear/index.ts b/date-fns/src/getWeekYear/index.ts
new file mode 100644
index 0000000..649b8d1
--- /dev/null
+++ b/date-fns/src/getWeekYear/index.ts
@@ -0,0 +1,98 @@
+import startOfWeek from '../startOfWeek/index'
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import {
+ WeekStartOptions,
+ LocaleOptions,
+ FirstWeekContainsDateOptions,
+} from '../types'
+
+/**
+ * @name getWeekYear
+ * @category Week-Numbering Year Helpers
+ * @summary Get the local week-numbering year of the given date.
+ *
+ * @description
+ * Get the local week-numbering year of the given date.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
+ * @returns {Number} the local week-numbering year
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ *
+ * @example
+ * // Which week numbering year is 26 December 2004 with the default settings?
+ * const result = getWeekYear(new Date(2004, 11, 26))
+ * //=> 2005
+ *
+ * @example
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
+ * //=> 2004
+ *
+ * @example
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
+ * //=> 2004
+ */
+export default function getWeekYear(
+ dirtyDate: Date | number,
+ options?: LocaleOptions & WeekStartOptions & FirstWeekContainsDateOptions
+): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+
+ const localeFirstWeekContainsDate =
+ options?.locale?.options?.firstWeekContainsDate
+ const defaultFirstWeekContainsDate =
+ localeFirstWeekContainsDate == null
+ ? 1
+ : toInteger(localeFirstWeekContainsDate)
+ const firstWeekContainsDate =
+ options?.firstWeekContainsDate == null
+ ? defaultFirstWeekContainsDate
+ : toInteger(options.firstWeekContainsDate)
+
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
+ throw new RangeError(
+ 'firstWeekContainsDate must be between 1 and 7 inclusively'
+ )
+ }
+
+ const firstWeekOfNextYear = new Date(0)
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate)
+ firstWeekOfNextYear.setHours(0, 0, 0, 0)
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options)
+
+ const firstWeekOfThisYear = new Date(0)
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate)
+ firstWeekOfThisYear.setHours(0, 0, 0, 0)
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options)
+
+ if (date.getTime() >= startOfNextYear.getTime()) {
+ return year + 1
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
+ return year
+ } else {
+ return year - 1
+ }
+}
diff --git a/date-fns/src/getWeekYear/test.ts b/date-fns/src/getWeekYear/test.ts
new file mode 100644
index 0000000..0f8bf54
--- /dev/null
+++ b/date-fns/src/getWeekYear/test.ts
@@ -0,0 +1,75 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import getWeekYear from '.'
+
+describe('getWeekYear', () => {
+ it('returns the local week-numbering year of the given date', () => {
+ const result = getWeekYear(new Date(2004, 11 /* Dec */, 26))
+ assert(result === 2005)
+ })
+
+ it('accepts a timestamp', () => {
+ const result = getWeekYear(new Date(2000, 11 /* Dec */, 30).getTime())
+ assert(result === 2000)
+ })
+
+ it('handles dates before 100 AD', () => {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(7, 11 /* Dec */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ const result = getWeekYear(initialDate)
+ assert(result === 8)
+ })
+
+ it('returns NaN if the given date is invalid', () => {
+ const result = getWeekYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', () => {
+ const date = new Date(2004, 11 /* Dec */, 26)
+ const result = getWeekYear(date, {
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 },
+ },
+ })
+ assert(result === 2004)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', () => {
+ const date = new Date(2004, 11 /* Dec */, 26)
+ const result = getWeekYear(date, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 },
+ },
+ })
+ assert(result === 2004)
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', () => {
+ // @ts-expect-error
+ const block = getWeekYear.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ weekStartsOn: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', () => {
+ // @ts-expect-error
+ const block = getWeekYear.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ firstWeekContainsDate: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(getWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getWeeksInMonth/index.d.ts b/date-fns/src/getWeeksInMonth/index.d.ts
new file mode 100644
index 0000000..e6ffaaa
--- /dev/null
+++ b/date-fns/src/getWeeksInMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getWeeksInMonth } from 'date-fns'
+export default getWeeksInMonth
diff --git a/date-fns/src/getWeeksInMonth/index.js.flow b/date-fns/src/getWeeksInMonth/index.js.flow
new file mode 100644
index 0000000..1115f28
--- /dev/null
+++ b/date-fns/src/getWeeksInMonth/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => number
diff --git a/date-fns/src/getWeeksInMonth/index.ts b/date-fns/src/getWeeksInMonth/index.ts
new file mode 100644
index 0000000..288ca59
--- /dev/null
+++ b/date-fns/src/getWeeksInMonth/index.ts
@@ -0,0 +1,51 @@
+import differenceInCalendarWeeks from '../differenceInCalendarWeeks/index'
+import lastDayOfMonth from '../lastDayOfMonth/index'
+import startOfMonth from '../startOfMonth/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, WeekStartOptions } from '../types'
+
+/**
+ * @name getWeeksInMonth
+ * @category Week Helpers
+ * @summary Get the number of calendar weeks a month spans.
+ *
+ * @description
+ * Get the number of calendar weeks the month in the given date spans.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Number} the number of calendar weeks
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // How many calendar weeks does February 2015 span?
+ * const result = getWeeksInMonth(new Date(2015, 1, 8))
+ * //=> 4
+ *
+ * @example
+ * // If the week starts on Monday,
+ * // how many calendar weeks does July 2017 span?
+ * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })
+ * //=> 6
+ */
+export default function getWeeksInMonth(
+ date: Date | number,
+ options?: LocaleOptions & WeekStartOptions
+): number {
+ requiredArgs(1, arguments)
+
+ return (
+ differenceInCalendarWeeks(
+ lastDayOfMonth(date),
+ startOfMonth(date),
+ options
+ ) + 1
+ )
+}
diff --git a/date-fns/src/getWeeksInMonth/test.ts b/date-fns/src/getWeeksInMonth/test.ts
new file mode 100644
index 0000000..e8b1db4
--- /dev/null
+++ b/date-fns/src/getWeeksInMonth/test.ts
@@ -0,0 +1,71 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import getWeeksInMonth from '.'
+
+describe('getWeeksInMonth', function() {
+ it('returns the number of calendar weeks the month in the given date spans', function() {
+ const result = getWeeksInMonth(new Date(2015, 1 /* Feb */, 8, 18, 0))
+ assert(result === 4)
+ })
+
+ it('allows to specify which day is the first day of the week', function() {
+ const result = getWeeksInMonth(new Date(2015, 1 /* Feb */, 8, 18, 0), {
+ weekStartsOn: 1
+ })
+ assert(result === 5)
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function() {
+ const result = getWeeksInMonth(new Date(2015, 1 /* Feb */, 8, 18, 0), {
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 1 }
+ }
+ })
+ assert(result === 5)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ const result = getWeeksInMonth(new Date(2015, 1 /* Feb */, 8, 18, 0), {
+ weekStartsOn: 1,
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 0 }
+ }
+ })
+ assert(result === 5)
+ })
+
+ it('accepts timestamps', function() {
+ const result = getWeeksInMonth(
+ new Date(2017, 3 /* Apr */, 8, 18, 0).getTime()
+ )
+ assert(result === 6)
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ getWeeksInMonth(date)
+ assert.deepStrictEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns NaN if the date is `Invalid Date`', function() {
+ const result = getWeeksInMonth(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ const block = getWeeksInMonth.bind(
+ null,
+ new Date(2014, 6 /* Jul */, 8, 18, 0),
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(getWeeksInMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/getYear/benchmark.js b/date-fns/src/getYear/benchmark.js
new file mode 100644
index 0000000..7ce62a3
--- /dev/null
+++ b/date-fns/src/getYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import getYear from '.'
+import moment from 'moment'
+
+suite('getYear', function () {
+ benchmark('date-fns', function () {
+ return getYear(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.year()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/getYear/index.d.ts b/date-fns/src/getYear/index.d.ts
new file mode 100644
index 0000000..3ef8154
--- /dev/null
+++ b/date-fns/src/getYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { getYear } from 'date-fns'
+export default getYear
diff --git a/date-fns/src/getYear/index.js.flow b/date-fns/src/getYear/index.js.flow
new file mode 100644
index 0000000..07bb012
--- /dev/null
+++ b/date-fns/src/getYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => number
diff --git a/date-fns/src/getYear/index.ts b/date-fns/src/getYear/index.ts
new file mode 100644
index 0000000..7fead17
--- /dev/null
+++ b/date-fns/src/getYear/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name getYear
+ * @category Year Helpers
+ * @summary Get the year of the given date.
+ *
+ * @description
+ * Get the year of the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the given date
+ * @returns {Number} the year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which year is 2 July 2014?
+ * const result = getYear(new Date(2014, 6, 2))
+ * //=> 2014
+ */
+export default function getYear(dirtyDate: Date | number): number {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ return year
+}
diff --git a/date-fns/src/getYear/test.ts b/date-fns/src/getYear/test.ts
new file mode 100644
index 0000000..77d6fbc
--- /dev/null
+++ b/date-fns/src/getYear/test.ts
@@ -0,0 +1,26 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import getYear from '.'
+
+describe('getYear', function() {
+ it('returns the year of the given date', function() {
+ const result = getYear(new Date(2014, 6 /* Jul */, 2))
+ assert(result === 2014)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = getYear(new Date(2000, 3 /* Apr */, 2).getTime())
+ assert(result === 2000)
+ })
+
+ it('returns NaN if the given date is invalid', function() {
+ const result = getYear(new Date(NaN))
+ assert(isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(getYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/hoursToMilliseconds/index.d.ts b/date-fns/src/hoursToMilliseconds/index.d.ts
new file mode 100644
index 0000000..ed24a0d
--- /dev/null
+++ b/date-fns/src/hoursToMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hoursToMilliseconds } from 'date-fns'
+export default hoursToMilliseconds
diff --git a/date-fns/src/hoursToMilliseconds/index.js.flow b/date-fns/src/hoursToMilliseconds/index.js.flow
new file mode 100644
index 0000000..950ac71
--- /dev/null
+++ b/date-fns/src/hoursToMilliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (hours: number) => number
diff --git a/date-fns/src/hoursToMilliseconds/index.ts b/date-fns/src/hoursToMilliseconds/index.ts
new file mode 100644
index 0000000..e87c7a3
--- /dev/null
+++ b/date-fns/src/hoursToMilliseconds/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { millisecondsInHour } from '../constants/index'
+
+/**
+ * @name hoursToMilliseconds
+ * @category Conversion Helpers
+ * @summary Convert hours to milliseconds.
+ *
+ * @description
+ * Convert a number of hours to a full number of milliseconds.
+ *
+ * @param {number} hours - number of hours to be converted
+ *
+ * @returns {number} the number of hours converted to milliseconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 hours to milliseconds:
+ * const result = hoursToMilliseconds(2)
+ * //=> 7200000
+ */
+export default function hoursToMilliseconds(hours: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(hours * millisecondsInHour)
+}
diff --git a/date-fns/src/hoursToMilliseconds/test.ts b/date-fns/src/hoursToMilliseconds/test.ts
new file mode 100644
index 0000000..fdc426c
--- /dev/null
+++ b/date-fns/src/hoursToMilliseconds/test.ts
@@ -0,0 +1,20 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import hoursToMilliseconds from '.'
+
+describe('hoursToMilliseconds', function () {
+ it('converts hours to milliseconds', function () {
+ assert(hoursToMilliseconds(1) === 3600000)
+ assert(hoursToMilliseconds(2) === 7200000)
+ })
+
+ it('uses floor rounding', () => {
+ assert(hoursToMilliseconds(0.123456) === 444441)
+ })
+
+ it('handles border values', () => {
+ assert(hoursToMilliseconds(1.5) === 5400000)
+ assert(hoursToMilliseconds(0) === 0)
+ })
+})
diff --git a/date-fns/src/hoursToMinutes/index.d.ts b/date-fns/src/hoursToMinutes/index.d.ts
new file mode 100644
index 0000000..d0fbbbf
--- /dev/null
+++ b/date-fns/src/hoursToMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hoursToMinutes } from 'date-fns'
+export default hoursToMinutes
diff --git a/date-fns/src/hoursToMinutes/index.js.flow b/date-fns/src/hoursToMinutes/index.js.flow
new file mode 100644
index 0000000..950ac71
--- /dev/null
+++ b/date-fns/src/hoursToMinutes/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (hours: number) => number
diff --git a/date-fns/src/hoursToMinutes/index.ts b/date-fns/src/hoursToMinutes/index.ts
new file mode 100644
index 0000000..dcf61de
--- /dev/null
+++ b/date-fns/src/hoursToMinutes/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { minutesInHour } from '../constants/index'
+
+/**
+ * @name hoursToMinutes
+ * @category Conversion Helpers
+ * @summary Convert hours to minutes.
+ *
+ * @description
+ * Convert a number of hours to a full number of minutes.
+ *
+ * @param {number} hours - number of hours to be converted
+ *
+ * @returns {number} the number of hours converted in minutes
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 hours to minutes:
+ * const result = hoursToMinutes(2)
+ * //=> 120
+ */
+export default function hoursToMinutes(hours: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(hours * minutesInHour)
+}
diff --git a/date-fns/src/hoursToMinutes/test.ts b/date-fns/src/hoursToMinutes/test.ts
new file mode 100644
index 0000000..ead8b21
--- /dev/null
+++ b/date-fns/src/hoursToMinutes/test.ts
@@ -0,0 +1,20 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import hoursToMinutes from '.'
+
+describe('hoursToMinutes', function () {
+ it('converts hours to minutes', function () {
+ assert(hoursToMinutes(1) === 60)
+ assert(hoursToMinutes(2) === 120)
+ })
+
+ it('uses floor rounding', () => {
+ assert(hoursToMinutes(0.123) === 7)
+ })
+
+ it('handles border values', () => {
+ assert(hoursToMinutes(1.5) === 90)
+ assert(hoursToMinutes(0) === 0)
+ })
+})
diff --git a/date-fns/src/hoursToSeconds/index.d.ts b/date-fns/src/hoursToSeconds/index.d.ts
new file mode 100644
index 0000000..8544afb
--- /dev/null
+++ b/date-fns/src/hoursToSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hoursToSeconds } from 'date-fns'
+export default hoursToSeconds
diff --git a/date-fns/src/hoursToSeconds/index.js.flow b/date-fns/src/hoursToSeconds/index.js.flow
new file mode 100644
index 0000000..950ac71
--- /dev/null
+++ b/date-fns/src/hoursToSeconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (hours: number) => number
diff --git a/date-fns/src/hoursToSeconds/index.ts b/date-fns/src/hoursToSeconds/index.ts
new file mode 100644
index 0000000..3629880
--- /dev/null
+++ b/date-fns/src/hoursToSeconds/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { secondsInHour } from '../constants/index'
+
+/**
+ * @name hoursToSeconds
+ * @category Conversion Helpers
+ * @summary Convert hours to seconds.
+ *
+ * @description
+ * Convert a number of hours to a full number of seconds.
+ *
+ * @param {number} hours - number of hours to be converted
+ *
+ * @returns {number} the number of hours converted in seconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 hours to seconds:
+ * const result = hoursToSeconds(2)
+ * //=> 7200
+ */
+export default function hoursToSeconds(hours: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(hours * secondsInHour)
+}
diff --git a/date-fns/src/hoursToSeconds/test.ts b/date-fns/src/hoursToSeconds/test.ts
new file mode 100644
index 0000000..b2e129b
--- /dev/null
+++ b/date-fns/src/hoursToSeconds/test.ts
@@ -0,0 +1,20 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import hoursToSeconds from '.'
+
+describe('hoursToSeconds', function () {
+ it('converts hours to seconds', function () {
+ assert(hoursToSeconds(1) === 3600)
+ assert(hoursToSeconds(2) === 7200)
+ })
+
+ it('uses floor rounding', () => {
+ assert(hoursToSeconds(0.123) === 442)
+ })
+
+ it('handles border values', () => {
+ assert(hoursToSeconds(1.5) === 5400)
+ assert(hoursToSeconds(0) === 0)
+ })
+})
diff --git a/date-fns/src/index.js b/date-fns/src/index.js
new file mode 100644
index 0000000..45095f8
--- /dev/null
+++ b/date-fns/src/index.js
@@ -0,0 +1,230 @@
+// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.
+
+export { default as add } from './add/index'
+export { default as addBusinessDays } from './addBusinessDays/index'
+export { default as addDays } from './addDays/index'
+export { default as addHours } from './addHours/index'
+export { default as addISOWeekYears } from './addISOWeekYears/index'
+export { default as addMilliseconds } from './addMilliseconds/index'
+export { default as addMinutes } from './addMinutes/index'
+export { default as addMonths } from './addMonths/index'
+export { default as addQuarters } from './addQuarters/index'
+export { default as addSeconds } from './addSeconds/index'
+export { default as addWeeks } from './addWeeks/index'
+export { default as addYears } from './addYears/index'
+export { default as areIntervalsOverlapping } from './areIntervalsOverlapping/index'
+export { default as closestIndexTo } from './closestIndexTo/index'
+export { default as closestTo } from './closestTo/index'
+export { default as compareAsc } from './compareAsc/index'
+export { default as compareDesc } from './compareDesc/index'
+export { default as daysToWeeks } from './daysToWeeks/index'
+export { default as differenceInBusinessDays } from './differenceInBusinessDays/index'
+export { default as differenceInCalendarDays } from './differenceInCalendarDays/index'
+export { default as differenceInCalendarISOWeekYears } from './differenceInCalendarISOWeekYears/index'
+export { default as differenceInCalendarISOWeeks } from './differenceInCalendarISOWeeks/index'
+export { default as differenceInCalendarMonths } from './differenceInCalendarMonths/index'
+export { default as differenceInCalendarQuarters } from './differenceInCalendarQuarters/index'
+export { default as differenceInCalendarWeeks } from './differenceInCalendarWeeks/index'
+export { default as differenceInCalendarYears } from './differenceInCalendarYears/index'
+export { default as differenceInDays } from './differenceInDays/index'
+export { default as differenceInHours } from './differenceInHours/index'
+export { default as differenceInISOWeekYears } from './differenceInISOWeekYears/index'
+export { default as differenceInMilliseconds } from './differenceInMilliseconds/index'
+export { default as differenceInMinutes } from './differenceInMinutes/index'
+export { default as differenceInMonths } from './differenceInMonths/index'
+export { default as differenceInQuarters } from './differenceInQuarters/index'
+export { default as differenceInSeconds } from './differenceInSeconds/index'
+export { default as differenceInWeeks } from './differenceInWeeks/index'
+export { default as differenceInYears } from './differenceInYears/index'
+export { default as eachDayOfInterval } from './eachDayOfInterval/index'
+export { default as eachHourOfInterval } from './eachHourOfInterval/index'
+export { default as eachMinuteOfInterval } from './eachMinuteOfInterval/index'
+export { default as eachMonthOfInterval } from './eachMonthOfInterval/index'
+export { default as eachQuarterOfInterval } from './eachQuarterOfInterval/index'
+export { default as eachWeekOfInterval } from './eachWeekOfInterval/index'
+export { default as eachWeekendOfInterval } from './eachWeekendOfInterval/index'
+export { default as eachWeekendOfMonth } from './eachWeekendOfMonth/index'
+export { default as eachWeekendOfYear } from './eachWeekendOfYear/index'
+export { default as eachYearOfInterval } from './eachYearOfInterval/index'
+export { default as endOfDay } from './endOfDay/index'
+export { default as endOfDecade } from './endOfDecade/index'
+export { default as endOfHour } from './endOfHour/index'
+export { default as endOfISOWeek } from './endOfISOWeek/index'
+export { default as endOfISOWeekYear } from './endOfISOWeekYear/index'
+export { default as endOfMinute } from './endOfMinute/index'
+export { default as endOfMonth } from './endOfMonth/index'
+export { default as endOfQuarter } from './endOfQuarter/index'
+export { default as endOfSecond } from './endOfSecond/index'
+export { default as endOfToday } from './endOfToday/index'
+export { default as endOfTomorrow } from './endOfTomorrow/index'
+export { default as endOfWeek } from './endOfWeek/index'
+export { default as endOfYear } from './endOfYear/index'
+export { default as endOfYesterday } from './endOfYesterday/index'
+export { default as format } from './format/index'
+export { default as formatDistance } from './formatDistance/index'
+export { default as formatDistanceStrict } from './formatDistanceStrict/index'
+export { default as formatDistanceToNow } from './formatDistanceToNow/index'
+export { default as formatDistanceToNowStrict } from './formatDistanceToNowStrict/index'
+export { default as formatDuration } from './formatDuration/index'
+export { default as formatISO } from './formatISO/index'
+export { default as formatISO9075 } from './formatISO9075/index'
+export { default as formatISODuration } from './formatISODuration/index'
+export { default as formatRFC3339 } from './formatRFC3339/index'
+export { default as formatRFC7231 } from './formatRFC7231/index'
+export { default as formatRelative } from './formatRelative/index'
+export { default as fromUnixTime } from './fromUnixTime/index'
+export { default as getDate } from './getDate/index'
+export { default as getDay } from './getDay/index'
+export { default as getDayOfYear } from './getDayOfYear/index'
+export { default as getDaysInMonth } from './getDaysInMonth/index'
+export { default as getDaysInYear } from './getDaysInYear/index'
+export { default as getDecade } from './getDecade/index'
+export { default as getHours } from './getHours/index'
+export { default as getISODay } from './getISODay/index'
+export { default as getISOWeek } from './getISOWeek/index'
+export { default as getISOWeekYear } from './getISOWeekYear/index'
+export { default as getISOWeeksInYear } from './getISOWeeksInYear/index'
+export { default as getMilliseconds } from './getMilliseconds/index'
+export { default as getMinutes } from './getMinutes/index'
+export { default as getMonth } from './getMonth/index'
+export { default as getOverlappingDaysInIntervals } from './getOverlappingDaysInIntervals/index'
+export { default as getQuarter } from './getQuarter/index'
+export { default as getSeconds } from './getSeconds/index'
+export { default as getTime } from './getTime/index'
+export { default as getUnixTime } from './getUnixTime/index'
+export { default as getWeek } from './getWeek/index'
+export { default as getWeekOfMonth } from './getWeekOfMonth/index'
+export { default as getWeekYear } from './getWeekYear/index'
+export { default as getWeeksInMonth } from './getWeeksInMonth/index'
+export { default as getYear } from './getYear/index'
+export { default as hoursToMilliseconds } from './hoursToMilliseconds/index'
+export { default as hoursToMinutes } from './hoursToMinutes/index'
+export { default as hoursToSeconds } from './hoursToSeconds/index'
+export { default as intervalToDuration } from './intervalToDuration/index'
+export { default as intlFormat } from './intlFormat/index'
+export { default as isAfter } from './isAfter/index'
+export { default as isBefore } from './isBefore/index'
+export { default as isDate } from './isDate/index'
+export { default as isEqual } from './isEqual/index'
+export { default as isExists } from './isExists/index'
+export { default as isFirstDayOfMonth } from './isFirstDayOfMonth/index'
+export { default as isFriday } from './isFriday/index'
+export { default as isFuture } from './isFuture/index'
+export { default as isLastDayOfMonth } from './isLastDayOfMonth/index'
+export { default as isLeapYear } from './isLeapYear/index'
+export { default as isMatch } from './isMatch/index'
+export { default as isMonday } from './isMonday/index'
+export { default as isPast } from './isPast/index'
+export { default as isSameDay } from './isSameDay/index'
+export { default as isSameHour } from './isSameHour/index'
+export { default as isSameISOWeek } from './isSameISOWeek/index'
+export { default as isSameISOWeekYear } from './isSameISOWeekYear/index'
+export { default as isSameMinute } from './isSameMinute/index'
+export { default as isSameMonth } from './isSameMonth/index'
+export { default as isSameQuarter } from './isSameQuarter/index'
+export { default as isSameSecond } from './isSameSecond/index'
+export { default as isSameWeek } from './isSameWeek/index'
+export { default as isSameYear } from './isSameYear/index'
+export { default as isSaturday } from './isSaturday/index'
+export { default as isSunday } from './isSunday/index'
+export { default as isThisHour } from './isThisHour/index'
+export { default as isThisISOWeek } from './isThisISOWeek/index'
+export { default as isThisMinute } from './isThisMinute/index'
+export { default as isThisMonth } from './isThisMonth/index'
+export { default as isThisQuarter } from './isThisQuarter/index'
+export { default as isThisSecond } from './isThisSecond/index'
+export { default as isThisWeek } from './isThisWeek/index'
+export { default as isThisYear } from './isThisYear/index'
+export { default as isThursday } from './isThursday/index'
+export { default as isToday } from './isToday/index'
+export { default as isTomorrow } from './isTomorrow/index'
+export { default as isTuesday } from './isTuesday/index'
+export { default as isValid } from './isValid/index'
+export { default as isWednesday } from './isWednesday/index'
+export { default as isWeekend } from './isWeekend/index'
+export { default as isWithinInterval } from './isWithinInterval/index'
+export { default as isYesterday } from './isYesterday/index'
+export { default as lastDayOfDecade } from './lastDayOfDecade/index'
+export { default as lastDayOfISOWeek } from './lastDayOfISOWeek/index'
+export { default as lastDayOfISOWeekYear } from './lastDayOfISOWeekYear/index'
+export { default as lastDayOfMonth } from './lastDayOfMonth/index'
+export { default as lastDayOfQuarter } from './lastDayOfQuarter/index'
+export { default as lastDayOfWeek } from './lastDayOfWeek/index'
+export { default as lastDayOfYear } from './lastDayOfYear/index'
+export { default as lightFormat } from './lightFormat/index'
+export { default as max } from './max/index'
+export { default as milliseconds } from './milliseconds/index'
+export { default as millisecondsToHours } from './millisecondsToHours/index'
+export { default as millisecondsToMinutes } from './millisecondsToMinutes/index'
+export { default as millisecondsToSeconds } from './millisecondsToSeconds/index'
+export { default as min } from './min/index'
+export { default as minutesToHours } from './minutesToHours/index'
+export { default as minutesToMilliseconds } from './minutesToMilliseconds/index'
+export { default as minutesToSeconds } from './minutesToSeconds/index'
+export { default as monthsToQuarters } from './monthsToQuarters/index'
+export { default as monthsToYears } from './monthsToYears/index'
+export { default as nextDay } from './nextDay/index'
+export { default as nextFriday } from './nextFriday/index'
+export { default as nextMonday } from './nextMonday/index'
+export { default as nextSaturday } from './nextSaturday/index'
+export { default as nextSunday } from './nextSunday/index'
+export { default as nextThursday } from './nextThursday/index'
+export { default as nextTuesday } from './nextTuesday/index'
+export { default as nextWednesday } from './nextWednesday/index'
+export { default as parse } from './parse/index'
+export { default as parseISO } from './parseISO/index'
+export { default as parseJSON } from './parseJSON/index'
+export { default as quartersToMonths } from './quartersToMonths/index'
+export { default as quartersToYears } from './quartersToYears/index'
+export { default as roundToNearestMinutes } from './roundToNearestMinutes/index'
+export { default as secondsToHours } from './secondsToHours/index'
+export { default as secondsToMilliseconds } from './secondsToMilliseconds/index'
+export { default as secondsToMinutes } from './secondsToMinutes/index'
+export { default as set } from './set/index'
+export { default as setDate } from './setDate/index'
+export { default as setDay } from './setDay/index'
+export { default as setDayOfYear } from './setDayOfYear/index'
+export { default as setHours } from './setHours/index'
+export { default as setISODay } from './setISODay/index'
+export { default as setISOWeek } from './setISOWeek/index'
+export { default as setISOWeekYear } from './setISOWeekYear/index'
+export { default as setMilliseconds } from './setMilliseconds/index'
+export { default as setMinutes } from './setMinutes/index'
+export { default as setMonth } from './setMonth/index'
+export { default as setQuarter } from './setQuarter/index'
+export { default as setSeconds } from './setSeconds/index'
+export { default as setWeek } from './setWeek/index'
+export { default as setWeekYear } from './setWeekYear/index'
+export { default as setYear } from './setYear/index'
+export { default as startOfDay } from './startOfDay/index'
+export { default as startOfDecade } from './startOfDecade/index'
+export { default as startOfHour } from './startOfHour/index'
+export { default as startOfISOWeek } from './startOfISOWeek/index'
+export { default as startOfISOWeekYear } from './startOfISOWeekYear/index'
+export { default as startOfMinute } from './startOfMinute/index'
+export { default as startOfMonth } from './startOfMonth/index'
+export { default as startOfQuarter } from './startOfQuarter/index'
+export { default as startOfSecond } from './startOfSecond/index'
+export { default as startOfToday } from './startOfToday/index'
+export { default as startOfTomorrow } from './startOfTomorrow/index'
+export { default as startOfWeek } from './startOfWeek/index'
+export { default as startOfWeekYear } from './startOfWeekYear/index'
+export { default as startOfYear } from './startOfYear/index'
+export { default as startOfYesterday } from './startOfYesterday/index'
+export { default as sub } from './sub/index'
+export { default as subBusinessDays } from './subBusinessDays/index'
+export { default as subDays } from './subDays/index'
+export { default as subHours } from './subHours/index'
+export { default as subISOWeekYears } from './subISOWeekYears/index'
+export { default as subMilliseconds } from './subMilliseconds/index'
+export { default as subMinutes } from './subMinutes/index'
+export { default as subMonths } from './subMonths/index'
+export { default as subQuarters } from './subQuarters/index'
+export { default as subSeconds } from './subSeconds/index'
+export { default as subWeeks } from './subWeeks/index'
+export { default as subYears } from './subYears/index'
+export { default as toDate } from './toDate/index'
+export { default as weeksToDays } from './weeksToDays/index'
+export { default as yearsToMonths } from './yearsToMonths/index'
+export { default as yearsToQuarters } from './yearsToQuarters/index'
+export * from './constants/index'
diff --git a/date-fns/src/index.js.flow b/date-fns/src/index.js.flow
new file mode 100644
index 0000000..46beda9
--- /dev/null
+++ b/date-fns/src/index.js.flow
@@ -0,0 +1,860 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: {
+ add: (date: Date | number, duration: Duration) => Date,
+
+ addBusinessDays: (date: Date | number, amount: number) => Date,
+
+ addDays: (date: Date | number, amount: number) => Date,
+
+ addHours: (date: Date | number, amount: number) => Date,
+
+ addISOWeekYears: (date: Date | number, amount: number) => Date,
+
+ addMilliseconds: (date: Date | number, amount: number) => Date,
+
+ addMinutes: (date: Date | number, amount: number) => Date,
+
+ addMonths: (date: Date | number, amount: number) => Date,
+
+ addQuarters: (date: Date | number, amount: number) => Date,
+
+ addSeconds: (date: Date | number, amount: number) => Date,
+
+ addWeeks: (date: Date | number, amount: number) => Date,
+
+ addYears: (date: Date | number, amount: number) => Date,
+
+ areIntervalsOverlapping: (
+ intervalLeft: Interval,
+ intervalRight: Interval,
+ options?: {
+ inclusive?: boolean,
+ }
+ ) => boolean,
+
+ closestIndexTo: (
+ dateToCompare: Date | number,
+ datesArray: (Date | number)[]
+ ) => number,
+
+ closestTo: (
+ dateToCompare: Date | number,
+ datesArray: (Date | number)[]
+ ) => Date,
+
+ compareAsc: (dateLeft: Date | number, dateRight: Date | number) => number,
+
+ compareDesc: (dateLeft: Date | number, dateRight: Date | number) => number,
+
+ daysToWeeks: (days: number) => number,
+
+ differenceInBusinessDays: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInCalendarDays: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInCalendarISOWeeks: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInCalendarISOWeekYears: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInCalendarMonths: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInCalendarQuarters: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInCalendarWeeks: (
+ dateLeft: Date | number,
+ dateRight: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => number,
+
+ differenceInCalendarYears: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInDays: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInHours: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInISOWeekYears: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInMilliseconds: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInMinutes: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInMonths: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInQuarters: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInSeconds: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInWeeks: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ differenceInYears: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => number,
+
+ eachDayOfInterval: (
+ interval: Interval,
+ options?: {
+ step?: number,
+ }
+ ) => Date[],
+
+ eachHourOfInterval: (
+ interval: Interval,
+ options?: {
+ step?: number,
+ }
+ ) => Date[],
+
+ eachMinuteOfInterval: (
+ interval: Interval,
+ options?: {
+ step?: number,
+ }
+ ) => Date[],
+
+ eachMonthOfInterval: (interval: Interval) => Date[],
+
+ eachQuarterOfInterval: (interval: Interval) => Date[],
+
+ eachWeekendOfInterval: (interval: Interval) => Date[],
+
+ eachWeekendOfMonth: (date: Date | number) => Date[],
+
+ eachWeekendOfYear: (date: Date | number) => Date[],
+
+ eachWeekOfInterval: (
+ interval: Interval,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => Date[],
+
+ eachYearOfInterval: (interval: Interval) => Date[],
+
+ endOfDay: (date: Date | number) => Date,
+
+ endOfDecade: (
+ date: Date | number,
+ options?: {
+ additionalDigits?: 0 | 1 | 2,
+ }
+ ) => Date,
+
+ endOfHour: (date: Date | number) => Date,
+
+ endOfISOWeek: (date: Date | number) => Date,
+
+ endOfISOWeekYear: (date: Date | number) => Date,
+
+ endOfMinute: (date: Date | number) => Date,
+
+ endOfMonth: (date: Date | number) => Date,
+
+ endOfQuarter: (date: Date | number) => Date,
+
+ endOfSecond: (date: Date | number) => Date,
+
+ endOfToday: () => Date,
+
+ endOfTomorrow: () => Date,
+
+ endOfWeek: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => Date,
+
+ endOfYear: (date: Date | number) => Date,
+
+ endOfYesterday: () => Date,
+
+ format: (
+ date: Date | number,
+ format: string,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: number,
+ useAdditionalWeekYearTokens?: boolean,
+ useAdditionalDayOfYearTokens?: boolean,
+ }
+ ) => string,
+
+ formatDistance: (
+ date: Date | number,
+ baseDate: Date | number,
+ options?: {
+ includeSeconds?: boolean,
+ addSuffix?: boolean,
+ locale?: Locale,
+ }
+ ) => string,
+
+ formatDistanceStrict: (
+ date: Date | number,
+ baseDate: Date | number,
+ options?: {
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ locale?: Locale,
+ }
+ ) => string,
+
+ formatDistanceToNow: (
+ date: Date | number,
+ options?: {
+ includeSeconds?: boolean,
+ addSuffix?: boolean,
+ locale?: Locale,
+ }
+ ) => string,
+
+ formatDistanceToNowStrict: (
+ date: Date | number,
+ options?: {
+ addSuffix?: boolean,
+ unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year',
+ roundingMethod?: 'floor' | 'ceil' | 'round',
+ locale?: Locale,
+ }
+ ) => string,
+
+ formatDuration: (
+ duration: Duration,
+ options?: {
+ format?: string[],
+ zero?: boolean,
+ delimiter?: string,
+ locale?: Locale,
+ }
+ ) => string,
+
+ formatISO: (
+ date: Date | number,
+ options?: {
+ format?: 'extended' | 'basic',
+ representation?: 'complete' | 'date' | 'time',
+ }
+ ) => string,
+
+ formatISO9075: (
+ date: Date | number,
+ options?: {
+ format?: 'extended' | 'basic',
+ representation?: 'complete' | 'date' | 'time',
+ }
+ ) => string,
+
+ formatISODuration: (duration: Duration) => string,
+
+ formatRelative: (
+ date: Date | number,
+ baseDate: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => string,
+
+ formatRFC3339: (
+ date: Date | number,
+ options?: {
+ fractionDigits?: 0 | 1 | 2 | 3,
+ }
+ ) => string,
+
+ formatRFC7231: (date: Date | number) => string,
+
+ fromUnixTime: (unixTime: number) => Date,
+
+ getDate: (date: Date | number) => number,
+
+ getDay: (date: Date | number) => 0 | 1 | 2 | 3 | 4 | 5 | 6,
+
+ getDayOfYear: (date: Date | number) => number,
+
+ getDaysInMonth: (date: Date | number) => number,
+
+ getDaysInYear: (date: Date | number) => number,
+
+ getDecade: (date: Date | number) => number,
+
+ getHours: (date: Date | number) => number,
+
+ getISODay: (date: Date | number) => number,
+
+ getISOWeek: (date: Date | number) => number,
+
+ getISOWeeksInYear: (date: Date | number) => number,
+
+ getISOWeekYear: (date: Date | number) => number,
+
+ getMilliseconds: (date: Date | number) => number,
+
+ getMinutes: (date: Date | number) => number,
+
+ getMonth: (date: Date | number) => number,
+
+ getOverlappingDaysInIntervals: (
+ intervalLeft: Interval,
+ intervalRight: Interval
+ ) => number,
+
+ getQuarter: (date: Date | number) => number,
+
+ getSeconds: (date: Date | number) => number,
+
+ getTime: (date: Date | number) => number,
+
+ getUnixTime: (date: Date | number) => number,
+
+ getWeek: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+ ) => number,
+
+ getWeekOfMonth: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => number,
+
+ getWeeksInMonth: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => number,
+
+ getWeekYear: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+ ) => number,
+
+ getYear: (date: Date | number) => number,
+
+ hoursToMilliseconds: (hours: number) => number,
+
+ hoursToMinutes: (hours: number) => number,
+
+ hoursToSeconds: (hours: number) => number,
+
+ intervalToDuration: (interval: Interval) => Duration,
+
+ intlFormat: (
+ argument: Date | number,
+ formatOptions?: {
+ localeMatcher?: 'lookup' | 'best fit',
+ weekday?: 'narrow' | 'short' | 'long',
+ era?: 'narrow' | 'short' | 'long',
+ year?: 'numeric' | '2-digit',
+ month?: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long',
+ day?: 'numeric' | '2-digit',
+ hour?: 'numeric' | '2-digit',
+ minute?: 'numeric' | '2-digit',
+ second?: 'numeric' | '2-digit',
+ timeZoneName?: 'short' | 'long',
+ formatMatcher?: 'basic' | 'best fit',
+ hour12?: boolean,
+ timeZone?: string,
+ },
+ localeOptions?: {
+ locale?: string | string[],
+ }
+ ) => string,
+
+ isAfter: (date: Date | number, dateToCompare: Date | number) => boolean,
+
+ isBefore: (date: Date | number, dateToCompare: Date | number) => boolean,
+
+ isDate: (value: any) => boolean,
+
+ isEqual: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isExists: (year: number, month: number, day: number) => boolean,
+
+ isFirstDayOfMonth: (date: Date | number) => boolean,
+
+ isFriday: (date: Date | number) => boolean,
+
+ isFuture: (date: Date | number) => boolean,
+
+ isLastDayOfMonth: (date: Date | number) => boolean,
+
+ isLeapYear: (date: Date | number) => boolean,
+
+ isMatch: (
+ dateString: string,
+ formatString: string,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ useAdditionalWeekYearTokens?: boolean,
+ useAdditionalDayOfYearTokens?: boolean,
+ }
+ ) => boolean,
+
+ isMonday: (date: Date | number) => boolean,
+
+ isPast: (date: Date | number) => boolean,
+
+ isSameDay: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSameHour: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSameISOWeek: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSameISOWeekYear: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+ ) => boolean,
+
+ isSameMinute: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSameMonth: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSameQuarter: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSameSecond: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSameWeek: (
+ dateLeft: Date | number,
+ dateRight: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => boolean,
+
+ isSameYear: (dateLeft: Date | number, dateRight: Date | number) => boolean,
+
+ isSaturday: (date: Date | number) => boolean,
+
+ isSunday: (date: Date | number) => boolean,
+
+ isThisHour: (date: Date | number) => boolean,
+
+ isThisISOWeek: (date: Date | number) => boolean,
+
+ isThisMinute: (date: Date | number) => boolean,
+
+ isThisMonth: (date: Date | number) => boolean,
+
+ isThisQuarter: (date: Date | number) => boolean,
+
+ isThisSecond: (date: Date | number) => boolean,
+
+ isThisWeek: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => boolean,
+
+ isThisYear: (date: Date | number) => boolean,
+
+ isThursday: (date: Date | number) => boolean,
+
+ isToday: (date: Date | number) => boolean,
+
+ isTomorrow: (date: Date | number) => boolean,
+
+ isTuesday: (date: Date | number) => boolean,
+
+ isValid: (date: any) => boolean,
+
+ isWednesday: (date: Date | number) => boolean,
+
+ isWeekend: (date: Date | number) => boolean,
+
+ isWithinInterval: (date: Date | number, interval: Interval) => boolean,
+
+ isYesterday: (date: Date | number) => boolean,
+
+ lastDayOfDecade: (date: Date | number) => Date,
+
+ lastDayOfISOWeek: (date: Date | number) => Date,
+
+ lastDayOfISOWeekYear: (date: Date | number) => Date,
+
+ lastDayOfMonth: (date: Date | number) => Date,
+
+ lastDayOfQuarter: (
+ date: Date | number,
+ options?: {
+ additionalDigits?: 0 | 1 | 2,
+ }
+ ) => Date,
+
+ lastDayOfWeek: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => Date,
+
+ lastDayOfYear: (date: Date | number) => Date,
+
+ lightFormat: (date: Date | number, format: string) => string,
+
+ max: (datesArray: (Date | number)[]) => Date,
+
+ milliseconds: (duration: Duration) => number,
+
+ millisecondsToHours: (milliseconds: number) => number,
+
+ millisecondsToMinutes: (milliseconds: number) => number,
+
+ millisecondsToSeconds: (milliseconds: number) => number,
+
+ min: (datesArray: (Date | number)[]) => Date,
+
+ minutesToHours: (minutes: number) => number,
+
+ minutesToMilliseconds: (minutes: number) => number,
+
+ minutesToSeconds: (minutes: number) => number,
+
+ monthsToQuarters: (months: number) => number,
+
+ monthsToYears: (months: number) => number,
+
+ nextDay: (date: Date | number, day: Day) => Date,
+
+ nextFriday: (date: Date | number) => Date,
+
+ nextMonday: (date: Date | number) => Date,
+
+ nextSaturday: (date: Date | number) => Date,
+
+ nextSunday: (date: Date | number) => Date,
+
+ nextThursday: (date: Date | number) => Date,
+
+ nextTuesday: (date: Date | number) => Date,
+
+ nextWednesday: (date: Date | number) => Date,
+
+ parse: (
+ dateString: string,
+ formatString: string,
+ referenceDate: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ useAdditionalWeekYearTokens?: boolean,
+ useAdditionalDayOfYearTokens?: boolean,
+ }
+ ) => Date,
+
+ parseISO: (
+ argument: string,
+ options?: {
+ additionalDigits?: 0 | 1 | 2,
+ }
+ ) => Date,
+
+ parseJSON: (argument: string | number | Date) => Date,
+
+ quartersToMonths: (quarters: number) => number,
+
+ quartersToYears: (quarters: number) => number,
+
+ roundToNearestMinutes: (
+ date: Date | number,
+ options?: {
+ nearestTo?: number,
+ }
+ ) => Date,
+
+ secondsToHours: (seconds: number) => number,
+
+ secondsToMilliseconds: (seconds: number) => number,
+
+ secondsToMinutes: (seconds: number) => number,
+
+ set: (
+ date: Date | number,
+ values: {
+ year?: number,
+ month?: number,
+ date?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+ milliseconds?: number,
+ }
+ ) => Date,
+
+ setDate: (date: Date | number, dayOfMonth: number) => Date,
+
+ setDay: (
+ date: Date | number,
+ day: number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => Date,
+
+ setDayOfYear: (date: Date | number, dayOfYear: number) => Date,
+
+ setHours: (date: Date | number, hours: number) => Date,
+
+ setISODay: (date: Date | number, day: number) => Date,
+
+ setISOWeek: (date: Date | number, isoWeek: number) => Date,
+
+ setISOWeekYear: (date: Date | number, isoWeekYear: number) => Date,
+
+ setMilliseconds: (date: Date | number, milliseconds: number) => Date,
+
+ setMinutes: (date: Date | number, minutes: number) => Date,
+
+ setMonth: (date: Date | number, month: number) => Date,
+
+ setQuarter: (date: Date | number, quarter: number) => Date,
+
+ setSeconds: (date: Date | number, seconds: number) => Date,
+
+ setWeek: (
+ date: Date | number,
+ week: number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+ ) => Date,
+
+ setWeekYear: (
+ date: Date | number,
+ weekYear: number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+ ) => Date,
+
+ setYear: (date: Date | number, year: number) => Date,
+
+ startOfDay: (date: Date | number) => Date,
+
+ startOfDecade: (date: Date | number) => Date,
+
+ startOfHour: (date: Date | number) => Date,
+
+ startOfISOWeek: (date: Date | number) => Date,
+
+ startOfISOWeekYear: (date: Date | number) => Date,
+
+ startOfMinute: (date: Date | number) => Date,
+
+ startOfMonth: (date: Date | number) => Date,
+
+ startOfQuarter: (date: Date | number) => Date,
+
+ startOfSecond: (date: Date | number) => Date,
+
+ startOfToday: () => Date,
+
+ startOfTomorrow: () => Date,
+
+ startOfWeek: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+ ) => Date,
+
+ startOfWeekYear: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+ ) => Date,
+
+ startOfYear: (date: Date | number) => Date,
+
+ startOfYesterday: () => Date,
+
+ sub: (date: Date | number, duration: Duration) => Date,
+
+ subBusinessDays: (date: Date | number, amount: number) => Date,
+
+ subDays: (date: Date | number, amount: number) => Date,
+
+ subHours: (date: Date | number, amount: number) => Date,
+
+ subISOWeekYears: (date: Date | number, amount: number) => Date,
+
+ subMilliseconds: (date: Date | number, amount: number) => Date,
+
+ subMinutes: (date: Date | number, amount: number) => Date,
+
+ subMonths: (date: Date | number, amount: number) => Date,
+
+ subQuarters: (date: Date | number, amount: number) => Date,
+
+ subSeconds: (date: Date | number, amount: number) => Date,
+
+ subWeeks: (date: Date | number, amount: number) => Date,
+
+ subYears: (date: Date | number, amount: number) => Date,
+
+ toDate: (argument: Date | number) => Date,
+
+ weeksToDays: (weeks: number) => number,
+
+ yearsToMonths: (years: number) => number,
+
+ yearsToQuarters: (years: number) => number,
+
+ daysInWeek: number,
+
+ maxTime: number,
+
+ millisecondsInMinute: number,
+
+ millisecondsInHour: number,
+
+ millisecondsInSecond: number,
+
+ minTime: number,
+
+ minutesInHour: number,
+
+ monthsInQuarter: number,
+
+ monthsInYear: number,
+
+ quartersInYear: number,
+
+ secondsInHour: number,
+
+ secondsInMinute: number,
+}
diff --git a/date-fns/src/intervalToDuration/index.d.ts b/date-fns/src/intervalToDuration/index.d.ts
new file mode 100644
index 0000000..ce7bc76
--- /dev/null
+++ b/date-fns/src/intervalToDuration/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { intervalToDuration } from 'date-fns'
+export default intervalToDuration
diff --git a/date-fns/src/intervalToDuration/index.js.flow b/date-fns/src/intervalToDuration/index.js.flow
new file mode 100644
index 0000000..dbd61ee
--- /dev/null
+++ b/date-fns/src/intervalToDuration/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (interval: Interval) => Duration
diff --git a/date-fns/src/intervalToDuration/index.ts b/date-fns/src/intervalToDuration/index.ts
new file mode 100644
index 0000000..e2143aa
--- /dev/null
+++ b/date-fns/src/intervalToDuration/index.ts
@@ -0,0 +1,81 @@
+import compareAsc from '../compareAsc/index'
+import differenceInYears from '../differenceInYears/index'
+import differenceInMonths from '../differenceInMonths/index'
+import differenceInDays from '../differenceInDays/index'
+import differenceInHours from '../differenceInHours/index'
+import differenceInMinutes from '../differenceInMinutes/index'
+import differenceInSeconds from '../differenceInSeconds/index'
+import isValid from '../isValid/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import toDate from '../toDate/index'
+import sub from '../sub/index'
+
+/**
+ * @name intervalToDuration
+ * @category Common Helpers
+ * @summary Convert interval to duration
+ *
+ * @description
+ * Convert a interval object to a duration object.
+ *
+ * @param {Interval} interval - the interval to convert to duration
+ *
+ * @returns {Duration} The duration Object
+ * @throws {TypeError} Requires 2 arguments
+ * @throws {RangeError} `start` must not be Invalid Date
+ * @throws {RangeError} `end` must not be Invalid Date
+ *
+ * @example
+ * // Get the duration between January 15, 1929 and April 4, 1968.
+ * intervalToDuration({
+ * start: new Date(1929, 0, 15, 12, 0, 0),
+ * end: new Date(1968, 3, 4, 19, 5, 0)
+ * })
+ * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }
+ */
+
+export default function intervalToDuration({ start, end }: Interval): Duration {
+ requiredArgs(1, arguments)
+
+ const dateLeft = toDate(start)
+ const dateRight = toDate(end)
+
+ if (!isValid(dateLeft)) {
+ throw new RangeError('Start Date is invalid')
+ }
+ if (!isValid(dateRight)) {
+ throw new RangeError('End Date is invalid')
+ }
+
+ const duration = {
+ years: 0,
+ months: 0,
+ days: 0,
+ hours: 0,
+ minutes: 0,
+ seconds: 0,
+ }
+
+ const sign = compareAsc(dateLeft, dateRight)
+
+ duration.years = Math.abs(differenceInYears(dateLeft, dateRight))
+
+ const remainingMonths = sub(dateLeft, { years: sign * duration.years })
+ duration.months = Math.abs(differenceInMonths(remainingMonths, dateRight))
+
+ const remainingDays = sub(remainingMonths, { months: sign * duration.months })
+ duration.days = Math.abs(differenceInDays(remainingDays, dateRight))
+
+ const remainingHours = sub(remainingDays, { days: sign * duration.days })
+ duration.hours = Math.abs(differenceInHours(remainingHours, dateRight))
+
+ const remainingMinutes = sub(remainingHours, { hours: sign * duration.hours })
+ duration.minutes = Math.abs(differenceInMinutes(remainingMinutes, dateRight))
+
+ const remainingSeconds = sub(remainingMinutes, {
+ minutes: sign * duration.minutes,
+ })
+ duration.seconds = Math.abs(differenceInSeconds(remainingSeconds, dateRight))
+
+ return duration
+}
diff --git a/date-fns/src/intervalToDuration/test.ts b/date-fns/src/intervalToDuration/test.ts
new file mode 100644
index 0000000..04f250b
--- /dev/null
+++ b/date-fns/src/intervalToDuration/test.ts
@@ -0,0 +1,116 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import intervalToDuration from '.'
+
+describe('intervalToDuration', function () {
+ it('returns correct duration for arbitrary dates', function () {
+ const start = new Date(1929, 0, 15, 12, 0, 0)
+ const end = new Date(1968, 3, 4, 19, 5, 0)
+ const result = intervalToDuration({ start, end })
+
+ assert.deepEqual(result, {
+ years: 39,
+ months: 2,
+ days: 20,
+ hours: 7,
+ minutes: 5,
+ seconds: 0,
+ })
+ })
+
+ it('returns correct duration (1 of everything)', function () {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2021, 3, 2, 13, 1, 1)
+ const result = intervalToDuration({ start, end })
+
+ assert.deepEqual(result, {
+ years: 1,
+ months: 1,
+ days: 1,
+ hours: 1,
+ minutes: 1,
+ seconds: 1,
+ })
+ })
+
+ it('returns duration of 0 when the dates are the same', function () {
+ const start = new Date(2020, 2, 1, 12, 0, 0)
+ const end = new Date(2020, 2, 1, 12, 0, 0)
+ const result = intervalToDuration({ start, end })
+
+ assert.deepEqual(result, {
+ years: 0,
+ months: 0,
+ days: 0,
+ hours: 0,
+ minutes: 0,
+ seconds: 0,
+ })
+ })
+
+ describe('edge cases', function () {
+ it('returns correct duration for dates in the end of Feb - issue 2255', function () {
+ assert.deepEqual(
+ intervalToDuration({
+ start: new Date(2012, 1 /* Feb */, 28, 9, 0, 0),
+ end: new Date(2012, 1 /* Feb */, 29, 10, 0, 0),
+ }),
+ {
+ years: 0,
+ months: 0,
+ days: 1,
+ hours: 1,
+ minutes: 0,
+ seconds: 0,
+ }
+ )
+
+ assert.deepEqual(
+ intervalToDuration({
+ start: new Date(2012, 1 /* Feb */, 29, 9, 0, 0),
+ end: new Date(2012, 1 /* Feb */, 29, 10, 0, 0),
+ }),
+ {
+ years: 0,
+ months: 0,
+ days: 0,
+ hours: 1,
+ minutes: 0,
+ seconds: 0,
+ }
+ )
+
+ assert.deepEqual(
+ intervalToDuration({
+ start: new Date(2012, 1 /* Feb */, 28, 9, 0, 0),
+ end: new Date(2012, 1 /* Feb */, 28, 10, 0, 0),
+ }),
+ {
+ years: 0,
+ months: 0,
+ days: 0,
+ hours: 1,
+ minutes: 0,
+ seconds: 0,
+ }
+ )
+
+ // Issue 2261
+ assert.deepEqual(
+ intervalToDuration({
+ start: new Date(2021, 1 /* Feb */, 28, 7, 23, 7),
+ end: new Date(2021, 1 /* Feb */, 28, 7, 38, 18),
+ }),
+ {
+ years: 0,
+ months: 0,
+ days: 0,
+ hours: 0,
+ minutes: 15,
+ seconds: 11,
+ }
+ )
+ })
+ })
+})
diff --git a/date-fns/src/intlFormat/index.d.ts b/date-fns/src/intlFormat/index.d.ts
new file mode 100644
index 0000000..fc29cf5
--- /dev/null
+++ b/date-fns/src/intlFormat/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { intlFormat } from 'date-fns'
+export default intlFormat
diff --git a/date-fns/src/intlFormat/index.js.flow b/date-fns/src/intlFormat/index.js.flow
new file mode 100644
index 0000000..adc0bb4
--- /dev/null
+++ b/date-fns/src/intlFormat/index.js.flow
@@ -0,0 +1,72 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ argument: Date | number,
+ formatOptions?: {
+ localeMatcher?: 'lookup' | 'best fit',
+ weekday?: 'narrow' | 'short' | 'long',
+ era?: 'narrow' | 'short' | 'long',
+ year?: 'numeric' | '2-digit',
+ month?: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long',
+ day?: 'numeric' | '2-digit',
+ hour?: 'numeric' | '2-digit',
+ minute?: 'numeric' | '2-digit',
+ second?: 'numeric' | '2-digit',
+ timeZoneName?: 'short' | 'long',
+ formatMatcher?: 'basic' | 'best fit',
+ hour12?: boolean,
+ timeZone?: string,
+ },
+ localeOptions?: {
+ locale?: string | string[],
+ }
+) => string
diff --git a/date-fns/src/intlFormat/index.ts b/date-fns/src/intlFormat/index.ts
new file mode 100644
index 0000000..908a23b
--- /dev/null
+++ b/date-fns/src/intlFormat/index.ts
@@ -0,0 +1,116 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+
+type Locale = Intl.ResolvedDateTimeFormatOptions['locale']
+type FormatOptions = Intl.DateTimeFormatOptions
+type LocaleOptions = { locale: Locale | Locale[] }
+
+export default function intlFormat(date: Date): string
+export default function intlFormat(
+ date: Date,
+ localeOptions: LocaleOptions
+): string
+export default function intlFormat(
+ date: Date,
+ formatOptions: FormatOptions
+): string
+export default function intlFormat(
+ date: Date,
+ formatOptions: FormatOptions,
+ localeOptions: LocaleOptions
+): string
+
+/**
+ * @name intlFormat
+ * @category Common Helpers
+ * @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).
+ *
+ * @description
+ * Return the formatted date string in the given format.
+ * The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside.
+ * formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options)
+ *
+ * > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default.
+ *
+ * @param {Date|Number} argument - the original date.
+ * @param {Object} [formatOptions] - an object with options.
+ * @param {'lookup'|'best fit'} [formatOptions.localeMatcher='best fit'] - locale selection algorithm.
+ * @param {'narrow'|'short'|'long'} [formatOptions.weekday] - representation the days of the week.
+ * @param {'narrow'|'short'|'long'} [formatOptions.era] - representation of eras.
+ * @param {'numeric'|'2-digit'} [formatOptions.year] - representation of years.
+ * @param {'numeric'|'2-digit'|'narrow'|'short'|'long'} [formatOptions.month='numeric'] - representation of month.
+ * @param {'numeric'|'2-digit'} [formatOptions.day='numeric'] - representation of day.
+ * @param {'numeric'|'2-digit'} [formatOptions.hour='numeric'] - representation of hours.
+ * @param {'numeric'|'2-digit'} [formatOptions.minute] - representation of minutes.
+ * @param {'numeric'|'2-digit'} [formatOptions.second] - representation of seconds.
+ * @param {'short'|'long'} [formatOptions.timeZoneName] - representation of names of time zones.
+ * @param {'basic'|'best fit'} [formatOptions.formatMatcher='best fit'] - format selection algorithm.
+ * @param {Boolean} [formatOptions.hour12] - determines whether to use 12-hour time format.
+ * @param {String} [formatOptions.timeZone] - the time zone to use.
+ * @param {Object} [localeOptions] - an object with locale.
+ * @param {String|String[]} [localeOptions.locale] - the locale code
+ * @returns {String} the formatted date string.
+ * @throws {TypeError} 1 argument required.
+ * @throws {RangeError} `date` must not be Invalid Date
+ *
+ * @example
+ * // Represent 10 October 2019 in German.
+ * // Convert the date with format's options and locale's options.
+ * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {
+ * weekday: 'long',
+ * year: 'numeric',
+ * month: 'long',
+ * day: 'numeric',
+ * }, {
+ * locale: 'de-DE',
+ * })
+ * //=> Freitag, 4. Oktober 2019
+ *
+ * @example
+ * // Represent 10 October 2019.
+ * // Convert the date with format's options.
+ * const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), {
+ * year: 'numeric',
+ * month: 'numeric',
+ * day: 'numeric',
+ * hour: 'numeric',
+ * })
+ * //=> 10/4/2019, 12 PM
+ *
+ * @example
+ * // Represent 10 October 2019 in Korean.
+ * // Convert the date with locale's options.
+ * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {
+ * locale: 'ko-KR',
+ * })
+ * //=> 2019. 10. 4.
+ *
+ * @example
+ * // Represent 10 October 2019 in middle-endian format:
+ * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456))
+ * //=> 10/4/2019
+ */
+export default function intlFormat(
+ date: Date,
+ formatOrLocale?: FormatOptions | LocaleOptions,
+ localeOptions?: LocaleOptions
+): string {
+ requiredArgs(1, arguments)
+
+ let formatOptions: FormatOptions | undefined
+
+ if (isFormatOptions(formatOrLocale)) {
+ formatOptions = formatOrLocale
+ } else {
+ localeOptions = formatOrLocale
+ }
+
+ return new Intl.DateTimeFormat(localeOptions?.locale, formatOptions).format(
+ date
+ )
+}
+
+function isFormatOptions(
+ opts: LocaleOptions | FormatOptions | undefined
+): opts is FormatOptions {
+ return opts !== undefined && !('locale' in opts)
+}
diff --git a/date-fns/src/intlFormat/test.ts b/date-fns/src/intlFormat/test.ts
new file mode 100644
index 0000000..1c7c5f8
--- /dev/null
+++ b/date-fns/src/intlFormat/test.ts
@@ -0,0 +1,111 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import intlFormat from '.'
+
+// Before Node version 13.0.0, only the locale data for en-US is available by default.
+const hasFullICU = () => {
+ try {
+ const january = new Date(9e8)
+ const spanish = new Intl.DateTimeFormat('es', { month: 'long' })
+ return spanish.format(january) === 'enero'
+ } catch (err) {
+ return false
+ }
+}
+
+const fullICUOnly = hasFullICU() ? it : it.skip
+
+const getOperationSystemLocale = () => {
+ if (typeof process !== 'undefined') {
+ const ENV = process.env
+ const language = ENV.LC_ALL || ENV.LC_MESSAGES || ENV.LANG || ENV.LANGUAGE
+ return language?.split('.')[0].replace('_', '-')
+ } else {
+ return (
+ // @ts-expect-error
+ window.navigator.userLanguage ||
+ window.navigator.language ||
+ (window.navigator.languages || [])[0]
+ )
+ }
+}
+
+describe('intlFormat', () => {
+ describe('formats date', function () {
+ fullICUOnly(
+ "should work without format's options and locale's options",
+ function () {
+ const date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ const result = intlFormat(date)
+ const localeResult = intlFormat(date, {
+ locale: getOperationSystemLocale(),
+ })
+
+ assert(result === localeResult)
+ }
+ )
+
+ fullICUOnly("should work with only format's options", function () {
+ const date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ const formatOptions = {
+ year: 'numeric',
+ month: 'numeric',
+ day: 'numeric',
+ hour: 'numeric',
+ minute: 'numeric',
+ second: 'numeric',
+ hour12: false,
+ timeZone: 'America/Los_Angeles',
+ }
+
+ const result = intlFormat(date, formatOptions)
+ const localeResult = intlFormat(date, formatOptions, {
+ locale: getOperationSystemLocale(),
+ })
+
+ assert(result === localeResult)
+ })
+
+ fullICUOnly("should work with only locale's options", function () {
+ const date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ // Korean uses year-month-day order
+ const localeOptions = {
+ locale: 'ko-KR',
+ }
+
+ const result = intlFormat(date, localeOptions)
+
+ assert(result === '2019. 10. 4.')
+ })
+
+ fullICUOnly(
+ "should work with format's options and locale's options",
+ function () {
+ const date = new Date(2019, 9 /* Oct */, 4, 12, 30, 13, 456)
+ const formatOptions = {
+ weekday: 'long',
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric',
+ }
+ const localeOptions = {
+ locale: 'de-DE',
+ }
+
+ const result = intlFormat(date, formatOptions, localeOptions)
+
+ assert(result === 'Freitag, 4. Oktober 2019')
+ }
+ )
+ })
+
+ it('throws RangeError if the date value is invalid', () => {
+ assert.throws(intlFormat.bind(null, new Date(NaN)), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ assert.throws(intlFormat.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isAfter/benchmark.js b/date-fns/src/isAfter/benchmark.js
new file mode 100644
index 0000000..6a9cbc0
--- /dev/null
+++ b/date-fns/src/isAfter/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isAfter from '.'
+import moment from 'moment'
+
+suite('isAfter', function () {
+ benchmark('date-fns', function () {
+ return isAfter(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isAfter(this.momentB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isAfter/index.d.ts b/date-fns/src/isAfter/index.d.ts
new file mode 100644
index 0000000..0ef024b
--- /dev/null
+++ b/date-fns/src/isAfter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isAfter } from 'date-fns'
+export default isAfter
diff --git a/date-fns/src/isAfter/index.js.flow b/date-fns/src/isAfter/index.js.flow
new file mode 100644
index 0000000..3cb525c
--- /dev/null
+++ b/date-fns/src/isAfter/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ dateToCompare: Date | number
+) => boolean
diff --git a/date-fns/src/isAfter/index.ts b/date-fns/src/isAfter/index.ts
new file mode 100644
index 0000000..b236d91
--- /dev/null
+++ b/date-fns/src/isAfter/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isAfter
+ * @category Common Helpers
+ * @summary Is the first date after the second one?
+ *
+ * @description
+ * Is the first date after the second one?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date that should be after the other one to return true
+ * @param {Date|Number} dateToCompare - the date to compare with
+ * @returns {Boolean} the first date is after the second date
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Is 10 July 1989 after 11 February 1987?
+ * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
+ * //=> true
+ */
+export default function isAfter(dirtyDate: Date | number, dirtyDateToCompare: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const dateToCompare = toDate(dirtyDateToCompare)
+ return date.getTime() > dateToCompare.getTime()
+}
diff --git a/date-fns/src/isAfter/test.ts b/date-fns/src/isAfter/test.ts
new file mode 100644
index 0000000..ca1c99a
--- /dev/null
+++ b/date-fns/src/isAfter/test.ts
@@ -0,0 +1,59 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isAfter from '.'
+
+describe('isAfter', function() {
+ it('returns true if the first date is after the second one', function() {
+ const result = isAfter(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is before the second one', function() {
+ const result = isAfter(
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === false)
+ })
+
+ it('returns false if the first date is equal to the second one', function() {
+ const result = isAfter(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isAfter(
+ new Date(1989, 6 /* Jul */, 10).getTime(),
+ new Date(1987, 1 /* Feb */, 11).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isAfter(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isAfter(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isAfter(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isAfter.bind(null), TypeError)
+ assert.throws(isAfter.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isBefore/benchmark.js b/date-fns/src/isBefore/benchmark.js
new file mode 100644
index 0000000..d70f2e8
--- /dev/null
+++ b/date-fns/src/isBefore/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isBefore from '.'
+import moment from 'moment'
+
+suite('isBefore', function () {
+ benchmark('date-fns', function () {
+ return isBefore(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isBefore(this.momentB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isBefore/index.d.ts b/date-fns/src/isBefore/index.d.ts
new file mode 100644
index 0000000..127ed7e
--- /dev/null
+++ b/date-fns/src/isBefore/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isBefore } from 'date-fns'
+export default isBefore
diff --git a/date-fns/src/isBefore/index.js.flow b/date-fns/src/isBefore/index.js.flow
new file mode 100644
index 0000000..3cb525c
--- /dev/null
+++ b/date-fns/src/isBefore/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ dateToCompare: Date | number
+) => boolean
diff --git a/date-fns/src/isBefore/index.ts b/date-fns/src/isBefore/index.ts
new file mode 100644
index 0000000..344b887
--- /dev/null
+++ b/date-fns/src/isBefore/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isBefore
+ * @category Common Helpers
+ * @summary Is the first date before the second one?
+ *
+ * @description
+ * Is the first date before the second one?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date that should be before the other one to return true
+ * @param {Date|Number} dateToCompare - the date to compare with
+ * @returns {Boolean} the first date is before the second date
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Is 10 July 1989 before 11 February 1987?
+ * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
+ * //=> false
+ */
+export default function isBefore(dirtyDate: Date | number, dirtyDateToCompare: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const dateToCompare = toDate(dirtyDateToCompare)
+ return date.getTime() < dateToCompare.getTime()
+}
diff --git a/date-fns/src/isBefore/test.ts b/date-fns/src/isBefore/test.ts
new file mode 100644
index 0000000..c4d0084
--- /dev/null
+++ b/date-fns/src/isBefore/test.ts
@@ -0,0 +1,59 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isBefore from '.'
+
+describe('isBefore', function() {
+ it('returns true if the first date is before the second one', function() {
+ const result = isBefore(
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is after the second one', function() {
+ const result = isBefore(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ )
+ assert(result === false)
+ })
+
+ it('returns false if the first date is equal to the second one', function() {
+ const result = isBefore(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isBefore(
+ new Date(1987, 1 /* Feb */, 11).getTime(),
+ new Date(1989, 6 /* Jul */, 10).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isBefore(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isBefore(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isBefore(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isBefore.bind(null), TypeError)
+ assert.throws(isBefore.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isDate/index.d.ts b/date-fns/src/isDate/index.d.ts
new file mode 100644
index 0000000..518477e
--- /dev/null
+++ b/date-fns/src/isDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isDate } from 'date-fns'
+export default isDate
diff --git a/date-fns/src/isDate/index.js.flow b/date-fns/src/isDate/index.js.flow
new file mode 100644
index 0000000..cc97d41
--- /dev/null
+++ b/date-fns/src/isDate/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (value: any) => boolean
diff --git a/date-fns/src/isDate/index.ts b/date-fns/src/isDate/index.ts
new file mode 100644
index 0000000..450e008
--- /dev/null
+++ b/date-fns/src/isDate/index.ts
@@ -0,0 +1,47 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isDate
+ * @category Common Helpers
+ * @summary Is the given value a date?
+ *
+ * @description
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {*} value - the value to check
+ * @returns {boolean} true if the given value is a date
+ * @throws {TypeError} 1 arguments required
+ *
+ * @example
+ * // For a valid date:
+ * const result = isDate(new Date())
+ * //=> true
+ *
+ * @example
+ * // For an invalid date:
+ * const result = isDate(new Date(NaN))
+ * //=> true
+ *
+ * @example
+ * // For some value:
+ * const result = isDate('2014-02-31')
+ * //=> false
+ *
+ * @example
+ * // For an object:
+ * const result = isDate({})
+ * //=> false
+ */
+export default function isDate(value: unknown): value is Date {
+ requiredArgs(1, arguments)
+
+ return (
+ value instanceof Date ||
+ (typeof value === 'object' &&
+ Object.prototype.toString.call(value) === '[object Date]')
+ )
+}
diff --git a/date-fns/src/isDate/test.ts b/date-fns/src/isDate/test.ts
new file mode 100644
index 0000000..7d87789
--- /dev/null
+++ b/date-fns/src/isDate/test.ts
@@ -0,0 +1,81 @@
+// @flow
+/* eslint-env mocha */
+/* global HTMLIFrameElement */
+
+import assert from 'assert'
+import { assertType } from '../_lib/test'
+import isDate from '.'
+
+describe('isDate', () => {
+ it('returns true if the given value is a date object', () => {
+ assert(isDate(new Date()))
+ })
+
+ it('returns true if the given value is an Invalid Date', () => {
+ assert(isDate(new Date(NaN)))
+ })
+
+ it('ensures that the passed argument is an instance of Date', () => {
+ const date: unknown = new Date()
+
+ if (isDate(date)) {
+ assertType<Date>(date)
+ } else {
+ assertType<unknown>(date)
+ }
+ })
+
+ describe('with date passed from another iframe', () => {
+ afterEach(() => {
+ const iframe = document.getElementById('iframe')
+ iframe && iframe.remove()
+ })
+
+ // Emulate web browser
+ if (!process.env.JEST_WORKER_ID) {
+ it('returns true for a date passed from another iframe', (done) => {
+ const iframe = document.createElement('iframe')
+ iframe.id = 'iframe'
+ iframe.addEventListener('load', () => {
+ execScript('window.date = new Date()') // eslint-disable-line no-implied-eval
+ // @ts-expect-error
+ assert(isDate(iframe.contentWindow.date))
+ // $ExpectedMistake sadly, but Flow doesn't know about Mocha's done
+ done()
+ })
+ if (!document.body) throw new Error('document.body is not defined')
+ document.body.appendChild(iframe)
+ })
+ }
+
+ function execScript(scriptText: string) {
+ const iframe = document.querySelector('iframe#iframe')
+ if (!iframe || !(iframe instanceof HTMLIFrameElement)) {
+ throw new Error("Can't execute the script because iframe isn't found")
+ }
+ const doc = iframe.contentDocument!
+ const script = doc.createElement('script')
+ script.innerText = scriptText
+ // @ts-expect-error
+ if (!(doc.body instanceof iframe.contentWindow.HTMLBodyElement)) {
+ throw new Error(
+ "Can't execute the script because iframe does not have body"
+ )
+ }
+ doc.body.append(script)
+ }
+ })
+
+ it('returns false if the given value is not a date object', () => {
+ assert(!isDate(new Date().getTime()))
+ assert(!isDate(new Date().toISOString()))
+ assert(!isDate({}))
+ assert(!isDate(null))
+ assert(!isDate(0))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(isDate.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isEqual/benchmark.js b/date-fns/src/isEqual/benchmark.js
new file mode 100644
index 0000000..c2276b6
--- /dev/null
+++ b/date-fns/src/isEqual/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isEqual from '.'
+import moment from 'moment'
+
+suite('isEqual', function () {
+ benchmark('date-fns', function () {
+ return isEqual(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isEqual/index.d.ts b/date-fns/src/isEqual/index.d.ts
new file mode 100644
index 0000000..87865db
--- /dev/null
+++ b/date-fns/src/isEqual/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isEqual } from 'date-fns'
+export default isEqual
diff --git a/date-fns/src/isEqual/index.js.flow b/date-fns/src/isEqual/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isEqual/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isEqual/index.ts b/date-fns/src/isEqual/index.ts
new file mode 100644
index 0000000..1157e62
--- /dev/null
+++ b/date-fns/src/isEqual/index.ts
@@ -0,0 +1,35 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isEqual
+ * @category Common Helpers
+ * @summary Are the given dates equal?
+ *
+ * @description
+ * Are the given dates equal?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to compare
+ * @param {Date|Number} dateRight - the second date to compare
+ * @returns {Boolean} the dates are equal
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?
+ * var result = isEqual(
+ * new Date(2014, 6, 2, 6, 30, 45, 0),
+ * new Date(2014, 6, 2, 6, 30, 45, 500)
+ * )
+ * //=> false
+ */
+export default function isEqual(dirtyLeftDate: Date | number, dirtyRightDate: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyLeftDate)
+ const dateRight = toDate(dirtyRightDate)
+ return dateLeft.getTime() === dateRight.getTime()
+}
diff --git a/date-fns/src/isEqual/test.ts b/date-fns/src/isEqual/test.ts
new file mode 100644
index 0000000..111ae4c
--- /dev/null
+++ b/date-fns/src/isEqual/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isEqual from '.'
+
+describe('isEqual', function() {
+ it('returns true if the given dates are equal', function() {
+ const result = isEqual(
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1987, 1 /* Feb */, 11)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates are not equal', function() {
+ const result = isEqual(
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isEqual(
+ new Date(1987, 1 /* Feb */, 11).getTime(),
+ new Date(1987, 1 /* Feb */, 11).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isEqual(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isEqual(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isEqual(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isEqual.bind(null), TypeError)
+ assert.throws(isEqual.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isExists/benchmark.js b/date-fns/src/isExists/benchmark.js
new file mode 100644
index 0000000..167c979
--- /dev/null
+++ b/date-fns/src/isExists/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isExists from '.'
+
+suite(
+ 'isExisting',
+ function() {
+ benchmark('date-fns', function() {
+ return isExists(this.invalidYear, this.invalidMonth, this.invalidDay)
+ })
+ },
+ {
+ setup: function() {
+ this.invalidYear = 2018
+ this.invalidMonth = 1
+ this.invalidDay = 31
+ }
+ }
+)
diff --git a/date-fns/src/isExists/index.d.ts b/date-fns/src/isExists/index.d.ts
new file mode 100644
index 0000000..af919be
--- /dev/null
+++ b/date-fns/src/isExists/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isExists } from 'date-fns'
+export default isExists
diff --git a/date-fns/src/isExists/index.js.flow b/date-fns/src/isExists/index.js.flow
new file mode 100644
index 0000000..810828e
--- /dev/null
+++ b/date-fns/src/isExists/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (year: number, month: number, day: number) => boolean
diff --git a/date-fns/src/isExists/index.ts b/date-fns/src/isExists/index.ts
new file mode 100644
index 0000000..a15e60a
--- /dev/null
+++ b/date-fns/src/isExists/index.ts
@@ -0,0 +1,38 @@
+/**
+ * @name isExists
+ * @category Common Helpers
+ * @summary Is the given date exists?
+ *
+ * @description
+ * Checks if the given arguments convert to an existing date.
+ *
+ * @param {Number} year of the date to check
+ * @param {Number} month of the date to check
+ * @param {Number} day of the date to check
+ * @returns {Boolean} the date exists
+ * @throws {TypeError} 3 arguments required
+ *
+ * @example
+ * // For the valid date:
+ * var result = isExists(2018, 0, 31)
+ * //=> true
+ *
+ * @example
+ * // For the invalid date:
+ * var result = isExists(2018, 1, 31)
+ * //=> false
+ */
+export default function isExists(year: number, month: number, day: number): boolean {
+ if (arguments.length < 3) {
+ throw new TypeError(
+ '3 argument required, but only ' + arguments.length + ' present'
+ )
+ }
+
+ const date = new Date(year, month, day)
+ return (
+ date.getFullYear() === year &&
+ date.getMonth() === month &&
+ date.getDate() === day
+ )
+}
diff --git a/date-fns/src/isExists/test.ts b/date-fns/src/isExists/test.ts
new file mode 100644
index 0000000..3df2470
--- /dev/null
+++ b/date-fns/src/isExists/test.ts
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isExists from '.'
+
+describe('isValid', function() {
+ it('returns true if the given date is valid', function() {
+ const result = isExists(2018, 0, 31)
+ assert(result === true)
+ })
+
+ it('returns false if the given date is invalid', function() {
+ const result = isExists(2018, 1 /* Feb */, 31)
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 3 arguments', function() {
+ assert.throws(isExists.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isFirstDayOfMonth/benchmark.js b/date-fns/src/isFirstDayOfMonth/benchmark.js
new file mode 100644
index 0000000..df8db56
--- /dev/null
+++ b/date-fns/src/isFirstDayOfMonth/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isFirstDayOfMonth from '.'
+
+suite('isFirstDayOfMonth', function () {
+ benchmark('date-fns', function () {
+ return isFirstDayOfMonth(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isFirstDayOfMonth/index.d.ts b/date-fns/src/isFirstDayOfMonth/index.d.ts
new file mode 100644
index 0000000..6c1a314
--- /dev/null
+++ b/date-fns/src/isFirstDayOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isFirstDayOfMonth } from 'date-fns'
+export default isFirstDayOfMonth
diff --git a/date-fns/src/isFirstDayOfMonth/index.js.flow b/date-fns/src/isFirstDayOfMonth/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isFirstDayOfMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isFirstDayOfMonth/index.ts b/date-fns/src/isFirstDayOfMonth/index.ts
new file mode 100644
index 0000000..e6fcfb1
--- /dev/null
+++ b/date-fns/src/isFirstDayOfMonth/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isFirstDayOfMonth
+ * @category Month Helpers
+ * @summary Is the given date the first day of a month?
+ *
+ * @description
+ * Is the given date the first day of a month?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is the first day of a month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 1 September 2014 the first day of a month?
+ * var result = isFirstDayOfMonth(new Date(2014, 8, 1))
+ * //=> true
+ */
+export default function isFirstDayOfMonth(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getDate() === 1
+}
diff --git a/date-fns/src/isFirstDayOfMonth/test.ts b/date-fns/src/isFirstDayOfMonth/test.ts
new file mode 100644
index 0000000..29c5476
--- /dev/null
+++ b/date-fns/src/isFirstDayOfMonth/test.ts
@@ -0,0 +1,32 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isFirstDayOfMonth from '.'
+
+describe('isFirstDayOfMonth', function() {
+ it('returns true if the given date is in the last day of month', function() {
+ const result = isFirstDayOfMonth(new Date(2014, 9 /* Oct */, 1))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not in the last day of month', function() {
+ const result = isFirstDayOfMonth(new Date(2014, 9 /* Oct */, 2))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 9 /* Oct */, 1).getTime()
+ const result = isFirstDayOfMonth(date)
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isFirstDayOfMonth(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isFirstDayOfMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isFriday/benchmark.js b/date-fns/src/isFriday/benchmark.js
new file mode 100644
index 0000000..edeab4d
--- /dev/null
+++ b/date-fns/src/isFriday/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isFriday from '.'
+
+suite('isFriday', function () {
+ benchmark('date-fns', function () {
+ return isFriday(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isFriday/index.d.ts b/date-fns/src/isFriday/index.d.ts
new file mode 100644
index 0000000..17ac2ef
--- /dev/null
+++ b/date-fns/src/isFriday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isFriday } from 'date-fns'
+export default isFriday
diff --git a/date-fns/src/isFriday/index.js.flow b/date-fns/src/isFriday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isFriday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isFriday/index.ts b/date-fns/src/isFriday/index.ts
new file mode 100644
index 0000000..9194a2e
--- /dev/null
+++ b/date-fns/src/isFriday/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isFriday
+ * @category Weekday Helpers
+ * @summary Is the given date Friday?
+ *
+ * @description
+ * Is the given date Friday?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is Friday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 26 September 2014 Friday?
+ * var result = isFriday(new Date(2014, 8, 26))
+ * //=> true
+ */
+export default function isFriday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getDay() === 5
+}
diff --git a/date-fns/src/isFriday/test.ts b/date-fns/src/isFriday/test.ts
new file mode 100644
index 0000000..3eae119
--- /dev/null
+++ b/date-fns/src/isFriday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isFriday from '.'
+
+describe('isFriday', function() {
+ it('returns true if the given date is Friday', function() {
+ const result = isFriday(new Date(2014, 8 /* Sep */, 26))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Friday', function() {
+ const result = isFriday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isFriday(new Date(2014, 1 /* Feb */, 14).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isFriday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isFriday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isFuture/benchmark.js b/date-fns/src/isFuture/benchmark.js
new file mode 100644
index 0000000..d04fd1a
--- /dev/null
+++ b/date-fns/src/isFuture/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isFuture from '.'
+
+suite(
+ 'isFuture',
+ () => {
+ benchmark('date-fns', function() {
+ return isFuture(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isFuture/index.d.ts b/date-fns/src/isFuture/index.d.ts
new file mode 100644
index 0000000..4cb82e8
--- /dev/null
+++ b/date-fns/src/isFuture/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isFuture } from 'date-fns'
+export default isFuture
diff --git a/date-fns/src/isFuture/index.js.flow b/date-fns/src/isFuture/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isFuture/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isFuture/index.ts b/date-fns/src/isFuture/index.ts
new file mode 100644
index 0000000..16ba1c9
--- /dev/null
+++ b/date-fns/src/isFuture/index.ts
@@ -0,0 +1,33 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isFuture
+ * @category Common Helpers
+ * @summary Is the given date in the future?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the future?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in the future
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 6 October 2014, is 31 December 2014 in the future?
+ * var result = isFuture(new Date(2014, 11, 31))
+ * //=> true
+ */
+export default function isFuture(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getTime() > Date.now()
+}
diff --git a/date-fns/src/isFuture/test.ts b/date-fns/src/isFuture/test.ts
new file mode 100644
index 0000000..bec205f
--- /dev/null
+++ b/date-fns/src/isFuture/test.ts
@@ -0,0 +1,41 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import sinon from 'sinon'
+import isFuture from '.'
+
+describe('isFuture', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date is in the future', () => {
+ const result = isFuture(new Date(2014, 9 /* Oct */, 31))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is in the past', () => {
+ const result = isFuture(new Date(2014, 8 /* Sep */, 1))
+ assert(result === false)
+ })
+
+ it('returns false if the given date is now', () => {
+ const result = isFuture(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const result = isFuture(new Date(2014, 9 /* Oct */, 31).getTime())
+ assert(result === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ assert.throws(isFuture.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isLastDayOfMonth/benchmark.js b/date-fns/src/isLastDayOfMonth/benchmark.js
new file mode 100644
index 0000000..6ce43bc
--- /dev/null
+++ b/date-fns/src/isLastDayOfMonth/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isLastDayOfMonth from '.'
+
+suite('isLastDayOfMonth', function () {
+ benchmark('date-fns', function () {
+ return isLastDayOfMonth(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isLastDayOfMonth/index.d.ts b/date-fns/src/isLastDayOfMonth/index.d.ts
new file mode 100644
index 0000000..665cb7d
--- /dev/null
+++ b/date-fns/src/isLastDayOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isLastDayOfMonth } from 'date-fns'
+export default isLastDayOfMonth
diff --git a/date-fns/src/isLastDayOfMonth/index.js.flow b/date-fns/src/isLastDayOfMonth/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isLastDayOfMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isLastDayOfMonth/index.ts b/date-fns/src/isLastDayOfMonth/index.ts
new file mode 100644
index 0000000..d16fc18
--- /dev/null
+++ b/date-fns/src/isLastDayOfMonth/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import endOfDay from '../endOfDay/index'
+import endOfMonth from '../endOfMonth/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isLastDayOfMonth
+ * @category Month Helpers
+ * @summary Is the given date the last day of a month?
+ *
+ * @description
+ * Is the given date the last day of a month?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is the last day of a month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 28 February 2014 the last day of a month?
+ * var result = isLastDayOfMonth(new Date(2014, 1, 28))
+ * //=> true
+ */
+export default function isLastDayOfMonth(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ return endOfDay(date).getTime() === endOfMonth(date).getTime()
+}
diff --git a/date-fns/src/isLastDayOfMonth/test.ts b/date-fns/src/isLastDayOfMonth/test.ts
new file mode 100644
index 0000000..4e20216
--- /dev/null
+++ b/date-fns/src/isLastDayOfMonth/test.ts
@@ -0,0 +1,32 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isLastDayOfMonth from '.'
+
+describe('isLastDayOfMonth', function() {
+ it('returns true if the given date is in the last day of month', function() {
+ const result = isLastDayOfMonth(new Date(2014, 9 /* Oct */, 31))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not in the last day of month', function() {
+ const result = isLastDayOfMonth(new Date(2014, 9 /* Oct */, 30))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ var date = new Date(2014, 9 /* Oct */, 31).getTime()
+ const result = isLastDayOfMonth(date)
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isLastDayOfMonth(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isLastDayOfMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isLeapYear/benchmark.js b/date-fns/src/isLeapYear/benchmark.js
new file mode 100644
index 0000000..ede4681
--- /dev/null
+++ b/date-fns/src/isLeapYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isLeapYear from '.'
+import moment from 'moment'
+
+suite('isLeapYear', function () {
+ benchmark('date-fns', function () {
+ return isLeapYear(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isLeapYear()
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/isLeapYear/index.d.ts b/date-fns/src/isLeapYear/index.d.ts
new file mode 100644
index 0000000..c08ad8a
--- /dev/null
+++ b/date-fns/src/isLeapYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isLeapYear } from 'date-fns'
+export default isLeapYear
diff --git a/date-fns/src/isLeapYear/index.js.flow b/date-fns/src/isLeapYear/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isLeapYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isLeapYear/index.ts b/date-fns/src/isLeapYear/index.ts
new file mode 100644
index 0000000..e3a0a27
--- /dev/null
+++ b/date-fns/src/isLeapYear/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isLeapYear
+ * @category Year Helpers
+ * @summary Is the given date in the leap year?
+ *
+ * @description
+ * Is the given date in the leap year?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in the leap year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 1 September 2012 in the leap year?
+ * var result = isLeapYear(new Date(2012, 8, 1))
+ * //=> true
+ */
+export default function isLeapYear(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0)
+}
diff --git a/date-fns/src/isLeapYear/test.ts b/date-fns/src/isLeapYear/test.ts
new file mode 100644
index 0000000..95f5cc5
--- /dev/null
+++ b/date-fns/src/isLeapYear/test.ts
@@ -0,0 +1,42 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isLeapYear from '.'
+
+describe('isLeapYear', function() {
+ it('returns true if the given date is in the leap year', function() {
+ const result = isLeapYear(new Date(2012, 6 /* Jul */, 2))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not in the leap year', function() {
+ const result = isLeapYear(new Date(2014, 6 /* Jul */, 2))
+ assert(result === false)
+ })
+
+ it('works for the years divisible by 100 but not by 400', function() {
+ const result = isLeapYear(new Date(2100, 6 /* Jul */, 2))
+ assert(result === false)
+ })
+
+ it('works for the years divisible by 400', function() {
+ const result = isLeapYear(new Date(2000, 6 /* Jul */, 2))
+ assert(result === true)
+ })
+
+ it('accepts a timestamp', function() {
+ var date = new Date(2012, 6 /* Jul */, 2).getTime()
+ const result = isLeapYear(date)
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isLeapYear(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isLeapYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isMatch/index.d.ts b/date-fns/src/isMatch/index.d.ts
new file mode 100644
index 0000000..e0c3fa5
--- /dev/null
+++ b/date-fns/src/isMatch/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isMatch } from 'date-fns'
+export default isMatch
diff --git a/date-fns/src/isMatch/index.js b/date-fns/src/isMatch/index.js
new file mode 100644
index 0000000..55caded
--- /dev/null
+++ b/date-fns/src/isMatch/index.js
@@ -0,0 +1,300 @@
+import parse from '../parse/index'
+import isValid from '../isValid/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isMatch
+ * @category Common Helpers
+ * @summary validates the date string against given formats
+ *
+ * @description
+ * Return the true if given date is string correct against the given format else
+ * will return false.
+ *
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
+ * > See: https://git.io/fxCyr
+ *
+ * The characters in the format string wrapped between two single quotes characters (') are escaped.
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
+ *
+ * Format of the format string is based on Unicode Technical Standard #35:
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
+ * with a few additions (see note 5 below the table).
+ *
+ * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
+ * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
+ *
+ * ```javascript
+ * isMatch('23 AM', 'HH a')
+ * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
+ * ```
+ *
+ * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
+ *
+ * Accepted format string patterns:
+ * | Unit |Prior| Pattern | Result examples | Notes |
+ * |---------------------------------|-----|---------|-----------------------------------|-------|
+ * | Era | 140 | G..GGG | AD, BC | |
+ * | | | GGGG | Anno Domini, Before Christ | 2 |
+ * | | | GGGGG | A, B | |
+ * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
+ * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
+ * | | | yy | 44, 01, 00, 17 | 4 |
+ * | | | yyy | 044, 001, 123, 999 | 4 |
+ * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
+ * | | | yyyyy | ... | 2,4 |
+ * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
+ * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
+ * | | | YY | 44, 01, 00, 17 | 4,6 |
+ * | | | YYY | 044, 001, 123, 999 | 4 |
+ * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
+ * | | | YYYYY | ... | 2,4 |
+ * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
+ * | | | RR | -43, 01, 00, 17 | 4,5 |
+ * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
+ * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
+ * | | | RRRRR | ... | 2,4,5 |
+ * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
+ * | | | uu | -43, 01, 99, -99 | 4 |
+ * | | | uuu | -043, 001, 123, 999, -999 | 4 |
+ * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
+ * | | | uuuuu | ... | 2,4 |
+ * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
+ * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
+ * | | | QQ | 01, 02, 03, 04 | |
+ * | | | QQQ | Q1, Q2, Q3, Q4 | |
+ * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
+ * | | | QQQQQ | 1, 2, 3, 4 | 4 |
+ * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
+ * | | | qo | 1st, 2nd, 3rd, 4th | 5 |
+ * | | | qq | 01, 02, 03, 04 | |
+ * | | | qqq | Q1, Q2, Q3, Q4 | |
+ * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
+ * | | | qqqqq | 1, 2, 3, 4 | 3 |
+ * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
+ * | | | Mo | 1st, 2nd, ..., 12th | 5 |
+ * | | | MM | 01, 02, ..., 12 | |
+ * | | | MMM | Jan, Feb, ..., Dec | |
+ * | | | MMMM | January, February, ..., December | 2 |
+ * | | | MMMMM | J, F, ..., D | |
+ * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
+ * | | | Lo | 1st, 2nd, ..., 12th | 5 |
+ * | | | LL | 01, 02, ..., 12 | |
+ * | | | LLL | Jan, Feb, ..., Dec | |
+ * | | | LLLL | January, February, ..., December | 2 |
+ * | | | LLLLL | J, F, ..., D | |
+ * | Local week of year | 100 | w | 1, 2, ..., 53 | |
+ * | | | wo | 1st, 2nd, ..., 53th | 5 |
+ * | | | ww | 01, 02, ..., 53 | |
+ * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
+ * | | | Io | 1st, 2nd, ..., 53th | 5 |
+ * | | | II | 01, 02, ..., 53 | 5 |
+ * | Day of month | 90 | d | 1, 2, ..., 31 | |
+ * | | | do | 1st, 2nd, ..., 31st | 5 |
+ * | | | dd | 01, 02, ..., 31 | |
+ * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
+ * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
+ * | | | DD | 01, 02, ..., 365, 366 | 7 |
+ * | | | DDD | 001, 002, ..., 365, 366 | |
+ * | | | DDDD | ... | 2 |
+ * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |
+ * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
+ * | | | EEEEE | M, T, W, T, F, S, S | |
+ * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
+ * | | | io | 1st, 2nd, ..., 7th | 5 |
+ * | | | ii | 01, 02, ..., 07 | 5 |
+ * | | | iii | Mon, Tue, Wed, ..., Su | 5 |
+ * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
+ * | | | iiiii | M, T, W, T, F, S, S | 5 |
+ * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |
+ * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
+ * | | | eo | 2nd, 3rd, ..., 1st | 5 |
+ * | | | ee | 02, 03, ..., 01 | |
+ * | | | eee | Mon, Tue, Wed, ..., Su | |
+ * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
+ * | | | eeeee | M, T, W, T, F, S, S | |
+ * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
+ * | | | co | 2nd, 3rd, ..., 1st | 5 |
+ * | | | cc | 02, 03, ..., 01 | |
+ * | | | ccc | Mon, Tue, Wed, ..., Su | |
+ * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
+ * | | | ccccc | M, T, W, T, F, S, S | |
+ * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | AM, PM | 80 | a..aaa | AM, PM | |
+ * | | | aaaa | a.m., p.m. | 2 |
+ * | | | aaaaa | a, p | |
+ * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
+ * | | | bbbb | a.m., p.m., noon, midnight | 2 |
+ * | | | bbbbb | a, p, n, mi | |
+ * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
+ * | | | BBBB | at night, in the morning, ... | 2 |
+ * | | | BBBBB | at night, in the morning, ... | |
+ * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
+ * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
+ * | | | hh | 01, 02, ..., 11, 12 | |
+ * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
+ * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
+ * | | | HH | 00, 01, 02, ..., 23 | |
+ * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
+ * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
+ * | | | KK | 01, 02, ..., 11, 00 | |
+ * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
+ * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
+ * | | | kk | 24, 01, 02, ..., 23 | |
+ * | Minute | 60 | m | 0, 1, ..., 59 | |
+ * | | | mo | 0th, 1st, ..., 59th | 5 |
+ * | | | mm | 00, 01, ..., 59 | |
+ * | Second | 50 | s | 0, 1, ..., 59 | |
+ * | | | so | 0th, 1st, ..., 59th | 5 |
+ * | | | ss | 00, 01, ..., 59 | |
+ * | Seconds timestamp | 40 | t | 512969520 | |
+ * | | | tt | ... | 2 |
+ * | Fraction of second | 30 | S | 0, 1, ..., 9 | |
+ * | | | SS | 00, 01, ..., 99 | |
+ * | | | SSS | 000, 0001, ..., 999 | |
+ * | | | SSSS | ... | 2 |
+ * | Milliseconds timestamp | 20 | T | 512969520900 | |
+ * | | | TT | ... | 2 |
+ * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
+ * | | | XX | -0800, +0530, Z | |
+ * | | | XXX | -08:00, +05:30, Z | |
+ * | | | XXXX | -0800, +0530, Z, +123456 | 2 |
+ * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
+ * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
+ * | | | xx | -0800, +0530, +0000 | |
+ * | | | xxx | -08:00, +05:30, +00:00 | 2 |
+ * | | | xxxx | -0800, +0530, +0000, +123456 | |
+ * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
+ * | Long localized date | NA | P | 05/29/1453 | 5,8 |
+ * | | | PP | May 29, 1453 | |
+ * | | | PPP | May 29th, 1453 | |
+ * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
+ * | Long localized time | NA | p | 12:00 AM | 5,8 |
+ * | | | pp | 12:00:00 AM | |
+ * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
+ * | | | PPpp | May 29, 1453, 12:00:00 AM | |
+ * | | | PPPpp | May 29th, 1453 at ... | |
+ * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
+ * Notes:
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
+ * are the same as "stand-alone" units, but are different in some languages.
+ * "Formatting" units are declined according to the rules of the language
+ * in the context of a date. "Stand-alone" units are always nominative singular.
+ * In `format` function, they will produce different result:
+ *
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
+ *
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
+ *
+ * `isMatch` will try to match both formatting and stand-alone units interchangably.
+ *
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
+ * the single quote characters (see below).
+ * If the sequence is longer than listed in table:
+ * - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number
+ * as wide as the sequence
+ * - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit.
+ * These variations are marked with "2" in the last column of the table.
+ *
+ * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
+ * These tokens represent the shortest form of the quarter.
+ *
+ * 4. The main difference between `y` and `u` patterns are B.C. years:
+ *
+ * | Year | `y` | `u` |
+ * |------|-----|-----|
+ * | AC 1 | 1 | 1 |
+ * | BC 1 | 1 | 0 |
+ * | BC 2 | 2 | -1 |
+ *
+ * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
+ *
+ * `isMatch('50', 'yy') //=> true`
+ *
+ * `isMatch('75', 'yy') //=> true`
+ *
+ * while `uu` will use the year as is:
+ *
+ * `isMatch('50', 'uu') //=> true`
+ *
+ * `isMatch('75', 'uu') //=> true`
+ *
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
+ * except local week-numbering years are dependent on `options.weekStartsOn`
+ * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}
+ * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).
+ *
+ * 5. These patterns are not in the Unicode Technical Standard #35:
+ * - `i`: ISO day of week
+ * - `I`: ISO week of year
+ * - `R`: ISO week-numbering year
+ * - `o`: ordinal number modifier
+ * - `P`: long localized date
+ * - `p`: long localized time
+ *
+ * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
+ *
+ * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
+ *
+ * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
+ * on the given locale.
+ *
+ * using `en-US` locale: `P` => `MM/dd/yyyy`
+ * using `en-US` locale: `p` => `hh:mm a`
+ * using `pt-BR` locale: `P` => `dd/MM/yyyy`
+ * using `pt-BR` locale: `p` => `HH:mm`
+ *
+ * Values will be checked in the descending order of its unit's priority.
+ * Units of an equal priority overwrite each other in the order of appearance.
+ *
+ * If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year),
+ * the values will be taken from today's using `new Date()` date which works as a context of parsing.
+ *
+ * The result may vary by locale.
+ *
+ * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
+ *
+ *
+ *
+ * @param {String} dateString - the date string to verify
+ * @param {String} formatString - the string of tokens
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
+ * see: https://git.io/fxCyr
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
+ * see: https://git.io/fxCyr
+ * @returns {Boolean}
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ * @throws {RangeError} `options.locale` must contain `match` property
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
+ *
+ * @example
+ * // Match 11 February 2014 from middle-endian format:
+ * var result = isMatch('02/11/2014', 'MM/dd/yyyy')
+ * //=> true
+ *
+ * @example
+ * // Match 28th of February in Esperanto locale in the context of 2010 year:
+ * import eo from 'date-fns/locale/eo'
+ * var result = isMatch('28-a de februaro', "do 'de' MMMM", {
+ * locale: eo
+ * })
+ * //=> true
+ */
+export default function isMatch(dateString, formatString, dirtyOptions) {
+ requiredArgs(2, arguments)
+ return isValid(parse(dateString, formatString, new Date(), dirtyOptions))
+}
diff --git a/date-fns/src/isMatch/index.js.flow b/date-fns/src/isMatch/index.js.flow
new file mode 100644
index 0000000..c27d35a
--- /dev/null
+++ b/date-fns/src/isMatch/index.js.flow
@@ -0,0 +1,62 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateString: string,
+ formatString: string,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ useAdditionalWeekYearTokens?: boolean,
+ useAdditionalDayOfYearTokens?: boolean,
+ }
+) => boolean
diff --git a/date-fns/src/isMatch/test.js b/date-fns/src/isMatch/test.js
new file mode 100644
index 0000000..dfe6e10
--- /dev/null
+++ b/date-fns/src/isMatch/test.js
@@ -0,0 +1,24 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isMatch from '.'
+import eo from '../locale/eo'
+
+describe('isMatch', function() {
+ it('accepts a dd-MM-yyyy format against 22-02-1998', function() {
+ assert(isMatch('22-02-1998', 'dd-MM-yyyy'))
+ })
+
+ it('reject a yyyy-dd-MM format against 22-02-1998', function() {
+ assert(!isMatch('22-02-1998', 'yyyy-dd-MM'))
+ })
+
+ it('accepts a date & format with locale', function() {
+ assert(
+ isMatch('28-a de februaro', "do 'de' MMMM", {
+ locale: eo
+ })
+ )
+ })
+})
diff --git a/date-fns/src/isMonday/benchmark.js b/date-fns/src/isMonday/benchmark.js
new file mode 100644
index 0000000..590451b
--- /dev/null
+++ b/date-fns/src/isMonday/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isMonday from '.'
+
+suite('isMonday', function () {
+ benchmark('date-fns', function () {
+ return isMonday(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isMonday/index.d.ts b/date-fns/src/isMonday/index.d.ts
new file mode 100644
index 0000000..dee60ac
--- /dev/null
+++ b/date-fns/src/isMonday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isMonday } from 'date-fns'
+export default isMonday
diff --git a/date-fns/src/isMonday/index.js.flow b/date-fns/src/isMonday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isMonday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isMonday/index.ts b/date-fns/src/isMonday/index.ts
new file mode 100644
index 0000000..95241d5
--- /dev/null
+++ b/date-fns/src/isMonday/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isMonday
+ * @category Weekday Helpers
+ * @summary Is the given date Monday?
+ *
+ * @description
+ * Is the given date Monday?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is Monday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 22 September 2014 Monday?
+ * var result = isMonday(new Date(2014, 8, 22))
+ * //=> true
+ */
+export default function isMonday(date: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(date).getDay() === 1
+}
diff --git a/date-fns/src/isMonday/test.ts b/date-fns/src/isMonday/test.ts
new file mode 100644
index 0000000..72eac8f
--- /dev/null
+++ b/date-fns/src/isMonday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isMonday from '.'
+
+describe('isMonday', function() {
+ it('returns true if the given date is Monday', function() {
+ const result = isMonday(new Date(2014, 8 /* Sep */, 22))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Monday', function() {
+ const result = isMonday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isMonday(new Date(2014, 1 /* Feb */, 10).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isMonday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isMonday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isPast/benchmark.js b/date-fns/src/isPast/benchmark.js
new file mode 100644
index 0000000..d5403bd
--- /dev/null
+++ b/date-fns/src/isPast/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isPast from '.'
+
+suite(
+ 'isPast',
+ () => {
+ benchmark('date-fns', function() {
+ return isPast(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isPast/index.d.ts b/date-fns/src/isPast/index.d.ts
new file mode 100644
index 0000000..8ae92ca
--- /dev/null
+++ b/date-fns/src/isPast/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isPast } from 'date-fns'
+export default isPast
diff --git a/date-fns/src/isPast/index.js.flow b/date-fns/src/isPast/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isPast/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isPast/index.ts b/date-fns/src/isPast/index.ts
new file mode 100644
index 0000000..b0c251e
--- /dev/null
+++ b/date-fns/src/isPast/index.ts
@@ -0,0 +1,33 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isPast
+ * @category Common Helpers
+ * @summary Is the given date in the past?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the past?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in the past
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 6 October 2014, is 2 July 2014 in the past?
+ * var result = isPast(new Date(2014, 6, 2))
+ * //=> true
+ */
+export default function isPast(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getTime() < Date.now()
+}
diff --git a/date-fns/src/isPast/test.ts b/date-fns/src/isPast/test.ts
new file mode 100644
index 0000000..eb3a947
--- /dev/null
+++ b/date-fns/src/isPast/test.ts
@@ -0,0 +1,42 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isPast from '.'
+
+describe('isPast', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date is in the past', () => {
+ const result = isPast(new Date(2014, 6 /* Jul */, 2))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is in the future', () => {
+ const result = isPast(new Date(2014, 11 /* Dec */, 31))
+ assert(result === false)
+ })
+
+ it('returns false if the given date is now', () => {
+ const result = isPast(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const result = isPast(new Date(2014, 6 /* Jul */, 2).getTime())
+ assert(result === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(isPast.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameDay/benchmark.js b/date-fns/src/isSameDay/benchmark.js
new file mode 100644
index 0000000..d68232f
--- /dev/null
+++ b/date-fns/src/isSameDay/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameDay from '.'
+import moment from 'moment'
+
+suite('isSameDay', function () {
+ benchmark('date-fns', function () {
+ return isSameDay(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'day')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameDay/index.d.ts b/date-fns/src/isSameDay/index.d.ts
new file mode 100644
index 0000000..c4c2d55
--- /dev/null
+++ b/date-fns/src/isSameDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameDay } from 'date-fns'
+export default isSameDay
diff --git a/date-fns/src/isSameDay/index.js.flow b/date-fns/src/isSameDay/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameDay/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameDay/index.ts b/date-fns/src/isSameDay/index.ts
new file mode 100644
index 0000000..6b42679
--- /dev/null
+++ b/date-fns/src/isSameDay/index.ts
@@ -0,0 +1,33 @@
+import startOfDay from '../startOfDay/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameDay
+ * @category Day Helpers
+ * @summary Are the given dates in the same day?
+ *
+ * @description
+ * Are the given dates in the same day?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same day
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
+ * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
+ * //=> true
+ */
+export default function isSameDay(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeftStartOfDay = startOfDay(dirtyDateLeft)
+ const dateRightStartOfDay = startOfDay(dirtyDateRight)
+
+ return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime()
+}
diff --git a/date-fns/src/isSameDay/test.ts b/date-fns/src/isSameDay/test.ts
new file mode 100644
index 0000000..ff90d55
--- /dev/null
+++ b/date-fns/src/isSameDay/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameDay from '.'
+
+describe('isSameDay', function() {
+ it('returns true if the given dates have the same day', function() {
+ const result = isSameDay(
+ new Date(2014, 8 /* Sep */, 4, 6, 0),
+ new Date(2014, 8 /* Sep */, 4, 18, 0)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different days', function() {
+ const result = isSameDay(
+ new Date(2014, 8 /* Sep */, 4, 23, 59),
+ new Date(2014, 8 /* Sep */, 5, 0, 0)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameDay(
+ new Date(2014, 8 /* Sep */, 4, 6, 0).getTime(),
+ new Date(2014, 8 /* Sep */, 4, 18, 0).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameDay(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameDay(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameDay(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameDay.bind(null), TypeError)
+ assert.throws(isSameDay.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameHour/benchmark.js b/date-fns/src/isSameHour/benchmark.js
new file mode 100644
index 0000000..c21d8c1
--- /dev/null
+++ b/date-fns/src/isSameHour/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameHour from '.'
+import moment from 'moment'
+
+suite('isSameHour', function () {
+ benchmark('date-fns', function () {
+ return isSameHour(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'hour')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameHour/index.d.ts b/date-fns/src/isSameHour/index.d.ts
new file mode 100644
index 0000000..78d4662
--- /dev/null
+++ b/date-fns/src/isSameHour/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameHour } from 'date-fns'
+export default isSameHour
diff --git a/date-fns/src/isSameHour/index.js.flow b/date-fns/src/isSameHour/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameHour/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameHour/index.ts b/date-fns/src/isSameHour/index.ts
new file mode 100644
index 0000000..d6e362e
--- /dev/null
+++ b/date-fns/src/isSameHour/index.ts
@@ -0,0 +1,33 @@
+import startOfHour from '../startOfHour/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameHour
+ * @category Hour Helpers
+ * @summary Are the given dates in the same hour?
+ *
+ * @description
+ * Are the given dates in the same hour?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same hour
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?
+ * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30))
+ * //=> true
+ */
+export default function isSameHour(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeftStartOfHour = startOfHour(dirtyDateLeft)
+ const dateRightStartOfHour = startOfHour(dirtyDateRight)
+
+ return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime()
+}
diff --git a/date-fns/src/isSameHour/test.ts b/date-fns/src/isSameHour/test.ts
new file mode 100644
index 0000000..dbbe3e2
--- /dev/null
+++ b/date-fns/src/isSameHour/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameHour from '.'
+
+describe('isSameHour', function() {
+ it('returns true if the given dates have the same hour', function() {
+ const result = isSameHour(
+ new Date(2014, 8 /* Sep */, 4, 6, 0),
+ new Date(2014, 8 /* Sep */, 4, 6, 30)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different hours', function() {
+ const result = isSameHour(
+ new Date(2014, 8 /* Sep */, 4, 6, 0),
+ new Date(2014, 8 /* Sep */, 4, 5, 0)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameHour(
+ new Date(2014, 8 /* Sep */, 4, 18, 0).getTime(),
+ new Date(2014, 8 /* Sep */, 4, 18, 45).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameHour(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameHour(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameHour(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameHour.bind(null), TypeError)
+ assert.throws(isSameHour.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameISOWeek/benchmark.js b/date-fns/src/isSameISOWeek/benchmark.js
new file mode 100644
index 0000000..51b9a1f
--- /dev/null
+++ b/date-fns/src/isSameISOWeek/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameISOWeek from '.'
+
+suite('isSameISOWeek', function () {
+ benchmark('date-fns', function () {
+ return isSameISOWeek(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/isSameISOWeek/index.d.ts b/date-fns/src/isSameISOWeek/index.d.ts
new file mode 100644
index 0000000..566ed8b
--- /dev/null
+++ b/date-fns/src/isSameISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameISOWeek } from 'date-fns'
+export default isSameISOWeek
diff --git a/date-fns/src/isSameISOWeek/index.js.flow b/date-fns/src/isSameISOWeek/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameISOWeek/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameISOWeek/index.ts b/date-fns/src/isSameISOWeek/index.ts
new file mode 100644
index 0000000..0643dd9
--- /dev/null
+++ b/date-fns/src/isSameISOWeek/index.ts
@@ -0,0 +1,32 @@
+import isSameWeek from '../isSameWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameISOWeek
+ * @category ISO Week Helpers
+ * @summary Are the given dates in the same ISO week?
+ *
+ * @description
+ * Are the given dates in the same ISO week?
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same ISO week
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 1 September 2014 and 7 September 2014 in the same ISO week?
+ * var result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7))
+ * //=> true
+ */
+export default function isSameISOWeek(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ return isSameWeek(dirtyDateLeft, dirtyDateRight, { weekStartsOn: 1 })
+}
diff --git a/date-fns/src/isSameISOWeek/test.ts b/date-fns/src/isSameISOWeek/test.ts
new file mode 100644
index 0000000..a1877ff
--- /dev/null
+++ b/date-fns/src/isSameISOWeek/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameISOWeek from '.'
+
+describe('isSameISOWeek', function() {
+ it('returns true if the given dates have the same ISO week', function() {
+ const result = isSameISOWeek(
+ new Date(2014, 8 /* Sep */, 1),
+ new Date(2014, 8 /* Sep */, 7)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different ISO weeks', function() {
+ const result = isSameISOWeek(
+ new Date(2014, 8 /* Sep */, 1),
+ new Date(2014, 8 /* Sep */, 14)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameISOWeek(
+ new Date(2014, 5 /* Jun */, 30).getTime(),
+ new Date(2014, 6 /* Jul */, 2).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameISOWeek(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameISOWeek(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameISOWeek(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameISOWeek.bind(null), TypeError)
+ assert.throws(isSameISOWeek.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameISOWeekYear/benchmark.js b/date-fns/src/isSameISOWeekYear/benchmark.js
new file mode 100644
index 0000000..ca906f6
--- /dev/null
+++ b/date-fns/src/isSameISOWeekYear/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameISOWeekYear from '.'
+
+suite('isSameISOWeekYear', function () {
+ benchmark('date-fns', function () {
+ return isSameISOWeekYear(this.dateA, this.dateB)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ }
+})
diff --git a/date-fns/src/isSameISOWeekYear/index.d.ts b/date-fns/src/isSameISOWeekYear/index.d.ts
new file mode 100644
index 0000000..e796092
--- /dev/null
+++ b/date-fns/src/isSameISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameISOWeekYear } from 'date-fns'
+export default isSameISOWeekYear
diff --git a/date-fns/src/isSameISOWeekYear/index.js.flow b/date-fns/src/isSameISOWeekYear/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameISOWeekYear/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameISOWeekYear/index.ts b/date-fns/src/isSameISOWeekYear/index.ts
new file mode 100644
index 0000000..bd82edf
--- /dev/null
+++ b/date-fns/src/isSameISOWeekYear/index.ts
@@ -0,0 +1,40 @@
+import startOfISOWeekYear from '../startOfISOWeekYear/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Are the given dates in the same ISO week-numbering year?
+ *
+ * @description
+ * Are the given dates in the same ISO week-numbering year?
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `isSameISOYear` to `isSameISOWeekYear`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same ISO week-numbering year
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year?
+ * var result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2))
+ * //=> true
+ */
+export default function isSameISOWeekYear(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeftStartOfYear = startOfISOWeekYear(dirtyDateLeft)
+ const dateRightStartOfYear = startOfISOWeekYear(dirtyDateRight)
+
+ return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime()
+}
diff --git a/date-fns/src/isSameISOWeekYear/test.ts b/date-fns/src/isSameISOWeekYear/test.ts
new file mode 100644
index 0000000..f5ac28f
--- /dev/null
+++ b/date-fns/src/isSameISOWeekYear/test.ts
@@ -0,0 +1,68 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameISOWeekYear from '.'
+
+describe('isSameISOWeekYear', function() {
+ it('returns true if the given dates have the same ISO week-numbering year', function() {
+ const result = isSameISOWeekYear(
+ new Date(2003, 11 /* Dec */, 29),
+ new Date(2005, 0 /* Jan */, 2)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different ISO week-numbering years', function() {
+ const result = isSameISOWeekYear(
+ new Date(2014, 11 /* Dec */, 28),
+ new Date(2014, 11 /* Dec */, 29)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameISOWeekYear(
+ new Date(2003, 11 /* Dec */, 29).getTime(),
+ new Date(2005, 0 /* Jan */, 2).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('handles dates before 100 AD', function() {
+ const firstDate = new Date(0)
+ firstDate.setFullYear(5, 0 /* Jan */, 1)
+ firstDate.setHours(0, 0, 0, 0)
+ const secondDate = new Date(0)
+ secondDate.setFullYear(5, 0 /* Jan */, 2)
+ secondDate.setHours(0, 0, 0, 0)
+ const result = isSameISOWeekYear(firstDate, secondDate)
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameISOWeekYear(
+ new Date(NaN),
+ new Date(1989, 6 /* Jul */, 10)
+ )
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameISOWeekYear(
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(NaN)
+ )
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameISOWeekYear(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameISOWeekYear.bind(null), TypeError)
+ assert.throws(isSameISOWeekYear.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameMinute/benchmark.js b/date-fns/src/isSameMinute/benchmark.js
new file mode 100644
index 0000000..a9cca50
--- /dev/null
+++ b/date-fns/src/isSameMinute/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameMinute from '.'
+import moment from 'moment'
+
+suite('isSameMinute', function () {
+ benchmark('date-fns', function () {
+ return isSameMinute(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'minute')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameMinute/index.d.ts b/date-fns/src/isSameMinute/index.d.ts
new file mode 100644
index 0000000..c26acef
--- /dev/null
+++ b/date-fns/src/isSameMinute/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameMinute } from 'date-fns'
+export default isSameMinute
diff --git a/date-fns/src/isSameMinute/index.js.flow b/date-fns/src/isSameMinute/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameMinute/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameMinute/index.ts b/date-fns/src/isSameMinute/index.ts
new file mode 100644
index 0000000..0885846
--- /dev/null
+++ b/date-fns/src/isSameMinute/index.ts
@@ -0,0 +1,37 @@
+import startOfMinute from '../startOfMinute/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameMinute
+ * @category Minute Helpers
+ * @summary Are the given dates in the same minute?
+ *
+ * @description
+ * Are the given dates in the same minute?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same minute
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15
+ * // in the same minute?
+ * var result = isSameMinute(
+ * new Date(2014, 8, 4, 6, 30),
+ * new Date(2014, 8, 4, 6, 30, 15)
+ * )
+ * //=> true
+ */
+export default function isSameMinute(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeftStartOfMinute = startOfMinute(dirtyDateLeft)
+ const dateRightStartOfMinute = startOfMinute(dirtyDateRight)
+
+ return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime()
+}
diff --git a/date-fns/src/isSameMinute/test.ts b/date-fns/src/isSameMinute/test.ts
new file mode 100644
index 0000000..a103ed9
--- /dev/null
+++ b/date-fns/src/isSameMinute/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameMinute from '.'
+
+describe('isSameMinute', function() {
+ it('returns true if the given dates have the same minute', function() {
+ const result = isSameMinute(
+ new Date(2014, 8 /* Sep */, 4, 6, 30),
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 15)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different minutes', function() {
+ const result = isSameMinute(
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 59),
+ new Date(2014, 8 /* Sep */, 4, 6, 31)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameMinute(
+ new Date(2014, 8 /* Sep */, 4, 18, 45).getTime(),
+ new Date(2014, 8 /* Sep */, 4, 18, 45, 30).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameMinute(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameMinute(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameMinute(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameMinute.bind(null), TypeError)
+ assert.throws(isSameMinute.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameMonth/benchmark.js b/date-fns/src/isSameMonth/benchmark.js
new file mode 100644
index 0000000..dec2530
--- /dev/null
+++ b/date-fns/src/isSameMonth/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameMonth from '.'
+import moment from 'moment'
+
+suite('isSameMonth', function () {
+ benchmark('date-fns', function () {
+ return isSameMonth(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'month')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameMonth/index.d.ts b/date-fns/src/isSameMonth/index.d.ts
new file mode 100644
index 0000000..bd0e886
--- /dev/null
+++ b/date-fns/src/isSameMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameMonth } from 'date-fns'
+export default isSameMonth
diff --git a/date-fns/src/isSameMonth/index.js.flow b/date-fns/src/isSameMonth/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameMonth/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameMonth/index.ts b/date-fns/src/isSameMonth/index.ts
new file mode 100644
index 0000000..65058b1
--- /dev/null
+++ b/date-fns/src/isSameMonth/index.ts
@@ -0,0 +1,35 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameMonth
+ * @category Month Helpers
+ * @summary Are the given dates in the same month?
+ *
+ * @description
+ * Are the given dates in the same month?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same month
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 2 September 2014 and 25 September 2014 in the same month?
+ * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
+ * //=> true
+ */
+export default function isSameMonth(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+ return (
+ dateLeft.getFullYear() === dateRight.getFullYear() &&
+ dateLeft.getMonth() === dateRight.getMonth()
+ )
+}
diff --git a/date-fns/src/isSameMonth/test.ts b/date-fns/src/isSameMonth/test.ts
new file mode 100644
index 0000000..23a8152
--- /dev/null
+++ b/date-fns/src/isSameMonth/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameMonth from '.'
+
+describe('isSameMonth', function() {
+ it('returns true if the given dates have the same month (and year)', function() {
+ const result = isSameMonth(
+ new Date(2014, 8 /* Sep */, 2),
+ new Date(2014, 8 /* Sep */, 25)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different months', function() {
+ const result = isSameMonth(
+ new Date(2014, 8 /* Sep */, 2),
+ new Date(2013, 8 /* Sep */, 25)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameMonth(
+ new Date(2014, 8 /* Sep */, 2).getTime(),
+ new Date(2014, 8 /* Sep */, 25).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameMonth(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameMonth(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameMonth(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameMonth.bind(null), TypeError)
+ assert.throws(isSameMonth.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameQuarter/benchmark.js b/date-fns/src/isSameQuarter/benchmark.js
new file mode 100644
index 0000000..ad6b2f4
--- /dev/null
+++ b/date-fns/src/isSameQuarter/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameQuarter from '.'
+import moment from 'moment'
+
+suite('isSameQuarter', function () {
+ benchmark('date-fns', function () {
+ return isSameQuarter(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'quarter')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameQuarter/index.d.ts b/date-fns/src/isSameQuarter/index.d.ts
new file mode 100644
index 0000000..584660a
--- /dev/null
+++ b/date-fns/src/isSameQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameQuarter } from 'date-fns'
+export default isSameQuarter
diff --git a/date-fns/src/isSameQuarter/index.js.flow b/date-fns/src/isSameQuarter/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameQuarter/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameQuarter/index.ts b/date-fns/src/isSameQuarter/index.ts
new file mode 100644
index 0000000..84d84d4
--- /dev/null
+++ b/date-fns/src/isSameQuarter/index.ts
@@ -0,0 +1,33 @@
+import startOfQuarter from '../startOfQuarter/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameQuarter
+ * @category Quarter Helpers
+ * @summary Are the given dates in the same year quarter?
+ *
+ * @description
+ * Are the given dates in the same year quarter?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same quarter
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 1 January 2014 and 8 March 2014 in the same quarter?
+ * var result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))
+ * //=> true
+ */
+export default function isSameQuarter(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeftStartOfQuarter = startOfQuarter(dirtyDateLeft)
+ const dateRightStartOfQuarter = startOfQuarter(dirtyDateRight)
+
+ return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime()
+}
diff --git a/date-fns/src/isSameQuarter/test.ts b/date-fns/src/isSameQuarter/test.ts
new file mode 100644
index 0000000..67fd437
--- /dev/null
+++ b/date-fns/src/isSameQuarter/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameQuarter from '.'
+
+describe('isSameQuarter', function() {
+ it('returns true if the given dates have the same quarter (and year)', function() {
+ const result = isSameQuarter(
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2014, 2 /* Mar */, 8)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different quarters', function() {
+ const result = isSameQuarter(
+ new Date(2014, 0 /* Jan */, 1),
+ new Date(2013, 8 /* Sep */, 25)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameQuarter(
+ new Date(2014, 6 /* Jul */, 2).getTime(),
+ new Date(2014, 8 /* Sep */, 25).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameQuarter(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameQuarter(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameQuarter(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameQuarter.bind(null), TypeError)
+ assert.throws(isSameQuarter.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameSecond/benchmark.js b/date-fns/src/isSameSecond/benchmark.js
new file mode 100644
index 0000000..2bc1b69
--- /dev/null
+++ b/date-fns/src/isSameSecond/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameSecond from '.'
+import moment from 'moment'
+
+suite('isSameSecond', function () {
+ benchmark('date-fns', function () {
+ return isSameSecond(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'second')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameSecond/index.d.ts b/date-fns/src/isSameSecond/index.d.ts
new file mode 100644
index 0000000..982464e
--- /dev/null
+++ b/date-fns/src/isSameSecond/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameSecond } from 'date-fns'
+export default isSameSecond
diff --git a/date-fns/src/isSameSecond/index.js.flow b/date-fns/src/isSameSecond/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameSecond/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameSecond/index.ts b/date-fns/src/isSameSecond/index.ts
new file mode 100644
index 0000000..cc53cf4
--- /dev/null
+++ b/date-fns/src/isSameSecond/index.ts
@@ -0,0 +1,37 @@
+import startOfSecond from '../startOfSecond/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameSecond
+ * @category Second Helpers
+ * @summary Are the given dates in the same second?
+ *
+ * @description
+ * Are the given dates in the same second?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same second
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500
+ * // in the same second?
+ * var result = isSameSecond(
+ * new Date(2014, 8, 4, 6, 30, 15),
+ * new Date(2014, 8, 4, 6, 30, 15, 500)
+ * )
+ * //=> true
+ */
+export default function isSameSecond(dirtyDateLeft: Date | number, dirtyDateRight: Date | number): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeftStartOfSecond = startOfSecond(dirtyDateLeft)
+ const dateRightStartOfSecond = startOfSecond(dirtyDateRight)
+
+ return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime()
+}
diff --git a/date-fns/src/isSameSecond/test.ts b/date-fns/src/isSameSecond/test.ts
new file mode 100644
index 0000000..4a23595
--- /dev/null
+++ b/date-fns/src/isSameSecond/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameSecond from '.'
+
+describe('isSameSecond', function() {
+ it('returns true if the given dates have the same second', function() {
+ const result = isSameSecond(
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 15),
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 15, 500)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different seconds', function() {
+ const result = isSameSecond(
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 58, 999),
+ new Date(2014, 8 /* Sep */, 4, 6, 30, 59)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameSecond(
+ new Date(2014, 8 /* Sep */, 4, 18, 45, 30).getTime(),
+ new Date(2014, 8 /* Sep */, 4, 18, 45, 30, 400).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameSecond(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameSecond(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameSecond(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameSecond.bind(null), TypeError)
+ assert.throws(isSameSecond.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameWeek/benchmark.js b/date-fns/src/isSameWeek/benchmark.js
new file mode 100644
index 0000000..55eabd5
--- /dev/null
+++ b/date-fns/src/isSameWeek/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameWeek from '.'
+import moment from 'moment'
+
+suite('isSameWeek', function () {
+ benchmark('date-fns', function () {
+ return isSameWeek(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'week')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameWeek/index.d.ts b/date-fns/src/isSameWeek/index.d.ts
new file mode 100644
index 0000000..b27f5f6
--- /dev/null
+++ b/date-fns/src/isSameWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameWeek } from 'date-fns'
+export default isSameWeek
diff --git a/date-fns/src/isSameWeek/index.js.flow b/date-fns/src/isSameWeek/index.js.flow
new file mode 100644
index 0000000..2ba3f16
--- /dev/null
+++ b/date-fns/src/isSameWeek/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => boolean
diff --git a/date-fns/src/isSameWeek/index.ts b/date-fns/src/isSameWeek/index.ts
new file mode 100644
index 0000000..692d8b7
--- /dev/null
+++ b/date-fns/src/isSameWeek/index.ts
@@ -0,0 +1,50 @@
+import startOfWeek from '../startOfWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { WeekStartOptions, LocaleOptions } from '../types'
+
+/**
+ * @name isSameWeek
+ * @category Week Helpers
+ * @summary Are the given dates in the same week?
+ *
+ * @description
+ * Are the given dates in the same week?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Boolean} the dates are in the same week
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // Are 31 August 2014 and 4 September 2014 in the same week?
+ * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))
+ * //=> true
+ *
+ * @example
+ * // If week starts with Monday,
+ * // are 31 August 2014 and 4 September 2014 in the same week?
+ * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {
+ * weekStartsOn: 1
+ * })
+ * //=> false
+ */
+export default function isSameWeek(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number,
+ dirtyOptions?: LocaleOptions & WeekStartOptions
+): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeftStartOfWeek = startOfWeek(dirtyDateLeft, dirtyOptions)
+ const dateRightStartOfWeek = startOfWeek(dirtyDateRight, dirtyOptions)
+
+ return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime()
+}
diff --git a/date-fns/src/isSameWeek/test.ts b/date-fns/src/isSameWeek/test.ts
new file mode 100644
index 0000000..26f5a02
--- /dev/null
+++ b/date-fns/src/isSameWeek/test.ts
@@ -0,0 +1,109 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameWeek from '.'
+
+describe('isSameWeek', function() {
+ it('returns true if the given dates have the same week', function() {
+ const result = isSameWeek(
+ new Date(2014, 7 /* Aug */, 31),
+ new Date(2014, 8 /* Sep */, 4)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different weeks', function() {
+ const result = isSameWeek(
+ new Date(2014, 7 /* Aug */, 30),
+ new Date(2014, 8 /* Sep */, 4)
+ )
+ assert(result === false)
+ })
+
+ it('allows to specify which day is the first day of the week', function() {
+ const result = isSameWeek(
+ new Date(2014, 7 /* Aug */, 31),
+ new Date(2014, 8 /* Sep */, 4),
+ { weekStartsOn: 1 }
+ )
+ assert(result === false)
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function() {
+ const result = isSameWeek(
+ new Date(2014, 7 /* Aug */, 31),
+ new Date(2014, 8 /* Sep */, 4),
+ {
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 1 }
+ }
+ }
+ )
+ assert(result === false)
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ const result = isSameWeek(
+ new Date(2014, 7 /* Aug */, 31),
+ new Date(2014, 8 /* Sep */, 4),
+ {
+ weekStartsOn: 1,
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 0 }
+ }
+ }
+ )
+ assert(result === false)
+ })
+
+ it('implicitly converts options', function() {
+ const result = isSameWeek(
+ new Date(2014, 7 /* Aug */, 31),
+ new Date(2014, 8 /* Sep */, 4),
+ // @ts-expect-error
+ { weekStartsOn: '1' }
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSameWeek(
+ new Date(2014, 7 /* Aug */, 31).getTime(),
+ new Date(2014, 8 /* Sep */, 4).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function() {
+ const result = isSameWeek(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function() {
+ const result = isSameWeek(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function() {
+ const result = isSameWeek(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ const block = isSameWeek.bind(
+ null,
+ new Date(2014, 7 /* Aug */, 31),
+ new Date(2014, 8 /* Sep */, 4),
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(isSameWeek.bind(null), TypeError)
+ assert.throws(isSameWeek.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSameYear/benchmark.js b/date-fns/src/isSameYear/benchmark.js
new file mode 100644
index 0000000..751ce3c
--- /dev/null
+++ b/date-fns/src/isSameYear/benchmark.js
@@ -0,0 +1,23 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSameYear from '.'
+import moment from 'moment'
+
+suite('isSameYear', function () {
+ benchmark('date-fns', function () {
+ return isSameYear(this.dateA, this.dateB)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isSame(this.momentB, 'year')
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isSameYear/index.d.ts b/date-fns/src/isSameYear/index.d.ts
new file mode 100644
index 0000000..c729e19
--- /dev/null
+++ b/date-fns/src/isSameYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSameYear } from 'date-fns'
+export default isSameYear
diff --git a/date-fns/src/isSameYear/index.js.flow b/date-fns/src/isSameYear/index.js.flow
new file mode 100644
index 0000000..55ea578
--- /dev/null
+++ b/date-fns/src/isSameYear/index.js.flow
@@ -0,0 +1,55 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateLeft: Date | number,
+ dateRight: Date | number
+) => boolean
diff --git a/date-fns/src/isSameYear/index.ts b/date-fns/src/isSameYear/index.ts
new file mode 100644
index 0000000..8c0f4e5
--- /dev/null
+++ b/date-fns/src/isSameYear/index.ts
@@ -0,0 +1,35 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSameYear
+ * @category Year Helpers
+ * @summary Are the given dates in the same year?
+ *
+ * @description
+ * Are the given dates in the same year?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} dateLeft - the first date to check
+ * @param {Date|Number} dateRight - the second date to check
+ * @returns {Boolean} the dates are in the same year
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Are 2 September 2014 and 25 September 2014 in the same year?
+ * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
+ * //=> true
+ */
+export default function isSameYear(
+ dirtyDateLeft: Date | number,
+ dirtyDateRight: Date | number
+): boolean {
+ requiredArgs(2, arguments)
+
+ const dateLeft = toDate(dirtyDateLeft)
+ const dateRight = toDate(dirtyDateRight)
+ return dateLeft.getFullYear() === dateRight.getFullYear()
+}
diff --git a/date-fns/src/isSameYear/test.ts b/date-fns/src/isSameYear/test.ts
new file mode 100644
index 0000000..1348827
--- /dev/null
+++ b/date-fns/src/isSameYear/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSameYear from '.'
+
+describe('isSameYear', function () {
+ it('returns true if the given dates have the same year', function () {
+ const result = isSameYear(
+ new Date(2014, 8 /* Sep */, 2),
+ new Date(2014, 8 /* Sep */, 25)
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the given dates have different years', function () {
+ const result = isSameYear(
+ new Date(2014, 8 /* Sep */, 2),
+ new Date(2013, 8 /* Sep */, 25)
+ )
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function () {
+ const result = isSameYear(
+ new Date(2014, 8 /* Sep */, 2).getTime(),
+ new Date(2014, 8 /* Sep */, 25).getTime()
+ )
+ assert(result === true)
+ })
+
+ it('returns false if the first date is `Invalid Date`', function () {
+ const result = isSameYear(new Date(NaN), new Date(1989, 6 /* Jul */, 10))
+ assert(result === false)
+ })
+
+ it('returns false if the second date is `Invalid Date`', function () {
+ const result = isSameYear(new Date(1987, 1 /* Feb */, 11), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('returns false if the both dates are `Invalid Date`', function () {
+ const result = isSameYear(new Date(NaN), new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(isSameYear.bind(null), TypeError)
+ assert.throws(isSameYear.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isSaturday/benchmark.js b/date-fns/src/isSaturday/benchmark.js
new file mode 100644
index 0000000..336f2fc
--- /dev/null
+++ b/date-fns/src/isSaturday/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSaturday from '.'
+
+suite('isSaturday', function () {
+ benchmark('date-fns', function () {
+ return isSaturday(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isSaturday/index.d.ts b/date-fns/src/isSaturday/index.d.ts
new file mode 100644
index 0000000..ac5ccb3
--- /dev/null
+++ b/date-fns/src/isSaturday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSaturday } from 'date-fns'
+export default isSaturday
diff --git a/date-fns/src/isSaturday/index.js.flow b/date-fns/src/isSaturday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isSaturday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isSaturday/index.ts b/date-fns/src/isSaturday/index.ts
new file mode 100644
index 0000000..5195c40
--- /dev/null
+++ b/date-fns/src/isSaturday/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSaturday
+ * @category Weekday Helpers
+ * @summary Is the given date Saturday?
+ *
+ * @description
+ * Is the given date Saturday?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is Saturday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 27 September 2014 Saturday?
+ * var result = isSaturday(new Date(2014, 8, 27))
+ * //=> true
+ */
+export default function isSaturday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getDay() === 6
+}
diff --git a/date-fns/src/isSaturday/test.ts b/date-fns/src/isSaturday/test.ts
new file mode 100644
index 0000000..223d775
--- /dev/null
+++ b/date-fns/src/isSaturday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSaturday from '.'
+
+describe('isSaturday', function() {
+ it('returns true if the given date is Saturday', function() {
+ const result = isSaturday(new Date(2014, 8 /* Sep */, 27))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Saturday', function() {
+ const result = isSaturday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSaturday(new Date(2014, 1 /* Feb */, 15).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isSaturday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isSaturday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isSunday/benchmark.js b/date-fns/src/isSunday/benchmark.js
new file mode 100644
index 0000000..9b65eb2
--- /dev/null
+++ b/date-fns/src/isSunday/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isSunday from '.'
+
+suite('isSunday', function () {
+ benchmark('date-fns', function () {
+ return isSunday(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isSunday/index.d.ts b/date-fns/src/isSunday/index.d.ts
new file mode 100644
index 0000000..5830086
--- /dev/null
+++ b/date-fns/src/isSunday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isSunday } from 'date-fns'
+export default isSunday
diff --git a/date-fns/src/isSunday/index.js.flow b/date-fns/src/isSunday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isSunday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isSunday/index.ts b/date-fns/src/isSunday/index.ts
new file mode 100644
index 0000000..cc3eba7
--- /dev/null
+++ b/date-fns/src/isSunday/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isSunday
+ * @category Weekday Helpers
+ * @summary Is the given date Sunday?
+ *
+ * @description
+ * Is the given date Sunday?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is Sunday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 21 September 2014 Sunday?
+ * var result = isSunday(new Date(2014, 8, 21))
+ * //=> true
+ */
+export default function isSunday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getDay() === 0
+}
diff --git a/date-fns/src/isSunday/test.ts b/date-fns/src/isSunday/test.ts
new file mode 100644
index 0000000..8e68e20
--- /dev/null
+++ b/date-fns/src/isSunday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isSunday from '.'
+
+describe('isSunday', function() {
+ it('returns true if the given date is Sunday', function() {
+ const result = isSunday(new Date(2014, 8 /* Sep */, 21))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Sunday', function() {
+ const result = isSunday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isSunday(new Date(2014, 1 /* Feb */, 9).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isSunday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isSunday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisHour/benchmark.js b/date-fns/src/isThisHour/benchmark.js
new file mode 100644
index 0000000..6f52e52
--- /dev/null
+++ b/date-fns/src/isThisHour/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+
+/* global suite, benchmark */
+
+import isThisHour from '.'
+
+suite(
+ 'isThisHour',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisHour(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisHour/index.d.ts b/date-fns/src/isThisHour/index.d.ts
new file mode 100644
index 0000000..1009e42
--- /dev/null
+++ b/date-fns/src/isThisHour/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisHour } from 'date-fns'
+export default isThisHour
diff --git a/date-fns/src/isThisHour/index.js.flow b/date-fns/src/isThisHour/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThisHour/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThisHour/index.ts b/date-fns/src/isThisHour/index.ts
new file mode 100644
index 0000000..976be6d
--- /dev/null
+++ b/date-fns/src/isThisHour/index.ts
@@ -0,0 +1,34 @@
+import isSameHour from '../isSameHour/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThisHour
+ * @category Hour Helpers
+ * @summary Is the given date in the same hour as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same hour as the current date?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in this hour
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If now is 25 September 2014 18:30:15.500,
+ * // is 25 September 2014 18:00:00 in this hour?
+ * var result = isThisHour(new Date(2014, 8, 25, 18))
+ * //=> true
+ */
+export default function isThisHour(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameHour(Date.now(), dirtyDate)
+}
diff --git a/date-fns/src/isThisHour/test.ts b/date-fns/src/isThisHour/test.ts
new file mode 100644
index 0000000..ec82710
--- /dev/null
+++ b/date-fns/src/isThisHour/test.ts
@@ -0,0 +1,39 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisHour from '.'
+
+describe('isThisHour', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 18, 30, 15, 500).getTime()
+ )
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same hour', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18)
+ assert(isThisHour(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different hours', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 19)
+ assert(isThisHour(date) === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18, 45).getTime()
+ assert(isThisHour(date) === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(isThisHour.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisISOWeek/benchmark.js b/date-fns/src/isThisISOWeek/benchmark.js
new file mode 100644
index 0000000..d036d61
--- /dev/null
+++ b/date-fns/src/isThisISOWeek/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+
+/* global suite, benchmark */
+
+import isThisISOWeek from '.'
+
+suite(
+ 'isThisISOWeek',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisISOWeek(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisISOWeek/index.d.ts b/date-fns/src/isThisISOWeek/index.d.ts
new file mode 100644
index 0000000..4fb42e8
--- /dev/null
+++ b/date-fns/src/isThisISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisISOWeek } from 'date-fns'
+export default isThisISOWeek
diff --git a/date-fns/src/isThisISOWeek/index.js.flow b/date-fns/src/isThisISOWeek/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThisISOWeek/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThisISOWeek/index.ts b/date-fns/src/isThisISOWeek/index.ts
new file mode 100644
index 0000000..6841b50
--- /dev/null
+++ b/date-fns/src/isThisISOWeek/index.ts
@@ -0,0 +1,36 @@
+import isSameISOWeek from '../isSameISOWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThisISOWeek
+ * @category ISO Week Helpers
+ * @summary Is the given date in the same ISO week as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same ISO week as the current date?
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in this ISO week
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 25 September 2014, is 22 September 2014 in this ISO week?
+ * var result = isThisISOWeek(new Date(2014, 8, 22))
+ * //=> true
+ */
+
+export default function isThisISOWeek(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameISOWeek(dirtyDate, Date.now())
+}
diff --git a/date-fns/src/isThisISOWeek/test.ts b/date-fns/src/isThisISOWeek/test.ts
new file mode 100644
index 0000000..0fe319e
--- /dev/null
+++ b/date-fns/src/isThisISOWeek/test.ts
@@ -0,0 +1,36 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisISOWeek from '.'
+
+describe('isSameISOWeek', () => {
+ let clock
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same ISO week', () => {
+ const date = new Date(2014, 8 /* Sep */, 22)
+ assert(isThisISOWeek(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different ISO weeks', () => {
+ const date = new Date(2014, 8 /* Sep */, 21)
+ assert(isThisISOWeek(date) === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 8 /* Sep */, 29).getTime()
+ assert(isThisISOWeek(date) === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isThisISOWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisMinute/benchmark.js b/date-fns/src/isThisMinute/benchmark.js
new file mode 100644
index 0000000..9801f3a
--- /dev/null
+++ b/date-fns/src/isThisMinute/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+
+/* global suite, benchmark */
+
+import isThisMinute from '.'
+
+suite(
+ 'isThisMinute',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisMinute(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisMinute/index.d.ts b/date-fns/src/isThisMinute/index.d.ts
new file mode 100644
index 0000000..ca1430d
--- /dev/null
+++ b/date-fns/src/isThisMinute/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisMinute } from 'date-fns'
+export default isThisMinute
diff --git a/date-fns/src/isThisMinute/index.js.flow b/date-fns/src/isThisMinute/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThisMinute/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThisMinute/index.ts b/date-fns/src/isThisMinute/index.ts
new file mode 100644
index 0000000..0606945
--- /dev/null
+++ b/date-fns/src/isThisMinute/index.ts
@@ -0,0 +1,35 @@
+import isSameMinute from '../isSameMinute/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThisMinute
+ * @category Minute Helpers
+ * @summary Is the given date in the same minute as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same minute as the current date?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in this minute
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If now is 25 September 2014 18:30:15.500,
+ * // is 25 September 2014 18:30:00 in this minute?
+ * var result = isThisMinute(new Date(2014, 8, 25, 18, 30))
+ * //=> true
+ */
+
+export default function isThisMinute(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameMinute(Date.now(), dirtyDate)
+}
diff --git a/date-fns/src/isThisMinute/test.ts b/date-fns/src/isThisMinute/test.ts
new file mode 100644
index 0000000..e395020
--- /dev/null
+++ b/date-fns/src/isThisMinute/test.ts
@@ -0,0 +1,39 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisMinute from '.'
+
+describe('isThisMinute', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 18, 30, 15, 500).getTime()
+ )
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same minute', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18, 30)
+ assert(isThisMinute(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different minutes', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18, 31)
+ assert(isThisMinute(date) === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18, 30, 30).getTime()
+ assert(isThisMinute(date) === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(isThisMinute.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisMonth/benchmark.js b/date-fns/src/isThisMonth/benchmark.js
new file mode 100644
index 0000000..d3deed0
--- /dev/null
+++ b/date-fns/src/isThisMonth/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+
+/* global suite, benchmark */
+
+import isThisMonth from '.'
+
+suite(
+ 'isThisMonth',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisMonth(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisMonth/index.d.ts b/date-fns/src/isThisMonth/index.d.ts
new file mode 100644
index 0000000..eaf72fd
--- /dev/null
+++ b/date-fns/src/isThisMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisMonth } from 'date-fns'
+export default isThisMonth
diff --git a/date-fns/src/isThisMonth/index.js.flow b/date-fns/src/isThisMonth/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThisMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThisMonth/index.ts b/date-fns/src/isThisMonth/index.ts
new file mode 100644
index 0000000..3079dc1
--- /dev/null
+++ b/date-fns/src/isThisMonth/index.ts
@@ -0,0 +1,34 @@
+import isSameMonth from '../isSameMonth/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThisMonth
+ * @category Month Helpers
+ * @summary Is the given date in the same month as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same month as the current date?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in this month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 25 September 2014, is 15 September 2014 in this month?
+ * var result = isThisMonth(new Date(2014, 8, 15))
+ * //=> true
+ */
+
+export default function isThisMonth(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameMonth(Date.now(), dirtyDate)
+}
diff --git a/date-fns/src/isThisMonth/test.ts b/date-fns/src/isThisMonth/test.ts
new file mode 100644
index 0000000..4c9d651
--- /dev/null
+++ b/date-fns/src/isThisMonth/test.ts
@@ -0,0 +1,37 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisMonth from '.'
+
+describe('isThisMonth', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same month (and year)', () => {
+ const date = new Date(2014, 8 /* Sep */, 15)
+ assert(isThisMonth(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different months', () => {
+ const date = new Date(2013, 7 /* Aug */, 31)
+ assert(isThisMonth(date) === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 8 /* Sep */, 30).getTime()
+ assert(isThisMonth(date) === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(isThisMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisQuarter/benchmark.js b/date-fns/src/isThisQuarter/benchmark.js
new file mode 100644
index 0000000..2c0db5c
--- /dev/null
+++ b/date-fns/src/isThisQuarter/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+
+/* global suite, benchmark */
+
+import isThisQuarter from '.'
+
+suite(
+ 'isThisQuarter',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisQuarter(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisQuarter/index.d.ts b/date-fns/src/isThisQuarter/index.d.ts
new file mode 100644
index 0000000..8c25708
--- /dev/null
+++ b/date-fns/src/isThisQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisQuarter } from 'date-fns'
+export default isThisQuarter
diff --git a/date-fns/src/isThisQuarter/index.js.flow b/date-fns/src/isThisQuarter/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThisQuarter/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThisQuarter/index.ts b/date-fns/src/isThisQuarter/index.ts
new file mode 100644
index 0000000..2d22060
--- /dev/null
+++ b/date-fns/src/isThisQuarter/index.ts
@@ -0,0 +1,33 @@
+import isSameQuarter from '../isSameQuarter/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThisQuarter
+ * @category Quarter Helpers
+ * @summary Is the given date in the same quarter as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same quarter as the current date?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in this quarter
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 25 September 2014, is 2 July 2014 in this quarter?
+ * var result = isThisQuarter(new Date(2014, 6, 2))
+ * //=> true
+ */
+export default function isThisQuarter(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameQuarter(Date.now(), dirtyDate)
+}
diff --git a/date-fns/src/isThisQuarter/test.ts b/date-fns/src/isThisQuarter/test.ts
new file mode 100644
index 0000000..1a4b77f
--- /dev/null
+++ b/date-fns/src/isThisQuarter/test.ts
@@ -0,0 +1,37 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisQuarter from '.'
+
+describe('isThisQuarter', function() {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(function() {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(function() {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same quarter (and year)', function() {
+ const date = new Date(2014, 6 /* Jul */, 2)
+ assert(isThisQuarter(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different quarters', function() {
+ const date = new Date(2014, 1 /* Feb */, 11)
+ assert(isThisQuarter(date) === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 6 /* Jul */, 2).getTime()
+ assert(isThisQuarter(date) === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(isThisQuarter.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisSecond/benchmark.js b/date-fns/src/isThisSecond/benchmark.js
new file mode 100644
index 0000000..4fd274b
--- /dev/null
+++ b/date-fns/src/isThisSecond/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+
+/* global suite, benchmark */
+
+import isThisSecond from '.'
+
+suite(
+ 'isThisSecond',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisSecond(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisSecond/index.d.ts b/date-fns/src/isThisSecond/index.d.ts
new file mode 100644
index 0000000..9d45da1
--- /dev/null
+++ b/date-fns/src/isThisSecond/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisSecond } from 'date-fns'
+export default isThisSecond
diff --git a/date-fns/src/isThisSecond/index.js.flow b/date-fns/src/isThisSecond/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThisSecond/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThisSecond/index.ts b/date-fns/src/isThisSecond/index.ts
new file mode 100644
index 0000000..61488c6
--- /dev/null
+++ b/date-fns/src/isThisSecond/index.ts
@@ -0,0 +1,34 @@
+import isSameSecond from '../isSameSecond/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThisSecond
+ * @category Second Helpers
+ * @summary Is the given date in the same second as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same second as the current date?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in this second
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If now is 25 September 2014 18:30:15.500,
+ * // is 25 September 2014 18:30:15.000 in this second?
+ * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))
+ * //=> true
+ */
+export default function isThisSecond(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameSecond(Date.now(), dirtyDate)
+}
diff --git a/date-fns/src/isThisSecond/test.ts b/date-fns/src/isThisSecond/test.ts
new file mode 100644
index 0000000..125542a
--- /dev/null
+++ b/date-fns/src/isThisSecond/test.ts
@@ -0,0 +1,39 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisSecond from '.'
+
+describe('isThisSecond', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 18, 30, 15, 500).getTime()
+ )
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same second', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18, 30, 15)
+ assert(isThisSecond(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different seconds', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18, 30, 16)
+ assert(isThisSecond(date) === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 8 /* Sep */, 25, 18, 30, 15, 250).getTime()
+ assert(isThisSecond(date) === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(isThisSecond.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisWeek/benchmark.js b/date-fns/src/isThisWeek/benchmark.js
new file mode 100644
index 0000000..ac9676f
--- /dev/null
+++ b/date-fns/src/isThisWeek/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+
+/* global suite, benchmark */
+
+import isThisWeek from '.'
+
+suite(
+ 'isThisWeek',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisWeek(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisWeek/index.d.ts b/date-fns/src/isThisWeek/index.d.ts
new file mode 100644
index 0000000..b22ba53
--- /dev/null
+++ b/date-fns/src/isThisWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisWeek } from 'date-fns'
+export default isThisWeek
diff --git a/date-fns/src/isThisWeek/index.js.flow b/date-fns/src/isThisWeek/index.js.flow
new file mode 100644
index 0000000..579c74a
--- /dev/null
+++ b/date-fns/src/isThisWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => boolean
diff --git a/date-fns/src/isThisWeek/index.ts b/date-fns/src/isThisWeek/index.ts
new file mode 100644
index 0000000..4d08327
--- /dev/null
+++ b/date-fns/src/isThisWeek/index.ts
@@ -0,0 +1,48 @@
+import isSameWeek from '../isSameWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, WeekStartOptions } from '../types'
+
+/**
+ * @name isThisWeek
+ * @category Week Helpers
+ * @summary Is the given date in the same week as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same week as the current date?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @param {Object} [options] - the object with options
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Boolean} the date is in this week
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // If today is 25 September 2014, is 21 September 2014 in this week?
+ * var result = isThisWeek(new Date(2014, 8, 21))
+ * //=> true
+ *
+ * @example
+ * // If today is 25 September 2014 and week starts with Monday
+ * // is 21 September 2014 in this week?
+ * var result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 })
+ * //=> false
+ */
+
+export default function isThisWeek(
+ dirtyDate: Date | number,
+ options?: LocaleOptions & WeekStartOptions
+): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameWeek(dirtyDate, Date.now(), options)
+}
diff --git a/date-fns/src/isThisWeek/test.ts b/date-fns/src/isThisWeek/test.ts
new file mode 100644
index 0000000..e6e323d
--- /dev/null
+++ b/date-fns/src/isThisWeek/test.ts
@@ -0,0 +1,42 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisWeek from '.'
+
+describe('isThisWeek', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same week', () => {
+ const date = new Date(2014, 8 /* Sep */, 21)
+ assert(isThisWeek(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different weeks', () => {
+ const date = new Date(2014, 8 /* Sep */, 29)
+ assert(isThisWeek(date) === false)
+ })
+
+ it('allows to specify which day is the first day of the week', () => {
+ const date = new Date(2014, 8 /* Sep */, 28)
+ assert(isThisWeek(date, { weekStartsOn: 1 }) === true)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 8 /* Sep */, 21).getTime()
+ assert(isThisWeek(date) === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(isThisWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThisYear/benchmark.js b/date-fns/src/isThisYear/benchmark.js
new file mode 100644
index 0000000..7dab3f6
--- /dev/null
+++ b/date-fns/src/isThisYear/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isThisYear from '.'
+
+suite(
+ 'isThisYear',
+ () => {
+ benchmark('date-fns', function() {
+ return isThisYear(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isThisYear/index.d.ts b/date-fns/src/isThisYear/index.d.ts
new file mode 100644
index 0000000..b95f1be
--- /dev/null
+++ b/date-fns/src/isThisYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThisYear } from 'date-fns'
+export default isThisYear
diff --git a/date-fns/src/isThisYear/index.js.flow b/date-fns/src/isThisYear/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThisYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThisYear/index.ts b/date-fns/src/isThisYear/index.ts
new file mode 100644
index 0000000..bcab724
--- /dev/null
+++ b/date-fns/src/isThisYear/index.ts
@@ -0,0 +1,33 @@
+import isSameYear from '../isSameYear/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThisYear
+ * @category Year Helpers
+ * @summary Is the given date in the same year as the current date?
+ * @pure false
+ *
+ * @description
+ * Is the given date in the same year as the current date?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is in this year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 25 September 2014, is 2 July 2014 in this year?
+ * var result = isThisYear(new Date(2014, 6, 2))
+ * //=> true
+ */
+export default function isThisYear(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameYear(dirtyDate, Date.now())
+}
diff --git a/date-fns/src/isThisYear/test.ts b/date-fns/src/isThisYear/test.ts
new file mode 100644
index 0000000..8e9bc79
--- /dev/null
+++ b/date-fns/src/isThisYear/test.ts
@@ -0,0 +1,37 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isThisYear from '.'
+
+describe('isThisYear', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date and the current date have the same year', () => {
+ const date = new Date(2014, 6 /* Jul */, 2)
+ assert(isThisYear(date) === true)
+ })
+
+ it('returns false if the given date and the current date have different years', () => {
+ const date = new Date(2015, 6 /* Jul */, 2)
+ assert(isThisYear(date) === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 6 /* Jul */, 2).getTime()
+ assert(isThisYear(date) === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(isThisYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isThursday/benchmark.js b/date-fns/src/isThursday/benchmark.js
new file mode 100644
index 0000000..0f86b64
--- /dev/null
+++ b/date-fns/src/isThursday/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isThursday from '.'
+
+suite('isThursday', function () {
+ benchmark('date-fns', function () {
+ return isThursday(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isThursday/index.d.ts b/date-fns/src/isThursday/index.d.ts
new file mode 100644
index 0000000..2f25237
--- /dev/null
+++ b/date-fns/src/isThursday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isThursday } from 'date-fns'
+export default isThursday
diff --git a/date-fns/src/isThursday/index.js.flow b/date-fns/src/isThursday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isThursday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isThursday/index.ts b/date-fns/src/isThursday/index.ts
new file mode 100644
index 0000000..bb35618
--- /dev/null
+++ b/date-fns/src/isThursday/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isThursday
+ * @category Weekday Helpers
+ * @summary Is the given date Thursday?
+ *
+ * @description
+ * Is the given date Thursday?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is Thursday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 25 September 2014 Thursday?
+ * var result = isThursday(new Date(2014, 8, 25))
+ * //=> true
+ */
+export default function isThursday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getDay() === 4
+}
diff --git a/date-fns/src/isThursday/test.ts b/date-fns/src/isThursday/test.ts
new file mode 100644
index 0000000..a51bf0f
--- /dev/null
+++ b/date-fns/src/isThursday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isThursday from '.'
+
+describe('isThursday', function() {
+ it('returns true if the given date is Thursday', function() {
+ const result = isThursday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Thursday', function() {
+ const result = isThursday(new Date(2014, 8 /* Sep */, 24))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isThursday(new Date(2014, 1 /* Feb */, 13).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isThursday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isThursday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isToday/benchmark.js b/date-fns/src/isToday/benchmark.js
new file mode 100644
index 0000000..e31d41a
--- /dev/null
+++ b/date-fns/src/isToday/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isToday from '.'
+
+suite(
+ 'isToday',
+ () => {
+ benchmark('date-fns', function() {
+ return isToday(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isToday/index.d.ts b/date-fns/src/isToday/index.d.ts
new file mode 100644
index 0000000..ed0cd15
--- /dev/null
+++ b/date-fns/src/isToday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isToday } from 'date-fns'
+export default isToday
diff --git a/date-fns/src/isToday/index.js.flow b/date-fns/src/isToday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isToday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isToday/index.ts b/date-fns/src/isToday/index.ts
new file mode 100644
index 0000000..91514d1
--- /dev/null
+++ b/date-fns/src/isToday/index.ts
@@ -0,0 +1,33 @@
+import isSameDay from '../isSameDay/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isToday
+ * @category Day Helpers
+ * @summary Is the given date today?
+ * @pure false
+ *
+ * @description
+ * Is the given date today?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is today
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 6 October 2014, is 6 October 14:00:00 today?
+ * var result = isToday(new Date(2014, 9, 6, 14, 0))
+ * //=> true
+ */
+export default function isToday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameDay(dirtyDate, Date.now())
+}
diff --git a/date-fns/src/isToday/test.ts b/date-fns/src/isToday/test.ts
new file mode 100644
index 0000000..c68191f
--- /dev/null
+++ b/date-fns/src/isToday/test.ts
@@ -0,0 +1,37 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isToday from '.'
+
+describe('isToday', function() {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(function() {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Sep */, 25).getTime())
+ })
+
+ afterEach(function() {
+ clock.restore()
+ })
+
+ it('returns true if the given date is today', function() {
+ const result = isToday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not today', function() {
+ const result = isToday(new Date(2014, 8 /* Sep */, 26))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isToday(new Date(2014, 8 /* Sep */, 25).getTime())
+ assert(result === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(isToday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isTomorrow/benchmark.js b/date-fns/src/isTomorrow/benchmark.js
new file mode 100644
index 0000000..b15319b
--- /dev/null
+++ b/date-fns/src/isTomorrow/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isTomorrow from '.'
+
+suite(
+ 'isTomorrow',
+ () => {
+ benchmark('date-fns', function() {
+ return isTomorrow(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isTomorrow/index.d.ts b/date-fns/src/isTomorrow/index.d.ts
new file mode 100644
index 0000000..b9c9115
--- /dev/null
+++ b/date-fns/src/isTomorrow/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isTomorrow } from 'date-fns'
+export default isTomorrow
diff --git a/date-fns/src/isTomorrow/index.js.flow b/date-fns/src/isTomorrow/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isTomorrow/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isTomorrow/index.ts b/date-fns/src/isTomorrow/index.ts
new file mode 100644
index 0000000..e7169c9
--- /dev/null
+++ b/date-fns/src/isTomorrow/index.ts
@@ -0,0 +1,34 @@
+import addDays from '../addDays/index'
+import isSameDay from '../isSameDay/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isTomorrow
+ * @category Day Helpers
+ * @summary Is the given date tomorrow?
+ * @pure false
+ *
+ * @description
+ * Is the given date tomorrow?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is tomorrow
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?
+ * var result = isTomorrow(new Date(2014, 9, 7, 14, 0))
+ * //=> true
+ */
+export default function isTomorrow(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameDay(dirtyDate, addDays(Date.now(), 1))
+}
diff --git a/date-fns/src/isTomorrow/test.ts b/date-fns/src/isTomorrow/test.ts
new file mode 100644
index 0000000..b442c8a
--- /dev/null
+++ b/date-fns/src/isTomorrow/test.ts
@@ -0,0 +1,37 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import isTomorrow from '.'
+
+describe('isTomorrow', () => {
+ let clock: sinon.SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Aug */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date is tomorrow', () => {
+ const result = isTomorrow(new Date(2014, 8 /* Sep */, 26))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not tomorrow', () => {
+ const result = isTomorrow(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const result = isTomorrow(new Date(2014, 8 /* Sep */, 26).getTime())
+ assert(result === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(isTomorrow.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isTuesday/benchmark.js b/date-fns/src/isTuesday/benchmark.js
new file mode 100644
index 0000000..344e24b
--- /dev/null
+++ b/date-fns/src/isTuesday/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isTuesday from '.'
+
+suite('isTuesday', function () {
+ benchmark('date-fns', function () {
+ return isTuesday(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isTuesday/index.d.ts b/date-fns/src/isTuesday/index.d.ts
new file mode 100644
index 0000000..87c7ceb
--- /dev/null
+++ b/date-fns/src/isTuesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isTuesday } from 'date-fns'
+export default isTuesday
diff --git a/date-fns/src/isTuesday/index.js.flow b/date-fns/src/isTuesday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isTuesday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isTuesday/index.ts b/date-fns/src/isTuesday/index.ts
new file mode 100644
index 0000000..7b534ff
--- /dev/null
+++ b/date-fns/src/isTuesday/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isTuesday
+ * @category Weekday Helpers
+ * @summary Is the given date Tuesday?
+ *
+ * @description
+ * Is the given date Tuesday?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is Tuesday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 23 September 2014 Tuesday?
+ * var result = isTuesday(new Date(2014, 8, 23))
+ * //=> true
+ */
+export default function isTuesday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getDay() === 2
+}
diff --git a/date-fns/src/isTuesday/test.ts b/date-fns/src/isTuesday/test.ts
new file mode 100644
index 0000000..45335a5
--- /dev/null
+++ b/date-fns/src/isTuesday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isTuesday from '.'
+
+describe('isTuesday', function() {
+ it('returns true if the given date is Tuesday', function() {
+ const result = isTuesday(new Date(2014, 8 /* Sep */, 23))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Tuesday', function() {
+ const result = isTuesday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isTuesday(new Date(2014, 1 /* Feb */, 11).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isTuesday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isTuesday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isValid/benchmark.js b/date-fns/src/isValid/benchmark.js
new file mode 100644
index 0000000..c935bc8
--- /dev/null
+++ b/date-fns/src/isValid/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isValid from '.'
+import moment from 'moment'
+
+suite('isValid', function () {
+ benchmark('date-fns', function () {
+ return isValid(this.invalidDate)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.invalidMoment.isValid()
+ })
+}, {
+ setup: function () {
+ this.invalidDate = new Date(NaN)
+ this.invalidMoment = moment(new Date(NaN))
+ }
+})
diff --git a/date-fns/src/isValid/index.d.ts b/date-fns/src/isValid/index.d.ts
new file mode 100644
index 0000000..26ad11d
--- /dev/null
+++ b/date-fns/src/isValid/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isValid } from 'date-fns'
+export default isValid
diff --git a/date-fns/src/isValid/index.js b/date-fns/src/isValid/index.js
new file mode 100644
index 0000000..854c97e
--- /dev/null
+++ b/date-fns/src/isValid/index.js
@@ -0,0 +1,66 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isValid
+ * @category Common Helpers
+ * @summary Is the given date valid?
+ *
+ * @description
+ * Returns false if argument is Invalid Date and true otherwise.
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
+ * Invalid Date is a Date, whose time value is NaN.
+ *
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - Now `isValid` doesn't throw an exception
+ * if the first argument is not an instance of Date.
+ * Instead, argument is converted beforehand using `toDate`.
+ *
+ * Examples:
+ *
+ * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
+ * |---------------------------|---------------|---------------|
+ * | `new Date()` | `true` | `true` |
+ * | `new Date('2016-01-01')` | `true` | `true` |
+ * | `new Date('')` | `false` | `false` |
+ * | `new Date(1488370835081)` | `true` | `true` |
+ * | `new Date(NaN)` | `false` | `false` |
+ * | `'2016-01-01'` | `TypeError` | `false` |
+ * | `''` | `TypeError` | `false` |
+ * | `1488370835081` | `TypeError` | `true` |
+ * | `NaN` | `TypeError` | `false` |
+ *
+ * We introduce this change to make *date-fns* consistent with ECMAScript behavior
+ * that try to coerce arguments to the expected type
+ * (which is also the case with other *date-fns* functions).
+ *
+ * @param {*} date - the date to check
+ * @returns {Boolean} the date is valid
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // For the valid date:
+ * var result = isValid(new Date(2014, 1, 31))
+ * //=> true
+ *
+ * @example
+ * // For the value, convertable into a date:
+ * var result = isValid(1393804800000)
+ * //=> true
+ *
+ * @example
+ * // For the invalid date:
+ * var result = isValid(new Date(''))
+ * //=> false
+ */
+export default function isValid(dirtyDate) {
+ requiredArgs(1, arguments)
+
+ var date = toDate(dirtyDate)
+ return !isNaN(date)
+}
diff --git a/date-fns/src/isValid/index.js.flow b/date-fns/src/isValid/index.js.flow
new file mode 100644
index 0000000..5bae5e0
--- /dev/null
+++ b/date-fns/src/isValid/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: any) => boolean
diff --git a/date-fns/src/isValid/test.js b/date-fns/src/isValid/test.js
new file mode 100644
index 0000000..95cb078
--- /dev/null
+++ b/date-fns/src/isValid/test.js
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isValid from '.'
+
+describe('isValid', function() {
+ it('returns true if the given date is valid', function() {
+ var result = isValid(new Date())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is invalid', function() {
+ var result = isValid(new Date(''))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ assert(isValid(new Date(2014, 1 /* Feb */, 11).getTime()) === true)
+ assert(isValid(NaN) === false)
+ })
+
+ it('treats null as an invalid date', function() {
+ var result = isValid(null)
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(isValid.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isWednesday/benchmark.js b/date-fns/src/isWednesday/benchmark.js
new file mode 100644
index 0000000..80a6c1e
--- /dev/null
+++ b/date-fns/src/isWednesday/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isWednesday from '.'
+
+suite('isWednesday', function () {
+ benchmark('date-fns', function () {
+ return isWednesday(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isWednesday/index.d.ts b/date-fns/src/isWednesday/index.d.ts
new file mode 100644
index 0000000..e517a93
--- /dev/null
+++ b/date-fns/src/isWednesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isWednesday } from 'date-fns'
+export default isWednesday
diff --git a/date-fns/src/isWednesday/index.js.flow b/date-fns/src/isWednesday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isWednesday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isWednesday/index.ts b/date-fns/src/isWednesday/index.ts
new file mode 100644
index 0000000..f5bf434
--- /dev/null
+++ b/date-fns/src/isWednesday/index.ts
@@ -0,0 +1,29 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isWednesday
+ * @category Weekday Helpers
+ * @summary Is the given date Wednesday?
+ *
+ * @description
+ * Is the given date Wednesday?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is Wednesday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Is 24 September 2014 Wednesday?
+ * const result = isWednesday(new Date(2014, 8, 24))
+ * //=> true
+ */
+export default function isWednesday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return toDate(dirtyDate).getDay() === 3
+}
diff --git a/date-fns/src/isWednesday/test.ts b/date-fns/src/isWednesday/test.ts
new file mode 100644
index 0000000..c4b1a7a
--- /dev/null
+++ b/date-fns/src/isWednesday/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isWednesday from '.'
+
+describe('isWednesday', function () {
+ it('returns true if the given date is Wednesday', function () {
+ const result = isWednesday(new Date(2014, 8 /* Sep */, 24))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not Wednesday', function () {
+ const result = isWednesday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function () {
+ const result = isWednesday(new Date(2014, 1 /* Feb */, 12).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function () {
+ const result = isWednesday(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(isWednesday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isWeekend/benchmark.js b/date-fns/src/isWeekend/benchmark.js
new file mode 100644
index 0000000..3152276
--- /dev/null
+++ b/date-fns/src/isWeekend/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isWeekend from '.'
+
+suite('isWeekend', function () {
+ benchmark('date-fns', function () {
+ return isWeekend(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/isWeekend/index.d.ts b/date-fns/src/isWeekend/index.d.ts
new file mode 100644
index 0000000..3e54f31
--- /dev/null
+++ b/date-fns/src/isWeekend/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isWeekend } from 'date-fns'
+export default isWeekend
diff --git a/date-fns/src/isWeekend/index.js.flow b/date-fns/src/isWeekend/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isWeekend/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isWeekend/index.ts b/date-fns/src/isWeekend/index.ts
new file mode 100644
index 0000000..9eebd6b
--- /dev/null
+++ b/date-fns/src/isWeekend/index.ts
@@ -0,0 +1,31 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isWeekend
+ * @category Weekday Helpers
+ * @summary Does the given date fall on a weekend?
+ *
+ * @description
+ * Does the given date fall on a weekend?
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date falls on a weekend
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Does 5 October 2014 fall on a weekend?
+ * const result = isWeekend(new Date(2014, 9, 5))
+ * //=> true
+ */
+export default function isWeekend(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const day = date.getDay()
+ return day === 0 || day === 6
+}
diff --git a/date-fns/src/isWeekend/test.ts b/date-fns/src/isWeekend/test.ts
new file mode 100644
index 0000000..750ecaa
--- /dev/null
+++ b/date-fns/src/isWeekend/test.ts
@@ -0,0 +1,31 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import isWeekend from '.'
+
+describe('isWeekend', function () {
+ it('returns true if the given date is in a weekend', function () {
+ const result = isWeekend(new Date(2014, 9 /* Oct */, 5))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not in a weekend', function () {
+ const result = isWeekend(new Date(2014, 9 /* Oct */, 6))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function () {
+ const result = isWeekend(new Date(2014, 9 /* Oct */, 5).getTime())
+ assert(result === true)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function () {
+ const result = isWeekend(new Date(NaN))
+ assert(result === false)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(isWeekend.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/isWithinInterval/benchmark.js b/date-fns/src/isWithinInterval/benchmark.js
new file mode 100644
index 0000000..e672457
--- /dev/null
+++ b/date-fns/src/isWithinInterval/benchmark.js
@@ -0,0 +1,25 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isWithinInterval from '.'
+import moment from 'moment'
+
+suite('isWithinInterval', function () {
+ benchmark('date-fns', function () {
+ return isWithinInterval(this.dateA, {start: this.dateB, end: this.dateC})
+ })
+
+ benchmark('Moment.js', function () {
+ return this.momentA.isBetween(this.momentB, this.momentC)
+ })
+}, {
+ setup: function () {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() - 604800000)
+ this.momentB = this.momentA.clone().subtract(7, 'days')
+ this.dateC = new Date(this.dateA.getTime() + 604800000)
+ this.momentC = this.momentA.clone().add(7, 'days')
+ }
+})
diff --git a/date-fns/src/isWithinInterval/index.d.ts b/date-fns/src/isWithinInterval/index.d.ts
new file mode 100644
index 0000000..17339db
--- /dev/null
+++ b/date-fns/src/isWithinInterval/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isWithinInterval } from 'date-fns'
+export default isWithinInterval
diff --git a/date-fns/src/isWithinInterval/index.js.flow b/date-fns/src/isWithinInterval/index.js.flow
new file mode 100644
index 0000000..f870053
--- /dev/null
+++ b/date-fns/src/isWithinInterval/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, interval: Interval) => boolean
diff --git a/date-fns/src/isWithinInterval/index.ts b/date-fns/src/isWithinInterval/index.ts
new file mode 100644
index 0000000..c6af6a0
--- /dev/null
+++ b/date-fns/src/isWithinInterval/index.ts
@@ -0,0 +1,91 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { Interval } from '../types'
+
+/**
+ * @name isWithinInterval
+ * @category Interval Helpers
+ * @summary Is the given date within the interval?
+ *
+ * @description
+ * Is the given date within the interval? (Including start and end.)
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `isWithinRange` to `isWithinInterval`.
+ * This change was made to mirror the use of the word "interval" in standard ISO 8601:2004 terminology:
+ *
+ * ```
+ * 2.1.3
+ * time interval
+ * part of the time axis limited by two instants
+ * ```
+ *
+ * Also, this function now accepts an object with `start` and `end` properties
+ * instead of two arguments as an interval.
+ * This function now throws `RangeError` if the start of the interval is after its end
+ * or if any date in the interval is `Invalid Date`.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ *
+ * isWithinRange(
+ * new Date(2014, 0, 3),
+ * new Date(2014, 0, 1), new Date(2014, 0, 7)
+ * )
+ *
+ * // v2.0.0 onward
+ *
+ * isWithinInterval(
+ * new Date(2014, 0, 3),
+ * { start: new Date(2014, 0, 1), end: new Date(2014, 0, 7) }
+ * )
+ * ```
+ *
+ * @param {Date|Number} date - the date to check
+ * @param {Interval} interval - the interval to check
+ * @returns {Boolean} the date is within the interval
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} The start of an interval cannot be after its end
+ * @throws {RangeError} Date in interval cannot be `Invalid Date`
+ *
+ * @example
+ * // For the date within the interval:
+ * isWithinInterval(new Date(2014, 0, 3), {
+ * start: new Date(2014, 0, 1),
+ * end: new Date(2014, 0, 7)
+ * })
+ * //=> true
+ *
+ * @example
+ * // For the date outside of the interval:
+ * isWithinInterval(new Date(2014, 0, 10), {
+ * start: new Date(2014, 0, 1),
+ * end: new Date(2014, 0, 7)
+ * })
+ * //=> false
+ *
+ * @example
+ * // For date equal to interval start:
+ * isWithinInterval(date, { start, end: date }) // => true
+ *
+ * @example
+ * // For date equal to interval end:
+ * isWithinInterval(date, { start: date, end }) // => true
+ */
+export default function isWithinInterval(dirtyDate: Date | number, interval: Interval): boolean {
+ requiredArgs(2, arguments)
+
+ const time = toDate(dirtyDate).getTime()
+ const startTime = toDate(interval.start).getTime()
+ const endTime = toDate(interval.end).getTime()
+
+ // Throw an exception if start date is after end date or if any date is `Invalid Date`
+ if (!(startTime <= endTime)) {
+ throw new RangeError('Invalid interval')
+ }
+
+ return time >= startTime && time <= endTime
+}
diff --git a/date-fns/src/isWithinInterval/test.ts b/date-fns/src/isWithinInterval/test.ts
new file mode 100644
index 0000000..b7ebe1f
--- /dev/null
+++ b/date-fns/src/isWithinInterval/test.ts
@@ -0,0 +1,104 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import isWithinInterval from '.'
+
+describe('isWithinInterval', function() {
+ it('returns true if the given date in within the given interval', function() {
+ const result = isWithinInterval(new Date(2014, 9 /* Oct */, 31), {
+ start: new Date(2014, 8 /* Sep */, 1),
+ end: new Date(2014, 11 /* Dec */, 31)
+ })
+ assert(result === true)
+ })
+
+ it('returns true if the given date has same time as the left boundary of the interval', function() {
+ const result = isWithinInterval(new Date(2014, 8 /* Sep */, 1), {
+ start: new Date(2014, 8 /* Sep */, 1),
+ end: new Date(2014, 11 /* Dec */, 31)
+ })
+ assert(result === true)
+ })
+
+ it('returns true if the given date has same time as the right boundary of the interval', function() {
+ const result = isWithinInterval(new Date(2014, 11 /* Dec */, 31), {
+ start: new Date(2014, 8 /* Sep */, 1),
+ end: new Date(2014, 11 /* Dec */, 31)
+ })
+ assert(result === true)
+ })
+
+ it('returns true if the given date and the both boundaries are the same', function() {
+ const result = isWithinInterval(new Date(2014, 11 /* Dec */, 31), {
+ start: new Date(2014, 11 /* Dec */, 31),
+ end: new Date(2014, 11 /* Dec */, 31)
+ })
+ assert(result === true)
+ })
+
+ it('returns false if the given date is outside of the interval', function() {
+ const result = isWithinInterval(new Date(2014, 1 /* Feb */, 11), {
+ start: new Date(2014, 8 /* Sep */, 1),
+ end: new Date(2014, 11 /* Dec */, 31)
+ })
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', function() {
+ const result = isWithinInterval(new Date(2014, 9 /* Oct */, 31).getTime(), {
+ start: new Date(2014, 8 /* Sep */, 1).getTime(),
+ end: new Date(2014, 11 /* Dec */, 31).getTime()
+ })
+ assert(result === true)
+ })
+
+ it('throws an exception if the start date is after the end date', function() {
+ const block = isWithinInterval.bind(null, new Date(2014, 9 /* Oct */, 31), {
+ start: new Date(2014, 11 /* Dec */, 31),
+ end: new Date(2014, 8 /* Sep */, 1)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the interval is undefined', function() {
+ // @ts-expect-error
+ const block = isWithinInterval.bind(
+ null,
+ new Date(2014, 9 /* Oct */, 31),
+ undefined
+ )
+ assert.throws(block, TypeError)
+ })
+
+ it('returns false if the given date is `Invalid Date`', function() {
+ const result = isWithinInterval(new Date(NaN), {
+ start: new Date(2014, 8 /* Sep */, 1),
+ end: new Date(2014, 11 /* Dec */, 31)
+ })
+ assert(result === false)
+ })
+
+ it('throws an exception if the start date is `Invalid Date`', function() {
+ const block = isWithinInterval.bind(null, new Date(2014, 9 /* Oct */, 31), {
+ start: new Date(NaN),
+ end: new Date(2014, 8 /* Sep */, 1)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws an exception if the end date is `Invalid Date`', function() {
+ const block = isWithinInterval.bind(null, new Date(2014, 9 /* Oct */, 31), {
+ start: new Date(2014, 11 /* Dec */, 31),
+ end: new Date(NaN)
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ // @ts-expect-error
+ assert.throws(isWithinInterval.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(isWithinInterval.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/isYesterday/benchmark.js b/date-fns/src/isYesterday/benchmark.js
new file mode 100644
index 0000000..2e333b4
--- /dev/null
+++ b/date-fns/src/isYesterday/benchmark.js
@@ -0,0 +1,19 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import isYesterday from '.'
+
+suite(
+ 'isYesterday',
+ () => {
+ benchmark('date-fns', function() {
+ return isYesterday(this.date)
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ }
+ }
+)
diff --git a/date-fns/src/isYesterday/index.d.ts b/date-fns/src/isYesterday/index.d.ts
new file mode 100644
index 0000000..b10c635
--- /dev/null
+++ b/date-fns/src/isYesterday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { isYesterday } from 'date-fns'
+export default isYesterday
diff --git a/date-fns/src/isYesterday/index.js.flow b/date-fns/src/isYesterday/index.js.flow
new file mode 100644
index 0000000..d3f01ee
--- /dev/null
+++ b/date-fns/src/isYesterday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => boolean
diff --git a/date-fns/src/isYesterday/index.ts b/date-fns/src/isYesterday/index.ts
new file mode 100644
index 0000000..0946fd9
--- /dev/null
+++ b/date-fns/src/isYesterday/index.ts
@@ -0,0 +1,34 @@
+import isSameDay from '../isSameDay/index'
+import subDays from '../subDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name isYesterday
+ * @category Day Helpers
+ * @summary Is the given date yesterday?
+ * @pure false
+ *
+ * @description
+ * Is the given date yesterday?
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to check
+ * @returns {Boolean} the date is yesterday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?
+ * var result = isYesterday(new Date(2014, 9, 5, 14, 0))
+ * //=> true
+ */
+export default function isYesterday(dirtyDate: Date | number): boolean {
+ requiredArgs(1, arguments)
+
+ return isSameDay(dirtyDate, subDays(Date.now(), 1))
+}
diff --git a/date-fns/src/isYesterday/test.ts b/date-fns/src/isYesterday/test.ts
new file mode 100644
index 0000000..4c79b72
--- /dev/null
+++ b/date-fns/src/isYesterday/test.ts
@@ -0,0 +1,38 @@
+// @flow
+/* eslint-env mocha */
+
+import { SinonFakeTimers } from 'sinon'
+import assert from 'assert'
+import sinon from 'sinon'
+import isYesterday from '.'
+
+describe('isYesterday', () => {
+ let clock: SinonFakeTimers
+ beforeEach(() => {
+ clock = sinon.useFakeTimers(new Date(2014, 8 /* Aug */, 25).getTime())
+ })
+
+ afterEach(() => {
+ clock.restore()
+ })
+
+ it('returns true if the given date is yesterday', () => {
+ const result = isYesterday(new Date(2014, 8 /* Sep */, 24))
+ assert(result === true)
+ })
+
+ it('returns false if the given date is not yesterday', () => {
+ const result = isYesterday(new Date(2014, 8 /* Sep */, 25))
+ assert(result === false)
+ })
+
+ it('accepts a timestamp', () => {
+ const result = isYesterday(new Date(2014, 8 /* Sep */, 24).getTime())
+ assert(result === true)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(isYesterday.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lastDayOfDecade/benchmark.js b/date-fns/src/lastDayOfDecade/benchmark.js
new file mode 100644
index 0000000..c683eca
--- /dev/null
+++ b/date-fns/src/lastDayOfDecade/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import lastDayOfDecade from '.'
+
+suite('lastDayOfYear', function () {
+ benchmark('date-fns', function () {
+ return lastDayOfDecade(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/lastDayOfDecade/index.d.ts b/date-fns/src/lastDayOfDecade/index.d.ts
new file mode 100644
index 0000000..05b0306
--- /dev/null
+++ b/date-fns/src/lastDayOfDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfDecade } from 'date-fns'
+export default lastDayOfDecade
diff --git a/date-fns/src/lastDayOfDecade/index.js.flow b/date-fns/src/lastDayOfDecade/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/lastDayOfDecade/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/lastDayOfDecade/index.ts b/date-fns/src/lastDayOfDecade/index.ts
new file mode 100644
index 0000000..7a50164
--- /dev/null
+++ b/date-fns/src/lastDayOfDecade/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name lastDayOfDecade
+ * @category Decade Helpers
+ * @summary Return the last day of a decade for the given date.
+ *
+ * @description
+ * Return the last day of a decade for the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the last day of a decade
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The last day of a decade for 21 December 2012 21:12:00:
+ * var result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))
+ * //=> Wed Dec 31 2019 00:00:00
+ */
+export default function lastDayOfDecade(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ const decade = 9 + Math.floor(year / 10) * 10
+ date.setFullYear(decade + 1, 0, 0)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/lastDayOfDecade/test.ts b/date-fns/src/lastDayOfDecade/test.ts
new file mode 100644
index 0000000..75c241e
--- /dev/null
+++ b/date-fns/src/lastDayOfDecade/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import lastDayOfDecade from '.'
+
+describe('lastDayOfDecade', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the last day of a decade', function() {
+ const date = new Date(1985, 9 /* Oct */, 20)
+ const result = lastDayOfDecade(date)
+ assert.deepEqual(result, new Date(1989, 11 /* Dec */, 31))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(1975, 0 /* Jan */, 19).getTime()
+ const result = lastDayOfDecade(date)
+ assert.deepEqual(result, new Date(1979, 11 /* Dec */, 31))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2013, 3 /* Apr */, 23)
+ lastDayOfDecade(date)
+ assert.deepEqual(date, new Date(2013, 3 /* Apr */, 23))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = lastDayOfDecade(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(lastDayOfDecade.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lastDayOfISOWeek/benchmark.js b/date-fns/src/lastDayOfISOWeek/benchmark.js
new file mode 100644
index 0000000..198dd8e
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeek/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import lastDayOfISOWeek from '.'
+
+suite('lastDayOfISOWeek', function () {
+ benchmark('date-fns', function () {
+ return lastDayOfISOWeek(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/lastDayOfISOWeek/index.d.ts b/date-fns/src/lastDayOfISOWeek/index.d.ts
new file mode 100644
index 0000000..e2533d6
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfISOWeek } from 'date-fns'
+export default lastDayOfISOWeek
diff --git a/date-fns/src/lastDayOfISOWeek/index.js.flow b/date-fns/src/lastDayOfISOWeek/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeek/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/lastDayOfISOWeek/index.ts b/date-fns/src/lastDayOfISOWeek/index.ts
new file mode 100644
index 0000000..dd856f3
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeek/index.ts
@@ -0,0 +1,32 @@
+import lastDayOfWeek from '../lastDayOfWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name lastDayOfISOWeek
+ * @category ISO Week Helpers
+ * @summary Return the last day of an ISO week for the given date.
+ *
+ * @description
+ * Return the last day of an ISO week for the given date.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the last day of an ISO week
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The last day of an ISO week for 2 September 2014 11:55:00:
+ * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Sun Sep 07 2014 00:00:00
+ */
+export default function lastDayOfISOWeek(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ return lastDayOfWeek(dirtyDate, { weekStartsOn: 1 })
+}
diff --git a/date-fns/src/lastDayOfISOWeek/test.ts b/date-fns/src/lastDayOfISOWeek/test.ts
new file mode 100644
index 0000000..947fcb4
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeek/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import lastDayOfISOWeek from '.'
+
+describe('lastDayOfISOWeek', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the last day of an ISO week', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfISOWeek(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 1 /* Feb */, 11, 11, 55, 0).getTime()
+ const result = lastDayOfISOWeek(date)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 16))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ lastDayOfISOWeek(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = lastDayOfISOWeek(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(lastDayOfISOWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lastDayOfISOWeekYear/benchmark.js b/date-fns/src/lastDayOfISOWeekYear/benchmark.js
new file mode 100644
index 0000000..9623d55
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeekYear/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import lastDayOfISOWeekYear from '.'
+
+suite('lastDayOfISOWeekYear', function () {
+ benchmark('date-fns', function () {
+ return lastDayOfISOWeekYear(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/lastDayOfISOWeekYear/index.d.ts b/date-fns/src/lastDayOfISOWeekYear/index.d.ts
new file mode 100644
index 0000000..b30859a
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfISOWeekYear } from 'date-fns'
+export default lastDayOfISOWeekYear
diff --git a/date-fns/src/lastDayOfISOWeekYear/index.js.flow b/date-fns/src/lastDayOfISOWeekYear/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeekYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/lastDayOfISOWeekYear/index.ts b/date-fns/src/lastDayOfISOWeekYear/index.ts
new file mode 100644
index 0000000..425095f
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeekYear/index.ts
@@ -0,0 +1,45 @@
+import getISOWeekYear from '../getISOWeekYear/index'
+import startOfISOWeek from '../startOfISOWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name lastDayOfISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Return the last day of an ISO week-numbering year for the given date.
+ *
+ * @description
+ * Return the last day of an ISO week-numbering year,
+ * which always starts 3 days before the year's first Thursday.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `lastDayOfISOYear` to `lastDayOfISOWeekYear`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the end of an ISO week-numbering year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The last day of an ISO week-numbering year for 2 July 2005:
+ * var result = lastDayOfISOWeekYear(new Date(2005, 6, 2))
+ * //=> Sun Jan 01 2006 00:00:00
+ */
+export default function lastDayOfISOWeekYear(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const year = getISOWeekYear(dirtyDate)
+ const fourthOfJanuary = new Date(0)
+ fourthOfJanuary.setFullYear(year + 1, 0, 4)
+ fourthOfJanuary.setHours(0, 0, 0, 0)
+ const date = startOfISOWeek(fourthOfJanuary)
+ date.setDate(date.getDate() - 1)
+ return date
+}
diff --git a/date-fns/src/lastDayOfISOWeekYear/test.ts b/date-fns/src/lastDayOfISOWeekYear/test.ts
new file mode 100644
index 0000000..9a06b16
--- /dev/null
+++ b/date-fns/src/lastDayOfISOWeekYear/test.ts
@@ -0,0 +1,45 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import lastDayOfISOWeekYear from '.'
+
+describe('lastDayOfISOWeekYear', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the last day of an ISO year', function() {
+ const result = lastDayOfISOWeekYear(new Date(2009, 0 /* Jan */, 1, 16, 0))
+ assert.deepEqual(result, new Date(2010, 0 /* Jan */, 3))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = lastDayOfISOWeekYear(
+ new Date(2005, 0 /* Jan */, 1, 6, 0).getTime()
+ )
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 2))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 2)
+ lastDayOfISOWeekYear(date)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(5, 0 /* Jan */, 4)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(6, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = lastDayOfISOWeekYear(initialDate)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = lastDayOfISOWeekYear(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(lastDayOfISOWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lastDayOfMonth/benchmark.js b/date-fns/src/lastDayOfMonth/benchmark.js
new file mode 100644
index 0000000..beddb74
--- /dev/null
+++ b/date-fns/src/lastDayOfMonth/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import lastDayOfMonth from '.'
+
+suite('lastDayOfMonth', function () {
+ benchmark('date-fns', function () {
+ return lastDayOfMonth(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/lastDayOfMonth/index.d.ts b/date-fns/src/lastDayOfMonth/index.d.ts
new file mode 100644
index 0000000..4db559b
--- /dev/null
+++ b/date-fns/src/lastDayOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfMonth } from 'date-fns'
+export default lastDayOfMonth
diff --git a/date-fns/src/lastDayOfMonth/index.js.flow b/date-fns/src/lastDayOfMonth/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/lastDayOfMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/lastDayOfMonth/index.ts b/date-fns/src/lastDayOfMonth/index.ts
new file mode 100644
index 0000000..1b97a13
--- /dev/null
+++ b/date-fns/src/lastDayOfMonth/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name lastDayOfMonth
+ * @category Month Helpers
+ * @summary Return the last day of a month for the given date.
+ *
+ * @description
+ * Return the last day of a month for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the last day of a month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The last day of a month for 2 September 2014 11:55:00:
+ * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Sep 30 2014 00:00:00
+ */
+export default function lastDayOfMonth(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const month = date.getMonth()
+ date.setFullYear(date.getFullYear(), month + 1, 0)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/lastDayOfMonth/test.ts b/date-fns/src/lastDayOfMonth/test.ts
new file mode 100644
index 0000000..3c63b4b
--- /dev/null
+++ b/date-fns/src/lastDayOfMonth/test.ts
@@ -0,0 +1,48 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import lastDayOfMonth from '.'
+
+describe('lastDayOfMonth', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the last day of a month', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 7 /* Aug */, 2, 11, 55, 0).getTime()
+ const result = lastDayOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ lastDayOfMonth(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ describe('edge cases', function() {
+ it('works for the February of a leap year', function() {
+ const date = new Date(2012, 1 /* Feb */, 11, 11, 55, 0)
+ const result = lastDayOfMonth(date)
+ assert.deepEqual(result, new Date(2012, 1 /* Feb */, 29))
+ })
+
+ it('works for the February of a non-leap year', function() {
+ const date = new Date(2014, 1 /* Feb */, 11, 11, 55, 0)
+ const result = lastDayOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 28))
+ })
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = lastDayOfMonth(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(lastDayOfMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lastDayOfQuarter/benchmark.js b/date-fns/src/lastDayOfQuarter/benchmark.js
new file mode 100644
index 0000000..72d5780
--- /dev/null
+++ b/date-fns/src/lastDayOfQuarter/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import lastDayOfQuarter from '.'
+
+suite('lastDayOfQuarter', function () {
+ benchmark('date-fns', function () {
+ return lastDayOfQuarter(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/lastDayOfQuarter/index.d.ts b/date-fns/src/lastDayOfQuarter/index.d.ts
new file mode 100644
index 0000000..3387b64
--- /dev/null
+++ b/date-fns/src/lastDayOfQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfQuarter } from 'date-fns'
+export default lastDayOfQuarter
diff --git a/date-fns/src/lastDayOfQuarter/index.js.flow b/date-fns/src/lastDayOfQuarter/index.js.flow
new file mode 100644
index 0000000..364a3bb
--- /dev/null
+++ b/date-fns/src/lastDayOfQuarter/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ additionalDigits?: 0 | 1 | 2,
+ }
+) => Date
diff --git a/date-fns/src/lastDayOfQuarter/index.ts b/date-fns/src/lastDayOfQuarter/index.ts
new file mode 100644
index 0000000..578cf12
--- /dev/null
+++ b/date-fns/src/lastDayOfQuarter/index.ts
@@ -0,0 +1,38 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name lastDayOfQuarter
+ * @category Quarter Helpers
+ * @summary Return the last day of a year quarter for the given date.
+ *
+ * @description
+ * Return the last day of a year quarter for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
+ * @returns {Date} the last day of a quarter
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
+ *
+ * @example
+ * // The last day of a quarter for 2 September 2014 11:55:00:
+ * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Sep 30 2014 00:00:00
+ */
+export default function lastDayOfQuarter(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const currentMonth = date.getMonth()
+ const month = currentMonth - (currentMonth % 3) + 3
+ date.setMonth(month, 0)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/lastDayOfQuarter/test.ts b/date-fns/src/lastDayOfQuarter/test.ts
new file mode 100644
index 0000000..0812953
--- /dev/null
+++ b/date-fns/src/lastDayOfQuarter/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import lastDayOfQuarter from '.'
+
+describe('lastDayOfQuarter', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the last day of a quarter', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfQuarter(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = lastDayOfQuarter(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ lastDayOfQuarter(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = lastDayOfQuarter(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(lastDayOfQuarter.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lastDayOfWeek/benchmark.js b/date-fns/src/lastDayOfWeek/benchmark.js
new file mode 100644
index 0000000..52dfdec
--- /dev/null
+++ b/date-fns/src/lastDayOfWeek/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import lastDayOfWeek from '.'
+
+suite('lastDayOfWeek', function () {
+ benchmark('date-fns', function () {
+ return lastDayOfWeek(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/lastDayOfWeek/index.d.ts b/date-fns/src/lastDayOfWeek/index.d.ts
new file mode 100644
index 0000000..d29b9bf
--- /dev/null
+++ b/date-fns/src/lastDayOfWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfWeek } from 'date-fns'
+export default lastDayOfWeek
diff --git a/date-fns/src/lastDayOfWeek/index.js.flow b/date-fns/src/lastDayOfWeek/index.js.flow
new file mode 100644
index 0000000..9285b67
--- /dev/null
+++ b/date-fns/src/lastDayOfWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => Date
diff --git a/date-fns/src/lastDayOfWeek/index.ts b/date-fns/src/lastDayOfWeek/index.ts
new file mode 100644
index 0000000..781d8b2
--- /dev/null
+++ b/date-fns/src/lastDayOfWeek/index.ts
@@ -0,0 +1,66 @@
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { LocaleOptions, WeekStartOptions } from '../types'
+
+/**
+ * @name lastDayOfWeek
+ * @category Week Helpers
+ * @summary Return the last day of a week for the given date.
+ *
+ * @description
+ * Return the last day of a week for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Date} the last day of a week
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // The last day of a week for 2 September 2014 11:55:00:
+ * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Sat Sep 06 2014 00:00:00
+ *
+ * @example
+ * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00:
+ * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
+ * //=> Sun Sep 07 2014 00:00:00
+ */
+export default function lastDayOfWeek(
+ dirtyDate: Date | number,
+ dirtyOptions?: LocaleOptions & WeekStartOptions
+): Date {
+ requiredArgs(1, arguments)
+
+ const options = dirtyOptions || {}
+ const locale = options.locale
+ const localeWeekStartsOn =
+ locale && locale.options && locale.options.weekStartsOn
+ const defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ const weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6')
+ }
+
+ const date = toDate(dirtyDate)
+ const day = date.getDay()
+ const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn)
+
+ date.setHours(0, 0, 0, 0)
+ date.setDate(date.getDate() + diff)
+ return date
+}
diff --git a/date-fns/src/lastDayOfWeek/test.ts b/date-fns/src/lastDayOfWeek/test.ts
new file mode 100644
index 0000000..99b1307
--- /dev/null
+++ b/date-fns/src/lastDayOfWeek/test.ts
@@ -0,0 +1,111 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import lastDayOfWeek from '.'
+
+describe('lastDayOfWeek', function () {
+ it('returns the date with the time set to 00:00:00 and the date set to the last day of a week', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfWeek(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 6))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfWeek(date, { weekStartsOn: 1 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfWeek(date, {
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfWeek(date, {
+ weekStartsOn: 1,
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('implicitly converts options', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ // @ts-expect-error
+ const result = lastDayOfWeek(date, { weekStartsOn: '1' })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('accepts a timestamp', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = lastDayOfWeek(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 6))
+ })
+
+ it('does not mutate the original date', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ lastDayOfWeek(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ describe('edge cases', function () {
+ describe('when the given day is before the start of a week', function () {
+ it('it returns the last day of a week', function () {
+ const date = new Date(2014, 9 /* Oct */, 6)
+ const result = lastDayOfWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 7))
+ })
+ })
+
+ describe('when the given day is the start of a week', function () {
+ it('it returns the last day of a week', function () {
+ const date = new Date(2014, 9 /* Oct */, 8)
+ const result = lastDayOfWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 14))
+ })
+ })
+
+ describe('when the given day is after the start of a week', function () {
+ it('it returns the last day of a week', function () {
+ const date = new Date(2014, 9 /* Oct */, 10)
+ const result = lastDayOfWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 14))
+ })
+ })
+
+ it('handles the week at the end of a year', function () {
+ const date = new Date(2014, 11 /* Dec */, 29)
+ const result = lastDayOfWeek(date, { weekStartsOn: 5 })
+ assert.deepEqual(result, new Date(2015, 0 /* Jan */, 1))
+ })
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ const result = lastDayOfWeek(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ const block = lastDayOfWeek.bind(
+ null,
+ new Date(2014, 8 /* Sep */, 2, 11, 55, 0),
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ assert.throws(lastDayOfWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lastDayOfYear/benchmark.js b/date-fns/src/lastDayOfYear/benchmark.js
new file mode 100644
index 0000000..9d55f10
--- /dev/null
+++ b/date-fns/src/lastDayOfYear/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import lastDayOfYear from '.'
+
+suite('lastDayOfYear', function () {
+ benchmark('date-fns', function () {
+ return lastDayOfYear(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/lastDayOfYear/index.d.ts b/date-fns/src/lastDayOfYear/index.d.ts
new file mode 100644
index 0000000..a90dc0d
--- /dev/null
+++ b/date-fns/src/lastDayOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lastDayOfYear } from 'date-fns'
+export default lastDayOfYear
diff --git a/date-fns/src/lastDayOfYear/index.js.flow b/date-fns/src/lastDayOfYear/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/lastDayOfYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/lastDayOfYear/index.ts b/date-fns/src/lastDayOfYear/index.ts
new file mode 100644
index 0000000..f82c61c
--- /dev/null
+++ b/date-fns/src/lastDayOfYear/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name lastDayOfYear
+ * @category Year Helpers
+ * @summary Return the last day of a year for the given date.
+ *
+ * @description
+ * Return the last day of a year for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the last day of a year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The last day of a year for 2 September 2014 11:55:00:
+ * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))
+ * //=> Wed Dec 31 2014 00:00:00
+ */
+export default function lastDayOfYear(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ date.setFullYear(year + 1, 0, 0)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/lastDayOfYear/test.ts b/date-fns/src/lastDayOfYear/test.ts
new file mode 100644
index 0000000..33997c9
--- /dev/null
+++ b/date-fns/src/lastDayOfYear/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import lastDayOfYear from '.'
+
+describe('lastDayOfYear', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the last day of a year', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = lastDayOfYear(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = lastDayOfYear(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 31))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ lastDayOfYear(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = lastDayOfYear(new Date(NaN))
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(lastDayOfYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/lightFormat/index.d.ts b/date-fns/src/lightFormat/index.d.ts
new file mode 100644
index 0000000..4aa361b
--- /dev/null
+++ b/date-fns/src/lightFormat/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lightFormat } from 'date-fns'
+export default lightFormat
diff --git a/date-fns/src/lightFormat/index.js.flow b/date-fns/src/lightFormat/index.js.flow
new file mode 100644
index 0000000..818d9c4
--- /dev/null
+++ b/date-fns/src/lightFormat/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, format: string) => string
diff --git a/date-fns/src/lightFormat/index.ts b/date-fns/src/lightFormat/index.ts
new file mode 100644
index 0000000..a16a127
--- /dev/null
+++ b/date-fns/src/lightFormat/index.ts
@@ -0,0 +1,144 @@
+import toDate from '../toDate/index'
+import formatters from '../_lib/format/lightFormatters/index'
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import isValid from '../isValid/index'
+import subMilliseconds from '../subMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+// This RegExp consists of three parts separated by `|`:
+// - (\w)\1* matches any sequences of the same letter
+// - '' matches two quote characters in a row
+// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
+// except a single quote symbol, which ends the sequence.
+// Two quote characters do not end the sequence.
+// If there is no matching single quote
+// then the sequence will continue until the end of the string.
+// - . matches any single character unmatched by previous parts of the RegExps
+const formattingTokensRegExp = /(\w)\1*|''|'(''|[^'])+('|$)|./g
+
+const escapedStringRegExp = /^'([^]*?)'?$/
+const doubleQuoteRegExp = /''/g
+const unescapedLatinCharacterRegExp = /[a-zA-Z]/
+
+/**
+ * @name lightFormat
+ * @category Common Helpers
+ * @summary Format the date.
+ *
+ * @description
+ * Return the formatted date string in the given format. Unlike `format`,
+ * `lightFormat` doesn't use locales and outputs date using the most popular tokens.
+ *
+ * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries.
+ * > See: https://git.io/fxCyr
+ *
+ * The characters wrapped between two single quotes characters (') are escaped.
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
+ *
+ * Format of the string is based on Unicode Technical Standard #35:
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
+ *
+ * Accepted patterns:
+ * | Unit | Pattern | Result examples |
+ * |---------------------------------|---------|-----------------------------------|
+ * | AM, PM | a..aaa | AM, PM |
+ * | | aaaa | a.m., p.m. |
+ * | | aaaaa | a, p |
+ * | Calendar year | y | 44, 1, 1900, 2017 |
+ * | | yy | 44, 01, 00, 17 |
+ * | | yyy | 044, 001, 000, 017 |
+ * | | yyyy | 0044, 0001, 1900, 2017 |
+ * | Month (formatting) | M | 1, 2, ..., 12 |
+ * | | MM | 01, 02, ..., 12 |
+ * | Day of month | d | 1, 2, ..., 31 |
+ * | | dd | 01, 02, ..., 31 |
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 |
+ * | | hh | 01, 02, ..., 11, 12 |
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 |
+ * | | HH | 00, 01, 02, ..., 23 |
+ * | Minute | m | 0, 1, ..., 59 |
+ * | | mm | 00, 01, ..., 59 |
+ * | Second | s | 0, 1, ..., 59 |
+ * | | ss | 00, 01, ..., 59 |
+ * | Fraction of second | S | 0, 1, ..., 9 |
+ * | | SS | 00, 01, ..., 99 |
+ * | | SSS | 000, 0001, ..., 999 |
+ * | | SSSS | ... |
+ *
+ * @param {Date|Number} date - the original date
+ * @param {String} format - the string of tokens
+ * @returns {String} the formatted date string
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
+ *
+ * @example
+ * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd')
+ * //=> '2014-02-11'
+ */
+
+type Token = keyof typeof formatters
+
+export default function lightFormat(
+ dirtyDate: Date | number,
+ formatStr: string
+): string {
+ requiredArgs(2, arguments)
+
+ const originalDate = toDate(dirtyDate)
+
+ if (!isValid(originalDate)) {
+ throw new RangeError('Invalid time value')
+ }
+
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
+ const timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate)
+ const utcDate = subMilliseconds(originalDate, timezoneOffset)
+
+ const tokens = formatStr.match(formattingTokensRegExp)
+
+ // The only case when formattingTokensRegExp doesn't match the string is when it's empty
+ if (!tokens) return ''
+
+ const result = tokens
+ .map((substring) => {
+ // Replace two single quote characters with one single quote character
+ if (substring === "''") {
+ return "'"
+ }
+
+ const firstCharacter = substring[0]
+ if (firstCharacter === "'") {
+ return cleanEscapedString(substring)
+ }
+
+ const formatter = formatters[firstCharacter as Token]
+ if (formatter) {
+ return formatter(utcDate, substring)
+ }
+
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
+ throw new RangeError(
+ 'Format string contains an unescaped latin alphabet character `' +
+ firstCharacter +
+ '`'
+ )
+ }
+
+ return substring
+ })
+ .join('')
+
+ return result
+}
+
+function cleanEscapedString(input: string) {
+ const matches = input.match(escapedStringRegExp)
+
+ if (!matches) {
+ return input
+ }
+
+ return matches[1].replace(doubleQuoteRegExp, "'")
+}
diff --git a/date-fns/src/lightFormat/test.ts b/date-fns/src/lightFormat/test.ts
new file mode 100644
index 0000000..13a8fd8
--- /dev/null
+++ b/date-fns/src/lightFormat/test.ts
@@ -0,0 +1,158 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import lightFormat from '.'
+
+describe('lightFormat', () => {
+ const date = new Date(1986, 3 /* Apr */, 4, 10, 32, 55, 123)
+
+ it('accepts a timestamp', () => {
+ const date = new Date(2014, 3, 4).getTime()
+ assert(lightFormat(date, 'yyyy-MM-dd') === '2014-04-04')
+ })
+
+ it('escapes characters between the single quote characters', () => {
+ const result = lightFormat(date, "'yyyy-'MM-dd'D yyyy-'MM-dd'")
+ assert(result === 'yyyy-04-04D yyyy-04-04')
+ })
+
+ it('two single quote characters are transformed into a "real" single quote', () => {
+ const date = new Date(2014, 3, 4, 5)
+ assert(lightFormat(date, "''h 'o''clock'''") === "'5 o'clock'")
+ })
+
+ it('accepts new line charactor', function () {
+ const date = new Date(2014, 3, 4, 5)
+ assert.equal(
+ lightFormat(date, "yyyy-MM-dd'\n'HH:mm:ss"),
+ '2014-04-04\n05:00:00'
+ )
+ })
+
+ describe('year', () => {
+ describe('regular year', () => {
+ it('works as expected', () => {
+ const result = lightFormat(date, 'y yy yyy yyyy yyyyy')
+ assert(result === '1986 86 1986 1986 01986')
+ })
+
+ it('1 BC formats as 1', () => {
+ const date = new Date(0)
+ date.setFullYear(0 /* Jan */, 1)
+ date.setHours(0, 0, 0, 0)
+ const result = lightFormat(date, 'y')
+ assert(result === '1')
+ })
+
+ it('2 BC formats as 2', () => {
+ const date = new Date(0)
+ date.setFullYear(-1, 0 /* Jan */, 1)
+ date.setHours(0, 0, 0, 0)
+ const result = lightFormat(date, 'y')
+ assert(result === '2')
+ })
+ })
+ })
+
+ describe('month', () => {
+ it('formatting month', () => {
+ const result = lightFormat(date, 'M MM')
+ assert(result === '4 04')
+ })
+ })
+
+ describe('day', () => {
+ it('date', () => {
+ const result = lightFormat(date, 'd dd')
+ assert(result === '4 04')
+ })
+ })
+
+ describe('hour', () => {
+ it('hour [1-12]', () => {
+ const result = lightFormat(
+ new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0),
+ 'h hh'
+ )
+ assert(result === '12 12')
+ })
+
+ it('hour [0-23]', () => {
+ const result = lightFormat(
+ new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0),
+ 'H HH'
+ )
+ assert(result === '0 00')
+ })
+
+ describe('AM, PM', () => {
+ it('works as expected', () => {
+ const result = lightFormat(
+ new Date(2018, 0 /* Jan */, 1, 0, 0, 0, 0),
+ 'a aa aaa aaaa aaaaa'
+ )
+ assert(result === 'AM AM am a.m. a')
+ })
+
+ it('12 PM', () => {
+ const date = new Date(1986, 3 /* Apr */, 4, 12, 0, 0, 900)
+ assert(lightFormat(date, 'h H a') === '12 12 PM')
+ })
+
+ it('12 AM', () => {
+ const date = new Date(1986, 3 /* Apr */, 6, 0, 0, 0, 900)
+ assert(lightFormat(date, 'h H a') === '12 0 AM')
+ })
+ })
+ })
+
+ it('minute', () => {
+ const result = lightFormat(date, 'm mm')
+ assert(result === '32 32')
+ })
+
+ describe('second', () => {
+ it('second', () => {
+ const result = lightFormat(date, 's ss')
+ assert(result === '55 55')
+ })
+ })
+
+ it('fractional seconds', function () {
+ const result = lightFormat(date, 'S SS SSS SSSS')
+ assert(result === '1 12 123 1230')
+ })
+
+ it('returns empty string when the format is an empty string', () => {
+ assert(lightFormat(Date.now(), '') === '')
+ })
+
+ it("throws RangeError if the date isn't valid", () => {
+ assert.throws(
+ lightFormat.bind(null, new Date(NaN), 'MMMM d, yyyy'),
+ RangeError
+ )
+ })
+
+ it('implicitly converts `formatString`', () => {
+ // eslint-disable-next-line no-new-wrappers
+ const formatString = new String('yyyy-MM-dd')
+
+ const date = new Date(2014, 3, 4)
+
+ // @ts-expect-error
+ assert(lightFormat(date, formatString) === '2014-04-04')
+ })
+
+ it('throws RangeError exception if the format string contains an unescaped latin alphabet character', function () {
+ assert.throws(lightFormat.bind(null, date, 'yyyy-MM-dd-nnnn'), RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', () => {
+ // @ts-expect-error
+ assert.throws(lightFormat.bind(null), TypeError)
+ // @ts-expect-error
+ assert.throws(lightFormat.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/locale/_lib/buildFormatLongFn/index.js b/date-fns/src/locale/_lib/buildFormatLongFn/index.js
new file mode 100644
index 0000000..44da3fc
--- /dev/null
+++ b/date-fns/src/locale/_lib/buildFormatLongFn/index.js
@@ -0,0 +1,8 @@
+export default function buildFormatLongFn (args) {
+ return function (dirtyOptions) {
+ var options = dirtyOptions || {}
+ var width = options.width ? String(options.width) : args.defaultWidth
+ var format = args.formats[width] || args.formats[args.defaultWidth]
+ return format
+ }
+}
diff --git a/date-fns/src/locale/_lib/buildLocalizeFn/index.js b/date-fns/src/locale/_lib/buildLocalizeFn/index.js
new file mode 100644
index 0000000..360d8a7
--- /dev/null
+++ b/date-fns/src/locale/_lib/buildLocalizeFn/index.js
@@ -0,0 +1,23 @@
+export default function buildLocalizeFn(args) {
+ return function(dirtyIndex, dirtyOptions) {
+ var options = dirtyOptions || {}
+
+ var context = options.context ? String(options.context) : 'standalone'
+
+ var valuesArray
+ if (context === 'formatting' && args.formattingValues) {
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth
+ const width = options.width ? String(options.width) : defaultWidth
+ valuesArray =
+ args.formattingValues[width] || args.formattingValues[defaultWidth]
+ } else {
+ const defaultWidth = args.defaultWidth
+ const width = options.width ? String(options.width) : args.defaultWidth
+ valuesArray = args.values[width] || args.values[defaultWidth]
+ }
+ var index = args.argumentCallback
+ ? args.argumentCallback(dirtyIndex)
+ : dirtyIndex
+ return valuesArray[index]
+ }
+}
diff --git a/date-fns/src/locale/_lib/buildMatchFn/index.js b/date-fns/src/locale/_lib/buildMatchFn/index.js
new file mode 100644
index 0000000..a5bd529
--- /dev/null
+++ b/date-fns/src/locale/_lib/buildMatchFn/index.js
@@ -0,0 +1,56 @@
+export default function buildMatchFn(args) {
+ return function(dirtyString, dirtyOptions) {
+ var string = String(dirtyString)
+ var options = dirtyOptions || {}
+ var width = options.width
+
+ var matchPattern =
+ (width && args.matchPatterns[width]) ||
+ args.matchPatterns[args.defaultMatchWidth]
+ var matchResult = string.match(matchPattern)
+
+ if (!matchResult) {
+ return null
+ }
+ var matchedString = matchResult[0]
+
+ var parsePatterns =
+ (width && args.parsePatterns[width]) ||
+ args.parsePatterns[args.defaultParseWidth]
+
+ var value
+ if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
+ value = findIndex(parsePatterns, function(pattern) {
+ return pattern.test(matchedString)
+ })
+ } else {
+ value = findKey(parsePatterns, function(pattern) {
+ return pattern.test(matchedString)
+ })
+ }
+
+ value = args.valueCallback ? args.valueCallback(value) : value
+ value = options.valueCallback ? options.valueCallback(value) : value
+
+ return {
+ value: value,
+ rest: string.slice(matchedString.length)
+ }
+ }
+}
+
+function findKey(object, predicate) {
+ for (var key in object) {
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
+ return key
+ }
+ }
+}
+
+function findIndex(array, predicate) {
+ for (var key = 0; key < array.length; key++) {
+ if (predicate(array[key])) {
+ return key
+ }
+ }
+}
diff --git a/date-fns/src/locale/_lib/buildMatchPatternFn/index.js b/date-fns/src/locale/_lib/buildMatchPatternFn/index.js
new file mode 100644
index 0000000..faaabed
--- /dev/null
+++ b/date-fns/src/locale/_lib/buildMatchPatternFn/index.js
@@ -0,0 +1,24 @@
+export default function buildMatchPatternFn (args) {
+ return function (dirtyString, dirtyOptions) {
+ var string = String(dirtyString)
+ var options = dirtyOptions || {}
+
+ var matchResult = string.match(args.matchPattern)
+ if (!matchResult) {
+ return null
+ }
+ var matchedString = matchResult[0]
+
+ var parseResult = string.match(args.parsePattern)
+ if (!parseResult) {
+ return null
+ }
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0]
+ value = options.valueCallback ? options.valueCallback(value) : value
+
+ return {
+ value: value,
+ rest: string.slice(matchedString.length)
+ }
+ }
+}
diff --git a/date-fns/src/locale/af/_lib/formatDistance/index.js b/date-fns/src/locale/af/_lib/formatDistance/index.js
new file mode 100644
index 0000000..0d51321
--- /dev/null
+++ b/date-fns/src/locale/af/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: "minder as 'n sekonde",
+ other: 'minder as {{count}} sekondes'
+ },
+
+ xSeconds: {
+ one: '1 sekonde',
+ other: '{{count}} sekondes'
+ },
+
+ halfAMinute: "'n halwe minuut",
+
+ lessThanXMinutes: {
+ one: "minder as 'n minuut",
+ other: 'minder as {{count}} minute'
+ },
+
+ xMinutes: {
+ one: "'n minuut",
+ other: '{{count}} minute'
+ },
+
+ aboutXHours: {
+ one: 'ongeveer 1 uur',
+ other: 'ongeveer {{count}} ure'
+ },
+
+ xHours: {
+ one: '1 uur',
+ other: '{{count}} ure'
+ },
+
+ xDays: {
+ one: '1 dag',
+ other: '{{count}} dae'
+ },
+
+ aboutXWeeks: {
+ one: 'ongeveer 1 week',
+ other: 'ongeveer {{count}} weke'
+ },
+
+ xWeeks: {
+ one: '1 week',
+ other: '{{count}} weke'
+ },
+
+ aboutXMonths: {
+ one: 'ongeveer 1 maand',
+ other: 'ongeveer {{count}} maande'
+ },
+
+ xMonths: {
+ one: '1 maand',
+ other: '{{count}} maande'
+ },
+
+ aboutXYears: {
+ one: 'ongeveer 1 jaar',
+ other: 'ongeveer {{count}} jaar'
+ },
+
+ xYears: {
+ one: '1 jaar',
+ other: '{{count}} jaar'
+ },
+
+ overXYears: {
+ one: 'meer as 1 jaar',
+ other: 'meer as {{count}} jaar'
+ },
+
+ almostXYears: {
+ one: 'byna 1 jaar',
+ other: 'byna {{count}} jaar'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'oor ' + result
+ } else {
+ return result + ' gelede'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/af/_lib/formatLong/index.js b/date-fns/src/locale/af/_lib/formatLong/index.js
new file mode 100644
index 0000000..1420aa8
--- /dev/null
+++ b/date-fns/src/locale/af/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'yyyy/MM/dd'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'om' {{time}}",
+ long: "{{date}} 'om' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/af/_lib/formatRelative/index.js b/date-fns/src/locale/af/_lib/formatRelative/index.js
new file mode 100644
index 0000000..8568a82
--- /dev/null
+++ b/date-fns/src/locale/af/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'verlede' eeee 'om' p",
+ yesterday: "'gister om' p",
+ today: "'vandag om' p",
+ tomorrow: "'môre om' p",
+ nextWeek: "eeee 'om' p",
+ other: 'P'
+}
+
+export default function formatRelative(token) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/af/_lib/localize/index.js b/date-fns/src/locale/af/_lib/localize/index.js
new file mode 100644
index 0000000..77e06b9
--- /dev/null
+++ b/date-fns/src/locale/af/_lib/localize/index.js
@@ -0,0 +1,176 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['vC', 'nC'],
+ abbreviated: ['vC', 'nC'],
+ wide: ['voor Christus', 'na Christus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['1ste kwartaal', '2de kwartaal', '3de kwartaal', '4de kwartaal']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Feb',
+ 'Mrt',
+ 'Apr',
+ 'Mei',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Okt',
+ 'Nov',
+ 'Des'
+ ],
+ wide: [
+ 'Januarie',
+ 'Februarie',
+ 'Maart',
+ 'April',
+ 'Mei',
+ 'Junie',
+ 'Julie',
+ 'Augustus',
+ 'September',
+ 'Oktober',
+ 'November',
+ 'Desember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'D', 'W', 'D', 'V', 'S'],
+ short: ['So', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Sa'],
+ abbreviated: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
+ wide: [
+ 'Sondag',
+ 'Maandag',
+ 'Dinsdag',
+ 'Woensdag',
+ 'Donderdag',
+ 'Vrydag',
+ 'Saterdag'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'vm',
+ pm: 'nm',
+ midnight: 'middernag',
+ noon: 'middaguur',
+ morning: 'oggend',
+ afternoon: 'middag',
+ evening: 'laat middag',
+ night: 'aand'
+ },
+ abbreviated: {
+ am: 'vm',
+ pm: 'nm',
+ midnight: 'middernag',
+ noon: 'middaguur',
+ morning: 'oggend',
+ afternoon: 'middag',
+ evening: 'laat middag',
+ night: 'aand'
+ },
+ wide: {
+ am: 'vm',
+ pm: 'nm',
+ midnight: 'middernag',
+ noon: 'middaguur',
+ morning: 'oggend',
+ afternoon: 'middag',
+ evening: 'laat middag',
+ night: 'aand'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'vm',
+ pm: 'nm',
+ midnight: 'middernag',
+ noon: 'uur die middag',
+ morning: 'uur die oggend',
+ afternoon: 'uur die middag',
+ evening: 'uur die aand',
+ night: 'uur die aand'
+ },
+ abbreviated: {
+ am: 'vm',
+ pm: 'nm',
+ midnight: 'middernag',
+ noon: 'uur die middag',
+ morning: 'uur die oggend',
+ afternoon: 'uur die middag',
+ evening: 'uur die aand',
+ night: 'uur die aand'
+ },
+ wide: {
+ am: 'vm',
+ pm: 'nm',
+ midnight: 'middernag',
+ noon: 'uur die middag',
+ morning: 'uur die oggend',
+ afternoon: 'uur die middag',
+ evening: 'uur die aand',
+ night: 'uur die aand'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ var rem100 = number % 100
+ if (rem100 < 20) {
+ switch (rem100) {
+ case 1:
+ case 8:
+ return number + 'ste'
+ default:
+ return number + 'de'
+ }
+ }
+ return number + 'ste'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/af/_lib/match/index.js b/date-fns/src/locale/af/_lib/match/index.js
new file mode 100644
index 0000000..e5cb7a0
--- /dev/null
+++ b/date-fns/src/locale/af/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(ste|de)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^([vn]\.? ?C\.?)/,
+ abbreviated: /^([vn]\. ?C\.?)/,
+ wide: /^((voor|na) Christus)/
+}
+var parseEraPatterns = {
+ any: [/^v/, /^n/]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^K[1234]/i,
+ wide: /^[1234](st|d)e kwartaal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(Jan|Feb|Mrt|Apr|Mei|Jun|Jul|Aug|Sep|Okt|Nov|Dec)\.?/i,
+ wide: /^(Januarie|Februarie|Maart|April|Mei|Junie|Julie|Augustus|September|Oktober|November|Desember)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^J/i,
+ /^F/i,
+ /^M/i,
+ /^A/i,
+ /^M/i,
+ /^J/i,
+ /^J/i,
+ /^A/i,
+ /^S/i,
+ /^O/i,
+ /^N/i,
+ /^D/i
+ ],
+ any: [
+ /^Jan/i,
+ /^Feb/i,
+ /^Mrt/i,
+ /^Apr/i,
+ /^Mei/i,
+ /^Jun/i,
+ /^Jul/i,
+ /^Aug/i,
+ /^Sep/i,
+ /^Okt/i,
+ /^Nov/i,
+ /^Dec/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smdwv]/i,
+ short: /^(So|Ma|Di|Wo|Do|Vr|Sa)/i,
+ abbreviated: /^(Son|Maa|Din|Woe|Don|Vry|Sat)/i,
+ wide: /^(Sondag|Maandag|Dinsdag|Woensdag|Donderdag|Vrydag|Saterdag)/i
+}
+var parseDayPatterns = {
+ narrow: [/^S/i, /^M/i, /^D/i, /^W/i, /^D/i, /^V/i, /^S/i],
+ any: [/^So/i, /^Ma/i, /^Di/i, /^Wo/i, /^Do/i, /^Vr/i, /^Sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(vm|nm|middernag|(?:uur )?die (oggend|middag|aand))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^vm/i,
+ pm: /^nm/i,
+ midnight: /^middernag/i,
+ noon: /^middaguur/i,
+ morning: /oggend/i,
+ afternoon: /middag/i,
+ evening: /laat middag/i,
+ night: /aand/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/af/index.d.ts b/date-fns/src/locale/af/index.d.ts
new file mode 100644
index 0000000..fb278e6
--- /dev/null
+++ b/date-fns/src/locale/af/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { af } from 'date-fns/locale'
+export default af
diff --git a/date-fns/src/locale/af/index.js b/date-fns/src/locale/af/index.js
new file mode 100644
index 0000000..205b983
--- /dev/null
+++ b/date-fns/src/locale/af/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Afrikaans locale.
+ * @language Afrikaans
+ * @iso-639-2 afr
+ * @author Marnus Weststrate [@marnusw]{@link https://github.com/marnusw}
+ */
+var locale = {
+ code: 'af',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/af/index.js.flow b/date-fns/src/locale/af/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/af/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/af/snapshot.md b/date-fns/src/locale/af/snapshot.md
new file mode 100644
index 0000000..968212c
--- /dev/null
+++ b/date-fns/src/locale/af/snapshot.md
@@ -0,0 +1,304 @@
+# Afrikaans (af) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987ste | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5de | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987ste | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5de | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1ste | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2de | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1ste kwartaal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2de kwartaal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1ste | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2de | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1ste kwartaal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2de kwartaal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2de | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7de | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Februarie | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Julie | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2de | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7de | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Februarie | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Julie | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1ste | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49ste | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1ste | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ste | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11de | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28ste | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42ste | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365ste | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vry | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vry | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vry | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vrydag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1ste | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5de | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vry | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vrydag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2de | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6de | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vry | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vrydag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2de | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6de | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vry | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vrydag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Vr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | uur die oggend | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | uur die middag | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | uur die oggend | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | uur die middag | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | uur die oggend | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | uur die middag | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | uur die oggend | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | uur die middag | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | uur die oggend | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | uur die middag | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | uur die aand | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11de | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11de | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11de | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ste | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11de | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11de | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11de | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ste | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1ste | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55ste | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1ste | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55ste | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987/02/11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Februarie 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Woensdag, 11 Februarie 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sondag, 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987/02/11, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Februarie 1987 om 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 om 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Woensdag, 11 Februarie 1987 om 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sondag, 29 Mei 1453 om 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------- | ---------------------- | -------------------------- |
+| 2006-01-01T00:00:00.000Z | ongeveer 6 jaar | ongeveer 6 jaar | oor ongeveer 6 jaar |
+| 2005-01-01T00:00:00.000Z | ongeveer 5 jaar | ongeveer 5 jaar | oor ongeveer 5 jaar |
+| 2004-01-01T00:00:00.000Z | ongeveer 4 jaar | ongeveer 4 jaar | oor ongeveer 4 jaar |
+| 2003-01-01T00:00:00.000Z | ongeveer 3 jaar | ongeveer 3 jaar | oor ongeveer 3 jaar |
+| 2002-01-01T00:00:00.000Z | ongeveer 2 jaar | ongeveer 2 jaar | oor ongeveer 2 jaar |
+| 2001-06-01T00:00:00.000Z | meer as 1 jaar | meer as 1 jaar | oor meer as 1 jaar |
+| 2001-02-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | oor ongeveer 1 jaar |
+| 2001-01-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | oor ongeveer 1 jaar |
+| 2000-06-01T00:00:00.000Z | 5 maande | 5 maande | oor 5 maande |
+| 2000-03-01T00:00:00.000Z | 2 maande | 2 maande | oor 2 maande |
+| 2000-02-01T00:00:00.000Z | ongeveer 1 maand | ongeveer 1 maand | oor ongeveer 1 maand |
+| 2000-01-15T00:00:00.000Z | 14 dae | 14 dae | oor 14 dae |
+| 2000-01-02T00:00:00.000Z | 1 dag | 1 dag | oor 1 dag |
+| 2000-01-01T06:00:00.000Z | ongeveer 6 ure | ongeveer 6 ure | oor ongeveer 6 ure |
+| 2000-01-01T01:00:00.000Z | ongeveer 1 uur | ongeveer 1 uur | oor ongeveer 1 uur |
+| 2000-01-01T00:45:00.000Z | ongeveer 1 uur | ongeveer 1 uur | oor ongeveer 1 uur |
+| 2000-01-01T00:30:00.000Z | 30 minute | 30 minute | oor 30 minute |
+| 2000-01-01T00:15:00.000Z | 15 minute | 15 minute | oor 15 minute |
+| 2000-01-01T00:01:00.000Z | 'n minuut | 'n minuut | oor 'n minuut |
+| 2000-01-01T00:00:25.000Z | minder as 'n minuut | 'n halwe minuut | oor minder as 'n minuut |
+| 2000-01-01T00:00:15.000Z | minder as 'n minuut | minder as 20 sekondes | oor minder as 'n minuut |
+| 2000-01-01T00:00:05.000Z | minder as 'n minuut | minder as 10 sekondes | oor minder as 'n minuut |
+| 2000-01-01T00:00:00.000Z | minder as 'n minuut | minder as 5 sekondes | minder as 'n minuut gelede |
+| 1999-12-31T23:59:55.000Z | minder as 'n minuut | minder as 10 sekondes | minder as 'n minuut gelede |
+| 1999-12-31T23:59:45.000Z | minder as 'n minuut | minder as 20 sekondes | minder as 'n minuut gelede |
+| 1999-12-31T23:59:35.000Z | minder as 'n minuut | 'n halwe minuut | minder as 'n minuut gelede |
+| 1999-12-31T23:59:00.000Z | 'n minuut | 'n minuut | 'n minuut gelede |
+| 1999-12-31T23:45:00.000Z | 15 minute | 15 minute | 15 minute gelede |
+| 1999-12-31T23:30:00.000Z | 30 minute | 30 minute | 30 minute gelede |
+| 1999-12-31T23:15:00.000Z | ongeveer 1 uur | ongeveer 1 uur | ongeveer 1 uur gelede |
+| 1999-12-31T23:00:00.000Z | ongeveer 1 uur | ongeveer 1 uur | ongeveer 1 uur gelede |
+| 1999-12-31T18:00:00.000Z | ongeveer 6 ure | ongeveer 6 ure | ongeveer 6 ure gelede |
+| 1999-12-30T00:00:00.000Z | 2 dae | 2 dae | 2 dae gelede |
+| 1999-12-15T00:00:00.000Z | 17 dae | 17 dae | 17 dae gelede |
+| 1999-12-01T00:00:00.000Z | ongeveer 1 maand | ongeveer 1 maand | ongeveer 1 maand gelede |
+| 1999-11-01T00:00:00.000Z | 2 maande | 2 maande | 2 maande gelede |
+| 1999-06-01T00:00:00.000Z | 7 maande | 7 maande | 7 maande gelede |
+| 1999-01-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | ongeveer 1 jaar gelede |
+| 1998-12-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | ongeveer 1 jaar gelede |
+| 1998-06-01T00:00:00.000Z | meer as 1 jaar | meer as 1 jaar | meer as 1 jaar gelede |
+| 1998-01-01T00:00:00.000Z | ongeveer 2 jaar | ongeveer 2 jaar | ongeveer 2 jaar gelede |
+| 1997-01-01T00:00:00.000Z | ongeveer 3 jaar | ongeveer 3 jaar | ongeveer 3 jaar gelede |
+| 1996-01-01T00:00:00.000Z | ongeveer 4 jaar | ongeveer 4 jaar | ongeveer 4 jaar gelede |
+| 1995-01-01T00:00:00.000Z | ongeveer 5 jaar | ongeveer 5 jaar | ongeveer 5 jaar gelede |
+| 1994-01-01T00:00:00.000Z | ongeveer 6 jaar | ongeveer 6 jaar | ongeveer 6 jaar gelede |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 jaar | oor 6 jaar | 52608 ure |
+| 2005-01-01T00:00:00.000Z | 5 jaar | oor 5 jaar | 43848 ure |
+| 2004-01-01T00:00:00.000Z | 4 jaar | oor 4 jaar | 35064 ure |
+| 2003-01-01T00:00:00.000Z | 3 jaar | oor 3 jaar | 26304 ure |
+| 2002-01-01T00:00:00.000Z | 2 jaar | oor 2 jaar | 17544 ure |
+| 2001-06-01T00:00:00.000Z | 1 jaar | oor 1 jaar | 12408 ure |
+| 2001-02-01T00:00:00.000Z | 1 jaar | oor 1 jaar | 9528 ure |
+| 2001-01-01T00:00:00.000Z | 1 jaar | oor 1 jaar | 8784 ure |
+| 2000-06-01T00:00:00.000Z | 5 maande | oor 5 maande | 3648 ure |
+| 2000-03-01T00:00:00.000Z | 2 maande | oor 2 maande | 1440 ure |
+| 2000-02-01T00:00:00.000Z | 1 maand | oor 1 maand | 744 ure |
+| 2000-01-15T00:00:00.000Z | 14 dae | oor 14 dae | 336 ure |
+| 2000-01-02T00:00:00.000Z | 1 dag | oor 1 dag | 24 ure |
+| 2000-01-01T06:00:00.000Z | 6 ure | oor 6 ure | 6 ure |
+| 2000-01-01T01:00:00.000Z | 1 uur | oor 1 uur | 1 uur |
+| 2000-01-01T00:45:00.000Z | 45 minute | oor 45 minute | 1 uur |
+| 2000-01-01T00:30:00.000Z | 30 minute | oor 30 minute | 1 uur |
+| 2000-01-01T00:15:00.000Z | 15 minute | oor 15 minute | 0 ure |
+| 2000-01-01T00:01:00.000Z | 'n minuut | oor 'n minuut | 0 ure |
+| 2000-01-01T00:00:25.000Z | 25 sekondes | oor 25 sekondes | 0 ure |
+| 2000-01-01T00:00:15.000Z | 15 sekondes | oor 15 sekondes | 0 ure |
+| 2000-01-01T00:00:05.000Z | 5 sekondes | oor 5 sekondes | 0 ure |
+| 2000-01-01T00:00:00.000Z | 0 sekondes | 0 sekondes gelede | 0 ure |
+| 1999-12-31T23:59:55.000Z | 5 sekondes | 5 sekondes gelede | 0 ure |
+| 1999-12-31T23:59:45.000Z | 15 sekondes | 15 sekondes gelede | 0 ure |
+| 1999-12-31T23:59:35.000Z | 25 sekondes | 25 sekondes gelede | 0 ure |
+| 1999-12-31T23:59:00.000Z | 'n minuut | 'n minuut gelede | 0 ure |
+| 1999-12-31T23:45:00.000Z | 15 minute | 15 minute gelede | 0 ure |
+| 1999-12-31T23:30:00.000Z | 30 minute | 30 minute gelede | 1 uur |
+| 1999-12-31T23:15:00.000Z | 45 minute | 45 minute gelede | 1 uur |
+| 1999-12-31T23:00:00.000Z | 1 uur | 1 uur gelede | 1 uur |
+| 1999-12-31T18:00:00.000Z | 6 ure | 6 ure gelede | 6 ure |
+| 1999-12-30T00:00:00.000Z | 2 dae | 2 dae gelede | 48 ure |
+| 1999-12-15T00:00:00.000Z | 17 dae | 17 dae gelede | 408 ure |
+| 1999-12-01T00:00:00.000Z | 1 maand | 1 maand gelede | 744 ure |
+| 1999-11-01T00:00:00.000Z | 2 maande | 2 maande gelede | 1464 ure |
+| 1999-06-01T00:00:00.000Z | 7 maande | 7 maande gelede | 5136 ure |
+| 1999-01-01T00:00:00.000Z | 1 jaar | 1 jaar gelede | 8760 ure |
+| 1998-12-01T00:00:00.000Z | 1 jaar | 1 jaar gelede | 9504 ure |
+| 1998-06-01T00:00:00.000Z | 2 jaar | 2 jaar gelede | 13896 ure |
+| 1998-01-01T00:00:00.000Z | 2 jaar | 2 jaar gelede | 17520 ure |
+| 1997-01-01T00:00:00.000Z | 3 jaar | 3 jaar gelede | 26280 ure |
+| 1996-01-01T00:00:00.000Z | 4 jaar | 4 jaar gelede | 35064 ure |
+| 1995-01-01T00:00:00.000Z | 5 jaar | 5 jaar gelede | 43824 ure |
+| 1994-01-01T00:00:00.000Z | 6 jaar | 6 jaar gelede | 52584 ure |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 2000/01/10 |
+| 2000-01-05T00:00:00.000Z | Woensdag om 00:00 |
+| 2000-01-02T00:00:00.000Z | môre om 00:00 |
+| 2000-01-01T00:00:00.000Z | vandag om 00:00 |
+| 1999-12-31T00:00:00.000Z | gister om 00:00 |
+| 1999-12-27T00:00:00.000Z | verlede Maandag om 00:00 |
+| 1999-12-21T00:00:00.000Z | 1999/12/21 |
diff --git a/date-fns/src/locale/ar-DZ/_lib/formatDistance/index.js b/date-fns/src/locale/ar-DZ/_lib/formatDistance/index.js
new file mode 100644
index 0000000..bcdb373
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/_lib/formatDistance/index.js
@@ -0,0 +1,135 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'أقل من ثانية واحدة',
+ two: 'أقل من ثانتين',
+ threeToTen: 'أقل من {{count}} ثواني',
+ other: 'أقل من {{count}} ثانية'
+ },
+
+ xSeconds: {
+ one: 'ثانية واحدة',
+ two: 'ثانتين',
+ threeToTen: '{{count}} ثواني',
+ other: '{{count}} ثانية'
+ },
+
+ halfAMinute: 'نصف دقيقة',
+
+ lessThanXMinutes: {
+ one: 'أقل من دقيقة',
+ two: 'أقل من دقيقتين',
+ threeToTen: 'أقل من {{count}} دقائق',
+ other: 'أقل من {{count}} دقيقة'
+ },
+
+ xMinutes: {
+ one: 'دقيقة واحدة',
+ two: 'دقيقتين',
+ threeToTen: '{{count}} دقائق',
+ other: '{{count}} دقيقة'
+ },
+
+ aboutXHours: {
+ one: 'ساعة واحدة تقريباً',
+ two: 'ساعتين تقريباً',
+ threeToTen: '{{count}} ساعات تقريباً',
+ other: '{{count}} ساعة تقريباً'
+ },
+
+ xHours: {
+ one: 'ساعة واحدة',
+ two: 'ساعتين',
+ threeToTen: '{{count}} ساعات',
+ other: '{{count}} ساعة'
+ },
+
+ xDays: {
+ one: 'يوم واحد',
+ two: 'يومين',
+ threeToTen: '{{count}} أيام',
+ other: '{{count}} يوم'
+ },
+
+ aboutXWeeks: {
+ one: 'أسبوع واحد تقريباً',
+ two: 'أسبوعين تقريباً',
+ threeToTen: '{{count}} أسابيع تقريباً',
+ other: '{{count}} أسبوع تقريباً'
+ },
+
+ xWeeks: {
+ one: 'أسبوع واحد',
+ two: 'أسبوعين',
+ threeToTen: '{{count}} أسابيع',
+ other: '{{count}} أسبوع'
+ },
+
+ aboutXMonths: {
+ one: 'شهر واحد تقريباً',
+ two: 'شهرين تقريباً',
+ threeToTen: '{{count}} أشهر تقريباً',
+ other: '{{count}} شهر تقريباً'
+ },
+
+ xMonths: {
+ one: 'شهر واحد',
+ two: 'شهرين',
+ threeToTen: '{{count}} أشهر',
+ other: '{{count}} شهر'
+ },
+
+ aboutXYears: {
+ one: 'عام واحد تقريباً',
+ two: 'عامين تقريباً',
+ threeToTen: '{{count}} أعوام تقريباً',
+ other: '{{count}} عام تقريباً'
+ },
+
+ xYears: {
+ one: 'عام واحد',
+ two: 'عامين',
+ threeToTen: '{{count}} أعوام',
+ other: '{{count}} عام'
+ },
+
+ overXYears: {
+ one: 'أكثر من عام',
+ two: 'أكثر من عامين',
+ threeToTen: 'أكثر من {{count}} أعوام',
+ other: 'أكثر من {{count}} عام'
+ },
+
+ almostXYears: {
+ one: 'عام واحد تقريباً',
+ two: 'عامين تقريباً',
+ threeToTen: '{{count}} أعوام تقريباً',
+ other: '{{count}} عام تقريباً'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 2) {
+ result = formatDistanceLocale[token].two
+ } else if (count <= 10) {
+ result = formatDistanceLocale[token].threeToTen.replace('{{count}}', count)
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'في خلال ' + result
+ } else {
+ return 'منذ ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ar-DZ/_lib/formatLong/index.js b/date-fns/src/locale/ar-DZ/_lib/formatLong/index.js
new file mode 100644
index 0000000..a65ad56
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'عند' {{time}}",
+ long: "{{date}} 'عند' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ar-DZ/_lib/formatRelative/index.js b/date-fns/src/locale/ar-DZ/_lib/formatRelative/index.js
new file mode 100644
index 0000000..9276495
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'أخر' eeee 'عند' p",
+ yesterday: "'أمس عند' p",
+ today: "'اليوم عند' p",
+ tomorrow: "'غداً عند' p",
+ nextWeek: "eeee 'عند' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ar-DZ/_lib/localize/index.js b/date-fns/src/locale/ar-DZ/_lib/localize/index.js
new file mode 100644
index 0000000..0a8c733
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/_lib/localize/index.js
@@ -0,0 +1,163 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ق', 'ب'],
+ abbreviated: ['ق.م.', 'ب.م.'],
+ wide: ['قبل الميلاد', 'بعد الميلاد']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['ر1', 'ر2', 'ر3', 'ر4'],
+ wide: ['الربع الأول', 'الربع الثاني', 'الربع الثالث', 'الربع الرابع']
+}
+
+var monthValues = {
+ narrow: ['ج', 'ف', 'م', 'أ', 'م', 'ج', 'ج', 'أ', 'س', 'أ', 'ن', 'د'],
+ abbreviated: [
+ 'جانـ',
+ 'فيفـ',
+ 'مارس',
+ 'أفريل',
+ 'مايـ',
+ 'جوانـ',
+ 'جويـ',
+ 'أوت',
+ 'سبتـ',
+ 'أكتـ',
+ 'نوفـ',
+ 'ديسـ'
+ ],
+ wide: [
+ 'جانفي',
+ 'فيفري',
+ 'مارس',
+ 'أفريل',
+ 'ماي',
+ 'جوان',
+ 'جويلية',
+ 'أوت',
+ 'سبتمبر',
+ 'أكتوبر',
+ 'نوفمبر',
+ 'ديسمبر'
+ ]
+}
+
+var dayValues = {
+ narrow: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
+ short: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
+ abbreviated: ['أحد', 'اثنـ', 'ثلا', 'أربـ', 'خميـ', 'جمعة', 'سبت'],
+ wide: [
+ 'الأحد',
+ 'الاثنين',
+ 'الثلاثاء',
+ 'الأربعاء',
+ 'الخميس',
+ 'الجمعة',
+ 'السبت'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ },
+ abbreviated: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ },
+ wide: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'في الصباح',
+ afternoon: 'بعد الظـهر',
+ evening: 'في المساء',
+ night: 'في الليل'
+ },
+ abbreviated: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'في الصباح',
+ evening: 'في المساء',
+ night: 'في الليل'
+ },
+ wide: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ afternoon: 'بعد الظـهر',
+ evening: 'في المساء',
+ night: 'في الليل'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ return String(dirtyNumber)
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ar-DZ/_lib/match/index.js b/date-fns/src/locale/ar-DZ/_lib/match/index.js
new file mode 100644
index 0000000..98e270c
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/_lib/match/index.js
@@ -0,0 +1,147 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ق|ب)/i,
+ abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,
+ wide: /^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i
+}
+var parseEraPatterns = {
+ any: [/^قبل/i, /^بعد/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^ر[1234]/i,
+ wide: /^الربع [1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[جفمأسند]/i,
+ abbreviated: /^(جان|فيف|مار|أفر|ماي|جوا|جوي|أوت|سبت|أكت|نوف|ديس)/i,
+ wide: /^(جانفي|فيفري|مارس|أفريل|ماي|جوان|جويلية|أوت|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/i
+}
+
+var parseMonthPatterns = {
+ narrow: [
+ /^ج/i,
+ /^ف/i,
+ /^م/i,
+ /^أ/i,
+ /^م/i,
+ /^ج/i,
+ /^ج/i,
+ /^أ/i,
+ /^س/i,
+ /^أ/i,
+ /^ن/i,
+ /^د/i
+ ],
+ any: [
+ /^جان/i,
+ /^فيف/i,
+ /^مار/i,
+ /^أفر/i,
+ /^ماي/i,
+ /^جوا/i,
+ /^جوي/i,
+ /^أوت/i,
+ /^سبت/i,
+ /^أكت/i,
+ /^نوف/i,
+ /^ديس/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[حنثرخجس]/i,
+ short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
+ abbreviated: /^(أحد|اثن|ثلا|أرب|خمي|جمعة|سبت)/i,
+ wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ح/i, /^ن/i, /^ث/i, /^ر/i, /^خ/i, /^ج/i, /^س/i],
+ wide: [
+ /^الأحد/i,
+ /^الاثنين/i,
+ /^الثلاثاء/i,
+ /^الأربعاء/i,
+ /^الخميس/i,
+ /^الجمعة/i,
+ /^السبت/i
+ ],
+ any: [/^أح/i, /^اث/i, /^ث/i, /^أر/i, /^خ/i, /^ج/i, /^س/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mi/i,
+ noon: /^no/i,
+ morning: /morning/i,
+ afternoon: /afternoon/i,
+ evening: /evening/i,
+ night: /night/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ar-DZ/index.d.ts b/date-fns/src/locale/ar-DZ/index.d.ts
new file mode 100644
index 0000000..97f47f1
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { arDZ } from 'date-fns/locale'
+export default arDZ
diff --git a/date-fns/src/locale/ar-DZ/index.js b/date-fns/src/locale/ar-DZ/index.js
new file mode 100644
index 0000000..173a706
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Arabic locale (Algerian Arabic).
+ * @language Algerian Arabic
+ * @iso-639-2 ara
+ * @author Badreddine Boumaza [@badre429]{@link https://github.com/badre429}
+ * @author Ahmed ElShahat [@elshahat]{@link https://github.com/elshahat}
+ */
+var locale = {
+ code: 'ar-DZ',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1,
+ },
+}
+
+export default locale
diff --git a/date-fns/src/locale/ar-DZ/index.js.flow b/date-fns/src/locale/ar-DZ/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ar-DZ/snapshot.md b/date-fns/src/locale/ar-DZ/snapshot.md
new file mode 100644
index 0000000..ca2403f
--- /dev/null
+++ b/date-fns/src/locale/ar-DZ/snapshot.md
@@ -0,0 +1,304 @@
+# Algerian Arabic (ar-DZ) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | ر1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ر2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | الربع الأول | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | الربع الثاني | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | ر1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ر2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | الربع الأول | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | الربع الثاني | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | فيفـ | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | جويـ | Invalid Date |
+| | MMMM | 2019-02-11T12:13:14.015Z | فيفري | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | جويلية | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ج | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | فيفـ | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | جويـ | Invalid Date |
+| | LLLL | 2019-02-11T12:13:14.015Z | فيفري | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | جويلية | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ج | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49 | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | بعد الظـهر | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | بعد الظـهر | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | فيفـ 11, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | مايـ 29, 1453 | Invalid Date |
+| | PPP | 1987-02-11T12:13:14.015Z | فيفري 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | الأربعاء, فيفري 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | الأحد, ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59 م | Invalid Date |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م | Invalid Date |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 م GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م GMT+0 | Invalid Date |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 م GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م GMT+00:00 | Invalid Date |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 م | Invalid Date |
+| | PPpp | 1987-02-11T12:13:14.015Z | فيفـ 11, 1987, 12:13:14 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | مايـ 29, 1453, 11:59:59 م | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | فيفري 11, 1987 عند 12:13:14 م GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 عند 11:59:59 م GMT+0 | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | الأربعاء, فيفري 11, 1987 عند 12:13:14 م GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | الأحد, ماي 29, 1453 عند 11:59:59 م GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | -------------------------- |
+| 2006-01-01T00:00:00.000Z | 6 أعوام تقريباً | 6 أعوام تقريباً | في خلال 6 أعوام تقريباً |
+| 2005-01-01T00:00:00.000Z | 5 أعوام تقريباً | 5 أعوام تقريباً | في خلال 5 أعوام تقريباً |
+| 2004-01-01T00:00:00.000Z | 4 أعوام تقريباً | 4 أعوام تقريباً | في خلال 4 أعوام تقريباً |
+| 2003-01-01T00:00:00.000Z | 3 أعوام تقريباً | 3 أعوام تقريباً | في خلال 3 أعوام تقريباً |
+| 2002-01-01T00:00:00.000Z | عامين تقريباً | عامين تقريباً | في خلال عامين تقريباً |
+| 2001-06-01T00:00:00.000Z | أكثر من عام | أكثر من عام | في خلال أكثر من عام |
+| 2001-02-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | في خلال عام واحد تقريباً |
+| 2001-01-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | في خلال عام واحد تقريباً |
+| 2000-06-01T00:00:00.000Z | 5 أشهر | 5 أشهر | في خلال 5 أشهر |
+| 2000-03-01T00:00:00.000Z | شهرين | شهرين | في خلال شهرين |
+| 2000-02-01T00:00:00.000Z | شهر واحد تقريباً | شهر واحد تقريباً | في خلال شهر واحد تقريباً |
+| 2000-01-15T00:00:00.000Z | 14 يوم | 14 يوم | في خلال 14 يوم |
+| 2000-01-02T00:00:00.000Z | يوم واحد | يوم واحد | في خلال يوم واحد |
+| 2000-01-01T06:00:00.000Z | 6 ساعات تقريباً | 6 ساعات تقريباً | في خلال 6 ساعات تقريباً |
+| 2000-01-01T01:00:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | في خلال ساعة واحدة تقريباً |
+| 2000-01-01T00:45:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | في خلال ساعة واحدة تقريباً |
+| 2000-01-01T00:30:00.000Z | 30 دقيقة | 30 دقيقة | في خلال 30 دقيقة |
+| 2000-01-01T00:15:00.000Z | 15 دقيقة | 15 دقيقة | في خلال 15 دقيقة |
+| 2000-01-01T00:01:00.000Z | دقيقة واحدة | دقيقة واحدة | في خلال دقيقة واحدة |
+| 2000-01-01T00:00:25.000Z | أقل من دقيقة | نصف دقيقة | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:15.000Z | أقل من دقيقة | أقل من 20 ثانية | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:05.000Z | أقل من دقيقة | أقل من 10 ثواني | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:00.000Z | أقل من دقيقة | أقل من 5 ثواني | منذ أقل من دقيقة |
+| 1999-12-31T23:59:55.000Z | أقل من دقيقة | أقل من 10 ثواني | منذ أقل من دقيقة |
+| 1999-12-31T23:59:45.000Z | أقل من دقيقة | أقل من 20 ثانية | منذ أقل من دقيقة |
+| 1999-12-31T23:59:35.000Z | أقل من دقيقة | نصف دقيقة | منذ أقل من دقيقة |
+| 1999-12-31T23:59:00.000Z | دقيقة واحدة | دقيقة واحدة | منذ دقيقة واحدة |
+| 1999-12-31T23:45:00.000Z | 15 دقيقة | 15 دقيقة | منذ 15 دقيقة |
+| 1999-12-31T23:30:00.000Z | 30 دقيقة | 30 دقيقة | منذ 30 دقيقة |
+| 1999-12-31T23:15:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | منذ ساعة واحدة تقريباً |
+| 1999-12-31T23:00:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | منذ ساعة واحدة تقريباً |
+| 1999-12-31T18:00:00.000Z | 6 ساعات تقريباً | 6 ساعات تقريباً | منذ 6 ساعات تقريباً |
+| 1999-12-30T00:00:00.000Z | يومين | يومين | منذ يومين |
+| 1999-12-15T00:00:00.000Z | 17 يوم | 17 يوم | منذ 17 يوم |
+| 1999-12-01T00:00:00.000Z | شهر واحد تقريباً | شهر واحد تقريباً | منذ شهر واحد تقريباً |
+| 1999-11-01T00:00:00.000Z | شهرين | شهرين | منذ شهرين |
+| 1999-06-01T00:00:00.000Z | 7 أشهر | 7 أشهر | منذ 7 أشهر |
+| 1999-01-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | منذ عام واحد تقريباً |
+| 1998-12-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | منذ عام واحد تقريباً |
+| 1998-06-01T00:00:00.000Z | أكثر من عام | أكثر من عام | منذ أكثر من عام |
+| 1998-01-01T00:00:00.000Z | عامين تقريباً | عامين تقريباً | منذ عامين تقريباً |
+| 1997-01-01T00:00:00.000Z | 3 أعوام تقريباً | 3 أعوام تقريباً | منذ 3 أعوام تقريباً |
+| 1996-01-01T00:00:00.000Z | 4 أعوام تقريباً | 4 أعوام تقريباً | منذ 4 أعوام تقريباً |
+| 1995-01-01T00:00:00.000Z | 5 أعوام تقريباً | 5 أعوام تقريباً | منذ 5 أعوام تقريباً |
+| 1994-01-01T00:00:00.000Z | 6 أعوام تقريباً | 6 أعوام تقريباً | منذ 6 أعوام تقريباً |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 أعوام | في خلال 6 أعوام | 52608 ساعة |
+| 2005-01-01T00:00:00.000Z | 5 أعوام | في خلال 5 أعوام | 43848 ساعة |
+| 2004-01-01T00:00:00.000Z | 4 أعوام | في خلال 4 أعوام | 35064 ساعة |
+| 2003-01-01T00:00:00.000Z | 3 أعوام | في خلال 3 أعوام | 26304 ساعة |
+| 2002-01-01T00:00:00.000Z | عامين | في خلال عامين | 17544 ساعة |
+| 2001-06-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 12408 ساعة |
+| 2001-02-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 9528 ساعة |
+| 2001-01-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 8784 ساعة |
+| 2000-06-01T00:00:00.000Z | 5 أشهر | في خلال 5 أشهر | 3648 ساعة |
+| 2000-03-01T00:00:00.000Z | شهرين | في خلال شهرين | 1440 ساعة |
+| 2000-02-01T00:00:00.000Z | شهر واحد | في خلال شهر واحد | 744 ساعة |
+| 2000-01-15T00:00:00.000Z | 14 يوم | في خلال 14 يوم | 336 ساعة |
+| 2000-01-02T00:00:00.000Z | يوم واحد | في خلال يوم واحد | 24 ساعة |
+| 2000-01-01T06:00:00.000Z | 6 ساعات | في خلال 6 ساعات | 6 ساعات |
+| 2000-01-01T01:00:00.000Z | ساعة واحدة | في خلال ساعة واحدة | ساعة واحدة |
+| 2000-01-01T00:45:00.000Z | 45 دقيقة | في خلال 45 دقيقة | ساعة واحدة |
+| 2000-01-01T00:30:00.000Z | 30 دقيقة | في خلال 30 دقيقة | ساعة واحدة |
+| 2000-01-01T00:15:00.000Z | 15 دقيقة | في خلال 15 دقيقة | 0 ساعات |
+| 2000-01-01T00:01:00.000Z | دقيقة واحدة | في خلال دقيقة واحدة | 0 ساعات |
+| 2000-01-01T00:00:25.000Z | 25 ثانية | في خلال 25 ثانية | 0 ساعات |
+| 2000-01-01T00:00:15.000Z | 15 ثانية | في خلال 15 ثانية | 0 ساعات |
+| 2000-01-01T00:00:05.000Z | 5 ثواني | في خلال 5 ثواني | 0 ساعات |
+| 2000-01-01T00:00:00.000Z | 0 ثواني | منذ 0 ثواني | 0 ساعات |
+| 1999-12-31T23:59:55.000Z | 5 ثواني | منذ 5 ثواني | 0 ساعات |
+| 1999-12-31T23:59:45.000Z | 15 ثانية | منذ 15 ثانية | 0 ساعات |
+| 1999-12-31T23:59:35.000Z | 25 ثانية | منذ 25 ثانية | 0 ساعات |
+| 1999-12-31T23:59:00.000Z | دقيقة واحدة | منذ دقيقة واحدة | 0 ساعات |
+| 1999-12-31T23:45:00.000Z | 15 دقيقة | منذ 15 دقيقة | 0 ساعات |
+| 1999-12-31T23:30:00.000Z | 30 دقيقة | منذ 30 دقيقة | ساعة واحدة |
+| 1999-12-31T23:15:00.000Z | 45 دقيقة | منذ 45 دقيقة | ساعة واحدة |
+| 1999-12-31T23:00:00.000Z | ساعة واحدة | منذ ساعة واحدة | ساعة واحدة |
+| 1999-12-31T18:00:00.000Z | 6 ساعات | منذ 6 ساعات | 6 ساعات |
+| 1999-12-30T00:00:00.000Z | يومين | منذ يومين | 48 ساعة |
+| 1999-12-15T00:00:00.000Z | 17 يوم | منذ 17 يوم | 408 ساعة |
+| 1999-12-01T00:00:00.000Z | شهر واحد | منذ شهر واحد | 744 ساعة |
+| 1999-11-01T00:00:00.000Z | شهرين | منذ شهرين | 1464 ساعة |
+| 1999-06-01T00:00:00.000Z | 7 أشهر | منذ 7 أشهر | 5136 ساعة |
+| 1999-01-01T00:00:00.000Z | عام واحد | منذ عام واحد | 8760 ساعة |
+| 1998-12-01T00:00:00.000Z | عام واحد | منذ عام واحد | 9504 ساعة |
+| 1998-06-01T00:00:00.000Z | عامين | منذ عامين | 13896 ساعة |
+| 1998-01-01T00:00:00.000Z | عامين | منذ عامين | 17520 ساعة |
+| 1997-01-01T00:00:00.000Z | 3 أعوام | منذ 3 أعوام | 26280 ساعة |
+| 1996-01-01T00:00:00.000Z | 4 أعوام | منذ 4 أعوام | 35064 ساعة |
+| 1995-01-01T00:00:00.000Z | 5 أعوام | منذ 5 أعوام | 43824 ساعة |
+| 1994-01-01T00:00:00.000Z | 6 أعوام | منذ 6 أعوام | 52584 ساعة |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | الأربعاء عند 12:00 ص |
+| 2000-01-02T00:00:00.000Z | غداً عند 12:00 ص |
+| 2000-01-01T00:00:00.000Z | اليوم عند 12:00 ص |
+| 1999-12-31T00:00:00.000Z | أمس عند 12:00 ص |
+| 1999-12-27T00:00:00.000Z | أخر الاثنين عند 12:00 ص |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/ar-MA/_lib/formatDistance/index.js b/date-fns/src/locale/ar-MA/_lib/formatDistance/index.js
new file mode 100644
index 0000000..bcdb373
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/_lib/formatDistance/index.js
@@ -0,0 +1,135 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'أقل من ثانية واحدة',
+ two: 'أقل من ثانتين',
+ threeToTen: 'أقل من {{count}} ثواني',
+ other: 'أقل من {{count}} ثانية'
+ },
+
+ xSeconds: {
+ one: 'ثانية واحدة',
+ two: 'ثانتين',
+ threeToTen: '{{count}} ثواني',
+ other: '{{count}} ثانية'
+ },
+
+ halfAMinute: 'نصف دقيقة',
+
+ lessThanXMinutes: {
+ one: 'أقل من دقيقة',
+ two: 'أقل من دقيقتين',
+ threeToTen: 'أقل من {{count}} دقائق',
+ other: 'أقل من {{count}} دقيقة'
+ },
+
+ xMinutes: {
+ one: 'دقيقة واحدة',
+ two: 'دقيقتين',
+ threeToTen: '{{count}} دقائق',
+ other: '{{count}} دقيقة'
+ },
+
+ aboutXHours: {
+ one: 'ساعة واحدة تقريباً',
+ two: 'ساعتين تقريباً',
+ threeToTen: '{{count}} ساعات تقريباً',
+ other: '{{count}} ساعة تقريباً'
+ },
+
+ xHours: {
+ one: 'ساعة واحدة',
+ two: 'ساعتين',
+ threeToTen: '{{count}} ساعات',
+ other: '{{count}} ساعة'
+ },
+
+ xDays: {
+ one: 'يوم واحد',
+ two: 'يومين',
+ threeToTen: '{{count}} أيام',
+ other: '{{count}} يوم'
+ },
+
+ aboutXWeeks: {
+ one: 'أسبوع واحد تقريباً',
+ two: 'أسبوعين تقريباً',
+ threeToTen: '{{count}} أسابيع تقريباً',
+ other: '{{count}} أسبوع تقريباً'
+ },
+
+ xWeeks: {
+ one: 'أسبوع واحد',
+ two: 'أسبوعين',
+ threeToTen: '{{count}} أسابيع',
+ other: '{{count}} أسبوع'
+ },
+
+ aboutXMonths: {
+ one: 'شهر واحد تقريباً',
+ two: 'شهرين تقريباً',
+ threeToTen: '{{count}} أشهر تقريباً',
+ other: '{{count}} شهر تقريباً'
+ },
+
+ xMonths: {
+ one: 'شهر واحد',
+ two: 'شهرين',
+ threeToTen: '{{count}} أشهر',
+ other: '{{count}} شهر'
+ },
+
+ aboutXYears: {
+ one: 'عام واحد تقريباً',
+ two: 'عامين تقريباً',
+ threeToTen: '{{count}} أعوام تقريباً',
+ other: '{{count}} عام تقريباً'
+ },
+
+ xYears: {
+ one: 'عام واحد',
+ two: 'عامين',
+ threeToTen: '{{count}} أعوام',
+ other: '{{count}} عام'
+ },
+
+ overXYears: {
+ one: 'أكثر من عام',
+ two: 'أكثر من عامين',
+ threeToTen: 'أكثر من {{count}} أعوام',
+ other: 'أكثر من {{count}} عام'
+ },
+
+ almostXYears: {
+ one: 'عام واحد تقريباً',
+ two: 'عامين تقريباً',
+ threeToTen: '{{count}} أعوام تقريباً',
+ other: '{{count}} عام تقريباً'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 2) {
+ result = formatDistanceLocale[token].two
+ } else if (count <= 10) {
+ result = formatDistanceLocale[token].threeToTen.replace('{{count}}', count)
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'في خلال ' + result
+ } else {
+ return 'منذ ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ar-MA/_lib/formatLong/index.js b/date-fns/src/locale/ar-MA/_lib/formatLong/index.js
new file mode 100644
index 0000000..a65ad56
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'عند' {{time}}",
+ long: "{{date}} 'عند' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ar-MA/_lib/formatRelative/index.js b/date-fns/src/locale/ar-MA/_lib/formatRelative/index.js
new file mode 100644
index 0000000..9276495
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'أخر' eeee 'عند' p",
+ yesterday: "'أمس عند' p",
+ today: "'اليوم عند' p",
+ tomorrow: "'غداً عند' p",
+ nextWeek: "eeee 'عند' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ar-MA/_lib/localize/index.js b/date-fns/src/locale/ar-MA/_lib/localize/index.js
new file mode 100644
index 0000000..f165992
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/_lib/localize/index.js
@@ -0,0 +1,163 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ق', 'ب'],
+ abbreviated: ['ق.م.', 'ب.م.'],
+ wide: ['قبل الميلاد', 'بعد الميلاد']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['ر1', 'ر2', 'ر3', 'ر4'],
+ wide: ['الربع الأول', 'الربع الثاني', 'الربع الثالث', 'الربع الرابع']
+}
+
+var monthValues = {
+ narrow: ['ي', 'ف', 'م', 'أ', 'م', 'ي', 'ي', 'غ', 'ش', 'أ', 'ن', 'د'],
+ abbreviated: [
+ 'ينا',
+ 'فبر',
+ 'مارس',
+ 'أبريل',
+ 'ماي',
+ 'يونـ',
+ 'يولـ',
+ 'غشت',
+ 'شتنـ',
+ 'أكتـ',
+ 'نونـ',
+ 'دجنـ'
+ ],
+ wide: [
+ 'يناير',
+ 'فبراير',
+ 'مارس',
+ 'أبريل',
+ 'ماي',
+ 'يونيو',
+ 'يوليوز',
+ 'غشت',
+ 'شتنبر',
+ 'أكتوبر',
+ 'نونبر',
+ 'دجنبر'
+ ]
+}
+
+var dayValues = {
+ narrow: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
+ short: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
+ abbreviated: ['أحد', 'اثنـ', 'ثلا', 'أربـ', 'خميـ', 'جمعة', 'سبت'],
+ wide: [
+ 'الأحد',
+ 'الإثنين',
+ 'الثلاثاء',
+ 'الأربعاء',
+ 'الخميس',
+ 'الجمعة',
+ 'السبت'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ },
+ abbreviated: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ },
+ wide: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'في الصباح',
+ afternoon: 'بعد الظـهر',
+ evening: 'في المساء',
+ night: 'في الليل'
+ },
+ abbreviated: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'في الصباح',
+ evening: 'في المساء',
+ night: 'في الليل'
+ },
+ wide: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ afternoon: 'بعد الظـهر',
+ evening: 'في المساء',
+ night: 'في الليل'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ return String(dirtyNumber)
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ar-MA/_lib/match/index.js b/date-fns/src/locale/ar-MA/_lib/match/index.js
new file mode 100644
index 0000000..62c87a5
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/_lib/match/index.js
@@ -0,0 +1,146 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ق|ب)/i,
+ abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,
+ wide: /^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i
+}
+var parseEraPatterns = {
+ any: [/^قبل/i, /^بعد/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^ر[1234]/i,
+ wide: /^الربع [1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[يفمأمسند]/i,
+ abbreviated: /^(ين|ف|مار|أب|ماي|يون|يول|غش|شت|أك|ن|د)/i,
+ wide: /^(ين|ف|مار|أب|ماي|يون|يول|غش|شت|أك|ن|د)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^ي/i,
+ /^ف/i,
+ /^م/i,
+ /^أ/i,
+ /^م/i,
+ /^ي/i,
+ /^ي/i,
+ /^غ/i,
+ /^ش/i,
+ /^أ/i,
+ /^ن/i,
+ /^د/i
+ ],
+ any: [
+ /^ين/i,
+ /^فب/i,
+ /^مار/i,
+ /^أب/i,
+ /^ماي/i,
+ /^يون/i,
+ /^يول/i,
+ /^غشت/i,
+ /^ش/i,
+ /^أك/i,
+ /^ن/i,
+ /^د/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[حنثرخجس]/i,
+ short: /^(أحد|إثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
+ abbreviated: /^(أحد|إثن|ثلا|أرب|خمي|جمعة|سبت)/i,
+ wide: /^(الأحد|الإثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ح/i, /^ن/i, /^ث/i, /^ر/i, /^خ/i, /^ج/i, /^س/i],
+ wide: [
+ /^الأحد/i,
+ /^الإثنين/i,
+ /^الثلاثاء/i,
+ /^الأربعاء/i,
+ /^الخميس/i,
+ /^الجمعة/i,
+ /^السبت/i
+ ],
+ any: [/^أح/i, /^إث/i, /^ث/i, /^أر/i, /^خ/i, /^ج/i, /^س/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mi/i,
+ noon: /^no/i,
+ morning: /morning/i,
+ afternoon: /afternoon/i,
+ evening: /evening/i,
+ night: /night/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ar-MA/index.d.ts b/date-fns/src/locale/ar-MA/index.d.ts
new file mode 100644
index 0000000..b12ae41
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { arMA } from 'date-fns/locale'
+export default arMA
diff --git a/date-fns/src/locale/ar-MA/index.js b/date-fns/src/locale/ar-MA/index.js
new file mode 100644
index 0000000..0f9acc3
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Arabic locale (Moroccan Arabic).
+ * @language Moroccan Arabic
+ * @iso-639-2 ara
+ * @author Achraf Rrami [@rramiachraf]{@link https://github.com/rramiachraf}
+ */
+var locale = {
+ code: 'ar-MA',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ // Monday is 1
+ weekStartsOn: 1,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ar-MA/index.js.flow b/date-fns/src/locale/ar-MA/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ar-MA/snapshot.md b/date-fns/src/locale/ar-MA/snapshot.md
new file mode 100644
index 0000000..ccb0c1c
--- /dev/null
+++ b/date-fns/src/locale/ar-MA/snapshot.md
@@ -0,0 +1,304 @@
+# Moroccan Arabic (ar-MA) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | ر1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ر2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | الربع الأول | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | الربع الثاني | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | ر1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ر2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | الربع الأول | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | الربع الثاني | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | فبر | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يولـ | Invalid Date |
+| | MMMM | 2019-02-11T12:13:14.015Z | فبراير | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يوليوز | Invalid Date |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ي | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | فبر | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يولـ | Invalid Date |
+| | LLLL | 2019-02-11T12:13:14.015Z | فبراير | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يوليوز | Invalid Date |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ي | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | الإثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | اثنين | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | الإثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | اثنين | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | الإثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | اثنين | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | الإثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | اثنين | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | بعد الظـهر | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | بعد الظـهر | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | فبر 11, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | فبراير 11, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | الأربعاء, فبراير 11, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | الأحد, ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59 م | Invalid Date |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م | Invalid Date |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 م GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م GMT+0 | Invalid Date |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 م GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م GMT+00:00 | Invalid Date |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 م | Invalid Date |
+| | PPpp | 1987-02-11T12:13:14.015Z | فبر 11, 1987, 12:13:14 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453, 11:59:59 م | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | فبراير 11, 1987 عند 12:13:14 م GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 عند 11:59:59 م GMT+0 | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | الأربعاء, فبراير 11, 1987 عند 12:13:14 م GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | الأحد, ماي 29, 1453 عند 11:59:59 م GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | -------------------------- |
+| 2006-01-01T00:00:00.000Z | 6 أعوام تقريباً | 6 أعوام تقريباً | في خلال 6 أعوام تقريباً |
+| 2005-01-01T00:00:00.000Z | 5 أعوام تقريباً | 5 أعوام تقريباً | في خلال 5 أعوام تقريباً |
+| 2004-01-01T00:00:00.000Z | 4 أعوام تقريباً | 4 أعوام تقريباً | في خلال 4 أعوام تقريباً |
+| 2003-01-01T00:00:00.000Z | 3 أعوام تقريباً | 3 أعوام تقريباً | في خلال 3 أعوام تقريباً |
+| 2002-01-01T00:00:00.000Z | عامين تقريباً | عامين تقريباً | في خلال عامين تقريباً |
+| 2001-06-01T00:00:00.000Z | أكثر من عام | أكثر من عام | في خلال أكثر من عام |
+| 2001-02-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | في خلال عام واحد تقريباً |
+| 2001-01-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | في خلال عام واحد تقريباً |
+| 2000-06-01T00:00:00.000Z | 5 أشهر | 5 أشهر | في خلال 5 أشهر |
+| 2000-03-01T00:00:00.000Z | شهرين | شهرين | في خلال شهرين |
+| 2000-02-01T00:00:00.000Z | شهر واحد تقريباً | شهر واحد تقريباً | في خلال شهر واحد تقريباً |
+| 2000-01-15T00:00:00.000Z | 14 يوم | 14 يوم | في خلال 14 يوم |
+| 2000-01-02T00:00:00.000Z | يوم واحد | يوم واحد | في خلال يوم واحد |
+| 2000-01-01T06:00:00.000Z | 6 ساعات تقريباً | 6 ساعات تقريباً | في خلال 6 ساعات تقريباً |
+| 2000-01-01T01:00:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | في خلال ساعة واحدة تقريباً |
+| 2000-01-01T00:45:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | في خلال ساعة واحدة تقريباً |
+| 2000-01-01T00:30:00.000Z | 30 دقيقة | 30 دقيقة | في خلال 30 دقيقة |
+| 2000-01-01T00:15:00.000Z | 15 دقيقة | 15 دقيقة | في خلال 15 دقيقة |
+| 2000-01-01T00:01:00.000Z | دقيقة واحدة | دقيقة واحدة | في خلال دقيقة واحدة |
+| 2000-01-01T00:00:25.000Z | أقل من دقيقة | نصف دقيقة | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:15.000Z | أقل من دقيقة | أقل من 20 ثانية | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:05.000Z | أقل من دقيقة | أقل من 10 ثواني | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:00.000Z | أقل من دقيقة | أقل من 5 ثواني | منذ أقل من دقيقة |
+| 1999-12-31T23:59:55.000Z | أقل من دقيقة | أقل من 10 ثواني | منذ أقل من دقيقة |
+| 1999-12-31T23:59:45.000Z | أقل من دقيقة | أقل من 20 ثانية | منذ أقل من دقيقة |
+| 1999-12-31T23:59:35.000Z | أقل من دقيقة | نصف دقيقة | منذ أقل من دقيقة |
+| 1999-12-31T23:59:00.000Z | دقيقة واحدة | دقيقة واحدة | منذ دقيقة واحدة |
+| 1999-12-31T23:45:00.000Z | 15 دقيقة | 15 دقيقة | منذ 15 دقيقة |
+| 1999-12-31T23:30:00.000Z | 30 دقيقة | 30 دقيقة | منذ 30 دقيقة |
+| 1999-12-31T23:15:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | منذ ساعة واحدة تقريباً |
+| 1999-12-31T23:00:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | منذ ساعة واحدة تقريباً |
+| 1999-12-31T18:00:00.000Z | 6 ساعات تقريباً | 6 ساعات تقريباً | منذ 6 ساعات تقريباً |
+| 1999-12-30T00:00:00.000Z | يومين | يومين | منذ يومين |
+| 1999-12-15T00:00:00.000Z | 17 يوم | 17 يوم | منذ 17 يوم |
+| 1999-12-01T00:00:00.000Z | شهر واحد تقريباً | شهر واحد تقريباً | منذ شهر واحد تقريباً |
+| 1999-11-01T00:00:00.000Z | شهرين | شهرين | منذ شهرين |
+| 1999-06-01T00:00:00.000Z | 7 أشهر | 7 أشهر | منذ 7 أشهر |
+| 1999-01-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | منذ عام واحد تقريباً |
+| 1998-12-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | منذ عام واحد تقريباً |
+| 1998-06-01T00:00:00.000Z | أكثر من عام | أكثر من عام | منذ أكثر من عام |
+| 1998-01-01T00:00:00.000Z | عامين تقريباً | عامين تقريباً | منذ عامين تقريباً |
+| 1997-01-01T00:00:00.000Z | 3 أعوام تقريباً | 3 أعوام تقريباً | منذ 3 أعوام تقريباً |
+| 1996-01-01T00:00:00.000Z | 4 أعوام تقريباً | 4 أعوام تقريباً | منذ 4 أعوام تقريباً |
+| 1995-01-01T00:00:00.000Z | 5 أعوام تقريباً | 5 أعوام تقريباً | منذ 5 أعوام تقريباً |
+| 1994-01-01T00:00:00.000Z | 6 أعوام تقريباً | 6 أعوام تقريباً | منذ 6 أعوام تقريباً |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 أعوام | في خلال 6 أعوام | 52608 ساعة |
+| 2005-01-01T00:00:00.000Z | 5 أعوام | في خلال 5 أعوام | 43848 ساعة |
+| 2004-01-01T00:00:00.000Z | 4 أعوام | في خلال 4 أعوام | 35064 ساعة |
+| 2003-01-01T00:00:00.000Z | 3 أعوام | في خلال 3 أعوام | 26304 ساعة |
+| 2002-01-01T00:00:00.000Z | عامين | في خلال عامين | 17544 ساعة |
+| 2001-06-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 12408 ساعة |
+| 2001-02-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 9528 ساعة |
+| 2001-01-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 8784 ساعة |
+| 2000-06-01T00:00:00.000Z | 5 أشهر | في خلال 5 أشهر | 3648 ساعة |
+| 2000-03-01T00:00:00.000Z | شهرين | في خلال شهرين | 1440 ساعة |
+| 2000-02-01T00:00:00.000Z | شهر واحد | في خلال شهر واحد | 744 ساعة |
+| 2000-01-15T00:00:00.000Z | 14 يوم | في خلال 14 يوم | 336 ساعة |
+| 2000-01-02T00:00:00.000Z | يوم واحد | في خلال يوم واحد | 24 ساعة |
+| 2000-01-01T06:00:00.000Z | 6 ساعات | في خلال 6 ساعات | 6 ساعات |
+| 2000-01-01T01:00:00.000Z | ساعة واحدة | في خلال ساعة واحدة | ساعة واحدة |
+| 2000-01-01T00:45:00.000Z | 45 دقيقة | في خلال 45 دقيقة | ساعة واحدة |
+| 2000-01-01T00:30:00.000Z | 30 دقيقة | في خلال 30 دقيقة | ساعة واحدة |
+| 2000-01-01T00:15:00.000Z | 15 دقيقة | في خلال 15 دقيقة | 0 ساعات |
+| 2000-01-01T00:01:00.000Z | دقيقة واحدة | في خلال دقيقة واحدة | 0 ساعات |
+| 2000-01-01T00:00:25.000Z | 25 ثانية | في خلال 25 ثانية | 0 ساعات |
+| 2000-01-01T00:00:15.000Z | 15 ثانية | في خلال 15 ثانية | 0 ساعات |
+| 2000-01-01T00:00:05.000Z | 5 ثواني | في خلال 5 ثواني | 0 ساعات |
+| 2000-01-01T00:00:00.000Z | 0 ثواني | منذ 0 ثواني | 0 ساعات |
+| 1999-12-31T23:59:55.000Z | 5 ثواني | منذ 5 ثواني | 0 ساعات |
+| 1999-12-31T23:59:45.000Z | 15 ثانية | منذ 15 ثانية | 0 ساعات |
+| 1999-12-31T23:59:35.000Z | 25 ثانية | منذ 25 ثانية | 0 ساعات |
+| 1999-12-31T23:59:00.000Z | دقيقة واحدة | منذ دقيقة واحدة | 0 ساعات |
+| 1999-12-31T23:45:00.000Z | 15 دقيقة | منذ 15 دقيقة | 0 ساعات |
+| 1999-12-31T23:30:00.000Z | 30 دقيقة | منذ 30 دقيقة | ساعة واحدة |
+| 1999-12-31T23:15:00.000Z | 45 دقيقة | منذ 45 دقيقة | ساعة واحدة |
+| 1999-12-31T23:00:00.000Z | ساعة واحدة | منذ ساعة واحدة | ساعة واحدة |
+| 1999-12-31T18:00:00.000Z | 6 ساعات | منذ 6 ساعات | 6 ساعات |
+| 1999-12-30T00:00:00.000Z | يومين | منذ يومين | 48 ساعة |
+| 1999-12-15T00:00:00.000Z | 17 يوم | منذ 17 يوم | 408 ساعة |
+| 1999-12-01T00:00:00.000Z | شهر واحد | منذ شهر واحد | 744 ساعة |
+| 1999-11-01T00:00:00.000Z | شهرين | منذ شهرين | 1464 ساعة |
+| 1999-06-01T00:00:00.000Z | 7 أشهر | منذ 7 أشهر | 5136 ساعة |
+| 1999-01-01T00:00:00.000Z | عام واحد | منذ عام واحد | 8760 ساعة |
+| 1998-12-01T00:00:00.000Z | عام واحد | منذ عام واحد | 9504 ساعة |
+| 1998-06-01T00:00:00.000Z | عامين | منذ عامين | 13896 ساعة |
+| 1998-01-01T00:00:00.000Z | عامين | منذ عامين | 17520 ساعة |
+| 1997-01-01T00:00:00.000Z | 3 أعوام | منذ 3 أعوام | 26280 ساعة |
+| 1996-01-01T00:00:00.000Z | 4 أعوام | منذ 4 أعوام | 35064 ساعة |
+| 1995-01-01T00:00:00.000Z | 5 أعوام | منذ 5 أعوام | 43824 ساعة |
+| 1994-01-01T00:00:00.000Z | 6 أعوام | منذ 6 أعوام | 52584 ساعة |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | الأربعاء عند 12:00 ص |
+| 2000-01-02T00:00:00.000Z | غداً عند 12:00 ص |
+| 2000-01-01T00:00:00.000Z | اليوم عند 12:00 ص |
+| 1999-12-31T00:00:00.000Z | أمس عند 12:00 ص |
+| 1999-12-27T00:00:00.000Z | أخر الإثنين عند 12:00 ص |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/ar-SA/_lib/formatDistance/index.js b/date-fns/src/locale/ar-SA/_lib/formatDistance/index.js
new file mode 100644
index 0000000..bcdb373
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/_lib/formatDistance/index.js
@@ -0,0 +1,135 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'أقل من ثانية واحدة',
+ two: 'أقل من ثانتين',
+ threeToTen: 'أقل من {{count}} ثواني',
+ other: 'أقل من {{count}} ثانية'
+ },
+
+ xSeconds: {
+ one: 'ثانية واحدة',
+ two: 'ثانتين',
+ threeToTen: '{{count}} ثواني',
+ other: '{{count}} ثانية'
+ },
+
+ halfAMinute: 'نصف دقيقة',
+
+ lessThanXMinutes: {
+ one: 'أقل من دقيقة',
+ two: 'أقل من دقيقتين',
+ threeToTen: 'أقل من {{count}} دقائق',
+ other: 'أقل من {{count}} دقيقة'
+ },
+
+ xMinutes: {
+ one: 'دقيقة واحدة',
+ two: 'دقيقتين',
+ threeToTen: '{{count}} دقائق',
+ other: '{{count}} دقيقة'
+ },
+
+ aboutXHours: {
+ one: 'ساعة واحدة تقريباً',
+ two: 'ساعتين تقريباً',
+ threeToTen: '{{count}} ساعات تقريباً',
+ other: '{{count}} ساعة تقريباً'
+ },
+
+ xHours: {
+ one: 'ساعة واحدة',
+ two: 'ساعتين',
+ threeToTen: '{{count}} ساعات',
+ other: '{{count}} ساعة'
+ },
+
+ xDays: {
+ one: 'يوم واحد',
+ two: 'يومين',
+ threeToTen: '{{count}} أيام',
+ other: '{{count}} يوم'
+ },
+
+ aboutXWeeks: {
+ one: 'أسبوع واحد تقريباً',
+ two: 'أسبوعين تقريباً',
+ threeToTen: '{{count}} أسابيع تقريباً',
+ other: '{{count}} أسبوع تقريباً'
+ },
+
+ xWeeks: {
+ one: 'أسبوع واحد',
+ two: 'أسبوعين',
+ threeToTen: '{{count}} أسابيع',
+ other: '{{count}} أسبوع'
+ },
+
+ aboutXMonths: {
+ one: 'شهر واحد تقريباً',
+ two: 'شهرين تقريباً',
+ threeToTen: '{{count}} أشهر تقريباً',
+ other: '{{count}} شهر تقريباً'
+ },
+
+ xMonths: {
+ one: 'شهر واحد',
+ two: 'شهرين',
+ threeToTen: '{{count}} أشهر',
+ other: '{{count}} شهر'
+ },
+
+ aboutXYears: {
+ one: 'عام واحد تقريباً',
+ two: 'عامين تقريباً',
+ threeToTen: '{{count}} أعوام تقريباً',
+ other: '{{count}} عام تقريباً'
+ },
+
+ xYears: {
+ one: 'عام واحد',
+ two: 'عامين',
+ threeToTen: '{{count}} أعوام',
+ other: '{{count}} عام'
+ },
+
+ overXYears: {
+ one: 'أكثر من عام',
+ two: 'أكثر من عامين',
+ threeToTen: 'أكثر من {{count}} أعوام',
+ other: 'أكثر من {{count}} عام'
+ },
+
+ almostXYears: {
+ one: 'عام واحد تقريباً',
+ two: 'عامين تقريباً',
+ threeToTen: '{{count}} أعوام تقريباً',
+ other: '{{count}} عام تقريباً'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 2) {
+ result = formatDistanceLocale[token].two
+ } else if (count <= 10) {
+ result = formatDistanceLocale[token].threeToTen.replace('{{count}}', count)
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'في خلال ' + result
+ } else {
+ return 'منذ ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ar-SA/_lib/formatLong/index.js b/date-fns/src/locale/ar-SA/_lib/formatLong/index.js
new file mode 100644
index 0000000..a65ad56
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'عند' {{time}}",
+ long: "{{date}} 'عند' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ar-SA/_lib/formatRelative/index.js b/date-fns/src/locale/ar-SA/_lib/formatRelative/index.js
new file mode 100644
index 0000000..9276495
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'أخر' eeee 'عند' p",
+ yesterday: "'أمس عند' p",
+ today: "'اليوم عند' p",
+ tomorrow: "'غداً عند' p",
+ nextWeek: "eeee 'عند' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ar-SA/_lib/localize/index.js b/date-fns/src/locale/ar-SA/_lib/localize/index.js
new file mode 100644
index 0000000..2d83b5c
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/_lib/localize/index.js
@@ -0,0 +1,163 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ق', 'ب'],
+ abbreviated: ['ق.م.', 'ب.م.'],
+ wide: ['قبل الميلاد', 'بعد الميلاد']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['ر1', 'ر2', 'ر3', 'ر4'],
+ wide: ['الربع الأول', 'الربع الثاني', 'الربع الثالث', 'الربع الرابع']
+}
+
+var monthValues = {
+ narrow: ['ي', 'ف', 'م', 'أ', 'م', 'ي', 'ي', 'أ', 'س', 'أ', 'ن', 'د'],
+ abbreviated: [
+ 'ينا',
+ 'فبر',
+ 'مارس',
+ 'أبريل',
+ 'مايو',
+ 'يونـ',
+ 'يولـ',
+ 'أغسـ',
+ 'سبتـ',
+ 'أكتـ',
+ 'نوفـ',
+ 'ديسـ'
+ ],
+ wide: [
+ 'يناير',
+ 'فبراير',
+ 'مارس',
+ 'أبريل',
+ 'مايو',
+ 'يونيو',
+ 'يوليو',
+ 'أغسطس',
+ 'سبتمبر',
+ 'أكتوبر',
+ 'نوفمبر',
+ 'ديسمبر'
+ ]
+}
+
+var dayValues = {
+ narrow: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
+ short: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
+ abbreviated: ['أحد', 'اثنـ', 'ثلا', 'أربـ', 'خميـ', 'جمعة', 'سبت'],
+ wide: [
+ 'الأحد',
+ 'الاثنين',
+ 'الثلاثاء',
+ 'الأربعاء',
+ 'الخميس',
+ 'الجمعة',
+ 'السبت'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ },
+ abbreviated: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ },
+ wide: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'صباحاً',
+ afternoon: 'بعد الظهر',
+ evening: 'مساءاً',
+ night: 'ليلاً'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'في الصباح',
+ afternoon: 'بعد الظـهر',
+ evening: 'في المساء',
+ night: 'في الليل'
+ },
+ abbreviated: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ morning: 'في الصباح',
+ evening: 'في المساء',
+ night: 'في الليل'
+ },
+ wide: {
+ am: 'ص',
+ pm: 'م',
+ midnight: 'نصف الليل',
+ noon: 'ظهر',
+ afternoon: 'بعد الظـهر',
+ evening: 'في المساء',
+ night: 'في الليل'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ return String(dirtyNumber)
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ar-SA/_lib/match/index.js b/date-fns/src/locale/ar-SA/_lib/match/index.js
new file mode 100644
index 0000000..ad9a68d
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/_lib/match/index.js
@@ -0,0 +1,146 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ق|ب)/i,
+ abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,
+ wide: /^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i
+}
+var parseEraPatterns = {
+ any: [/^قبل/i, /^بعد/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^ر[1234]/i,
+ wide: /^الربع [1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[يفمأمسند]/i,
+ abbreviated: /^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i,
+ wide: /^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^ي/i,
+ /^ف/i,
+ /^م/i,
+ /^أ/i,
+ /^م/i,
+ /^ي/i,
+ /^ي/i,
+ /^أ/i,
+ /^س/i,
+ /^أ/i,
+ /^ن/i,
+ /^د/i
+ ],
+ any: [
+ /^ين/i,
+ /^ف/i,
+ /^مار/i,
+ /^أب/i,
+ /^ماي/i,
+ /^يون/i,
+ /^يول/i,
+ /^أغ/i,
+ /^س/i,
+ /^أك/i,
+ /^ن/i,
+ /^د/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[حنثرخجس]/i,
+ short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
+ abbreviated: /^(أحد|اثن|ثلا|أرب|خمي|جمعة|سبت)/i,
+ wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ح/i, /^ن/i, /^ث/i, /^ر/i, /^خ/i, /^ج/i, /^س/i],
+ wide: [
+ /^الأحد/i,
+ /^الاثنين/i,
+ /^الثلاثاء/i,
+ /^الأربعاء/i,
+ /^الخميس/i,
+ /^الجمعة/i,
+ /^السبت/i
+ ],
+ any: [/^أح/i, /^اث/i, /^ث/i, /^أر/i, /^خ/i, /^ج/i, /^س/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mi/i,
+ noon: /^no/i,
+ morning: /morning/i,
+ afternoon: /afternoon/i,
+ evening: /evening/i,
+ night: /night/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ar-SA/index.d.ts b/date-fns/src/locale/ar-SA/index.d.ts
new file mode 100644
index 0000000..e1a74a0
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { arSA } from 'date-fns/locale'
+export default arSA
diff --git a/date-fns/src/locale/ar-SA/index.js b/date-fns/src/locale/ar-SA/index.js
new file mode 100644
index 0000000..bc8b674
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Arabic locale (Sauid Arabic).
+ * @language Arabic
+ * @iso-639-2 ara
+ * @author Dhaifallah Alwadani [@dalwadani]{@link https://github.com/dalwadani}
+ */
+var locale = {
+ code: 'ar-SA',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ar-SA/index.js.flow b/date-fns/src/locale/ar-SA/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ar-SA/snapshot.md b/date-fns/src/locale/ar-SA/snapshot.md
new file mode 100644
index 0000000..0f21930
--- /dev/null
+++ b/date-fns/src/locale/ar-SA/snapshot.md
@@ -0,0 +1,304 @@
+# Arabic (ar-SA) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | ر1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ر2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | الربع الأول | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | الربع الثاني | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | ر1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ر2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | الربع الأول | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | الربع الثاني | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | فبر | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يولـ | Invalid Date |
+| | MMMM | 2019-02-11T12:13:14.015Z | فبراير | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يوليو | Invalid Date |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ي | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | فبر | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يولـ | Invalid Date |
+| | LLLL | 2019-02-11T12:13:14.015Z | فبراير | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | يوليو | Invalid Date |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ي | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49 | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | اثنـ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | الاثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | الجمعة | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | ن | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | اثنين | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعة | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ص | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | م | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ص | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | بعد الظـهر | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | في الصباح | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | بعد الظـهر | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | في المساء | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | في الليل | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | فبر 11, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | مايو 29, 1453 | Invalid Date |
+| | PPP | 1987-02-11T12:13:14.015Z | فبراير 11, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | مايو 29, 1453 | Invalid Date |
+| | PPPP | 1987-02-11T12:13:14.015Z | الأربعاء, فبراير 11, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | الأحد, مايو 29, 1453 | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59 م | Invalid Date |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م | Invalid Date |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 م GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م GMT+0 | Invalid Date |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 م GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 م GMT+00:00 | Invalid Date |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 م | Invalid Date |
+| | PPpp | 1987-02-11T12:13:14.015Z | فبر 11, 1987, 12:13:14 م | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | مايو 29, 1453, 11:59:59 م | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | فبراير 11, 1987 عند 12:13:14 م GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | مايو 29, 1453 عند 11:59:59 م GMT+0 | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | الأربعاء, فبراير 11, 1987 عند 12:13:14 م GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | الأحد, مايو 29, 1453 عند 11:59:59 م GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | -------------------------- |
+| 2006-01-01T00:00:00.000Z | 6 أعوام تقريباً | 6 أعوام تقريباً | في خلال 6 أعوام تقريباً |
+| 2005-01-01T00:00:00.000Z | 5 أعوام تقريباً | 5 أعوام تقريباً | في خلال 5 أعوام تقريباً |
+| 2004-01-01T00:00:00.000Z | 4 أعوام تقريباً | 4 أعوام تقريباً | في خلال 4 أعوام تقريباً |
+| 2003-01-01T00:00:00.000Z | 3 أعوام تقريباً | 3 أعوام تقريباً | في خلال 3 أعوام تقريباً |
+| 2002-01-01T00:00:00.000Z | عامين تقريباً | عامين تقريباً | في خلال عامين تقريباً |
+| 2001-06-01T00:00:00.000Z | أكثر من عام | أكثر من عام | في خلال أكثر من عام |
+| 2001-02-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | في خلال عام واحد تقريباً |
+| 2001-01-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | في خلال عام واحد تقريباً |
+| 2000-06-01T00:00:00.000Z | 5 أشهر | 5 أشهر | في خلال 5 أشهر |
+| 2000-03-01T00:00:00.000Z | شهرين | شهرين | في خلال شهرين |
+| 2000-02-01T00:00:00.000Z | شهر واحد تقريباً | شهر واحد تقريباً | في خلال شهر واحد تقريباً |
+| 2000-01-15T00:00:00.000Z | 14 يوم | 14 يوم | في خلال 14 يوم |
+| 2000-01-02T00:00:00.000Z | يوم واحد | يوم واحد | في خلال يوم واحد |
+| 2000-01-01T06:00:00.000Z | 6 ساعات تقريباً | 6 ساعات تقريباً | في خلال 6 ساعات تقريباً |
+| 2000-01-01T01:00:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | في خلال ساعة واحدة تقريباً |
+| 2000-01-01T00:45:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | في خلال ساعة واحدة تقريباً |
+| 2000-01-01T00:30:00.000Z | 30 دقيقة | 30 دقيقة | في خلال 30 دقيقة |
+| 2000-01-01T00:15:00.000Z | 15 دقيقة | 15 دقيقة | في خلال 15 دقيقة |
+| 2000-01-01T00:01:00.000Z | دقيقة واحدة | دقيقة واحدة | في خلال دقيقة واحدة |
+| 2000-01-01T00:00:25.000Z | أقل من دقيقة | نصف دقيقة | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:15.000Z | أقل من دقيقة | أقل من 20 ثانية | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:05.000Z | أقل من دقيقة | أقل من 10 ثواني | في خلال أقل من دقيقة |
+| 2000-01-01T00:00:00.000Z | أقل من دقيقة | أقل من 5 ثواني | منذ أقل من دقيقة |
+| 1999-12-31T23:59:55.000Z | أقل من دقيقة | أقل من 10 ثواني | منذ أقل من دقيقة |
+| 1999-12-31T23:59:45.000Z | أقل من دقيقة | أقل من 20 ثانية | منذ أقل من دقيقة |
+| 1999-12-31T23:59:35.000Z | أقل من دقيقة | نصف دقيقة | منذ أقل من دقيقة |
+| 1999-12-31T23:59:00.000Z | دقيقة واحدة | دقيقة واحدة | منذ دقيقة واحدة |
+| 1999-12-31T23:45:00.000Z | 15 دقيقة | 15 دقيقة | منذ 15 دقيقة |
+| 1999-12-31T23:30:00.000Z | 30 دقيقة | 30 دقيقة | منذ 30 دقيقة |
+| 1999-12-31T23:15:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | منذ ساعة واحدة تقريباً |
+| 1999-12-31T23:00:00.000Z | ساعة واحدة تقريباً | ساعة واحدة تقريباً | منذ ساعة واحدة تقريباً |
+| 1999-12-31T18:00:00.000Z | 6 ساعات تقريباً | 6 ساعات تقريباً | منذ 6 ساعات تقريباً |
+| 1999-12-30T00:00:00.000Z | يومين | يومين | منذ يومين |
+| 1999-12-15T00:00:00.000Z | 17 يوم | 17 يوم | منذ 17 يوم |
+| 1999-12-01T00:00:00.000Z | شهر واحد تقريباً | شهر واحد تقريباً | منذ شهر واحد تقريباً |
+| 1999-11-01T00:00:00.000Z | شهرين | شهرين | منذ شهرين |
+| 1999-06-01T00:00:00.000Z | 7 أشهر | 7 أشهر | منذ 7 أشهر |
+| 1999-01-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | منذ عام واحد تقريباً |
+| 1998-12-01T00:00:00.000Z | عام واحد تقريباً | عام واحد تقريباً | منذ عام واحد تقريباً |
+| 1998-06-01T00:00:00.000Z | أكثر من عام | أكثر من عام | منذ أكثر من عام |
+| 1998-01-01T00:00:00.000Z | عامين تقريباً | عامين تقريباً | منذ عامين تقريباً |
+| 1997-01-01T00:00:00.000Z | 3 أعوام تقريباً | 3 أعوام تقريباً | منذ 3 أعوام تقريباً |
+| 1996-01-01T00:00:00.000Z | 4 أعوام تقريباً | 4 أعوام تقريباً | منذ 4 أعوام تقريباً |
+| 1995-01-01T00:00:00.000Z | 5 أعوام تقريباً | 5 أعوام تقريباً | منذ 5 أعوام تقريباً |
+| 1994-01-01T00:00:00.000Z | 6 أعوام تقريباً | 6 أعوام تقريباً | منذ 6 أعوام تقريباً |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 أعوام | في خلال 6 أعوام | 52608 ساعة |
+| 2005-01-01T00:00:00.000Z | 5 أعوام | في خلال 5 أعوام | 43848 ساعة |
+| 2004-01-01T00:00:00.000Z | 4 أعوام | في خلال 4 أعوام | 35064 ساعة |
+| 2003-01-01T00:00:00.000Z | 3 أعوام | في خلال 3 أعوام | 26304 ساعة |
+| 2002-01-01T00:00:00.000Z | عامين | في خلال عامين | 17544 ساعة |
+| 2001-06-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 12408 ساعة |
+| 2001-02-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 9528 ساعة |
+| 2001-01-01T00:00:00.000Z | عام واحد | في خلال عام واحد | 8784 ساعة |
+| 2000-06-01T00:00:00.000Z | 5 أشهر | في خلال 5 أشهر | 3648 ساعة |
+| 2000-03-01T00:00:00.000Z | شهرين | في خلال شهرين | 1440 ساعة |
+| 2000-02-01T00:00:00.000Z | شهر واحد | في خلال شهر واحد | 744 ساعة |
+| 2000-01-15T00:00:00.000Z | 14 يوم | في خلال 14 يوم | 336 ساعة |
+| 2000-01-02T00:00:00.000Z | يوم واحد | في خلال يوم واحد | 24 ساعة |
+| 2000-01-01T06:00:00.000Z | 6 ساعات | في خلال 6 ساعات | 6 ساعات |
+| 2000-01-01T01:00:00.000Z | ساعة واحدة | في خلال ساعة واحدة | ساعة واحدة |
+| 2000-01-01T00:45:00.000Z | 45 دقيقة | في خلال 45 دقيقة | ساعة واحدة |
+| 2000-01-01T00:30:00.000Z | 30 دقيقة | في خلال 30 دقيقة | ساعة واحدة |
+| 2000-01-01T00:15:00.000Z | 15 دقيقة | في خلال 15 دقيقة | 0 ساعات |
+| 2000-01-01T00:01:00.000Z | دقيقة واحدة | في خلال دقيقة واحدة | 0 ساعات |
+| 2000-01-01T00:00:25.000Z | 25 ثانية | في خلال 25 ثانية | 0 ساعات |
+| 2000-01-01T00:00:15.000Z | 15 ثانية | في خلال 15 ثانية | 0 ساعات |
+| 2000-01-01T00:00:05.000Z | 5 ثواني | في خلال 5 ثواني | 0 ساعات |
+| 2000-01-01T00:00:00.000Z | 0 ثواني | منذ 0 ثواني | 0 ساعات |
+| 1999-12-31T23:59:55.000Z | 5 ثواني | منذ 5 ثواني | 0 ساعات |
+| 1999-12-31T23:59:45.000Z | 15 ثانية | منذ 15 ثانية | 0 ساعات |
+| 1999-12-31T23:59:35.000Z | 25 ثانية | منذ 25 ثانية | 0 ساعات |
+| 1999-12-31T23:59:00.000Z | دقيقة واحدة | منذ دقيقة واحدة | 0 ساعات |
+| 1999-12-31T23:45:00.000Z | 15 دقيقة | منذ 15 دقيقة | 0 ساعات |
+| 1999-12-31T23:30:00.000Z | 30 دقيقة | منذ 30 دقيقة | ساعة واحدة |
+| 1999-12-31T23:15:00.000Z | 45 دقيقة | منذ 45 دقيقة | ساعة واحدة |
+| 1999-12-31T23:00:00.000Z | ساعة واحدة | منذ ساعة واحدة | ساعة واحدة |
+| 1999-12-31T18:00:00.000Z | 6 ساعات | منذ 6 ساعات | 6 ساعات |
+| 1999-12-30T00:00:00.000Z | يومين | منذ يومين | 48 ساعة |
+| 1999-12-15T00:00:00.000Z | 17 يوم | منذ 17 يوم | 408 ساعة |
+| 1999-12-01T00:00:00.000Z | شهر واحد | منذ شهر واحد | 744 ساعة |
+| 1999-11-01T00:00:00.000Z | شهرين | منذ شهرين | 1464 ساعة |
+| 1999-06-01T00:00:00.000Z | 7 أشهر | منذ 7 أشهر | 5136 ساعة |
+| 1999-01-01T00:00:00.000Z | عام واحد | منذ عام واحد | 8760 ساعة |
+| 1998-12-01T00:00:00.000Z | عام واحد | منذ عام واحد | 9504 ساعة |
+| 1998-06-01T00:00:00.000Z | عامين | منذ عامين | 13896 ساعة |
+| 1998-01-01T00:00:00.000Z | عامين | منذ عامين | 17520 ساعة |
+| 1997-01-01T00:00:00.000Z | 3 أعوام | منذ 3 أعوام | 26280 ساعة |
+| 1996-01-01T00:00:00.000Z | 4 أعوام | منذ 4 أعوام | 35064 ساعة |
+| 1995-01-01T00:00:00.000Z | 5 أعوام | منذ 5 أعوام | 43824 ساعة |
+| 1994-01-01T00:00:00.000Z | 6 أعوام | منذ 6 أعوام | 52584 ساعة |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | الأربعاء عند 12:00 ص |
+| 2000-01-02T00:00:00.000Z | غداً عند 12:00 ص |
+| 2000-01-01T00:00:00.000Z | اليوم عند 12:00 ص |
+| 1999-12-31T00:00:00.000Z | أمس عند 12:00 ص |
+| 1999-12-27T00:00:00.000Z | أخر الاثنين عند 12:00 ص |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/ar/_lib/formatDistance/index.js b/date-fns/src/locale/ar/_lib/formatDistance/index.js
new file mode 100644
index 0000000..843ac71
--- /dev/null
+++ b/date-fns/src/locale/ar/_lib/formatDistance/index.js
@@ -0,0 +1,91 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'أقل من ثانية واحدة',
+ other: 'أقل من {{count}} ثواني'
+ },
+
+ xSeconds: {
+ one: 'ثانية واحدة',
+ other: '{{count}} ثواني'
+ },
+
+ halfAMinute: 'نصف دقيقة',
+
+ lessThanXMinutes: {
+ one: 'أقل من دقيقة',
+ other: 'أقل من {{count}} دقيقة'
+ },
+
+ xMinutes: {
+ one: 'دقيقة واحدة',
+ other: '{{count}} دقائق'
+ },
+
+ aboutXHours: {
+ one: 'ساعة واحدة تقريباً',
+ other: '{{count}} ساعات تقريباً'
+ },
+
+ xHours: {
+ one: 'ساعة واحدة',
+ other: '{{count}} ساعات'
+ },
+
+ xDays: {
+ one: 'يوم واحد',
+ other: '{{count}} أيام'
+ },
+
+ aboutXMonths: {
+ one: 'شهر واحد تقريباً',
+ other: '{{count}} أشهر تقريباً'
+ },
+
+ xMonths: {
+ one: 'شهر واحد',
+ other: '{{count}} أشهر'
+ },
+
+ aboutXYears: {
+ one: 'عام واحد تقريباً',
+ other: '{{count}} أعوام تقريباً'
+ },
+
+ xYears: {
+ one: 'عام واحد',
+ other: '{{count}} أعوام'
+ },
+
+ overXYears: {
+ one: 'أكثر من عام',
+ other: 'أكثر من {{count}} أعوام'
+ },
+
+ almostXYears: {
+ one: 'عام واحد تقريباً',
+ other: '{{count}} أعوام تقريباً'
+ }
+}
+
+export default function formatDistance (token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'في خلال ' + result
+ } else {
+ return 'منذ ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ar/_lib/formatLong/index.js b/date-fns/src/locale/ar/_lib/formatLong/index.js
new file mode 100644
index 0000000..2cf1867
--- /dev/null
+++ b/date-fns/src/locale/ar/_lib/formatLong/index.js
@@ -0,0 +1,12 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var formatLong = buildFormatLongFn({
+ LT: 'h:mm aa',
+ LTS: 'h:mm:ss aa',
+ L: 'MM/DD/YYYY',
+ LL: 'MMMM D YYYY',
+ LLL: 'MMMM D YYYY h:mm aa',
+ LLLL: 'dddd, MMMM D YYYY h:mm aa'
+})
+
+export default formatLong
diff --git a/date-fns/src/locale/ar/_lib/formatRelative/index.js b/date-fns/src/locale/ar/_lib/formatRelative/index.js
new file mode 100644
index 0000000..52ebbf1
--- /dev/null
+++ b/date-fns/src/locale/ar/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: '[last] dddd [at] LT',
+ yesterday: '[yesterday at] LT',
+ today: '[today at] LT',
+ tomorrow: '[tomorrow at] LT',
+ nextWeek: 'dddd [at] LT',
+ other: 'L'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ar/_lib/localize/index.js b/date-fns/src/locale/ar/_lib/localize/index.js
new file mode 100644
index 0000000..811e9e8
--- /dev/null
+++ b/date-fns/src/locale/ar/_lib/localize/index.js
@@ -0,0 +1,71 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+import buildLocalizeArrayFn from '../../../_lib/buildLocalizeArrayFn/index'
+
+var weekdayValues = {
+ narrow: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
+ short: ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'],
+ long: [
+ 'الأحد',
+ 'الاثنين',
+ 'الثلاثاء',
+ 'الأربعاء',
+ 'الخميس',
+ 'الجمعة',
+ 'السبت'
+ ]
+}
+
+var monthValues = {
+ short: [
+ 'يناير',
+ 'فبراير',
+ 'مارس',
+ 'أبريل',
+ 'مايو',
+ 'يونيو',
+ 'يوليو',
+ 'أغسطس',
+ 'سبتمبر',
+ 'أكتوبر',
+ 'نوفمبر',
+ 'ديسمبر'
+ ],
+ long: [
+ 'كانون الثاني يناير',
+ 'شباط فبراير',
+ 'آذار مارس',
+ 'نيسان أبريل',
+ 'أيار مايو',
+ 'حزيران يونيو',
+ 'تموز يوليو',
+ 'آب أغسطس',
+ 'أيلول سبتمبر',
+ 'تشرين الأول أكتوبر',
+ 'تشرين الثاني نوفمبر',
+ 'كانون الأول ديسمبر'
+ ]
+}
+
+var timeOfDayValues = {
+ uppercase: ['صباح', 'مساء'],
+ lowercase: ['ص', 'م'],
+ long: ['صباحاً', 'مساءً']
+}
+
+function ordinalNumber(dirtyNumber) {
+ return String(dirtyNumber)
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ weekday: buildLocalizeFn(weekdayValues, 'long'),
+ weekdays: buildLocalizeArrayFn(weekdayValues, 'long'),
+ month: buildLocalizeFn(monthValues, 'long'),
+ months: buildLocalizeArrayFn(monthValues, 'long'),
+ timeOfDay: buildLocalizeFn(timeOfDayValues, 'long', function(hours) {
+ return hours / 12 >= 1 ? 1 : 0
+ }),
+ timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'long')
+}
+
+export default localize
diff --git a/date-fns/src/locale/ar/_lib/match/index.js b/date-fns/src/locale/ar/_lib/match/index.js
new file mode 100644
index 0000000..5a3f4c5
--- /dev/null
+++ b/date-fns/src/locale/ar/_lib/match/index.js
@@ -0,0 +1,60 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildParseFn from '../../../_lib/buildParseFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import parseDecimal from '../../../_lib/parseDecimal/index'
+
+var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i
+
+var matchWeekdaysPatterns = {
+ narrow: /^(su|mo|tu|we|th|fr|sa)/i,
+ short: /^(sun|mon|tue|wed|thu|fri|sat)/i,
+ long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
+}
+
+var parseWeekdayPatterns = {
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
+}
+
+var matchMonthsPatterns = {
+ short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
+ long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
+}
+
+var parseMonthPatterns = {
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^may/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchTimesOfDayPatterns = {
+ short: /^(am|pm)/i,
+ long: /^([ap]\.?\s?m\.?)/i
+}
+
+var parseTimeOfDayPatterns = {
+ any: [/^a/i, /^p/i]
+}
+
+var match = {
+ ordinalNumbers: buildMatchPatternFn(matchOrdinalNumbersPattern),
+ ordinalNumber: parseDecimal,
+ weekdays: buildMatchFn(matchWeekdaysPatterns, 'long'),
+ weekday: buildParseFn(parseWeekdayPatterns, 'any'),
+ months: buildMatchFn(matchMonthsPatterns, 'long'),
+ month: buildParseFn(parseMonthPatterns, 'any'),
+ timesOfDay: buildMatchFn(matchTimesOfDayPatterns, 'long'),
+ timeOfDay: buildParseFn(parseTimeOfDayPatterns, 'any')
+}
+
+export default match
diff --git a/date-fns/src/locale/ar/index.d.ts b/date-fns/src/locale/ar/index.d.ts
new file mode 100644
index 0000000..61adf3b
--- /dev/null
+++ b/date-fns/src/locale/ar/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ar } from 'date-fns/locale'
+export default ar
diff --git a/date-fns/src/locale/ar/index.js b/date-fns/src/locale/ar/index.js
new file mode 100644
index 0000000..efad6f7
--- /dev/null
+++ b/date-fns/src/locale/ar/index.js
@@ -0,0 +1,32 @@
+// import formatDistance from './_lib/formatDistance/index'
+// import formatLong from './_lib/formatLong/index'
+// import formatRelative from './_lib/formatRelative/index'
+// import localize from './_lib/localize/index'
+// import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Arabic locale (Modern Standard Arabic - Al-fussha).
+ * @language Modern Standard Arabic
+ * @iso-639-2 ara
+ * @author Abdallah Hassan [@AbdallahAHO]{@link https://github.com/AbdallahAHO}
+ */
+// var locale = {
+// code: 'ar',
+// formatDistance: formatDistance,
+// formatLong: formatLong,
+// formatRelative: formatRelative,
+// localize: localize,
+// match: match,
+// options: {
+// weekStartsOn: 6 /* Saturday */,
+// firstWeekContainsDate: 1
+// }
+// }
+
+// export default locale
+
+throw new Error(
+ 'ar locale is currently unavailable. Please check the progress of converting this locale to v2.0.0 in this issue on Github: TBA'
+)
diff --git a/date-fns/src/locale/ar/index.js.flow b/date-fns/src/locale/ar/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ar/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/az/_lib/formatDistance/index.js b/date-fns/src/locale/az/_lib/formatDistance/index.js
new file mode 100644
index 0000000..836a06b
--- /dev/null
+++ b/date-fns/src/locale/az/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'bir saniyədən az',
+ other: '{{count}} bir saniyədən az'
+ },
+
+ xSeconds: {
+ one: '1 saniyə',
+ other: '{{count}} saniyə'
+ },
+
+ halfAMinute: 'yarım dəqiqə',
+
+ lessThanXMinutes: {
+ one: 'bir dəqiqədən az',
+ other: '{{count}} bir dəqiqədən az'
+ },
+
+ xMinutes: {
+ one: 'bir dəqiqə',
+ other: '{{count}} dəqiqə'
+ },
+
+ aboutXHours: {
+ one: 'təxminən 1 saat',
+ other: 'təxminən {{count}} saat'
+ },
+
+ xHours: {
+ one: '1 saat',
+ other: '{{count}} saat'
+ },
+
+ xDays: {
+ one: '1 gün',
+ other: '{{count}} gün'
+ },
+
+ aboutXWeeks: {
+ one: 'təxminən 1 həftə',
+ other: 'təxminən {{count}} həftə'
+ },
+
+ xWeeks: {
+ one: '1 həftə',
+ other: '{{count}} həftə'
+ },
+
+ aboutXMonths: {
+ one: 'təxminən 1 ay',
+ other: 'təxminən {{count}} ay'
+ },
+
+ xMonths: {
+ one: '1 ay',
+ other: '{{count}} ay'
+ },
+
+ aboutXYears: {
+ one: 'təxminən 1 il',
+ other: 'təxminən {{count}} il'
+ },
+
+ xYears: {
+ one: '1 il',
+ other: '{{count}} il'
+ },
+
+ overXYears: {
+ one: '1 ildən çox',
+ other: '{{count}} ildən çox'
+ },
+
+ almostXYears: {
+ one: 'demək olar ki 1 il',
+ other: 'demək olar ki {{count}} il'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ var result
+
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' əvvəl'
+ } else {
+ return result + ' sonra'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/az/_lib/formatLong/index.js b/date-fns/src/locale/az/_lib/formatLong/index.js
new file mode 100644
index 0000000..baf216e
--- /dev/null
+++ b/date-fns/src/locale/az/_lib/formatLong/index.js
@@ -0,0 +1,39 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, do MMMM y 'il'",
+ long: "do MMMM y 'il'",
+ medium: "d MMM y 'il'",
+ short: 'dd.MM.yyyy'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+var dateTimeFormats = {
+ full: "{{date}} {{time}} - 'də'",
+ long: "{{date}} {{time}} - 'də'",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/az/_lib/formatRelative/index.js b/date-fns/src/locale/az/_lib/formatRelative/index.js
new file mode 100644
index 0000000..c9c1bc5
--- /dev/null
+++ b/date-fns/src/locale/az/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'sonuncu' eeee p -'də'",
+ yesterday: "'dünən' p -'də'",
+ today: "'bugün' p -'də'",
+ tomorrow: "'sabah' p -'də'",
+ nextWeek: "eeee p -'də'",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/az/_lib/localize/index.js b/date-fns/src/locale/az/_lib/localize/index.js
new file mode 100644
index 0000000..97bd29f
--- /dev/null
+++ b/date-fns/src/locale/az/_lib/localize/index.js
@@ -0,0 +1,194 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['B', 'A'],
+ abbreviated: ['BC', 'AD'],
+ wide: ["Hz. İsa'dan öncə", 'Anno Domini']
+}
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['1ci kvartal', '2ci kvartal', '3cü kvartal', '4cü kvartal'] // Note: in English, the names of days of the week and months are capitalized.
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
+ // Generally, formatted dates should look like they are in the middle of a sentence,
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
+}
+var monthValues = {
+ narrow: ['Y', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Yan',
+ 'Fev',
+ 'Mar',
+ 'Apr',
+ 'May',
+ 'İyun',
+ 'İyul',
+ 'Avq',
+ 'Sen',
+ 'Okt',
+ 'Noy',
+ 'Dek'
+ ],
+ wide: [
+ 'Yanvar',
+ 'Fevral',
+ 'Mart',
+ 'Aprel',
+ 'May',
+ 'İyun',
+ 'İyul',
+ 'Avqust',
+ 'Sentyabr',
+ 'Oktyabr',
+ 'Noyabr',
+ 'Dekabr'
+ ]
+}
+var dayValues = {
+ narrow: ['B.', 'B.e', 'Ç.a', 'Ç.', 'C.a', 'C.', 'Ş.'],
+ short: ['B.', 'B.e', 'Ç.a', 'Ç.', 'C.a', 'C.', 'Ş.'],
+ abbreviated: ['Baz', 'Baz.e', 'Çər.a', 'Çər', 'Cüm.a', 'Cüm', 'Şə'],
+ wide: [
+ 'Bazar',
+ 'Bazar ertəsi',
+ 'Çərşənbə axşamı',
+ 'Çərşənbə',
+ 'Cümə axşamı',
+ 'Cümə',
+ 'Şənbə'
+ ]
+}
+var dayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'gecəyarı',
+ noon: 'gün',
+ morning: 'səhər',
+ afternoon: 'gündüz',
+ evening: 'axşam',
+ night: 'gecə'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'gecəyarı',
+ noon: 'gün',
+ morning: 'səhər',
+ afternoon: 'gündüz',
+ evening: 'axşam',
+ night: 'gecə'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'gecəyarı',
+ noon: 'gün',
+ morning: 'səhər',
+ afternoon: 'gündüz',
+ evening: 'axşam',
+ night: 'gecə'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'gecəyarı',
+ noon: 'gün',
+ morning: 'səhər',
+ afternoon: 'gündüz',
+ evening: 'axşam',
+ night: 'gecə'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'gecəyarı',
+ noon: 'gün',
+ morning: 'səhər',
+ afternoon: 'gündüz',
+ evening: 'axşam',
+ night: 'gecə'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'gecəyarı',
+ noon: 'gün',
+ morning: 'səhər',
+ afternoon: 'gündüz',
+ evening: 'axşam',
+ night: 'gecə'
+ }
+}
+
+var suffixes = {
+ 1: '-inci',
+ 5: '-inci',
+ 8: '-inci',
+ 70: '-inci',
+ 80: '-inci',
+ 2: '-nci',
+ 7: '-nci',
+ 20: '-nci',
+ 50: '-nci',
+ 3: '-üncü',
+ 4: '-üncü',
+ 100: '-üncü',
+ 6: '-ncı',
+ 9: '-uncu',
+ 10: '-uncu',
+ 30: '-uncu',
+ 60: '-ıncı',
+ 90: '-ıncı'
+}
+
+function getSuffix(number) {
+ if (number === 0) {
+ // special case for zero
+ return number + '-ıncı'
+ }
+ var a = number % 10,
+ b = (number % 100) - a,
+ c = number >= 100 ? 100 : null
+ return suffixes[a] || suffixes[b] || suffixes[c]
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ var suffix = getSuffix(number)
+
+ return number + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/az/_lib/match/index.js b/date-fns/src/locale/az/_lib/match/index.js
new file mode 100644
index 0000000..853c316
--- /dev/null
+++ b/date-fns/src/locale/az/_lib/match/index.js
@@ -0,0 +1,166 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?(ci|inci|nci|uncu|üncü|ncı))?/i
+var parseOrdinalNumberPattern = /\d+/i
+var matchEraPatterns = {
+ narrow: /^(b|a)$/i,
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)$/i,
+ wide: /^(Hz. İsa'dan öncə|ümumi eradan əvvəl|anno domini|ümumi dövr)$/i
+}
+var parseEraPatterns = {
+ any: [/^b$/i, /^(a|c)$/i]
+}
+var matchQuarterPatterns = {
+ narrow: /^[1234]$/i,
+ abbreviated: /^K[1234]$/i,
+ wide: /^[1234](ci)? kvartal$/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+var matchMonthPatterns = {
+ narrow: /^[(?-i)yfmaisond]$/i,
+ abbreviated: /^(Yan|Fev|Mar|Apr|May|İyun|İyul|Avq|Sen|Okt|Noy|Dek)$/i,
+ wide: /^(Yanvar|Fevral|Mart|Aprel|May|İyun|İyul|Avgust|Sentyabr|Oktyabr|Noyabr|Dekabr)$/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^[(?-i)y]$/i,
+ /^[(?-i)f]$/i,
+ /^[(?-i)m]$/i,
+ /^[(?-i)a]$/i,
+ /^[(?-i)m]$/i,
+ /^[(?-i)i]$/i,
+ /^[(?-i)i]$/i,
+ /^[(?-i)a]$/i,
+ /^[(?-i)s]$/i,
+ /^[(?-i)o]$/i,
+ /^[(?-i)n]$/i,
+ /^[(?-i)d]$/i
+ ],
+ abbreviated: [
+ /^Yan$/i,
+ /^Fev$/i,
+ /^Mar$/i,
+ /^Apr$/i,
+ /^May$/i,
+ /^İyun$/i,
+ /^İyul$/i,
+ /^Avg$/i,
+ /^Sen$/i,
+ /^Okt$/i,
+ /^Noy$/i,
+ /^Dek$/i
+ ],
+ wide: [
+ /^Yanvar$/i,
+ /^Fevral$/i,
+ /^Mart$/i,
+ /^Aprel$/i,
+ /^May$/i,
+ /^İyun$/i,
+ /^İyul$/i,
+ /^Avgust$/i,
+ /^Sentyabr$/i,
+ /^Oktyabr$/i,
+ /^Noyabr$/i,
+ /^Dekabr$/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
+ short: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
+ abbreviated: /^(Baz\.e|Çər|Çər\.a|Cüm|Cüm\.a|Şə)$/i,
+ wide: /^(Bazar|Bazar ertəsi|Çərşənbə axşamı|Çərşənbə|Cümə axşamı|Cümə|Şənbə)$/i
+}
+var parseDayPatterns = {
+ narrow: [
+ /^B\.$/i,
+ /^B\.e$/i,
+ /^Ç\.a$/i,
+ /^Ç\.$/i,
+ /^C\.a$/i,
+ /^C\.$/i,
+ /^Ş\.$/i
+ ],
+ abbreviated: [
+ /^Baz\.e$/i,
+ /^Çər$/i,
+ /^Çər\.a$/i,
+ /^Cüm$/i,
+ /^Cüm\.a$/i,
+ /^Şə$/i
+ ],
+ wide: [
+ /^Bazar$/i,
+ /^Bazar ertəsi$/i,
+ /^Çərşənbə axşamı$/i,
+ /^Çərşənbə$/i,
+ /^Cümə axşamı$/i,
+ /^Cümə$/i,
+ /^Şənbə$/i
+ ],
+ any: [/^B\.$/i, /^B\.e$/i, /^Ç\.a$/i, /^Ç\.$/i, /^C\.a$/i, /^C\.$/i, /^Ş\.$/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i,
+ any: /^(am|pm|a\.m\.|p\.m\.|AM|PM|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a$/i,
+ pm: /^p$/i,
+ midnight: /^gecəyarı$/i,
+ noon: /^gün$/i,
+ morning: /səhər$/i,
+ afternoon: /gündüz$/i,
+ evening: /axşam$/i,
+ night: /gecə$/i
+ }
+}
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+export default match
diff --git a/date-fns/src/locale/az/index.d.ts b/date-fns/src/locale/az/index.d.ts
new file mode 100644
index 0000000..b2b2253
--- /dev/null
+++ b/date-fns/src/locale/az/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { az } from 'date-fns/locale'
+export default az
diff --git a/date-fns/src/locale/az/index.js b/date-fns/src/locale/az/index.js
new file mode 100644
index 0000000..20b836a
--- /dev/null
+++ b/date-fns/src/locale/az/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Azerbaijani locale.
+ * @language Azerbaijani
+ * @iso-639-2 aze
+ */
+
+var locale = {
+ code: 'az',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/az/index.js.flow b/date-fns/src/locale/az/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/az/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/az/snapshot.md b/date-fns/src/locale/az/snapshot.md
new file mode 100644
index 0000000..0f84be4
--- /dev/null
+++ b/date-fns/src/locale/az/snapshot.md
@@ -0,0 +1,304 @@
+# Azerbaijani (az) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-nci | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-inci | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-nci | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-inci | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-inci | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-nci | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1ci kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ci kvartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-inci | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-nci | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1ci kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ci kvartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-nci | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-nci | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | İyul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Fevral | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | İyul | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-nci | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-nci | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | İyul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Fevral | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | İyul | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-inci | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-inci | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-inci | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-inci | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-inci | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-inci | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-nci | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-inci | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Baz.e | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cüm | 2019-02-13T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Baz.e | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cüm | 2019-02-13T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Baz.e | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cüm | 2019-02-13T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Bazar ertəsi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cümə | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-inci | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-inci | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Baz.e | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cüm | 2019-02-13T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Bazar ertəsi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cümə | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-inci | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-inci | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Baz.e | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cüm | 2019-02-13T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Bazar ertəsi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cümə | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-inci | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-inci | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Baz.e | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cüm | 2019-02-13T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Bazar ertəsi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cümə | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | B.e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C. | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | səhər | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | gündüz | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | axşam | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | gecə | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | səhər | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | gündüz | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | axşam | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | gecə | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | səhər | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | gündüz | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | axşam | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | gecə | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | səhər | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | gündüz | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | axşam | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | gecə | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | səhər | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | gündüz | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | axşam | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | gecə | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-inci | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-inci | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-inci | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-üncü | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-inci | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-inci | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-inci | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-üncü | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-inci | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-inci | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-inci | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-inci | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Fev 1987 il | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 il | Invalid Date |
+| | PPP | 1987-02-11T12:13:14.015Z | 11-inci Fevral 1987 il | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29-uncu May 1453 il | Invalid Date |
+| | PPPP | 1987-02-11T12:13:14.015Z | Çərşənbə, 11-inci Fevral 1987 il | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | Bazar, 29-uncu May 1453 il | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Fev 1987 il, 12:13:14 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 il, 23:59:59 | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11-inci Fevral 1987 il 12:13:14 GMT+0 - də | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29-uncu May 1453 il 23:59:59 GMT+0 - də | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Çərşənbə, 11-inci Fevral 1987 il 12:13:14 GMT+00:00 - də | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | Bazar, 29-uncu May 1453 il 23:59:59 GMT+00:00 - də | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | təxminən 6 il | təxminən 6 il | təxminən 6 il əvvəl |
+| 2005-01-01T00:00:00.000Z | təxminən 5 il | təxminən 5 il | təxminən 5 il əvvəl |
+| 2004-01-01T00:00:00.000Z | təxminən 4 il | təxminən 4 il | təxminən 4 il əvvəl |
+| 2003-01-01T00:00:00.000Z | təxminən 3 il | təxminən 3 il | təxminən 3 il əvvəl |
+| 2002-01-01T00:00:00.000Z | təxminən 2 il | təxminən 2 il | təxminən 2 il əvvəl |
+| 2001-06-01T00:00:00.000Z | 1 ildən çox | 1 ildən çox | 1 ildən çox əvvəl |
+| 2001-02-01T00:00:00.000Z | təxminən 1 il | təxminən 1 il | təxminən 1 il əvvəl |
+| 2001-01-01T00:00:00.000Z | təxminən 1 il | təxminən 1 il | təxminən 1 il əvvəl |
+| 2000-06-01T00:00:00.000Z | 5 ay | 5 ay | 5 ay əvvəl |
+| 2000-03-01T00:00:00.000Z | 2 ay | 2 ay | 2 ay əvvəl |
+| 2000-02-01T00:00:00.000Z | təxminən 1 ay | təxminən 1 ay | təxminən 1 ay əvvəl |
+| 2000-01-15T00:00:00.000Z | 14 gün | 14 gün | 14 gün əvvəl |
+| 2000-01-02T00:00:00.000Z | 1 gün | 1 gün | 1 gün əvvəl |
+| 2000-01-01T06:00:00.000Z | təxminən 6 saat | təxminən 6 saat | təxminən 6 saat əvvəl |
+| 2000-01-01T01:00:00.000Z | təxminən 1 saat | təxminən 1 saat | təxminən 1 saat əvvəl |
+| 2000-01-01T00:45:00.000Z | təxminən 1 saat | təxminən 1 saat | təxminən 1 saat əvvəl |
+| 2000-01-01T00:30:00.000Z | 30 dəqiqə | 30 dəqiqə | 30 dəqiqə əvvəl |
+| 2000-01-01T00:15:00.000Z | 15 dəqiqə | 15 dəqiqə | 15 dəqiqə əvvəl |
+| 2000-01-01T00:01:00.000Z | bir dəqiqə | bir dəqiqə | bir dəqiqə əvvəl |
+| 2000-01-01T00:00:25.000Z | bir dəqiqədən az | yarım dəqiqə | bir dəqiqədən az əvvəl |
+| 2000-01-01T00:00:15.000Z | bir dəqiqədən az | 20 bir saniyədən az | bir dəqiqədən az əvvəl |
+| 2000-01-01T00:00:05.000Z | bir dəqiqədən az | 10 bir saniyədən az | bir dəqiqədən az əvvəl |
+| 2000-01-01T00:00:00.000Z | bir dəqiqədən az | 5 bir saniyədən az | bir dəqiqədən az sonra |
+| 1999-12-31T23:59:55.000Z | bir dəqiqədən az | 10 bir saniyədən az | bir dəqiqədən az sonra |
+| 1999-12-31T23:59:45.000Z | bir dəqiqədən az | 20 bir saniyədən az | bir dəqiqədən az sonra |
+| 1999-12-31T23:59:35.000Z | bir dəqiqədən az | yarım dəqiqə | bir dəqiqədən az sonra |
+| 1999-12-31T23:59:00.000Z | bir dəqiqə | bir dəqiqə | bir dəqiqə sonra |
+| 1999-12-31T23:45:00.000Z | 15 dəqiqə | 15 dəqiqə | 15 dəqiqə sonra |
+| 1999-12-31T23:30:00.000Z | 30 dəqiqə | 30 dəqiqə | 30 dəqiqə sonra |
+| 1999-12-31T23:15:00.000Z | təxminən 1 saat | təxminən 1 saat | təxminən 1 saat sonra |
+| 1999-12-31T23:00:00.000Z | təxminən 1 saat | təxminən 1 saat | təxminən 1 saat sonra |
+| 1999-12-31T18:00:00.000Z | təxminən 6 saat | təxminən 6 saat | təxminən 6 saat sonra |
+| 1999-12-30T00:00:00.000Z | 2 gün | 2 gün | 2 gün sonra |
+| 1999-12-15T00:00:00.000Z | 17 gün | 17 gün | 17 gün sonra |
+| 1999-12-01T00:00:00.000Z | təxminən 1 ay | təxminən 1 ay | təxminən 1 ay sonra |
+| 1999-11-01T00:00:00.000Z | 2 ay | 2 ay | 2 ay sonra |
+| 1999-06-01T00:00:00.000Z | 7 ay | 7 ay | 7 ay sonra |
+| 1999-01-01T00:00:00.000Z | təxminən 1 il | təxminən 1 il | təxminən 1 il sonra |
+| 1998-12-01T00:00:00.000Z | təxminən 1 il | təxminən 1 il | təxminən 1 il sonra |
+| 1998-06-01T00:00:00.000Z | 1 ildən çox | 1 ildən çox | 1 ildən çox sonra |
+| 1998-01-01T00:00:00.000Z | təxminən 2 il | təxminən 2 il | təxminən 2 il sonra |
+| 1997-01-01T00:00:00.000Z | təxminən 3 il | təxminən 3 il | təxminən 3 il sonra |
+| 1996-01-01T00:00:00.000Z | təxminən 4 il | təxminən 4 il | təxminən 4 il sonra |
+| 1995-01-01T00:00:00.000Z | təxminən 5 il | təxminən 5 il | təxminən 5 il sonra |
+| 1994-01-01T00:00:00.000Z | təxminən 6 il | təxminən 6 il | təxminən 6 il sonra |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 il | 6 il əvvəl | 52608 saat |
+| 2005-01-01T00:00:00.000Z | 5 il | 5 il əvvəl | 43848 saat |
+| 2004-01-01T00:00:00.000Z | 4 il | 4 il əvvəl | 35064 saat |
+| 2003-01-01T00:00:00.000Z | 3 il | 3 il əvvəl | 26304 saat |
+| 2002-01-01T00:00:00.000Z | 2 il | 2 il əvvəl | 17544 saat |
+| 2001-06-01T00:00:00.000Z | 1 il | 1 il əvvəl | 12408 saat |
+| 2001-02-01T00:00:00.000Z | 1 il | 1 il əvvəl | 9528 saat |
+| 2001-01-01T00:00:00.000Z | 1 il | 1 il əvvəl | 8784 saat |
+| 2000-06-01T00:00:00.000Z | 5 ay | 5 ay əvvəl | 3648 saat |
+| 2000-03-01T00:00:00.000Z | 2 ay | 2 ay əvvəl | 1440 saat |
+| 2000-02-01T00:00:00.000Z | 1 ay | 1 ay əvvəl | 744 saat |
+| 2000-01-15T00:00:00.000Z | 14 gün | 14 gün əvvəl | 336 saat |
+| 2000-01-02T00:00:00.000Z | 1 gün | 1 gün əvvəl | 24 saat |
+| 2000-01-01T06:00:00.000Z | 6 saat | 6 saat əvvəl | 6 saat |
+| 2000-01-01T01:00:00.000Z | 1 saat | 1 saat əvvəl | 1 saat |
+| 2000-01-01T00:45:00.000Z | 45 dəqiqə | 45 dəqiqə əvvəl | 1 saat |
+| 2000-01-01T00:30:00.000Z | 30 dəqiqə | 30 dəqiqə əvvəl | 1 saat |
+| 2000-01-01T00:15:00.000Z | 15 dəqiqə | 15 dəqiqə əvvəl | 0 saat |
+| 2000-01-01T00:01:00.000Z | bir dəqiqə | bir dəqiqə əvvəl | 0 saat |
+| 2000-01-01T00:00:25.000Z | 25 saniyə | 25 saniyə əvvəl | 0 saat |
+| 2000-01-01T00:00:15.000Z | 15 saniyə | 15 saniyə əvvəl | 0 saat |
+| 2000-01-01T00:00:05.000Z | 5 saniyə | 5 saniyə əvvəl | 0 saat |
+| 2000-01-01T00:00:00.000Z | 0 saniyə | 0 saniyə sonra | 0 saat |
+| 1999-12-31T23:59:55.000Z | 5 saniyə | 5 saniyə sonra | 0 saat |
+| 1999-12-31T23:59:45.000Z | 15 saniyə | 15 saniyə sonra | 0 saat |
+| 1999-12-31T23:59:35.000Z | 25 saniyə | 25 saniyə sonra | 0 saat |
+| 1999-12-31T23:59:00.000Z | bir dəqiqə | bir dəqiqə sonra | 0 saat |
+| 1999-12-31T23:45:00.000Z | 15 dəqiqə | 15 dəqiqə sonra | 0 saat |
+| 1999-12-31T23:30:00.000Z | 30 dəqiqə | 30 dəqiqə sonra | 1 saat |
+| 1999-12-31T23:15:00.000Z | 45 dəqiqə | 45 dəqiqə sonra | 1 saat |
+| 1999-12-31T23:00:00.000Z | 1 saat | 1 saat sonra | 1 saat |
+| 1999-12-31T18:00:00.000Z | 6 saat | 6 saat sonra | 6 saat |
+| 1999-12-30T00:00:00.000Z | 2 gün | 2 gün sonra | 48 saat |
+| 1999-12-15T00:00:00.000Z | 17 gün | 17 gün sonra | 408 saat |
+| 1999-12-01T00:00:00.000Z | 1 ay | 1 ay sonra | 744 saat |
+| 1999-11-01T00:00:00.000Z | 2 ay | 2 ay sonra | 1464 saat |
+| 1999-06-01T00:00:00.000Z | 7 ay | 7 ay sonra | 5136 saat |
+| 1999-01-01T00:00:00.000Z | 1 il | 1 il sonra | 8760 saat |
+| 1998-12-01T00:00:00.000Z | 1 il | 1 il sonra | 9504 saat |
+| 1998-06-01T00:00:00.000Z | 2 il | 2 il sonra | 13896 saat |
+| 1998-01-01T00:00:00.000Z | 2 il | 2 il sonra | 17520 saat |
+| 1997-01-01T00:00:00.000Z | 3 il | 3 il sonra | 26280 saat |
+| 1996-01-01T00:00:00.000Z | 4 il | 4 il sonra | 35064 saat |
+| 1995-01-01T00:00:00.000Z | 5 il | 5 il sonra | 43824 saat |
+| 1994-01-01T00:00:00.000Z | 6 il | 6 il sonra | 52584 saat |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | Çərşənbə 0:00 -də |
+| 2000-01-02T00:00:00.000Z | sabah 0:00 -də |
+| 2000-01-01T00:00:00.000Z | bugün 0:00 -də |
+| 1999-12-31T00:00:00.000Z | dünən 0:00 -də |
+| 1999-12-27T00:00:00.000Z | sonuncu Bazar ertəsi 0:00 -də |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/be/_lib/formatDistance/index.js b/date-fns/src/locale/be/_lib/formatDistance/index.js
new file mode 100644
index 0000000..b8e33dc
--- /dev/null
+++ b/date-fns/src/locale/be/_lib/formatDistance/index.js
@@ -0,0 +1,257 @@
+function declension(scheme, count) {
+ // scheme for count=1 exists
+ if (scheme.one !== undefined && count === 1) {
+ return scheme.one
+ }
+
+ var rem10 = count % 10
+ var rem100 = count % 100
+
+ // 1, 21, 31, ...
+ if (rem10 === 1 && rem100 !== 11) {
+ return scheme.singularNominative.replace('{{count}}', count)
+
+ // 2, 3, 4, 22, 23, 24, 32 ...
+ } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
+ return scheme.singularGenitive.replace('{{count}}', count)
+
+ // 5, 6, 7, 8, 9, 10, 11, ...
+ } else {
+ return scheme.pluralGenitive.replace('{{count}}', count)
+ }
+}
+
+function buildLocalizeTokenFn(scheme) {
+ return function(count, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ if (scheme.future) {
+ return declension(scheme.future, count)
+ } else {
+ return 'праз ' + declension(scheme.regular, count)
+ }
+ } else {
+ if (scheme.past) {
+ return declension(scheme.past, count)
+ } else {
+ return declension(scheme.regular, count) + ' таму'
+ }
+ }
+ } else {
+ return declension(scheme.regular, count)
+ }
+ }
+}
+
+var formatDistanceLocale = {
+ lessThanXSeconds: buildLocalizeTokenFn({
+ regular: {
+ one: 'менш за секунду',
+ singularNominative: 'менш за {{count}} секунду',
+ singularGenitive: 'менш за {{count}} секунды',
+ pluralGenitive: 'менш за {{count}} секунд'
+ },
+ future: {
+ one: 'менш, чым праз секунду',
+ singularNominative: 'менш, чым праз {{count}} секунду',
+ singularGenitive: 'менш, чым праз {{count}} секунды',
+ pluralGenitive: 'менш, чым праз {{count}} секунд'
+ }
+ }),
+
+ xSeconds: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} секунда',
+ singularGenitive: '{{count}} секунды',
+ pluralGenitive: '{{count}} секунд'
+ },
+ past: {
+ singularNominative: '{{count}} секунду таму',
+ singularGenitive: '{{count}} секунды таму',
+ pluralGenitive: '{{count}} секунд таму'
+ },
+ future: {
+ singularNominative: 'праз {{count}} секунду',
+ singularGenitive: 'праз {{count}} секунды',
+ pluralGenitive: 'праз {{count}} секунд'
+ }
+ }),
+
+ halfAMinute: function(_, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'праз паўхвіліны'
+ } else {
+ return 'паўхвіліны таму'
+ }
+ }
+
+ return 'паўхвіліны'
+ },
+
+ lessThanXMinutes: buildLocalizeTokenFn({
+ regular: {
+ one: 'менш за хвіліну',
+ singularNominative: 'менш за {{count}} хвіліну',
+ singularGenitive: 'менш за {{count}} хвіліны',
+ pluralGenitive: 'менш за {{count}} хвілін'
+ },
+ future: {
+ one: 'менш, чым праз хвіліну',
+ singularNominative: 'менш, чым праз {{count}} хвіліну',
+ singularGenitive: 'менш, чым праз {{count}} хвіліны',
+ pluralGenitive: 'менш, чым праз {{count}} хвілін'
+ }
+ }),
+
+ xMinutes: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} хвіліна',
+ singularGenitive: '{{count}} хвіліны',
+ pluralGenitive: '{{count}} хвілін'
+ },
+ past: {
+ singularNominative: '{{count}} хвіліну таму',
+ singularGenitive: '{{count}} хвіліны таму',
+ pluralGenitive: '{{count}} хвілін таму'
+ },
+ future: {
+ singularNominative: 'праз {{count}} хвіліну',
+ singularGenitive: 'праз {{count}} хвіліны',
+ pluralGenitive: 'праз {{count}} хвілін'
+ }
+ }),
+
+ aboutXHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'каля {{count}} гадзіны',
+ singularGenitive: 'каля {{count}} гадзін',
+ pluralGenitive: 'каля {{count}} гадзін'
+ },
+ future: {
+ singularNominative: 'прыблізна праз {{count}} гадзіну',
+ singularGenitive: 'прыблізна праз {{count}} гадзіны',
+ pluralGenitive: 'прыблізна праз {{count}} гадзін'
+ }
+ }),
+
+ xHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} гадзіна',
+ singularGenitive: '{{count}} гадзіны',
+ pluralGenitive: '{{count}} гадзін'
+ },
+ past: {
+ singularNominative: '{{count}} гадзіну таму',
+ singularGenitive: '{{count}} гадзіны таму',
+ pluralGenitive: '{{count}} гадзін таму'
+ },
+ future: {
+ singularNominative: 'праз {{count}} гадзіну',
+ singularGenitive: 'праз {{count}} гадзіны',
+ pluralGenitive: 'праз {{count}} гадзін'
+ }
+ }),
+
+ xDays: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} дзень',
+ singularGenitive: '{{count}} дні',
+ pluralGenitive: '{{count}} дзён'
+ }
+ }),
+
+ aboutXWeeks: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'каля {{count}} месяца', // TODO
+ singularGenitive: 'каля {{count}} месяцаў', // TODO
+ pluralGenitive: 'каля {{count}} месяцаў' // TODO
+ },
+ future: {
+ singularNominative: 'прыблізна праз {{count}} месяц', // TODO
+ singularGenitive: 'прыблізна праз {{count}} месяцы', // TODO
+ pluralGenitive: 'прыблізна праз {{count}} месяцаў' // TODO
+ }
+ }),
+
+ xWeeks: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} месяц',
+ singularGenitive: '{{count}} месяцы',
+ pluralGenitive: '{{count}} месяцаў'
+ }
+ }),
+
+ aboutXMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'каля {{count}} месяца',
+ singularGenitive: 'каля {{count}} месяцаў',
+ pluralGenitive: 'каля {{count}} месяцаў'
+ },
+ future: {
+ singularNominative: 'прыблізна праз {{count}} месяц',
+ singularGenitive: 'прыблізна праз {{count}} месяцы',
+ pluralGenitive: 'прыблізна праз {{count}} месяцаў'
+ }
+ }),
+
+ xMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} месяц',
+ singularGenitive: '{{count}} месяцы',
+ pluralGenitive: '{{count}} месяцаў'
+ }
+ }),
+
+ aboutXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'каля {{count}} года',
+ singularGenitive: 'каля {{count}} гадоў',
+ pluralGenitive: 'каля {{count}} гадоў'
+ },
+ future: {
+ singularNominative: 'прыблізна праз {{count}} год',
+ singularGenitive: 'прыблізна праз {{count}} гады',
+ pluralGenitive: 'прыблізна праз {{count}} гадоў'
+ }
+ }),
+
+ xYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} год',
+ singularGenitive: '{{count}} гады',
+ pluralGenitive: '{{count}} гадоў'
+ }
+ }),
+
+ overXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'больш за {{count}} год',
+ singularGenitive: 'больш за {{count}} гады',
+ pluralGenitive: 'больш за {{count}} гадоў'
+ },
+ future: {
+ singularNominative: 'больш, чым праз {{count}} год',
+ singularGenitive: 'больш, чым праз {{count}} гады',
+ pluralGenitive: 'больш, чым праз {{count}} гадоў'
+ }
+ }),
+
+ almostXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'амаль {{count}} год',
+ singularGenitive: 'амаль {{count}} гады',
+ pluralGenitive: 'амаль {{count}} гадоў'
+ },
+ future: {
+ singularNominative: 'амаль праз {{count}} год',
+ singularGenitive: 'амаль праз {{count}} гады',
+ pluralGenitive: 'амаль праз {{count}} гадоў'
+ }
+ })
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ return formatDistanceLocale[token](count, options)
+}
diff --git a/date-fns/src/locale/be/_lib/formatLong/index.js b/date-fns/src/locale/be/_lib/formatLong/index.js
new file mode 100644
index 0000000..e3ac8dd
--- /dev/null
+++ b/date-fns/src/locale/be/_lib/formatLong/index.js
@@ -0,0 +1,38 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, d MMMM y 'г.'",
+ long: "d MMMM y 'г.'",
+ medium: "d MMM y 'г.'",
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ any: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'any'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/be/_lib/formatRelative/index.js b/date-fns/src/locale/be/_lib/formatRelative/index.js
new file mode 100644
index 0000000..5e2643c
--- /dev/null
+++ b/date-fns/src/locale/be/_lib/formatRelative/index.js
@@ -0,0 +1,82 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+var accusativeWeekdays = [
+ 'нядзелю',
+ 'панядзелак',
+ 'аўторак',
+ 'сераду',
+ 'чацвер',
+ 'пятніцу',
+ 'суботу'
+]
+
+function lastWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 5:
+ case 6:
+ return "'у мінулую " + weekday + " а' p"
+ case 1:
+ case 2:
+ case 4:
+ return "'у мінулы " + weekday + " а' p"
+ }
+}
+
+function thisWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ return "'у " + weekday + " а' p"
+}
+
+function nextWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 5:
+ case 6:
+ return "'у наступную " + weekday + " а' p"
+ case 1:
+ case 2:
+ case 4:
+ return "'у наступны " + weekday + " а' p"
+ }
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'учора а' p",
+ today: "'сёння а' p",
+ tomorrow: "'заўтра а' p",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/be/_lib/localize/index.js b/date-fns/src/locale/be/_lib/localize/index.js
new file mode 100644
index 0000000..caeb8b0
--- /dev/null
+++ b/date-fns/src/locale/be/_lib/localize/index.js
@@ -0,0 +1,227 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['да н.э.', 'н.э.'],
+ abbreviated: ['да н. э.', 'н. э.'],
+ wide: ['да нашай эры', 'нашай эры']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1-ы кв.', '2-і кв.', '3-і кв.', '4-ы кв.'],
+ wide: ['1-ы квартал', '2-і квартал', '3-і квартал', '4-ы квартал']
+}
+
+var monthValues = {
+ narrow: ['С', 'Л', 'С', 'К', 'М', 'Ч', 'Л', 'Ж', 'В', 'К', 'Л', 'С'],
+ abbreviated: [
+ 'студз.',
+ 'лют.',
+ 'сак.',
+ 'крас.',
+ 'май',
+ 'чэрв.',
+ 'ліп.',
+ 'жн.',
+ 'вер.',
+ 'кастр.',
+ 'ліст.',
+ 'снеж.'
+ ],
+ wide: [
+ 'студзень',
+ 'люты',
+ 'сакавік',
+ 'красавік',
+ 'май',
+ 'чэрвень',
+ 'ліпень',
+ 'жнівень',
+ 'верасень',
+ 'кастрычнік',
+ 'лістапад',
+ 'снежань'
+ ]
+}
+var formattingMonthValues = {
+ narrow: ['С', 'Л', 'С', 'К', 'М', 'Ч', 'Л', 'Ж', 'В', 'К', 'Л', 'С'],
+ abbreviated: [
+ 'студз.',
+ 'лют.',
+ 'сак.',
+ 'крас.',
+ 'мая',
+ 'чэрв.',
+ 'ліп.',
+ 'жн.',
+ 'вер.',
+ 'кастр.',
+ 'ліст.',
+ 'снеж.'
+ ],
+ wide: [
+ 'студзеня',
+ 'лютага',
+ 'сакавіка',
+ 'красавіка',
+ 'мая',
+ 'чэрвеня',
+ 'ліпеня',
+ 'жніўня',
+ 'верасня',
+ 'кастрычніка',
+ 'лістапада',
+ 'снежня'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Н', 'П', 'А', 'С', 'Ч', 'П', 'С'],
+ short: ['нд', 'пн', 'аў', 'ср', 'чц', 'пт', 'сб'],
+ abbreviated: ['нядз', 'пан', 'аўт', 'сер', 'чац', 'пят', 'суб'],
+ wide: [
+ 'нядзеля',
+ 'панядзелак',
+ 'аўторак',
+ 'серада',
+ 'чацвер',
+ 'пятніца',
+ 'субота'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'поўн.',
+ noon: 'поўд.',
+ morning: 'ран.',
+ afternoon: 'дзень',
+ evening: 'веч.',
+ night: 'ноч'
+ },
+ abbreviated: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'поўн.',
+ noon: 'поўд.',
+ morning: 'ран.',
+ afternoon: 'дзень',
+ evening: 'веч.',
+ night: 'ноч'
+ },
+ wide: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'поўнач',
+ noon: 'поўдзень',
+ morning: 'раніца',
+ afternoon: 'дзень',
+ evening: 'вечар',
+ night: 'ноч'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'поўн.',
+ noon: 'поўд.',
+ morning: 'ран.',
+ afternoon: 'дня',
+ evening: 'веч.',
+ night: 'ночы'
+ },
+ abbreviated: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'поўн.',
+ noon: 'поўд.',
+ morning: 'ран.',
+ afternoon: 'дня',
+ evening: 'веч.',
+ night: 'ночы'
+ },
+ wide: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'поўнач',
+ noon: 'поўдзень',
+ morning: 'раніцы',
+ afternoon: 'дня',
+ evening: 'вечара',
+ night: 'ночы'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var number = Number(dirtyNumber)
+ var suffix
+
+ /** Though it's an incorrect ordinal form of a date we use it here for consistency with other similar locales (ru, uk)
+ * For date-month combinations should be used `d` formatter.
+ * Correct: `d MMMM` (4 верасня)
+ * Incorrect: `do MMMM` (4-га верасня)
+ *
+ * But following the consistency leads to mistakes for literal uses of `do` formatter (ordinal day of month).
+ * So for phrase "5th day of month" (`do дзень месяца`)
+ * library will produce: `5-га дзень месяца`
+ * but correct spelling should be: `5-ы дзень месяца`
+ *
+ * So I guess there should be a stand-alone and a formatting version of "day of month" formatters
+ */
+ if (unit === 'date') {
+ suffix = '-га'
+ } else if (unit === 'hour' || unit === 'minute' || unit === 'second') {
+ suffix = '-я'
+ } else {
+ suffix =
+ (number % 10 === 2 || number % 10 === 3) &&
+ (number % 100 !== 12 && number % 100 !== 13)
+ ? '-і'
+ : '-ы'
+ }
+
+ return number + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'any',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/be/_lib/match/index.js b/date-fns/src/locale/be/_lib/match/index.js
new file mode 100644
index 0000000..bb59653
--- /dev/null
+++ b/date-fns/src/locale/be/_lib/match/index.js
@@ -0,0 +1,138 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?(е|я|га|і|ы|ае|ая|яя|шы|гі|ці|ты|мы))?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^((да )?н\.?\s?э\.?)/i,
+ abbreviated: /^((да )?н\.?\s?э\.?)/i,
+ wide: /^(да нашай эры|нашай эры|наша эра)/i
+}
+var parseEraPatterns = {
+ any: [/^д/i, /^н/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234](-?[ыі]?)? кв.?/i,
+ wide: /^[1234](-?[ыі]?)? квартал/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[слкмчжв]/i,
+ abbreviated: /^(студз|лют|сак|крас|ма[йя]|чэрв|ліп|жн|вер|кастр|ліст|снеж)\.?/i,
+ wide: /^(студзен[ья]|лют(ы|ага)|сакавіка?|красавіка?|ма[йя]|чэрвен[ья]|ліпен[ья]|жні(вень|ўня)|верас(ень|ня)|кастрычніка?|лістапада?|снеж(ань|ня))/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^с/i,
+ /^л/i,
+ /^с/i,
+ /^к/i,
+ /^м/i,
+ /^ч/i,
+ /^л/i,
+ /^ж/i,
+ /^в/i,
+ /^к/i,
+ /^л/i,
+ /^с/i
+ ],
+ any: [
+ /^ст/i,
+ /^лю/i,
+ /^са/i,
+ /^кр/i,
+ /^ма/i,
+ /^ч/i,
+ /^ліп/i,
+ /^ж/i,
+ /^в/i,
+ /^ка/i,
+ /^ліс/i,
+ /^сн/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[нпасч]/i,
+ short: /^(нд|ня|пн|па|аў|ат|ср|се|чц|ча|пт|пя|сб|су)\.?/i,
+ abbreviated: /^(нядз?|ндз|пнд|пан|аўт|срд|сер|чцв|чац|птн|пят|суб).?/i,
+ wide: /^(нядзел[яі]|панядзел(ак|ка)|аўтор(ак|ка)|серад[аы]|чацв(ер|ярга)|пятніц[аы]|субот[аы])/i
+}
+var parseDayPatterns = {
+ narrow: [/^н/i, /^п/i, /^а/i, /^с/i, /^ч/i, /^п/i, /^с/i],
+ any: [/^н/i, /^п[ан]/i, /^а/i, /^с[ер]/i, /^ч/i, /^п[ят]/i, /^с[уб]/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
+ abbreviated: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
+ wide: /^([дп]п|поўнач|поўдзень|раніц[аы]|дзень|дня|вечара?|ночы?)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^дп/i,
+ pm: /^пп/i,
+ midnight: /^поўн/i,
+ noon: /^поўд/i,
+ morning: /^р/i,
+ afternoon: /^д[зн]/i,
+ evening: /^в/i,
+ night: /^н/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/be/index.d.ts b/date-fns/src/locale/be/index.d.ts
new file mode 100644
index 0000000..d3cec40
--- /dev/null
+++ b/date-fns/src/locale/be/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { be } from 'date-fns/locale'
+export default be
diff --git a/date-fns/src/locale/be/index.js b/date-fns/src/locale/be/index.js
new file mode 100644
index 0000000..f35ef2b
--- /dev/null
+++ b/date-fns/src/locale/be/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Belarusian locale.
+ * @language Belarusian
+ * @iso-639-2 bel
+ * @author Kiryl Anokhin [@alyrik]{@link https://github.com/alyrik}
+ * @author Martin Wind [@arvigeus]{@link https://github.com/mawi12345}
+ */
+var locale = {
+ code: 'be',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/be/index.js.flow b/date-fns/src/locale/be/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/be/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/be/snapshot.md b/date-fns/src/locale/be/snapshot.md
new file mode 100644
index 0000000..f4f60b7
--- /dev/null
+++ b/date-fns/src/locale/be/snapshot.md
@@ -0,0 +1,304 @@
+# Belarusian (be) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-ы | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-ы | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-ы | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-ы | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-ы | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-і | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1-ы кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-і кв. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-ы квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-і квартал | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-ы | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-і | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1-ы кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-і кв. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-ы квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-і квартал | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-і | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ы | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | лют. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ліп. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | лютага | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ліпеня | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-і | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ы | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | лют. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ліп. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | люты | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ліпень | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-ы | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ы | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-ы | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ы | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-га | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-га | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-і | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-ы | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | пан | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пят | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | пан | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пят | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | пан | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пят | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | панядзелак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятніца | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-ы | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ы | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | пан | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пят | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | панядзелак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятніца | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-ы | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ы | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | пан | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пят | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | панядзелак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятніца | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-ы | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ы | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | пан | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пят | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | панядзелак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятніца | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ран. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночы | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ран. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночы | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ран. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночы | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | раніцы | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | вечара | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночы | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ран. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночы | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-я | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-я | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-я | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-я | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-я | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-я | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-я | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-я | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-я | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-я | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-я | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-я | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 лют. 1987 г. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 лютага 1987 г. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | серада, 11 лютага 1987 г. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | нядзеля, 29 мая 1453 г. | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 лют. 1987 г., 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г., 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 лютага 1987 г., 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г., 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | серада, 11 лютага 1987 г., 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | нядзеля, 29 мая 1453 г., 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------- | ---------------------- | ------------------------ |
+| 2006-01-01T00:00:00.000Z | каля 6 гадоў | каля 6 гадоў | прыблізна праз 6 гадоў |
+| 2005-01-01T00:00:00.000Z | каля 5 гадоў | каля 5 гадоў | прыблізна праз 5 гадоў |
+| 2004-01-01T00:00:00.000Z | каля 4 гадоў | каля 4 гадоў | прыблізна праз 4 гады |
+| 2003-01-01T00:00:00.000Z | каля 3 гадоў | каля 3 гадоў | прыблізна праз 3 гады |
+| 2002-01-01T00:00:00.000Z | каля 2 гадоў | каля 2 гадоў | прыблізна праз 2 гады |
+| 2001-06-01T00:00:00.000Z | больш за 1 год | больш за 1 год | больш, чым праз 1 год |
+| 2001-02-01T00:00:00.000Z | каля 1 года | каля 1 года | прыблізна праз 1 год |
+| 2001-01-01T00:00:00.000Z | каля 1 года | каля 1 года | прыблізна праз 1 год |
+| 2000-06-01T00:00:00.000Z | 5 месяцаў | 5 месяцаў | праз 5 месяцаў |
+| 2000-03-01T00:00:00.000Z | 2 месяцы | 2 месяцы | праз 2 месяцы |
+| 2000-02-01T00:00:00.000Z | каля 1 месяца | каля 1 месяца | прыблізна праз 1 месяц |
+| 2000-01-15T00:00:00.000Z | 14 дзён | 14 дзён | праз 14 дзён |
+| 2000-01-02T00:00:00.000Z | 1 дзень | 1 дзень | праз 1 дзень |
+| 2000-01-01T06:00:00.000Z | каля 6 гадзін | каля 6 гадзін | прыблізна праз 6 гадзін |
+| 2000-01-01T01:00:00.000Z | каля 1 гадзіны | каля 1 гадзіны | прыблізна праз 1 гадзіну |
+| 2000-01-01T00:45:00.000Z | каля 1 гадзіны | каля 1 гадзіны | прыблізна праз 1 гадзіну |
+| 2000-01-01T00:30:00.000Z | 30 хвілін | 30 хвілін | праз 30 хвілін |
+| 2000-01-01T00:15:00.000Z | 15 хвілін | 15 хвілін | праз 15 хвілін |
+| 2000-01-01T00:01:00.000Z | 1 хвіліна | 1 хвіліна | праз 1 хвіліну |
+| 2000-01-01T00:00:25.000Z | менш за хвіліну | паўхвіліны | менш, чым праз хвіліну |
+| 2000-01-01T00:00:15.000Z | менш за хвіліну | менш за 20 секунд | менш, чым праз хвіліну |
+| 2000-01-01T00:00:05.000Z | менш за хвіліну | менш за 10 секунд | менш, чым праз хвіліну |
+| 2000-01-01T00:00:00.000Z | менш за хвіліну | менш за 5 секунд | менш за хвіліну таму |
+| 1999-12-31T23:59:55.000Z | менш за хвіліну | менш за 10 секунд | менш за хвіліну таму |
+| 1999-12-31T23:59:45.000Z | менш за хвіліну | менш за 20 секунд | менш за хвіліну таму |
+| 1999-12-31T23:59:35.000Z | менш за хвіліну | паўхвіліны | менш за хвіліну таму |
+| 1999-12-31T23:59:00.000Z | 1 хвіліна | 1 хвіліна | 1 хвіліну таму |
+| 1999-12-31T23:45:00.000Z | 15 хвілін | 15 хвілін | 15 хвілін таму |
+| 1999-12-31T23:30:00.000Z | 30 хвілін | 30 хвілін | 30 хвілін таму |
+| 1999-12-31T23:15:00.000Z | каля 1 гадзіны | каля 1 гадзіны | каля 1 гадзіны таму |
+| 1999-12-31T23:00:00.000Z | каля 1 гадзіны | каля 1 гадзіны | каля 1 гадзіны таму |
+| 1999-12-31T18:00:00.000Z | каля 6 гадзін | каля 6 гадзін | каля 6 гадзін таму |
+| 1999-12-30T00:00:00.000Z | 2 дні | 2 дні | 2 дні таму |
+| 1999-12-15T00:00:00.000Z | 17 дзён | 17 дзён | 17 дзён таму |
+| 1999-12-01T00:00:00.000Z | каля 1 месяца | каля 1 месяца | каля 1 месяца таму |
+| 1999-11-01T00:00:00.000Z | 2 месяцы | 2 месяцы | 2 месяцы таму |
+| 1999-06-01T00:00:00.000Z | 7 месяцаў | 7 месяцаў | 7 месяцаў таму |
+| 1999-01-01T00:00:00.000Z | каля 1 года | каля 1 года | каля 1 года таму |
+| 1998-12-01T00:00:00.000Z | каля 1 года | каля 1 года | каля 1 года таму |
+| 1998-06-01T00:00:00.000Z | больш за 1 год | больш за 1 год | больш за 1 год таму |
+| 1998-01-01T00:00:00.000Z | каля 2 гадоў | каля 2 гадоў | каля 2 гадоў таму |
+| 1997-01-01T00:00:00.000Z | каля 3 гадоў | каля 3 гадоў | каля 3 гадоў таму |
+| 1996-01-01T00:00:00.000Z | каля 4 гадоў | каля 4 гадоў | каля 4 гадоў таму |
+| 1995-01-01T00:00:00.000Z | каля 5 гадоў | каля 5 гадоў | каля 5 гадоў таму |
+| 1994-01-01T00:00:00.000Z | каля 6 гадоў | каля 6 гадоў | каля 6 гадоў таму |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 гадоў | праз 6 гадоў | 52608 гадзін |
+| 2005-01-01T00:00:00.000Z | 5 гадоў | праз 5 гадоў | 43848 гадзін |
+| 2004-01-01T00:00:00.000Z | 4 гады | праз 4 гады | 35064 гадзіны |
+| 2003-01-01T00:00:00.000Z | 3 гады | праз 3 гады | 26304 гадзіны |
+| 2002-01-01T00:00:00.000Z | 2 гады | праз 2 гады | 17544 гадзіны |
+| 2001-06-01T00:00:00.000Z | 1 год | праз 1 год | 12408 гадзін |
+| 2001-02-01T00:00:00.000Z | 1 год | праз 1 год | 9528 гадзін |
+| 2001-01-01T00:00:00.000Z | 1 год | праз 1 год | 8784 гадзіны |
+| 2000-06-01T00:00:00.000Z | 5 месяцаў | праз 5 месяцаў | 3648 гадзін |
+| 2000-03-01T00:00:00.000Z | 2 месяцы | праз 2 месяцы | 1440 гадзін |
+| 2000-02-01T00:00:00.000Z | 1 месяц | праз 1 месяц | 744 гадзіны |
+| 2000-01-15T00:00:00.000Z | 14 дзён | праз 14 дзён | 336 гадзін |
+| 2000-01-02T00:00:00.000Z | 1 дзень | праз 1 дзень | 24 гадзіны |
+| 2000-01-01T06:00:00.000Z | 6 гадзін | праз 6 гадзін | 6 гадзін |
+| 2000-01-01T01:00:00.000Z | 1 гадзіна | праз 1 гадзіну | 1 гадзіна |
+| 2000-01-01T00:45:00.000Z | 45 хвілін | праз 45 хвілін | 1 гадзіна |
+| 2000-01-01T00:30:00.000Z | 30 хвілін | праз 30 хвілін | 1 гадзіна |
+| 2000-01-01T00:15:00.000Z | 15 хвілін | праз 15 хвілін | 0 гадзін |
+| 2000-01-01T00:01:00.000Z | 1 хвіліна | праз 1 хвіліну | 0 гадзін |
+| 2000-01-01T00:00:25.000Z | 25 секунд | праз 25 секунд | 0 гадзін |
+| 2000-01-01T00:00:15.000Z | 15 секунд | праз 15 секунд | 0 гадзін |
+| 2000-01-01T00:00:05.000Z | 5 секунд | праз 5 секунд | 0 гадзін |
+| 2000-01-01T00:00:00.000Z | 0 секунд | 0 секунд таму | 0 гадзін |
+| 1999-12-31T23:59:55.000Z | 5 секунд | 5 секунд таму | 0 гадзін |
+| 1999-12-31T23:59:45.000Z | 15 секунд | 15 секунд таму | 0 гадзін |
+| 1999-12-31T23:59:35.000Z | 25 секунд | 25 секунд таму | 0 гадзін |
+| 1999-12-31T23:59:00.000Z | 1 хвіліна | 1 хвіліну таму | 0 гадзін |
+| 1999-12-31T23:45:00.000Z | 15 хвілін | 15 хвілін таму | 0 гадзін |
+| 1999-12-31T23:30:00.000Z | 30 хвілін | 30 хвілін таму | 1 гадзіна |
+| 1999-12-31T23:15:00.000Z | 45 хвілін | 45 хвілін таму | 1 гадзіна |
+| 1999-12-31T23:00:00.000Z | 1 гадзіна | 1 гадзіну таму | 1 гадзіна |
+| 1999-12-31T18:00:00.000Z | 6 гадзін | 6 гадзін таму | 6 гадзін |
+| 1999-12-30T00:00:00.000Z | 2 дні | 2 дні таму | 48 гадзін |
+| 1999-12-15T00:00:00.000Z | 17 дзён | 17 дзён таму | 408 гадзін |
+| 1999-12-01T00:00:00.000Z | 1 месяц | 1 месяц таму | 744 гадзіны |
+| 1999-11-01T00:00:00.000Z | 2 месяцы | 2 месяцы таму | 1464 гадзіны |
+| 1999-06-01T00:00:00.000Z | 7 месяцаў | 7 месяцаў таму | 5136 гадзін |
+| 1999-01-01T00:00:00.000Z | 1 год | 1 год таму | 8760 гадзін |
+| 1998-12-01T00:00:00.000Z | 1 год | 1 год таму | 9504 гадзіны |
+| 1998-06-01T00:00:00.000Z | 2 гады | 2 гады таму | 13896 гадзін |
+| 1998-01-01T00:00:00.000Z | 2 гады | 2 гады таму | 17520 гадзін |
+| 1997-01-01T00:00:00.000Z | 3 гады | 3 гады таму | 26280 гадзін |
+| 1996-01-01T00:00:00.000Z | 4 гады | 4 гады таму | 35064 гадзіны |
+| 1995-01-01T00:00:00.000Z | 5 гадоў | 5 гадоў таму | 43824 гадзіны |
+| 1994-01-01T00:00:00.000Z | 6 гадоў | 6 гадоў таму | 52584 гадзіны |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | у наступную сераду а 0:00 |
+| 2000-01-02T00:00:00.000Z | заўтра а 0:00 |
+| 2000-01-01T00:00:00.000Z | сёння а 0:00 |
+| 1999-12-31T00:00:00.000Z | учора а 0:00 |
+| 1999-12-27T00:00:00.000Z | у панядзелак а 0:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/bg/_lib/formatDistance/index.js b/date-fns/src/locale/bg/_lib/formatDistance/index.js
new file mode 100644
index 0000000..ea4221a
--- /dev/null
+++ b/date-fns/src/locale/bg/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'по-малко от секунда',
+ other: 'по-малко от {{count}} секунди'
+ },
+
+ xSeconds: {
+ one: '1 секунда',
+ other: '{{count}} секунди'
+ },
+
+ halfAMinute: 'половин минута',
+
+ lessThanXMinutes: {
+ one: 'по-малко от минута',
+ other: 'по-малко от {{count}} минути'
+ },
+
+ xMinutes: {
+ one: '1 минута',
+ other: '{{count}} минути'
+ },
+
+ aboutXHours: {
+ one: 'около час',
+ other: 'около {{count}} часа'
+ },
+
+ xHours: {
+ one: '1 час',
+ other: '{{count}} часа'
+ },
+
+ xDays: {
+ one: '1 ден',
+ other: '{{count}} дни'
+ },
+
+ aboutXWeeks: {
+ one: 'около седмица',
+ other: 'около {{count}} седмици'
+ },
+
+ xWeeks: {
+ one: '1 седмица',
+ other: '{{count}} седмици'
+ },
+
+ aboutXMonths: {
+ one: 'около месец',
+ other: 'около {{count}} месеца'
+ },
+
+ xMonths: {
+ one: '1 месец',
+ other: '{{count}} месеца'
+ },
+
+ aboutXYears: {
+ one: 'около година',
+ other: 'около {{count}} години'
+ },
+
+ xYears: {
+ one: '1 година',
+ other: '{{count}} години'
+ },
+
+ overXYears: {
+ one: 'над година',
+ other: 'над {{count}} години'
+ },
+
+ almostXYears: {
+ one: 'почти година',
+ other: 'почти {{count}} години'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'след ' + result
+ } else {
+ return 'преди ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/bg/_lib/formatLong/index.js b/date-fns/src/locale/bg/_lib/formatLong/index.js
new file mode 100644
index 0000000..bf70409
--- /dev/null
+++ b/date-fns/src/locale/bg/_lib/formatLong/index.js
@@ -0,0 +1,38 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, dd MMMM yyyy',
+ long: 'dd MMMM yyyy',
+ medium: 'dd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ any: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'any'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/bg/_lib/formatRelative/index.js b/date-fns/src/locale/bg/_lib/formatRelative/index.js
new file mode 100644
index 0000000..0e291c0
--- /dev/null
+++ b/date-fns/src/locale/bg/_lib/formatRelative/index.js
@@ -0,0 +1,88 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+// Adapted from the `ru` translation
+
+var weekdays = [
+ 'неделя',
+ 'понеделник',
+ 'вторник',
+ 'сряда',
+ 'четвъртък',
+ 'петък',
+ 'събота'
+]
+
+function lastWeek(day) {
+ var weekday = weekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 6:
+ return "'миналата " + weekday + " в' p"
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return "'миналия " + weekday + " в' p"
+ }
+}
+
+function thisWeek(day) {
+ var weekday = weekdays[day]
+
+ if (day === 2 /* Tue */) {
+ return "'във " + weekday + " в' p"
+ } else {
+ return "'в " + weekday + " в' p"
+ }
+}
+
+function nextWeek(day) {
+ var weekday = weekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 6:
+ return "'следващата " + weekday + " в' p"
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return "'следващия " + weekday + " в' p"
+ }
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'вчера в' p",
+ today: "'днес в' p",
+ tomorrow: "'утре в' p",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/bg/_lib/localize/index.js b/date-fns/src/locale/bg/_lib/localize/index.js
new file mode 100644
index 0000000..5d98d2e
--- /dev/null
+++ b/date-fns/src/locale/bg/_lib/localize/index.js
@@ -0,0 +1,155 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['пр.н.е.', 'н.е.'],
+ abbreviated: ['преди н. е.', 'н. е.'],
+ wide: ['преди новата ера', 'новата ера']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1-во тримес.', '2-ро тримес.', '3-то тримес.', '4-то тримес.'],
+ wide: [
+ '1-во тримесечие',
+ '2-ро тримесечие',
+ '3-то тримесечие',
+ '4-то тримесечие'
+ ]
+}
+
+var monthValues = {
+ abbreviated: [
+ 'яну',
+ 'фев',
+ 'мар',
+ 'апр',
+ 'май',
+ 'юни',
+ 'юли',
+ 'авг',
+ 'сеп',
+ 'окт',
+ 'ное',
+ 'дек'
+ ],
+ wide: [
+ 'януари',
+ 'февруари',
+ 'март',
+ 'април',
+ 'май',
+ 'юни',
+ 'юли',
+ 'август',
+ 'септември',
+ 'октомври',
+ 'ноември',
+ 'декември'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Н', 'П', 'В', 'С', 'Ч', 'П', 'С'],
+ short: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
+ abbreviated: ['нед', 'пон', 'вто', 'сря', 'чет', 'пет', 'съб'],
+ wide: [
+ 'неделя',
+ 'понеделник',
+ 'вторник',
+ 'сряда',
+ 'четвъртък',
+ 'петък',
+ 'събота'
+ ]
+}
+
+var dayPeriodValues = {
+ wide: {
+ am: 'преди обяд',
+ pm: 'след обяд',
+ midnight: 'в полунощ',
+ noon: 'на обяд',
+ morning: 'сутринта',
+ afternoon: 'следобед',
+ evening: 'вечерта',
+ night: 'през нощта'
+ }
+}
+
+function isFeminine(unit) {
+ return (
+ unit === 'year' || unit === 'week' || unit === 'minute' || unit === 'second'
+ )
+}
+
+function isNeuter(unit) {
+ return unit === 'quarter'
+}
+
+function numberWithSuffix(number, unit, masculine, feminine, neuter) {
+ var suffix = isNeuter(unit) ? neuter : isFeminine(unit) ? feminine : masculine
+ return number + '-' + suffix
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var number = Number(dirtyNumber)
+
+ if (number === 0) {
+ return numberWithSuffix(0, unit, 'ев', 'ева', 'ево')
+ } else if (number % 1000 === 0) {
+ return numberWithSuffix(number, unit, 'ен', 'на', 'но')
+ } else if (number % 100 === 0) {
+ return numberWithSuffix(number, unit, 'тен', 'тна', 'тно')
+ }
+
+ var rem100 = number % 100
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ return numberWithSuffix(number, unit, 'ви', 'ва', 'во')
+ case 2:
+ return numberWithSuffix(number, unit, 'ри', 'ра', 'ро')
+ case 7:
+ case 8:
+ return numberWithSuffix(number, unit, 'ми', 'ма', 'мо')
+ }
+ }
+
+ return numberWithSuffix(number, unit, 'ти', 'та', 'то')
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/bg/_lib/match/index.js b/date-fns/src/locale/bg/_lib/match/index.js
new file mode 100644
index 0000000..bb0b71e
--- /dev/null
+++ b/date-fns/src/locale/bg/_lib/match/index.js
@@ -0,0 +1,123 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^((пр)?н\.?\s?е\.?)/i,
+ abbreviated: /^((пр)?н\.?\s?е\.?)/i,
+ wide: /^(преди новата ера|новата ера|нова ера)/i
+}
+var parseEraPatterns = {
+ any: [/^п/i, /^н/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234](-?[врт]?o?)? тримес.?/i,
+ wide: /^[1234](-?[врт]?о?)? тримесечие/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchDayPatterns = {
+ narrow: /^[нпвсч]/i,
+ short: /^(нд|пн|вт|ср|чт|пт|сб)/i,
+ abbreviated: /^(нед|пон|вто|сря|чет|пет|съб)/i,
+ wide: /^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
+ any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[ъб]/i]
+}
+
+var matchMonthPatterns = {
+ abbreviated: /^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,
+ wide: /^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i
+}
+
+var parseMonthPatterns = {
+ any: [
+ /^я/i,
+ /^ф/i,
+ /^мар/i,
+ /^ап/i,
+ /^май/i,
+ /^юн/i,
+ /^юл/i,
+ /^ав/i,
+ /^се/i,
+ /^окт/i,
+ /^но/i,
+ /^де/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(преди о|след о|в по|на о|през|веч|сут|следо)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^преди о/i,
+ pm: /^след о/i,
+ midnight: /^в пол/i,
+ noon: /^на об/i,
+ morning: /^сут/i,
+ afternoon: /^следо/i,
+ evening: /^веч/i,
+ night: /^през н/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/bg/index.d.ts b/date-fns/src/locale/bg/index.d.ts
new file mode 100644
index 0000000..485fc59
--- /dev/null
+++ b/date-fns/src/locale/bg/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { bg } from 'date-fns/locale'
+export default bg
diff --git a/date-fns/src/locale/bg/index.js b/date-fns/src/locale/bg/index.js
new file mode 100644
index 0000000..3221b94
--- /dev/null
+++ b/date-fns/src/locale/bg/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Bulgarian locale.
+ * @language Bulgarian
+ * @iso-639-2 bul
+ * @author Nikolay Stoynov [@arvigeus]{@link https://github.com/arvigeus}
+ * @author Tsvetan Ovedenski [@fintara]{@link https://github.com/fintara}
+ */
+var locale = {
+ code: 'bg',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/bg/index.js.flow b/date-fns/src/locale/bg/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/bg/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/bg/snapshot.md b/date-fns/src/locale/bg/snapshot.md
new file mode 100644
index 0000000..329dbc2
--- /dev/null
+++ b/date-fns/src/locale/bg/snapshot.md
@@ -0,0 +1,304 @@
+# Bulgarian (bg) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-ма | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-та | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-ма | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-та | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-во | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2-ро | Invalid Date |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1-во тримес. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2-ро тримес. | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-во тримесечие | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ро тримесечие | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-во | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2-ро | Invalid Date |
+| | qqq | 2019-01-01T12:13:14.015Z | 1-во тримес. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2-ро тримес. | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-во тримесечие | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ро тримесечие | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-ри | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ми | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | фев | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | юли | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | юли | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | юли | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-ри | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ми | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | фев | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | юли | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | юли | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | юли | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-ва | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ма | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-ва | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ма | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-ти | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-ми | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-ри | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-ти | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петък | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-ви | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ти | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петък | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-ви | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ти | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петък | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-ви | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ти | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петък | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | преди обяд | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | след обяд | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | преди обяд | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | сутринта | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | следобед | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | вечерта | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | през нощта | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | сутринта | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | следобед | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | вечерта | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | през нощта | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | сутринта | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | следобед | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | вечерта | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | през нощта | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | сутринта | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | следобед | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | вечерта | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | през нощта | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | сутринта | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | следобед | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | вечерта | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | през нощта | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ти | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ти | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ти | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ти | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-ва | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-та | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-ва | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-та | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 фев 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 май 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 февруари 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 май 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | сряда, 11 февруари 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | неделя, 29 май 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 фев 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 май 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 февруари 1987 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 май 1453 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | сряда, 11 февруари 1987 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | неделя, 29 май 1453 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------ |
+| 2006-01-01T00:00:00.000Z | около 6 години | около 6 години | след около 6 години |
+| 2005-01-01T00:00:00.000Z | около 5 години | около 5 години | след около 5 години |
+| 2004-01-01T00:00:00.000Z | около 4 години | около 4 години | след около 4 години |
+| 2003-01-01T00:00:00.000Z | около 3 години | около 3 години | след около 3 години |
+| 2002-01-01T00:00:00.000Z | около 2 години | около 2 години | след около 2 години |
+| 2001-06-01T00:00:00.000Z | над година | над година | след над година |
+| 2001-02-01T00:00:00.000Z | около година | около година | след около година |
+| 2001-01-01T00:00:00.000Z | около година | около година | след около година |
+| 2000-06-01T00:00:00.000Z | 5 месеца | 5 месеца | след 5 месеца |
+| 2000-03-01T00:00:00.000Z | 2 месеца | 2 месеца | след 2 месеца |
+| 2000-02-01T00:00:00.000Z | около месец | около месец | след около месец |
+| 2000-01-15T00:00:00.000Z | 14 дни | 14 дни | след 14 дни |
+| 2000-01-02T00:00:00.000Z | 1 ден | 1 ден | след 1 ден |
+| 2000-01-01T06:00:00.000Z | около 6 часа | около 6 часа | след около 6 часа |
+| 2000-01-01T01:00:00.000Z | около час | около час | след около час |
+| 2000-01-01T00:45:00.000Z | около час | около час | след около час |
+| 2000-01-01T00:30:00.000Z | 30 минути | 30 минути | след 30 минути |
+| 2000-01-01T00:15:00.000Z | 15 минути | 15 минути | след 15 минути |
+| 2000-01-01T00:01:00.000Z | 1 минута | 1 минута | след 1 минута |
+| 2000-01-01T00:00:25.000Z | по-малко от минута | половин минута | след по-малко от минута |
+| 2000-01-01T00:00:15.000Z | по-малко от минута | по-малко от 20 секунди | след по-малко от минута |
+| 2000-01-01T00:00:05.000Z | по-малко от минута | по-малко от 10 секунди | след по-малко от минута |
+| 2000-01-01T00:00:00.000Z | по-малко от минута | по-малко от 5 секунди | преди по-малко от минута |
+| 1999-12-31T23:59:55.000Z | по-малко от минута | по-малко от 10 секунди | преди по-малко от минута |
+| 1999-12-31T23:59:45.000Z | по-малко от минута | по-малко от 20 секунди | преди по-малко от минута |
+| 1999-12-31T23:59:35.000Z | по-малко от минута | половин минута | преди по-малко от минута |
+| 1999-12-31T23:59:00.000Z | 1 минута | 1 минута | преди 1 минута |
+| 1999-12-31T23:45:00.000Z | 15 минути | 15 минути | преди 15 минути |
+| 1999-12-31T23:30:00.000Z | 30 минути | 30 минути | преди 30 минути |
+| 1999-12-31T23:15:00.000Z | около час | около час | преди около час |
+| 1999-12-31T23:00:00.000Z | около час | около час | преди около час |
+| 1999-12-31T18:00:00.000Z | около 6 часа | около 6 часа | преди около 6 часа |
+| 1999-12-30T00:00:00.000Z | 2 дни | 2 дни | преди 2 дни |
+| 1999-12-15T00:00:00.000Z | 17 дни | 17 дни | преди 17 дни |
+| 1999-12-01T00:00:00.000Z | около месец | около месец | преди около месец |
+| 1999-11-01T00:00:00.000Z | 2 месеца | 2 месеца | преди 2 месеца |
+| 1999-06-01T00:00:00.000Z | 7 месеца | 7 месеца | преди 7 месеца |
+| 1999-01-01T00:00:00.000Z | около година | около година | преди около година |
+| 1998-12-01T00:00:00.000Z | около година | около година | преди около година |
+| 1998-06-01T00:00:00.000Z | над година | над година | преди над година |
+| 1998-01-01T00:00:00.000Z | около 2 години | около 2 години | преди около 2 години |
+| 1997-01-01T00:00:00.000Z | около 3 години | около 3 години | преди около 3 години |
+| 1996-01-01T00:00:00.000Z | около 4 години | около 4 години | преди около 4 години |
+| 1995-01-01T00:00:00.000Z | около 5 години | около 5 години | преди около 5 години |
+| 1994-01-01T00:00:00.000Z | около 6 години | около 6 години | преди около 6 години |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 години | след 6 години | 52608 часа |
+| 2005-01-01T00:00:00.000Z | 5 години | след 5 години | 43848 часа |
+| 2004-01-01T00:00:00.000Z | 4 години | след 4 години | 35064 часа |
+| 2003-01-01T00:00:00.000Z | 3 години | след 3 години | 26304 часа |
+| 2002-01-01T00:00:00.000Z | 2 години | след 2 години | 17544 часа |
+| 2001-06-01T00:00:00.000Z | 1 година | след 1 година | 12408 часа |
+| 2001-02-01T00:00:00.000Z | 1 година | след 1 година | 9528 часа |
+| 2001-01-01T00:00:00.000Z | 1 година | след 1 година | 8784 часа |
+| 2000-06-01T00:00:00.000Z | 5 месеца | след 5 месеца | 3648 часа |
+| 2000-03-01T00:00:00.000Z | 2 месеца | след 2 месеца | 1440 часа |
+| 2000-02-01T00:00:00.000Z | 1 месец | след 1 месец | 744 часа |
+| 2000-01-15T00:00:00.000Z | 14 дни | след 14 дни | 336 часа |
+| 2000-01-02T00:00:00.000Z | 1 ден | след 1 ден | 24 часа |
+| 2000-01-01T06:00:00.000Z | 6 часа | след 6 часа | 6 часа |
+| 2000-01-01T01:00:00.000Z | 1 час | след 1 час | 1 час |
+| 2000-01-01T00:45:00.000Z | 45 минути | след 45 минути | 1 час |
+| 2000-01-01T00:30:00.000Z | 30 минути | след 30 минути | 1 час |
+| 2000-01-01T00:15:00.000Z | 15 минути | след 15 минути | 0 часа |
+| 2000-01-01T00:01:00.000Z | 1 минута | след 1 минута | 0 часа |
+| 2000-01-01T00:00:25.000Z | 25 секунди | след 25 секунди | 0 часа |
+| 2000-01-01T00:00:15.000Z | 15 секунди | след 15 секунди | 0 часа |
+| 2000-01-01T00:00:05.000Z | 5 секунди | след 5 секунди | 0 часа |
+| 2000-01-01T00:00:00.000Z | 0 секунди | преди 0 секунди | 0 часа |
+| 1999-12-31T23:59:55.000Z | 5 секунди | преди 5 секунди | 0 часа |
+| 1999-12-31T23:59:45.000Z | 15 секунди | преди 15 секунди | 0 часа |
+| 1999-12-31T23:59:35.000Z | 25 секунди | преди 25 секунди | 0 часа |
+| 1999-12-31T23:59:00.000Z | 1 минута | преди 1 минута | 0 часа |
+| 1999-12-31T23:45:00.000Z | 15 минути | преди 15 минути | 0 часа |
+| 1999-12-31T23:30:00.000Z | 30 минути | преди 30 минути | 1 час |
+| 1999-12-31T23:15:00.000Z | 45 минути | преди 45 минути | 1 час |
+| 1999-12-31T23:00:00.000Z | 1 час | преди 1 час | 1 час |
+| 1999-12-31T18:00:00.000Z | 6 часа | преди 6 часа | 6 часа |
+| 1999-12-30T00:00:00.000Z | 2 дни | преди 2 дни | 48 часа |
+| 1999-12-15T00:00:00.000Z | 17 дни | преди 17 дни | 408 часа |
+| 1999-12-01T00:00:00.000Z | 1 месец | преди 1 месец | 744 часа |
+| 1999-11-01T00:00:00.000Z | 2 месеца | преди 2 месеца | 1464 часа |
+| 1999-06-01T00:00:00.000Z | 7 месеца | преди 7 месеца | 5136 часа |
+| 1999-01-01T00:00:00.000Z | 1 година | преди 1 година | 8760 часа |
+| 1998-12-01T00:00:00.000Z | 1 година | преди 1 година | 9504 часа |
+| 1998-06-01T00:00:00.000Z | 2 години | преди 2 години | 13896 часа |
+| 1998-01-01T00:00:00.000Z | 2 години | преди 2 години | 17520 часа |
+| 1997-01-01T00:00:00.000Z | 3 години | преди 3 години | 26280 часа |
+| 1996-01-01T00:00:00.000Z | 4 години | преди 4 години | 35064 часа |
+| 1995-01-01T00:00:00.000Z | 5 години | преди 5 години | 43824 часа |
+| 1994-01-01T00:00:00.000Z | 6 години | преди 6 години | 52584 часа |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | следващата сряда в 0:00 |
+| 2000-01-02T00:00:00.000Z | утре в 0:00 |
+| 2000-01-01T00:00:00.000Z | днес в 0:00 |
+| 1999-12-31T00:00:00.000Z | вчера в 0:00 |
+| 1999-12-27T00:00:00.000Z | в понеделник в 0:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/bn/_lib/formatDistance/index.js b/date-fns/src/locale/bn/_lib/formatDistance/index.js
new file mode 100644
index 0000000..79835f9
--- /dev/null
+++ b/date-fns/src/locale/bn/_lib/formatDistance/index.js
@@ -0,0 +1,106 @@
+import localize from '../localize/index'
+
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'প্রায় ১ সেকেন্ড',
+ other: 'প্রায় {{count}} সেকেন্ড'
+ },
+
+ xSeconds: {
+ one: '১ সেকেন্ড',
+ other: '{{count}} সেকেন্ড'
+ },
+
+ halfAMinute: 'আধ মিনিট',
+
+ lessThanXMinutes: {
+ one: 'প্রায় ১ মিনিট',
+ other: 'প্রায় {{count}} মিনিট'
+ },
+
+ xMinutes: {
+ one: '১ মিনিট',
+ other: '{{count}} মিনিট'
+ },
+
+ aboutXHours: {
+ one: 'প্রায় ১ ঘন্টা',
+ other: 'প্রায় {{count}} ঘন্টা'
+ },
+
+ xHours: {
+ one: '১ ঘন্টা',
+ other: '{{count}} ঘন্টা'
+ },
+
+ xDays: {
+ one: '১ দিন',
+ other: '{{count}} দিন'
+ },
+
+ aboutXWeeks: {
+ one: 'প্রায় ১ সপ্তাহ',
+ other: 'প্রায় {{count}} সপ্তাহ'
+ },
+
+ xWeeks: {
+ one: '১ সপ্তাহ',
+ other: '{{count}} সপ্তাহ'
+ },
+
+ aboutXMonths: {
+ one: 'প্রায় ১ মাস',
+ other: 'প্রায় {{count}} মাস'
+ },
+
+ xMonths: {
+ one: '১ মাস',
+ other: '{{count}} মাস'
+ },
+
+ aboutXYears: {
+ one: 'প্রায় ১ বছর',
+ other: 'প্রায় {{count}} বছর'
+ },
+
+ xYears: {
+ one: '১ বছর',
+ other: '{{count}} বছর'
+ },
+
+ overXYears: {
+ one: '১ বছরের বেশি',
+ other: '{{count}} বছরের বেশি'
+ },
+
+ almostXYears: {
+ one: 'প্রায় ১ বছর',
+ other: 'প্রায় {{count}} বছর'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace(
+ '{{count}}',
+ localize.numberToLocale(count)
+ )
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' এর মধ্যে'
+ } else {
+ return result + ' আগে'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/bn/_lib/formatLong/index.js b/date-fns/src/locale/bn/_lib/formatLong/index.js
new file mode 100644
index 0000000..59b7c24
--- /dev/null
+++ b/date-fns/src/locale/bn/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} {{time}} 'সময়'",
+ long: "{{date}} {{time}} 'সময়'",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/bn/_lib/formatRelative/index.js b/date-fns/src/locale/bn/_lib/formatRelative/index.js
new file mode 100644
index 0000000..69fdc9c
--- /dev/null
+++ b/date-fns/src/locale/bn/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'গত' eeee 'সময়' p",
+ yesterday: "'গতকাল' 'সময়' p",
+ today: "'আজ' 'সময়' p",
+ tomorrow: "'আগামীকাল' 'সময়' p",
+ nextWeek: "eeee 'সময়' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/bn/_lib/localize/index.js b/date-fns/src/locale/bn/_lib/localize/index.js
new file mode 100644
index 0000000..c704a96
--- /dev/null
+++ b/date-fns/src/locale/bn/_lib/localize/index.js
@@ -0,0 +1,265 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var numberValues = {
+ locale: {
+ '1': '১',
+ '2': '২',
+ '3': '৩',
+ '4': '৪',
+ '5': '৫',
+ '6': '৬',
+ '7': '৭',
+ '8': '৮',
+ '9': '৯',
+ '0': '০'
+ },
+ number: {
+ '১': '1',
+ '২': '2',
+ '৩': '3',
+ '৪': '4',
+ '৫': '5',
+ '৬': '6',
+ '৭': '7',
+ '৮': '8',
+ '৯': '9',
+ '০': '0'
+ }
+}
+
+var eraValues = {
+ narrow: ['খ্রিঃপূঃ', 'খ্রিঃ'],
+ abbreviated: ['খ্রিঃপূর্ব', 'খ্রিঃ'],
+ wide: ['খ্রিস্টপূর্ব', 'খ্রিস্টাব্দ']
+}
+
+var quarterValues = {
+ narrow: ['১', '২', '৩', '৪'],
+ abbreviated: ['১ত্রৈ', '২ত্রৈ', '৩ত্রৈ', '৪ত্রৈ'],
+ wide: ['১ম ত্রৈমাসিক', '২য় ত্রৈমাসিক', '৩য় ত্রৈমাসিক', '৪র্থ ত্রৈমাসিক']
+}
+
+var monthValues = {
+ narrow: [
+ 'জানু',
+ 'ফেব্রু',
+ 'মার্চ',
+ 'এপ্রিল',
+ 'মে',
+ 'জুন',
+ 'জুলাই',
+ 'আগস্ট',
+ 'সেপ্ট',
+ 'অক্টো',
+ 'নভে',
+ 'ডিসে'
+ ],
+ abbreviated: [
+ 'জানু',
+ 'ফেব্রু',
+ 'মার্চ',
+ 'এপ্রিল',
+ 'মে',
+ 'জুন',
+ 'জুলাই',
+ 'আগস্ট',
+ 'সেপ্ট',
+ 'অক্টো',
+ 'নভে',
+ 'ডিসে'
+ ],
+ wide: [
+ 'জানুয়ারি',
+ 'ফেব্রুয়ারি',
+ 'মার্চ',
+ 'এপ্রিল',
+ 'মে',
+ 'জুন',
+ 'জুলাই',
+ 'আগস্ট',
+ 'সেপ্টেম্বর',
+ 'অক্টোবর',
+ 'নভেম্বর',
+ 'ডিসেম্বর'
+ ]
+}
+
+var dayValues = {
+ narrow: ['র', 'সো', 'ম', 'বু', 'বৃ', 'শু', 'শ'],
+ short: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহ', 'শুক্র', 'শনি'],
+ abbreviated: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহ', 'শুক্র', 'শনি'],
+ wide: [
+ 'রবিবার',
+ 'সোমবার',
+ 'মঙ্গলবার',
+ 'বুধবার',
+ 'বৃহস্পতিবার ',
+ 'শুক্রবার',
+ 'শনিবার'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'পূ',
+ pm: 'অপ',
+ midnight: 'মধ্যরাত',
+ noon: 'মধ্যাহ্ন',
+ morning: 'সকাল',
+ afternoon: 'বিকাল',
+ evening: 'সন্ধ্যা',
+ night: 'রাত'
+ },
+ abbreviated: {
+ am: 'পূর্বাহ্ন',
+ pm: 'অপরাহ্ন',
+ midnight: 'মধ্যরাত',
+ noon: 'মধ্যাহ্ন',
+ morning: 'সকাল',
+ afternoon: 'বিকাল',
+ evening: 'সন্ধ্যা',
+ night: 'রাত'
+ },
+ wide: {
+ am: 'পূর্বাহ্ন',
+ pm: 'অপরাহ্ন',
+ midnight: 'মধ্যরাত',
+ noon: 'মধ্যাহ্ন',
+ morning: 'সকাল',
+ afternoon: 'বিকাল',
+ evening: 'সন্ধ্যা',
+ night: 'রাত'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'পূ',
+ pm: 'অপ',
+ midnight: 'মধ্যরাত',
+ noon: 'মধ্যাহ্ন',
+ morning: 'সকাল',
+ afternoon: 'বিকাল',
+ evening: 'সন্ধ্যা',
+ night: 'রাত'
+ },
+ abbreviated: {
+ am: 'পূর্বাহ্ন',
+ pm: 'অপরাহ্ন',
+ midnight: 'মধ্যরাত',
+ noon: 'মধ্যাহ্ন',
+ morning: 'সকাল',
+ afternoon: 'বিকাল',
+ evening: 'সন্ধ্যা',
+ night: 'রাত'
+ },
+ wide: {
+ am: 'পূর্বাহ্ন',
+ pm: 'অপরাহ্ন',
+ midnight: 'মধ্যরাত',
+ noon: 'মধ্যাহ্ন',
+ morning: 'সকাল',
+ afternoon: 'বিকাল',
+ evening: 'সন্ধ্যা',
+ night: 'রাত'
+ }
+}
+
+function dateOrdinalNumber(number, localeNumber) {
+ if (number > 18 && number <= 31) {
+ return localeNumber + 'শে'
+ } else {
+ switch (number) {
+ case 1:
+ return localeNumber + 'লা'
+ case 2:
+ case 3:
+ return localeNumber + 'রা'
+ case 4:
+ return localeNumber + 'ঠা'
+ default:
+ return localeNumber + 'ই'
+ }
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = localize.localeToNumber(dirtyNumber)
+ var localeNumber = localize.numberToLocale(number)
+ var unit = dirtyOptions.unit
+
+ if (unit === 'date') {
+ return dateOrdinalNumber(number, localeNumber)
+ }
+ if (number > 10 || number === 0) return localeNumber + 'তম'
+
+ var rem10 = number % 10
+ switch (rem10) {
+ case 2:
+ case 3:
+ return localeNumber + 'য়'
+ case 4:
+ return localeNumber + 'র্থ'
+ case 6:
+ return localeNumber + 'ষ্ঠ'
+ case 1:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 0:
+ return localeNumber + 'ম'
+ }
+}
+
+function localeToNumber(locale) {
+ var number = locale.toString().replace(/[১২৩৪৫৬৭৮৯০]/g, function(match) {
+ return numberValues.number[match]
+ })
+ return Number(number)
+}
+
+function numberToLocale(number) {
+ return number.toString().replace(/\d/g, function(match) {
+ return numberValues.locale[match]
+ })
+}
+
+var localize = {
+ localeToNumber: localeToNumber,
+
+ numberToLocale: numberToLocale,
+
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/bn/_lib/match/index.js b/date-fns/src/locale/bn/_lib/match/index.js
new file mode 100644
index 0000000..d017815
--- /dev/null
+++ b/date-fns/src/locale/bn/_lib/match/index.js
@@ -0,0 +1,144 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(ম|য়|র্থ|ষ্ঠ|শে|ই|তম)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(খ্রিঃপূঃ|খ্রিঃ)/i,
+ abbreviated: /^(খ্রিঃপূর্ব|খ্রিঃ)/i,
+ wide: /^(খ্রিস্টপূর্ব|খ্রিস্টাব্দ)/i
+}
+var parseEraPatterns = {
+ narrow: [/^খ্রিঃপূঃ/i, /^খ্রিঃ/i],
+ abbreviated: [/^খ্রিঃপূর্ব/i, /^খ্রিঃ/i],
+ wide: [/^খ্রিস্টপূর্ব/i, /^খ্রিস্টাব্দ/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[১২৩৪]/i,
+ abbreviated: /^[১২৩৪]ত্রৈ/i,
+ wide: /^[১২৩৪](ম|য়|র্থ)? ত্রৈমাসিক/i
+}
+var parseQuarterPatterns = {
+ any: [/১/i, /২/i, /৩/i, /৪/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,
+ abbreviated: /^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,
+ wide: /^(জানুয়ারি|ফেব্রুয়ারি|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্টেম্বর|অক্টোবর|নভেম্বর|ডিসেম্বর)/i
+}
+var parseMonthPatterns = {
+ any: [
+ /^জানু/i,
+ /^ফেব্রু/i,
+ /^মার্চ/i,
+ /^এপ্রিল/i,
+ /^মে/i,
+ /^জুন/i,
+ /^জুলাই/i,
+ /^আগস্ট/i,
+ /^সেপ্ট/i,
+ /^অক্টো/i,
+ /^নভে/i,
+ /^ডিসে/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(র|সো|ম|বু|বৃ|শু|শ)+/i,
+ short: /^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,
+ abbreviated: /^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,
+ wide: /^(রবিবার|সোমবার|মঙ্গলবার|বুধবার|বৃহস্পতিবার |শুক্রবার|শনিবার)+/i
+}
+var parseDayPatterns = {
+ narrow: [/^র/i, /^সো/i, /^ম/i, /^বু/i, /^বৃ/i, /^শু/i, /^শ/i],
+ short: [/^রবি/i, /^সোম/i, /^মঙ্গল/i, /^বুধ/i, /^বৃহ/i, /^শুক্র/i, /^শনি/i],
+ abbreviated: [
+ /^রবি/i,
+ /^সোম/i,
+ /^মঙ্গল/i,
+ /^বুধ/i,
+ /^বৃহ/i,
+ /^শুক্র/i,
+ /^শনি/i
+ ],
+ wide: [
+ /^রবিবার/i,
+ /^সোমবার/i,
+ /^মঙ্গলবার/i,
+ /^বুধবার/i,
+ /^বৃহস্পতিবার /i,
+ /^শুক্রবার/i,
+ /^শনিবার/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(পূ|অপ|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,
+ abbreviated: /^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,
+ wide: /^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^পূ/i,
+ pm: /^অপ/i,
+ midnight: /^মধ্যরাত/i,
+ noon: /^মধ্যাহ্ন/i,
+ morning: /সকাল/i,
+ afternoon: /বিকাল/i,
+ evening: /সন্ধ্যা/i,
+ night: /রাত/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/bn/index.d.ts b/date-fns/src/locale/bn/index.d.ts
new file mode 100644
index 0000000..9f9b38c
--- /dev/null
+++ b/date-fns/src/locale/bn/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { bn } from 'date-fns/locale'
+export default bn
diff --git a/date-fns/src/locale/bn/index.js b/date-fns/src/locale/bn/index.js
new file mode 100644
index 0000000..0be2d13
--- /dev/null
+++ b/date-fns/src/locale/bn/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Bengali locale.
+ * @language Bengali
+ * @iso-639-2 ben
+ * @author Touhidur Rahman [@touhidrahman]{@link https://github.com/touhidrahman}
+ * @author Farhad Yasir [@nutboltu]{@link https://github.com/nutboltu}
+ */
+var locale = {
+ code: 'bn',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/bn/index.js.flow b/date-fns/src/locale/bn/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/bn/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/bn/snapshot.md b/date-fns/src/locale/bn/snapshot.md
new file mode 100644
index 0000000..2505705
--- /dev/null
+++ b/date-fns/src/locale/bn/snapshot.md
@@ -0,0 +1,304 @@
+# Bengali (bn) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | ১৯৮৭তম | Invalid Date |
+| | | 0005-01-01T12:13:14.015Z | ৫ম | Invalid Date |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | ১৯৮৭তম | Invalid Date |
+| | | 0005-01-01T12:13:14.015Z | ৫ম | Invalid Date |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | ১ম | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | ২য় | Invalid Date |
+| | QQQ | 2019-01-01T12:13:14.015Z | ১ত্রৈ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ২ত্রৈ | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | ১ম ত্রৈমাসিক | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ২য় ত্রৈমাসিক | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | ১ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ২ | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | ১ম | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | ২য় | Invalid Date |
+| | qqq | 2019-01-01T12:13:14.015Z | ১ত্রৈ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ২ত্রৈ | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | ১ম ত্রৈমাসিক | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ২য় ত্রৈমাসিক | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | ২য় | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ৭ম | Invalid Date |
+| | MMM | 2019-02-11T12:13:14.015Z | ফেব্রু | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | জুলাই | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | ফেব্রুয়ারি | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | জুলাই | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ফেব্রু | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | জুলাই | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | ২য় | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ৭ম | Invalid Date |
+| | LLL | 2019-02-11T12:13:14.015Z | ফেব্রু | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | জুলাই | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | ফেব্রুয়ারি | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | জুলাই | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ফেব্রু | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | জুলাই | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | ১ম | Invalid Date |
+| | | 2019-12-01T12:13:14.015Z | ৪৯তম | Invalid Date |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | ১ম | Invalid Date |
+| | | 2019-12-01T12:13:14.015Z | ৪৮তম | Invalid Date |
+| Day of month | do | 2019-02-11T12:13:14.015Z | ১১ই | Invalid Date |
+| | | 2019-02-28T12:13:14.015Z | ২৮শে | Invalid Date |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | ৪২তম | Invalid Date |
+| | | 2019-12-31T12:13:14.015Z | ৩৬৫তম | Invalid Date |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | সোমবার | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্রবার | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | সো | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শু | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | ১ম | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ৫ম | Invalid Date |
+| | iii | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | সোমবার | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্রবার | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | সো | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শু | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | ২য় | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ৬ষ্ঠ | Invalid Date |
+| | eee | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | সোমবার | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্রবার | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | সো | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শু | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | ২য় | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ৬ষ্ঠ | Invalid Date |
+| | ccc | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | সোমবার | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্রবার | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | সো | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শু | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | সোম | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | শুক্র | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | পূ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূ | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপরাহ্ন | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূর্বাহ্ন | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | পূ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | অপ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | অপ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | পূ | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | সকাল | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | বিকাল | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | সন্ধ্যা | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | রাত | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | সকাল | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | বিকাল | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | সন্ধ্যা | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | রাত | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | সকাল | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | বিকাল | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | সন্ধ্যা | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | রাত | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | সকাল | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | বিকাল | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | সন্ধ্যা | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | রাত | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | সকাল | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | বিকাল | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | সন্ধ্যা | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | রাত | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | ১১তম | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | ১১তম | Invalid Date |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | ১১তম | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | ২৩তম | Invalid Date |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | ১১তম | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | ১১তম | Invalid Date |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | ১১তম | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | ২৩তম | Invalid Date |
+| Minute | mo | 2019-01-01T12:01:14.015Z | ১ম | Invalid Date |
+| | | 2019-04-01T12:55:14.015Z | ৫৫তম | Invalid Date |
+| Second | so | 2019-01-01T12:13:01.015Z | ১ম | Invalid Date |
+| | | 2019-04-01T12:13:55.015Z | ৫৫তম | Invalid Date |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | ফেব্রু 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | মে 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | ফেব্রুয়ারি ১১ই, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | মে ২৯শে, 1453 | Invalid Date |
+| | PPPP | 1987-02-11T12:13:14.015Z | বুধবার, ফেব্রুয়ারি ১১ই, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | রবিবার, মে ২৯শে, 1453 | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 অপরাহ্ন | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 অপরাহ্ন | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 অপরাহ্ন | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 অপরাহ্ন | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 অপরাহ্ন GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 অপরাহ্ন GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 অপরাহ্ন GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 অপরাহ্ন GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 অপরাহ্ন | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 অপরাহ্ন | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | ফেব্রু 11, 1987, 12:13:14 অপরাহ্ন | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | মে 29, 1453, 11:59:59 অপরাহ্ন | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | ফেব্রুয়ারি ১১ই, 1987 12:13:14 অপরাহ্ন GMT+0 সময় | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | মে ২৯শে, 1453 11:59:59 অপরাহ্ন GMT+0 সময় | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | বুধবার, ফেব্রুয়ারি ১১ই, 1987 12:13:14 অপরাহ্ন GMT+00:00 সময় | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | রবিবার, মে ২৯শে, 1453 11:59:59 অপরাহ্ন GMT+00:00 সময় | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------- | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | প্রায় ৬ বছর | প্রায় ৬ বছর | প্রায় ৬ বছর এর মধ্যে |
+| 2005-01-01T00:00:00.000Z | প্রায় ৫ বছর | প্রায় ৫ বছর | প্রায় ৫ বছর এর মধ্যে |
+| 2004-01-01T00:00:00.000Z | প্রায় ৪ বছর | প্রায় ৪ বছর | প্রায় ৪ বছর এর মধ্যে |
+| 2003-01-01T00:00:00.000Z | প্রায় ৩ বছর | প্রায় ৩ বছর | প্রায় ৩ বছর এর মধ্যে |
+| 2002-01-01T00:00:00.000Z | প্রায় ২ বছর | প্রায় ২ বছর | প্রায় ২ বছর এর মধ্যে |
+| 2001-06-01T00:00:00.000Z | ১ বছরের বেশি | ১ বছরের বেশি | ১ বছরের বেশি এর মধ্যে |
+| 2001-02-01T00:00:00.000Z | প্রায় ১ বছর | প্রায় ১ বছর | প্রায় ১ বছর এর মধ্যে |
+| 2001-01-01T00:00:00.000Z | প্রায় ১ বছর | প্রায় ১ বছর | প্রায় ১ বছর এর মধ্যে |
+| 2000-06-01T00:00:00.000Z | ৫ মাস | ৫ মাস | ৫ মাস এর মধ্যে |
+| 2000-03-01T00:00:00.000Z | ২ মাস | ২ মাস | ২ মাস এর মধ্যে |
+| 2000-02-01T00:00:00.000Z | প্রায় ১ মাস | প্রায় ১ মাস | প্রায় ১ মাস এর মধ্যে |
+| 2000-01-15T00:00:00.000Z | ১৪ দিন | ১৪ দিন | ১৪ দিন এর মধ্যে |
+| 2000-01-02T00:00:00.000Z | ১ দিন | ১ দিন | ১ দিন এর মধ্যে |
+| 2000-01-01T06:00:00.000Z | প্রায় ৬ ঘন্টা | প্রায় ৬ ঘন্টা | প্রায় ৬ ঘন্টা এর মধ্যে |
+| 2000-01-01T01:00:00.000Z | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা এর মধ্যে |
+| 2000-01-01T00:45:00.000Z | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা এর মধ্যে |
+| 2000-01-01T00:30:00.000Z | ৩০ মিনিট | ৩০ মিনিট | ৩০ মিনিট এর মধ্যে |
+| 2000-01-01T00:15:00.000Z | ১৫ মিনিট | ১৫ মিনিট | ১৫ মিনিট এর মধ্যে |
+| 2000-01-01T00:01:00.000Z | ১ মিনিট | ১ মিনিট | ১ মিনিট এর মধ্যে |
+| 2000-01-01T00:00:25.000Z | প্রায় ১ মিনিট | আধ মিনিট | প্রায় ১ মিনিট এর মধ্যে |
+| 2000-01-01T00:00:15.000Z | প্রায় ১ মিনিট | প্রায় ২০ সেকেন্ড | প্রায় ১ মিনিট এর মধ্যে |
+| 2000-01-01T00:00:05.000Z | প্রায় ১ মিনিট | প্রায় ১০ সেকেন্ড | প্রায় ১ মিনিট এর মধ্যে |
+| 2000-01-01T00:00:00.000Z | প্রায় ১ মিনিট | প্রায় ৫ সেকেন্ড | প্রায় ১ মিনিট আগে |
+| 1999-12-31T23:59:55.000Z | প্রায় ১ মিনিট | প্রায় ১০ সেকেন্ড | প্রায় ১ মিনিট আগে |
+| 1999-12-31T23:59:45.000Z | প্রায় ১ মিনিট | প্রায় ২০ সেকেন্ড | প্রায় ১ মিনিট আগে |
+| 1999-12-31T23:59:35.000Z | প্রায় ১ মিনিট | আধ মিনিট | প্রায় ১ মিনিট আগে |
+| 1999-12-31T23:59:00.000Z | ১ মিনিট | ১ মিনিট | ১ মিনিট আগে |
+| 1999-12-31T23:45:00.000Z | ১৫ মিনিট | ১৫ মিনিট | ১৫ মিনিট আগে |
+| 1999-12-31T23:30:00.000Z | ৩০ মিনিট | ৩০ মিনিট | ৩০ মিনিট আগে |
+| 1999-12-31T23:15:00.000Z | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা আগে |
+| 1999-12-31T23:00:00.000Z | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা | প্রায় ১ ঘন্টা আগে |
+| 1999-12-31T18:00:00.000Z | প্রায় ৬ ঘন্টা | প্রায় ৬ ঘন্টা | প্রায় ৬ ঘন্টা আগে |
+| 1999-12-30T00:00:00.000Z | ২ দিন | ২ দিন | ২ দিন আগে |
+| 1999-12-15T00:00:00.000Z | ১৭ দিন | ১৭ দিন | ১৭ দিন আগে |
+| 1999-12-01T00:00:00.000Z | প্রায় ১ মাস | প্রায় ১ মাস | প্রায় ১ মাস আগে |
+| 1999-11-01T00:00:00.000Z | ২ মাস | ২ মাস | ২ মাস আগে |
+| 1999-06-01T00:00:00.000Z | ৭ মাস | ৭ মাস | ৭ মাস আগে |
+| 1999-01-01T00:00:00.000Z | প্রায় ১ বছর | প্রায় ১ বছর | প্রায় ১ বছর আগে |
+| 1998-12-01T00:00:00.000Z | প্রায় ১ বছর | প্রায় ১ বছর | প্রায় ১ বছর আগে |
+| 1998-06-01T00:00:00.000Z | ১ বছরের বেশি | ১ বছরের বেশি | ১ বছরের বেশি আগে |
+| 1998-01-01T00:00:00.000Z | প্রায় ২ বছর | প্রায় ২ বছর | প্রায় ২ বছর আগে |
+| 1997-01-01T00:00:00.000Z | প্রায় ৩ বছর | প্রায় ৩ বছর | প্রায় ৩ বছর আগে |
+| 1996-01-01T00:00:00.000Z | প্রায় ৪ বছর | প্রায় ৪ বছর | প্রায় ৪ বছর আগে |
+| 1995-01-01T00:00:00.000Z | প্রায় ৫ বছর | প্রায় ৫ বছর | প্রায় ৫ বছর আগে |
+| 1994-01-01T00:00:00.000Z | প্রায় ৬ বছর | প্রায় ৬ বছর | প্রায় ৬ বছর আগে |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | ৬ বছর | ৬ বছর এর মধ্যে | ৫২৬০৮ ঘন্টা |
+| 2005-01-01T00:00:00.000Z | ৫ বছর | ৫ বছর এর মধ্যে | ৪৩৮৪৮ ঘন্টা |
+| 2004-01-01T00:00:00.000Z | ৪ বছর | ৪ বছর এর মধ্যে | ৩৫০৬৪ ঘন্টা |
+| 2003-01-01T00:00:00.000Z | ৩ বছর | ৩ বছর এর মধ্যে | ২৬৩০৪ ঘন্টা |
+| 2002-01-01T00:00:00.000Z | ২ বছর | ২ বছর এর মধ্যে | ১৭৫৪৪ ঘন্টা |
+| 2001-06-01T00:00:00.000Z | ১ বছর | ১ বছর এর মধ্যে | ১২৪০৮ ঘন্টা |
+| 2001-02-01T00:00:00.000Z | ১ বছর | ১ বছর এর মধ্যে | ৯৫২৮ ঘন্টা |
+| 2001-01-01T00:00:00.000Z | ১ বছর | ১ বছর এর মধ্যে | ৮৭৮৪ ঘন্টা |
+| 2000-06-01T00:00:00.000Z | ৫ মাস | ৫ মাস এর মধ্যে | ৩৬৪৮ ঘন্টা |
+| 2000-03-01T00:00:00.000Z | ২ মাস | ২ মাস এর মধ্যে | ১৪৪০ ঘন্টা |
+| 2000-02-01T00:00:00.000Z | ১ মাস | ১ মাস এর মধ্যে | ৭৪৪ ঘন্টা |
+| 2000-01-15T00:00:00.000Z | ১৪ দিন | ১৪ দিন এর মধ্যে | ৩৩৬ ঘন্টা |
+| 2000-01-02T00:00:00.000Z | ১ দিন | ১ দিন এর মধ্যে | ২৪ ঘন্টা |
+| 2000-01-01T06:00:00.000Z | ৬ ঘন্টা | ৬ ঘন্টা এর মধ্যে | ৬ ঘন্টা |
+| 2000-01-01T01:00:00.000Z | ১ ঘন্টা | ১ ঘন্টা এর মধ্যে | ১ ঘন্টা |
+| 2000-01-01T00:45:00.000Z | ৪৫ মিনিট | ৪৫ মিনিট এর মধ্যে | ১ ঘন্টা |
+| 2000-01-01T00:30:00.000Z | ৩০ মিনিট | ৩০ মিনিট এর মধ্যে | ১ ঘন্টা |
+| 2000-01-01T00:15:00.000Z | ১৫ মিনিট | ১৫ মিনিট এর মধ্যে | ০ ঘন্টা |
+| 2000-01-01T00:01:00.000Z | ১ মিনিট | ১ মিনিট এর মধ্যে | ০ ঘন্টা |
+| 2000-01-01T00:00:25.000Z | ২৫ সেকেন্ড | ২৫ সেকেন্ড এর মধ্যে | ০ ঘন্টা |
+| 2000-01-01T00:00:15.000Z | ১৫ সেকেন্ড | ১৫ সেকেন্ড এর মধ্যে | ০ ঘন্টা |
+| 2000-01-01T00:00:05.000Z | ৫ সেকেন্ড | ৫ সেকেন্ড এর মধ্যে | ০ ঘন্টা |
+| 2000-01-01T00:00:00.000Z | ০ সেকেন্ড | ০ সেকেন্ড আগে | ০ ঘন্টা |
+| 1999-12-31T23:59:55.000Z | ৫ সেকেন্ড | ৫ সেকেন্ড আগে | ০ ঘন্টা |
+| 1999-12-31T23:59:45.000Z | ১৫ সেকেন্ড | ১৫ সেকেন্ড আগে | ০ ঘন্টা |
+| 1999-12-31T23:59:35.000Z | ২৫ সেকেন্ড | ২৫ সেকেন্ড আগে | ০ ঘন্টা |
+| 1999-12-31T23:59:00.000Z | ১ মিনিট | ১ মিনিট আগে | ০ ঘন্টা |
+| 1999-12-31T23:45:00.000Z | ১৫ মিনিট | ১৫ মিনিট আগে | ০ ঘন্টা |
+| 1999-12-31T23:30:00.000Z | ৩০ মিনিট | ৩০ মিনিট আগে | ১ ঘন্টা |
+| 1999-12-31T23:15:00.000Z | ৪৫ মিনিট | ৪৫ মিনিট আগে | ১ ঘন্টা |
+| 1999-12-31T23:00:00.000Z | ১ ঘন্টা | ১ ঘন্টা আগে | ১ ঘন্টা |
+| 1999-12-31T18:00:00.000Z | ৬ ঘন্টা | ৬ ঘন্টা আগে | ৬ ঘন্টা |
+| 1999-12-30T00:00:00.000Z | ২ দিন | ২ দিন আগে | ৪৮ ঘন্টা |
+| 1999-12-15T00:00:00.000Z | ১৭ দিন | ১৭ দিন আগে | ৪০৮ ঘন্টা |
+| 1999-12-01T00:00:00.000Z | ১ মাস | ১ মাস আগে | ৭৪৪ ঘন্টা |
+| 1999-11-01T00:00:00.000Z | ২ মাস | ২ মাস আগে | ১৪৬৪ ঘন্টা |
+| 1999-06-01T00:00:00.000Z | ৭ মাস | ৭ মাস আগে | ৫১৩৬ ঘন্টা |
+| 1999-01-01T00:00:00.000Z | ১ বছর | ১ বছর আগে | ৮৭৬০ ঘন্টা |
+| 1998-12-01T00:00:00.000Z | ১ বছর | ১ বছর আগে | ৯৫০৪ ঘন্টা |
+| 1998-06-01T00:00:00.000Z | ২ বছর | ২ বছর আগে | ১৩৮৯৬ ঘন্টা |
+| 1998-01-01T00:00:00.000Z | ২ বছর | ২ বছর আগে | ১৭৫২০ ঘন্টা |
+| 1997-01-01T00:00:00.000Z | ৩ বছর | ৩ বছর আগে | ২৬২৮০ ঘন্টা |
+| 1996-01-01T00:00:00.000Z | ৪ বছর | ৪ বছর আগে | ৩৫০৬৪ ঘন্টা |
+| 1995-01-01T00:00:00.000Z | ৫ বছর | ৫ বছর আগে | ৪৩৮২৪ ঘন্টা |
+| 1994-01-01T00:00:00.000Z | ৬ বছর | ৬ বছর আগে | ৫২৫৮৪ ঘন্টা |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | বুধবার সময় 12:00 পূর্বাহ্ন |
+| 2000-01-02T00:00:00.000Z | আগামীকাল সময় 12:00 পূর্বাহ্ন |
+| 2000-01-01T00:00:00.000Z | আজ সময় 12:00 পূর্বাহ্ন |
+| 1999-12-31T00:00:00.000Z | গতকাল সময় 12:00 পূর্বাহ্ন |
+| 1999-12-27T00:00:00.000Z | গত সোমবার সময় 12:00 পূর্বাহ্ন |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/ca/_lib/formatDistance/index.js b/date-fns/src/locale/ca/_lib/formatDistance/index.js
new file mode 100644
index 0000000..ebb8beb
--- /dev/null
+++ b/date-fns/src/locale/ca/_lib/formatDistance/index.js
@@ -0,0 +1,116 @@
+/**
+ * Davant de les xifres que es diuen amb vocal inicial, 1 i 11, s'apostrofen els articles el i la i la preposició de igual que si estiguessin escrits amb lletres.
+ * l'1 de juliol ('l'u')
+ * l'11 de novembre ('l'onze')
+ * l'11a clàusula del contracte ('l'onzena')
+ * la contractació d'11 jugadors ('d'onze')
+ * l'aval d'11.000 socis ('d'onze mil')
+ *
+ * Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=apostrofaci%25F3+davant+xifres&action=Principal&method=detall_completa&numPagina=1&idHit=11236&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=11236&titol=apostrofaci%F3%20davant%20de%20xifres%20%2F%20apostrofaci%F3%20davant%20de%201%20i%2011&numeroResultat=1&clickLink=detall&tipusCerca=cerca.normes
+ */
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: "menys d'un segon",
+ eleven: "menys d'onze segons",
+ other: 'menys de {{count}} segons'
+ },
+
+ xSeconds: {
+ one: '1 segon',
+ other: '{{count}} segons'
+ },
+
+ halfAMinute: 'mig minut',
+
+ lessThanXMinutes: {
+ one: "menys d'un minut",
+ eleven: "menys d'onze minuts",
+ other: 'menys de {{count}} minuts'
+ },
+
+ xMinutes: {
+ one: '1 minut',
+ other: '{{count}} minuts'
+ },
+
+ aboutXHours: {
+ one: 'aproximadament una hora',
+ other: 'aproximadament {{count}} hores'
+ },
+
+ xHours: {
+ one: '1 hora',
+ other: '{{count}} hores'
+ },
+
+ xDays: {
+ one: '1 dia',
+ other: '{{count}} dies'
+ },
+
+ aboutXWeeks: {
+ one: 'aproximadament una setmana',
+ other: 'aproximadament {{count}} setmanes'
+ },
+
+ xWeeks: {
+ one: '1 setmana',
+ other: '{{count}} setmanes'
+ },
+
+ aboutXMonths: {
+ one: 'aproximadament un mes',
+ other: 'aproximadament {{count}} mesos'
+ },
+
+ xMonths: {
+ one: '1 mes',
+ other: '{{count}} mesos'
+ },
+
+ aboutXYears: {
+ one: 'aproximadament un any',
+ other: 'aproximadament {{count}} anys'
+ },
+
+ xYears: {
+ one: '1 any',
+ other: '{{count}} anys'
+ },
+
+ overXYears: {
+ one: "més d'un any",
+ eleven: "més d'onze anys",
+ other: 'més de {{count}} anys'
+ },
+
+ almostXYears: {
+ one: 'gairebé un any',
+ other: 'gairebé {{count}} anys'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 11 && formatDistanceLocale[token].eleven) {
+ result = formatDistanceLocale[token].eleven
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'en ' + result
+ } else {
+ return 'fa ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ca/_lib/formatLong/index.js b/date-fns/src/locale/ca/_lib/formatLong/index.js
new file mode 100644
index 0000000..26d5834
--- /dev/null
+++ b/date-fns/src/locale/ca/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, d 'de' MMMM y",
+ long: "d 'de' MMMM y",
+ medium: 'd MMM y',
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'a les' {{time}}",
+ long: "{{date}} 'a les' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ca/_lib/formatRelative/index.js b/date-fns/src/locale/ca/_lib/formatRelative/index.js
new file mode 100644
index 0000000..fbe5461
--- /dev/null
+++ b/date-fns/src/locale/ca/_lib/formatRelative/index.js
@@ -0,0 +1,24 @@
+var formatRelativeLocale = {
+ lastWeek: "'el' eeee 'passat a la' LT",
+ yesterday: "'ahir a la' p",
+ today: "'avui a la' p",
+ tomorrow: "'demà a la' p",
+ nextWeek: "eeee 'a la' p",
+ other: 'P'
+}
+
+var formatRelativeLocalePlural = {
+ lastWeek: "'el' eeee 'passat a les' p",
+ yesterday: "'ahir a les' p",
+ today: "'avui a les' p",
+ tomorrow: "'demà a les' p",
+ nextWeek: "eeee 'a les' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ if (date.getUTCHours() !== 1) {
+ return formatRelativeLocalePlural[token]
+ }
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ca/_lib/localize/index.js b/date-fns/src/locale/ca/_lib/localize/index.js
new file mode 100644
index 0000000..7e39ff6
--- /dev/null
+++ b/date-fns/src/locale/ca/_lib/localize/index.js
@@ -0,0 +1,236 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+/**
+ * General information
+ * Reference: https://aplicacions.llengua.gencat.cat
+ * Reference: https://www.uoc.edu/portal/ca/servei-linguistic/convencions/abreviacions/simbols/simbols-habituals.html
+ */
+
+/**
+ * Abans de Crist: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=abans+de+crist&action=Principal&method=detall_completa&numPagina=1&idHit=6876&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=6876&titol=abans%20de%20Crist%20(abreviatura)%20/%20abans%20de%20Crist%20(sigla)&numeroResultat=1&clickLink=detall&tipusCerca=cerca.fitxes
+ * Desprest de Crist: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=despr%E9s+de+crist&action=Principal&method=detall_completa&numPagina=1&idHit=6879&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=6879&titol=despr%E9s%20de%20Crist%20(sigla)%20/%20despr%E9s%20de%20Crist%20(abreviatura)&numeroResultat=1&clickLink=detall&tipusCerca=cerca.fitxes
+ */
+var eraValues = {
+ narrow: ['aC', 'dC'],
+ abbreviated: ['a. de C.', 'd. de C.'],
+ wide: ['abans de Crist', 'després de Crist']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
+ wide: ['1r trimestre', '2n trimestre', '3r trimestre', '4t trimestre']
+}
+
+/**
+ * Dins d'un text convé fer servir la forma sencera dels mesos, ja que sempre és més clar el mot sencer que l'abreviatura, encara que aquesta sigui força coneguda.
+ * Cal reservar, doncs, les abreviatures per a les llistes o classificacions, els gràfics, les taules o quadres estadístics, els textos publicitaris, etc.
+ *
+ * Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=abreviacions+mesos&action=Principal&method=detall_completa&numPagina=1&idHit=8402&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=8402&titol=abreviatures%20dels%20mesos%20de%20l%27any&numeroResultat=5&clickLink=detall&tipusCerca=cerca.fitxes
+ */
+var monthValues = {
+ narrow: [
+ 'GN',
+ 'FB',
+ 'MÇ',
+ 'AB',
+ 'MG',
+ 'JN',
+ 'JL',
+ 'AG',
+ 'ST',
+ 'OC',
+ 'NV',
+ 'DS'
+ ],
+ /**
+ * Les abreviatures dels mesos de l'any es formen seguint una de les normes generals de formació d'abreviatures.
+ * S'escriu la primera síl·laba i les consonants de la síl·laba següent anteriors a la primera vocal.
+ * Els mesos de març, maig i juny no s'abreugen perquè són paraules d'una sola síl·laba.
+ */
+ abbreviated: [
+ 'gen.',
+ 'febr.',
+ 'març',
+ 'abr.',
+ 'maig',
+ 'juny',
+ 'jul.',
+ 'ag.',
+ 'set.',
+ 'oct.',
+ 'nov.',
+ 'des.'
+ ],
+ wide: [
+ 'gener',
+ 'febrer',
+ 'març',
+ 'abril',
+ 'maig',
+ 'juny',
+ 'juliol',
+ 'agost',
+ 'setembre',
+ 'octubre',
+ 'novembre',
+ 'desembre'
+ ]
+}
+
+/**
+ * Les abreviatures dels dies de la setmana comencen totes amb la lletra d.
+ * Tot seguit porten la consonant següent a la i, excepte en el cas de dimarts, dimecres i diumenge, en què aquesta consonant és la m i, per tant, hi podria haver confusió.
+ * Per evitar-ho, s'ha substituït la m per una t (en el cas de dimarts), una c (en el cas de dimecres) i una g (en el cas de diumenge), respectivament.
+ *
+ * Seguint la norma general d'ús de les abreviatures, les dels dies de la setmana sempre porten punt final.
+ * Igualment, van amb la primera lletra en majúscula quan la paraula sencera també hi aniria.
+ * En canvi, van amb la primera lletra en minúscula quan la inicial de la paraula sencera també hi aniria.
+ *
+ * Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=abreviatures+dies&action=Principal&method=detall_completa&numPagina=1&idHit=8387&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=8387&titol=abreviatures%20dels%20dies%20de%20la%20setmana&numeroResultat=1&clickLink=detall&tipusCerca=cerca.tot
+ */
+var dayValues = {
+ narrow: ['dg.', 'dl.', 'dt.', 'dm.', 'dj.', 'dv.', 'ds.'],
+ short: ['dg.', 'dl.', 'dt.', 'dm.', 'dj.', 'dv.', 'ds.'],
+ abbreviated: ['dg.', 'dl.', 'dt.', 'dm.', 'dj.', 'dv.', 'ds.'],
+ wide: [
+ 'diumenge',
+ 'dilluns',
+ 'dimarts',
+ 'dimecres',
+ 'dijous',
+ 'divendres',
+ 'dissabte'
+ ]
+}
+
+/**
+ * Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?action=Principal&method=detall&input_cercar=parts+del+dia&numPagina=1&database=FITXES_PUB&idFont=12801&idHit=12801&tipusFont=Fitxes+de+l%27Optimot&numeroResultat=1&databases_avansada=&categories_avansada=&clickLink=detall&titol=Nom+de+les+parts+del+dia&tematica=&tipusCerca=cerca.fitxes
+ */
+var dayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'mitjanit',
+ noon: 'migdia',
+ morning: 'matí',
+ afternoon: 'tarda',
+ evening: 'vespre',
+ night: 'nit'
+ },
+ abbreviated: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'mitjanit',
+ noon: 'migdia',
+ morning: 'matí',
+ afternoon: 'tarda',
+ evening: 'vespre',
+ night: 'nit'
+ },
+ wide: {
+ am: 'ante meridiem',
+ pm: 'post meridiem',
+ midnight: 'mitjanit',
+ noon: 'migdia',
+ morning: 'matí',
+ afternoon: 'tarda',
+ evening: 'vespre',
+ night: 'nit'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'de la mitjanit',
+ noon: 'del migdia',
+ morning: 'del matí',
+ afternoon: 'de la tarda',
+ evening: 'del vespre',
+ night: 'de la nit'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'de la mitjanit',
+ noon: 'del migdia',
+ morning: 'del matí',
+ afternoon: 'de la tarda',
+ evening: 'del vespre',
+ night: 'de la nit'
+ },
+ wide: {
+ am: 'ante meridiem',
+ pm: 'post meridiem',
+ midnight: 'de la mitjanit',
+ noon: 'del migdia',
+ morning: 'del matí',
+ afternoon: 'de la tarda',
+ evening: 'del vespre',
+ night: 'de la nit'
+ }
+}
+
+/**
+ * Quan van en singular, els nombres ordinals es representen, en forma d’abreviatura, amb la xifra seguida de l’última lletra del mot desplegat.
+ * És optatiu posar punt després de la lletra.
+ *
+ * Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/pdf/abrevia.pdf#page=18
+ *
+ * @param {Number} dirtyNumber
+ * @param {Object} [_dirtyOptions]
+ */
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ var rem100 = number % 100
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ return number + 'r'
+ case 2:
+ return number + 'n'
+ case 3:
+ return number + 'r'
+ case 4:
+ return number + 't'
+ }
+ }
+ return number + 'è'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ca/_lib/match/index.js b/date-fns/src/locale/ca/_lib/match/index.js
new file mode 100644
index 0000000..0eee872
--- /dev/null
+++ b/date-fns/src/locale/ca/_lib/match/index.js
@@ -0,0 +1,163 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(è|r|n|r|t)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(aC|dC)/i,
+ abbreviated: /^(a. de C.|d. de C.)/i,
+ wide: /^(abans de Crist|despr[eé]s de Crist)/i
+}
+var parseEraPatterns = {
+ narrow: [/^aC/i, /^dC/i],
+ abbreviated: [/^(a. de C.)/i, /^(d. de C.)/i],
+ wide: [/^(abans de Crist)/i, /^(despr[eé]s de Crist)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^T[1234]/i,
+ wide: /^[1234](è|r|n|r|t)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(GN|FB|MÇ|AB|MG|JN|JL|AG|ST|OC|NV|DS)/i,
+ abbreviated: /^(gen.|febr.|març|abr.|maig|juny|jul.|ag.|set.|oct.|nov.|des.)/i,
+ wide: /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^GN/i,
+ /^FB/i,
+ /^MÇ/i,
+ /^AB/i,
+ /^MG/i,
+ /^JN/i,
+ /^JL/i,
+ /^AG/i,
+ /^ST/i,
+ /^OC/i,
+ /^NV/i,
+ /^DS/i
+ ],
+ abbreviated: [
+ /^gen./i,
+ /^febr./i,
+ /^març/i,
+ /^abr./i,
+ /^maig/i,
+ /^juny/i,
+ /^jul./i,
+ /^ag./i,
+ /^set./i,
+ /^oct./i,
+ /^nov./i,
+ /^des./i
+ ],
+ wide: [
+ /^gener/i,
+ /^febrer/i,
+ /^març/i,
+ /^abril/i,
+ /^maig/i,
+ /^juny/i,
+ /^juliol/i,
+ /^agost/i,
+ /^setembre/i,
+ /^octubre/i,
+ /^novembre/i,
+ /^desembre/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,
+ short: /^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,
+ abbreviated: /^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,
+ wide: /^(diumenge|dilluns|dimarts|dimecres|dijous|divendres|dissabte)/i
+}
+var parseDayPatterns = {
+ narrow: [/^dg./i, /^dl./i, /^dt./i, /^dm./i, /^dj./i, /^dv./i, /^ds./i],
+ abbreviated: [/^dg./i, /^dl./i, /^dt./i, /^dm./i, /^dj./i, /^dv./i, /^ds./i],
+ wide: [
+ /^diumenge/i,
+ /^dilluns/i,
+ /^dimarts/i,
+ /^dimecres/i,
+ /^dijous/i,
+ /^divendres/i,
+ /^disssabte/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mn|md|(del|de la) (matí|tarda|vespre|nit))/i,
+ abbreviated: /^([ap]\.?\s?m\.?|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i,
+ wide: /^(ante meridiem|post meridiem|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mitjanit/i,
+ noon: /^migdia/i,
+ morning: /matí/i,
+ afternoon: /tarda/i,
+ evening: /vespre/i,
+ night: /nit/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ca/index.d.ts b/date-fns/src/locale/ca/index.d.ts
new file mode 100644
index 0000000..82742f7
--- /dev/null
+++ b/date-fns/src/locale/ca/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ca } from 'date-fns/locale'
+export default ca
diff --git a/date-fns/src/locale/ca/index.js b/date-fns/src/locale/ca/index.js
new file mode 100644
index 0000000..3498659
--- /dev/null
+++ b/date-fns/src/locale/ca/index.js
@@ -0,0 +1,31 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Catalan locale.
+ * @language Catalan
+ * @iso-639-2 cat
+ * @author Guillermo Grau [@guigrpa]{@link https://github.com/guigrpa}
+ * @author Alex Vizcaino [@avizcaino]{@link https://github.com/avizcaino}
+ */
+var locale = {
+ code: 'ca',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
+
+// throw new Error('ca locale is currently unavailable. Please check the progress of converting this locale to v2.0.0 in this issue on Github: TBA')
diff --git a/date-fns/src/locale/ca/index.js.flow b/date-fns/src/locale/ca/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ca/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ca/snapshot.md b/date-fns/src/locale/ca/snapshot.md
new file mode 100644
index 0000000..9fa73c8
--- /dev/null
+++ b/date-fns/src/locale/ca/snapshot.md
@@ -0,0 +1,304 @@
+# Catalan (ca) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987è | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5è | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987è | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4t | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1r | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2n | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1r trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2n trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1r | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2n | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1r trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2n trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2n | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7è | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | febr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | febrer | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juliol | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | FB | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | JL | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2n | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7è | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | febr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | febrer | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juliol | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | FB | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | JL | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1r | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48è | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1r | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48è | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11è | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28è | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42n | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365è | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | dilluns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | divendres | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | dl. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | dv. | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1r | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5è | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | dilluns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | divendres | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | dl. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | dv. | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1r | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5è | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | dilluns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | divendres | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | dl. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | dv. | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1r | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5è | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | dilluns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | divendres | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | dl. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dv. | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | dl. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | dv. | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ante meridiem | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | post meridiem | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | post meridiem | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ante meridiem | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | am | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | am | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ante meridiem | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | post meridiem | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | post meridiem | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ante meridiem | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | am | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | am | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | del matí | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarda | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | del vespre | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la nit | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | del matí | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarda | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | del vespre | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la nit | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | del matí | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarda | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | del vespre | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la nit | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | del matí | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarda | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | del vespre | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la nit | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | del matí | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarda | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | del vespre | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la nit | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11è | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11è | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11è | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23r | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11è | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11è | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11è | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23r | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1r | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55è | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1r | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55è | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 febr. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maig 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 de febrer 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 de maig 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | dimecres, 11 de febrer 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | diumenge, 29 de maig 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 febr. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maig 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 de febrer 1987 a les 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 de maig 1453 a les 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | dimecres, 11 de febrer 1987 a les 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | diumenge, 29 de maig 1453 a les 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------------- | ----------------------- | -------------------------- |
+| 2006-01-01T00:00:00.000Z | aproximadament 6 anys | aproximadament 6 anys | en aproximadament 6 anys |
+| 2005-01-01T00:00:00.000Z | aproximadament 5 anys | aproximadament 5 anys | en aproximadament 5 anys |
+| 2004-01-01T00:00:00.000Z | aproximadament 4 anys | aproximadament 4 anys | en aproximadament 4 anys |
+| 2003-01-01T00:00:00.000Z | aproximadament 3 anys | aproximadament 3 anys | en aproximadament 3 anys |
+| 2002-01-01T00:00:00.000Z | aproximadament 2 anys | aproximadament 2 anys | en aproximadament 2 anys |
+| 2001-06-01T00:00:00.000Z | més d'un any | més d'un any | en més d'un any |
+| 2001-02-01T00:00:00.000Z | aproximadament un any | aproximadament un any | en aproximadament un any |
+| 2001-01-01T00:00:00.000Z | aproximadament un any | aproximadament un any | en aproximadament un any |
+| 2000-06-01T00:00:00.000Z | 5 mesos | 5 mesos | en 5 mesos |
+| 2000-03-01T00:00:00.000Z | 2 mesos | 2 mesos | en 2 mesos |
+| 2000-02-01T00:00:00.000Z | aproximadament un mes | aproximadament un mes | en aproximadament un mes |
+| 2000-01-15T00:00:00.000Z | 14 dies | 14 dies | en 14 dies |
+| 2000-01-02T00:00:00.000Z | 1 dia | 1 dia | en 1 dia |
+| 2000-01-01T06:00:00.000Z | aproximadament 6 hores | aproximadament 6 hores | en aproximadament 6 hores |
+| 2000-01-01T01:00:00.000Z | aproximadament una hora | aproximadament una hora | en aproximadament una hora |
+| 2000-01-01T00:45:00.000Z | aproximadament una hora | aproximadament una hora | en aproximadament una hora |
+| 2000-01-01T00:30:00.000Z | 30 minuts | 30 minuts | en 30 minuts |
+| 2000-01-01T00:15:00.000Z | 15 minuts | 15 minuts | en 15 minuts |
+| 2000-01-01T00:01:00.000Z | 1 minut | 1 minut | en 1 minut |
+| 2000-01-01T00:00:25.000Z | menys d'un minut | mig minut | en menys d'un minut |
+| 2000-01-01T00:00:15.000Z | menys d'un minut | menys de 20 segons | en menys d'un minut |
+| 2000-01-01T00:00:05.000Z | menys d'un minut | menys de 10 segons | en menys d'un minut |
+| 2000-01-01T00:00:00.000Z | menys d'un minut | menys de 5 segons | fa menys d'un minut |
+| 1999-12-31T23:59:55.000Z | menys d'un minut | menys de 10 segons | fa menys d'un minut |
+| 1999-12-31T23:59:45.000Z | menys d'un minut | menys de 20 segons | fa menys d'un minut |
+| 1999-12-31T23:59:35.000Z | menys d'un minut | mig minut | fa menys d'un minut |
+| 1999-12-31T23:59:00.000Z | 1 minut | 1 minut | fa 1 minut |
+| 1999-12-31T23:45:00.000Z | 15 minuts | 15 minuts | fa 15 minuts |
+| 1999-12-31T23:30:00.000Z | 30 minuts | 30 minuts | fa 30 minuts |
+| 1999-12-31T23:15:00.000Z | aproximadament una hora | aproximadament una hora | fa aproximadament una hora |
+| 1999-12-31T23:00:00.000Z | aproximadament una hora | aproximadament una hora | fa aproximadament una hora |
+| 1999-12-31T18:00:00.000Z | aproximadament 6 hores | aproximadament 6 hores | fa aproximadament 6 hores |
+| 1999-12-30T00:00:00.000Z | 2 dies | 2 dies | fa 2 dies |
+| 1999-12-15T00:00:00.000Z | 17 dies | 17 dies | fa 17 dies |
+| 1999-12-01T00:00:00.000Z | aproximadament un mes | aproximadament un mes | fa aproximadament un mes |
+| 1999-11-01T00:00:00.000Z | 2 mesos | 2 mesos | fa 2 mesos |
+| 1999-06-01T00:00:00.000Z | 7 mesos | 7 mesos | fa 7 mesos |
+| 1999-01-01T00:00:00.000Z | aproximadament un any | aproximadament un any | fa aproximadament un any |
+| 1998-12-01T00:00:00.000Z | aproximadament un any | aproximadament un any | fa aproximadament un any |
+| 1998-06-01T00:00:00.000Z | més d'un any | més d'un any | fa més d'un any |
+| 1998-01-01T00:00:00.000Z | aproximadament 2 anys | aproximadament 2 anys | fa aproximadament 2 anys |
+| 1997-01-01T00:00:00.000Z | aproximadament 3 anys | aproximadament 3 anys | fa aproximadament 3 anys |
+| 1996-01-01T00:00:00.000Z | aproximadament 4 anys | aproximadament 4 anys | fa aproximadament 4 anys |
+| 1995-01-01T00:00:00.000Z | aproximadament 5 anys | aproximadament 5 anys | fa aproximadament 5 anys |
+| 1994-01-01T00:00:00.000Z | aproximadament 6 anys | aproximadament 6 anys | fa aproximadament 6 anys |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 anys | en 6 anys | 52608 hores |
+| 2005-01-01T00:00:00.000Z | 5 anys | en 5 anys | 43848 hores |
+| 2004-01-01T00:00:00.000Z | 4 anys | en 4 anys | 35064 hores |
+| 2003-01-01T00:00:00.000Z | 3 anys | en 3 anys | 26304 hores |
+| 2002-01-01T00:00:00.000Z | 2 anys | en 2 anys | 17544 hores |
+| 2001-06-01T00:00:00.000Z | 1 any | en 1 any | 12408 hores |
+| 2001-02-01T00:00:00.000Z | 1 any | en 1 any | 9528 hores |
+| 2001-01-01T00:00:00.000Z | 1 any | en 1 any | 8784 hores |
+| 2000-06-01T00:00:00.000Z | 5 mesos | en 5 mesos | 3648 hores |
+| 2000-03-01T00:00:00.000Z | 2 mesos | en 2 mesos | 1440 hores |
+| 2000-02-01T00:00:00.000Z | 1 mes | en 1 mes | 744 hores |
+| 2000-01-15T00:00:00.000Z | 14 dies | en 14 dies | 336 hores |
+| 2000-01-02T00:00:00.000Z | 1 dia | en 1 dia | 24 hores |
+| 2000-01-01T06:00:00.000Z | 6 hores | en 6 hores | 6 hores |
+| 2000-01-01T01:00:00.000Z | 1 hora | en 1 hora | 1 hora |
+| 2000-01-01T00:45:00.000Z | 45 minuts | en 45 minuts | 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minuts | en 30 minuts | 1 hora |
+| 2000-01-01T00:15:00.000Z | 15 minuts | en 15 minuts | 0 hores |
+| 2000-01-01T00:01:00.000Z | 1 minut | en 1 minut | 0 hores |
+| 2000-01-01T00:00:25.000Z | 25 segons | en 25 segons | 0 hores |
+| 2000-01-01T00:00:15.000Z | 15 segons | en 15 segons | 0 hores |
+| 2000-01-01T00:00:05.000Z | 5 segons | en 5 segons | 0 hores |
+| 2000-01-01T00:00:00.000Z | 0 segons | fa 0 segons | 0 hores |
+| 1999-12-31T23:59:55.000Z | 5 segons | fa 5 segons | 0 hores |
+| 1999-12-31T23:59:45.000Z | 15 segons | fa 15 segons | 0 hores |
+| 1999-12-31T23:59:35.000Z | 25 segons | fa 25 segons | 0 hores |
+| 1999-12-31T23:59:00.000Z | 1 minut | fa 1 minut | 0 hores |
+| 1999-12-31T23:45:00.000Z | 15 minuts | fa 15 minuts | 0 hores |
+| 1999-12-31T23:30:00.000Z | 30 minuts | fa 30 minuts | 1 hora |
+| 1999-12-31T23:15:00.000Z | 45 minuts | fa 45 minuts | 1 hora |
+| 1999-12-31T23:00:00.000Z | 1 hora | fa 1 hora | 1 hora |
+| 1999-12-31T18:00:00.000Z | 6 hores | fa 6 hores | 6 hores |
+| 1999-12-30T00:00:00.000Z | 2 dies | fa 2 dies | 48 hores |
+| 1999-12-15T00:00:00.000Z | 17 dies | fa 17 dies | 408 hores |
+| 1999-12-01T00:00:00.000Z | 1 mes | fa 1 mes | 744 hores |
+| 1999-11-01T00:00:00.000Z | 2 mesos | fa 2 mesos | 1464 hores |
+| 1999-06-01T00:00:00.000Z | 7 mesos | fa 7 mesos | 5136 hores |
+| 1999-01-01T00:00:00.000Z | 1 any | fa 1 any | 8760 hores |
+| 1998-12-01T00:00:00.000Z | 1 any | fa 1 any | 9504 hores |
+| 1998-06-01T00:00:00.000Z | 2 anys | fa 2 anys | 13896 hores |
+| 1998-01-01T00:00:00.000Z | 2 anys | fa 2 anys | 17520 hores |
+| 1997-01-01T00:00:00.000Z | 3 anys | fa 3 anys | 26280 hores |
+| 1996-01-01T00:00:00.000Z | 4 anys | fa 4 anys | 35064 hores |
+| 1995-01-01T00:00:00.000Z | 5 anys | fa 5 anys | 43824 hores |
+| 1994-01-01T00:00:00.000Z | 6 anys | fa 6 anys | 52584 hores |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | dimecres a les 00:00 |
+| 2000-01-02T00:00:00.000Z | demà a les 00:00 |
+| 2000-01-01T00:00:00.000Z | avui a les 00:00 |
+| 1999-12-31T00:00:00.000Z | ahir a les 00:00 |
+| 1999-12-27T00:00:00.000Z | el dilluns passat a les 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/cs/_lib/formatDistance/index.js b/date-fns/src/locale/cs/_lib/formatDistance/index.js
new file mode 100644
index 0000000..16f29a1
--- /dev/null
+++ b/date-fns/src/locale/cs/_lib/formatDistance/index.js
@@ -0,0 +1,318 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: {
+ regular: 'méně než vteřina',
+ past: 'před méně než vteřinou',
+ future: 'za méně než vteřinu'
+ },
+ few: {
+ regular: 'méně než {{count}} vteřiny',
+ past: 'před méně než {{count}} vteřinami',
+ future: 'za méně než {{count}} vteřiny'
+ },
+ many: {
+ regular: 'méně než {{count}} vteřin',
+ past: 'před méně než {{count}} vteřinami',
+ future: 'za méně než {{count}} vteřin'
+ }
+ },
+
+ xSeconds: {
+ one: {
+ regular: 'vteřina',
+ past: 'před vteřinou',
+ future: 'za vteřinu'
+ },
+ few: {
+ regular: '{{count}} vteřiny',
+ past: 'před {{count}} vteřinami',
+ future: 'za {{count}} vteřiny'
+ },
+ many: {
+ regular: '{{count}} vteřin',
+ past: 'před {{count}} vteřinami',
+ future: 'za {{count}} vteřin'
+ }
+ },
+
+ halfAMinute: {
+ other: {
+ regular: 'půl minuty',
+ past: 'před půl minutou',
+ future: 'za půl minuty'
+ }
+ },
+
+ lessThanXMinutes: {
+ one: {
+ regular: 'méně než minuta',
+ past: 'před méně než minutou',
+ future: 'za méně než minutu'
+ },
+ few: {
+ regular: 'méně než {{count}} minuty',
+ past: 'před méně než {{count}} minutami',
+ future: 'za méně než {{count}} minuty'
+ },
+ many: {
+ regular: 'méně než {{count}} minut',
+ past: 'před méně než {{count}} minutami',
+ future: 'za méně než {{count}} minut'
+ }
+ },
+
+ xMinutes: {
+ one: {
+ regular: 'minuta',
+ past: 'před minutou',
+ future: 'za minutu'
+ },
+ few: {
+ regular: '{{count}} minuty',
+ past: 'před {{count}} minutami',
+ future: 'za {{count}} minuty'
+ },
+ many: {
+ regular: '{{count}} minut',
+ past: 'před {{count}} minutami',
+ future: 'za {{count}} minut'
+ }
+ },
+
+ aboutXHours: {
+ one: {
+ regular: 'přibližně hodina',
+ past: 'přibližně před hodinou',
+ future: 'přibližně za hodinu'
+ },
+ few: {
+ regular: 'přibližně {{count}} hodiny',
+ past: 'přibližně před {{count}} hodinami',
+ future: 'přibližně za {{count}} hodiny'
+ },
+ many: {
+ regular: 'přibližně {{count}} hodin',
+ past: 'přibližně před {{count}} hodinami',
+ future: 'přibližně za {{count}} hodin'
+ }
+ },
+
+ xHours: {
+ one: {
+ regular: 'hodina',
+ past: 'před hodinou',
+ future: 'za hodinu'
+ },
+ few: {
+ regular: '{{count}} hodiny',
+ past: 'před {{count}} hodinami',
+ future: 'za {{count}} hodiny'
+ },
+ many: {
+ regular: '{{count}} hodin',
+ past: 'před {{count}} hodinami',
+ future: 'za {{count}} hodin'
+ }
+ },
+
+ xDays: {
+ one: {
+ regular: 'den',
+ past: 'před dnem',
+ future: 'za den'
+ },
+ few: {
+ regular: '{{count}} dny',
+ past: 'před {{count}} dny',
+ future: 'za {{count}} dny'
+ },
+ many: {
+ regular: '{{count}} dní',
+ past: 'před {{count}} dny',
+ future: 'za {{count}} dní'
+ }
+ },
+
+ aboutXWeeks: {
+ one: {
+ regular: 'přibližně týden',
+ past: 'přibližně před týdnem',
+ future: 'přibližně za týden'
+ },
+
+ few: {
+ regular: 'přibližně {{count}} týdny',
+ past: 'přibližně před {{count}} týdny',
+ future: 'přibližně za {{count}} týdny'
+ },
+
+ many: {
+ regular: 'přibližně {{count}} týdnů',
+ past: 'přibližně před {{count}} týdny',
+ future: 'přibližně za {{count}} týdnů'
+ }
+ },
+
+ xWeeks: {
+ one: {
+ regular: 'týden',
+ past: 'před týdnem',
+ future: 'za týden'
+ },
+
+ few: {
+ regular: '{{count}} týdny',
+ past: 'před {{count}} týdny',
+ future: 'za {{count}} týdny'
+ },
+
+ many: {
+ regular: '{{count}} týdnů',
+ past: 'před {{count}} týdny',
+ future: 'za {{count}} týdnů'
+ }
+ },
+
+ aboutXMonths: {
+ one: {
+ regular: 'přibližně měsíc',
+ past: 'přibližně před měsícem',
+ future: 'přibližně za měsíc'
+ },
+
+ few: {
+ regular: 'přibližně {{count}} měsíce',
+ past: 'přibližně před {{count}} měsíci',
+ future: 'přibližně za {{count}} měsíce'
+ },
+
+ many: {
+ regular: 'přibližně {{count}} měsíců',
+ past: 'přibližně před {{count}} měsíci',
+ future: 'přibližně za {{count}} měsíců'
+ }
+ },
+
+ xMonths: {
+ one: {
+ regular: 'měsíc',
+ past: 'před měsícem',
+ future: 'za měsíc'
+ },
+
+ few: {
+ regular: '{{count}} měsíce',
+ past: 'před {{count}} měsíci',
+ future: 'za {{count}} měsíce'
+ },
+
+ many: {
+ regular: '{{count}} měsíců',
+ past: 'před {{count}} měsíci',
+ future: 'za {{count}} měsíců'
+ }
+ },
+
+ aboutXYears: {
+ one: {
+ regular: 'přibližně rok',
+ past: 'přibližně před rokem',
+ future: 'přibližně za rok'
+ },
+ few: {
+ regular: 'přibližně {{count}} roky',
+ past: 'přibližně před {{count}} roky',
+ future: 'přibližně za {{count}} roky'
+ },
+ many: {
+ regular: 'přibližně {{count}} roků',
+ past: 'přibližně před {{count}} roky',
+ future: 'přibližně za {{count}} roků'
+ }
+ },
+
+ xYears: {
+ one: {
+ regular: 'rok',
+ past: 'před rokem',
+ future: 'za rok'
+ },
+ few: {
+ regular: '{{count}} roky',
+ past: 'před {{count}} roky',
+ future: 'za {{count}} roky'
+ },
+ many: {
+ regular: '{{count}} roků',
+ past: 'před {{count}} roky',
+ future: 'za {{count}} roků'
+ }
+ },
+
+ overXYears: {
+ one: {
+ regular: 'více než rok',
+ past: 'před více než rokem',
+ future: 'za více než rok'
+ },
+ few: {
+ regular: 'více než {{count}} roky',
+ past: 'před více než {{count}} roky',
+ future: 'za více než {{count}} roky'
+ },
+ many: {
+ regular: 'více než {{count}} roků',
+ past: 'před více než {{count}} roky',
+ future: 'za více než {{count}} roků'
+ }
+ },
+
+ almostXYears: {
+ one: {
+ regular: 'skoro rok',
+ past: 'skoro před rokem',
+ future: 'skoro za rok'
+ },
+ few: {
+ regular: 'skoro {{count}} roky',
+ past: 'skoro před {{count}} roky',
+ future: 'skoro za {{count}} roky'
+ },
+ many: {
+ regular: 'skoro {{count}} roků',
+ past: 'skoro před {{count}} roky',
+ future: 'skoro za {{count}} roků'
+ }
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ var scheme = formatDistanceLocale[token]
+
+ // cs pluralization
+ var pluralToken
+ if (typeof scheme.other === 'object') {
+ pluralToken = 'other'
+ } else if (count === 1) {
+ pluralToken = 'one'
+ } else if ((count > 1 && count < 5) || count === 0) {
+ pluralToken = 'few'
+ } else {
+ pluralToken = 'many'
+ }
+
+ // times
+ var suffixExist = options.addSuffix === true
+ var comparison = options.comparison
+ var timeToken
+ if (suffixExist && comparison === -1) {
+ timeToken = 'past'
+ } else if (suffixExist && comparison === 1) {
+ timeToken = 'future'
+ } else {
+ timeToken = 'regular'
+ }
+
+ return scheme[pluralToken][timeToken].replace('{{count}}', count)
+}
diff --git a/date-fns/src/locale/cs/_lib/formatLong/index.js b/date-fns/src/locale/cs/_lib/formatLong/index.js
new file mode 100644
index 0000000..c592d88
--- /dev/null
+++ b/date-fns/src/locale/cs/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d. MMMM yyyy',
+ long: 'd. MMMM yyyy',
+ medium: 'd. M. yyyy',
+ short: 'dd.MM.yyyy'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'v' {{time}}",
+ long: "{{date}} 'v' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/cs/_lib/formatRelative/index.js b/date-fns/src/locale/cs/_lib/formatRelative/index.js
new file mode 100644
index 0000000..34f80a8
--- /dev/null
+++ b/date-fns/src/locale/cs/_lib/formatRelative/index.js
@@ -0,0 +1,31 @@
+var accusativeWeekdays = [
+ 'neděli',
+ 'pondělí',
+ 'úterý',
+ 'středu',
+ 'čtvrtek',
+ 'pátek',
+ 'sobotu'
+]
+
+var formatRelativeLocale = {
+ lastWeek: "'poslední' eeee 've' p",
+ yesterday: "'včera v' p",
+ today: "'dnes v' p",
+ tomorrow: "'zítra v' p",
+ nextWeek: function(date, _baseDate, _options) {
+ var day = date.getUTCDay()
+ return "'v " + accusativeWeekdays[day] + " o' p"
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/cs/_lib/localize/index.js b/date-fns/src/locale/cs/_lib/localize/index.js
new file mode 100644
index 0000000..3bd8ee6
--- /dev/null
+++ b/date-fns/src/locale/cs/_lib/localize/index.js
@@ -0,0 +1,192 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['př. n. l.', 'n. l.'],
+ abbreviated: ['př. n. l.', 'n. l.'],
+ wide: ['před naším letopočtem', 'našeho letopočtu']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1. čtvrtletí', '2. čtvrtletí', '3. čtvrtletí', '4. čtvrtletí'],
+ wide: ['1. čtvrtletí', '2. čtvrtletí', '3. čtvrtletí', '4. čtvrtletí']
+}
+
+var monthValues = {
+ narrow: ['L', 'Ú', 'B', 'D', 'K', 'Č', 'Č', 'S', 'Z', 'Ř', 'L', 'P'],
+ abbreviated: [
+ 'led',
+ 'úno',
+ 'bře',
+ 'dub',
+ 'kvě',
+ 'čvn',
+ 'čvc',
+ 'srp',
+ 'zář',
+ 'říj',
+ 'lis',
+ 'pro'
+ ],
+ wide: [
+ 'leden',
+ 'únor',
+ 'březen',
+ 'duben',
+ 'květen',
+ 'červen',
+ 'červenec',
+ 'srpen',
+ 'září',
+ 'říjen',
+ 'listopad',
+ 'prosinec'
+ ]
+}
+var formattingMonthValues = {
+ narrow: ['L', 'Ú', 'B', 'D', 'K', 'Č', 'Č', 'S', 'Z', 'Ř', 'L', 'P'],
+ abbreviated: [
+ 'led',
+ 'úno',
+ 'bře',
+ 'dub',
+ 'kvě',
+ 'čvn',
+ 'čvc',
+ 'srp',
+ 'zář',
+ 'říj',
+ 'lis',
+ 'pro'
+ ],
+ wide: [
+ 'ledna',
+ 'února',
+ 'března',
+ 'dubna',
+ 'května',
+ 'června',
+ 'července',
+ 'srpna',
+ 'září',
+ 'října',
+ 'listopadu',
+ 'prosince'
+ ]
+}
+
+var dayValues = {
+ narrow: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
+ short: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
+ abbreviated: ['ned', 'pon', 'úte', 'stř', 'čtv', 'pát', 'sob'],
+ wide: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'dop.',
+ pm: 'odp.',
+ midnight: 'půlnoc',
+ noon: 'poledne',
+ morning: 'ráno',
+ afternoon: 'odpoledne',
+ evening: 'večer',
+ night: 'noc'
+ },
+ abbreviated: {
+ am: 'dop.',
+ pm: 'odp.',
+ midnight: 'půlnoc',
+ noon: 'poledne',
+ morning: 'ráno',
+ afternoon: 'odpoledne',
+ evening: 'večer',
+ night: 'noc'
+ },
+ wide: {
+ am: 'dopoledne',
+ pm: 'odpoledne',
+ midnight: 'půlnoc',
+ noon: 'poledne',
+ morning: 'ráno',
+ afternoon: 'odpoledne',
+ evening: 'večer',
+ night: 'noc'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'dop.',
+ pm: 'odp.',
+ midnight: 'půlnoc',
+ noon: 'poledne',
+ morning: 'ráno',
+ afternoon: 'odpoledne',
+ evening: 'večer',
+ night: 'noc'
+ },
+ abbreviated: {
+ am: 'dop.',
+ pm: 'odp.',
+ midnight: 'půlnoc',
+ noon: 'poledne',
+ morning: 'ráno',
+ afternoon: 'odpoledne',
+ evening: 'večer',
+ night: 'noc'
+ },
+ wide: {
+ am: 'dopoledne',
+ pm: 'odpoledne',
+ midnight: 'půlnoc',
+ noon: 'poledne',
+ morning: 'ráno',
+ afternoon: 'odpoledne',
+ evening: 'večer',
+ night: 'noc'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/cs/_lib/match/index.js b/date-fns/src/locale/cs/_lib/match/index.js
new file mode 100644
index 0000000..aaaaaa4
--- /dev/null
+++ b/date-fns/src/locale/cs/_lib/match/index.js
@@ -0,0 +1,139 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\.?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(p[řr]ed Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,
+ abbreviated: /^(pe[řr]ed Kr\.|pe[řr]ed n\. l\.|po Kr\.|n\. l\.)/i,
+ wide: /^(p[řr]ed Kristem|pred na[šs][íi]m letopo[čc]tem|po Kristu|na[šs]eho letopo[čc]tu)/i
+}
+
+var parseEraPatterns = {
+ any: [/^p[řr]/i, /^(po|n)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]\. [čc]tvrtlet[íi]/i,
+ wide: /^[1234]\. [čc]tvrtlet[íi]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[lúubdkčcszřrlp]/i,
+ abbreviated: /^(led|[úu]no|b[řr]e|dub|kv[ěe]|[čc]vn|[čc]vc|srp|z[áa][řr]|[řr][íi]j|lis|pro)/i,
+ wide: /^(leden|ledna|[úu]nora?|b[řr]ezen|b[řr]ezna|duben|dubna|kv[ěe]ten|kv[ěe]tna|[čc]erven(ec|ce)?|[čc]ervna|srpen|srpna|z[áa][řr][íi]|[řr][íi]jen|[řr][íi]jna|listopad(a|u)?|prosinec|prosince)/i
+}
+
+var parseMonthPatterns = {
+ narrow: [
+ /^l/i,
+ /^[úu]/i,
+ /^b/i,
+ /^d/i,
+ /^k/i,
+ /^[čc]/i,
+ /^[čc]/i,
+ /^s/i,
+ /^z/i,
+ /^[řr]/i,
+ /^l/i,
+ /^p/i
+ ],
+ any: [
+ /^led/i,
+ /^[úu]n/i,
+ /^b[řr]e/i,
+ /^dub/i,
+ /^kv[ěe]/i,
+ /^[čc]vn|[čc]erven(?!\w)|[čc]ervna/i,
+ /^[čc]vc|[čc]erven(ec|ce)/i,
+ /^srp/i,
+ /^z[áa][řr]/i,
+ /^[řr][íi]j/i,
+ /^lis/i,
+ /^pro/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[npuúsčps]/i,
+ short: /^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,
+ abbreviated: /^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,
+ wide: /^(ned[ěe]le|pond[ěe]l[íi]|[úu]ter[ýy]|st[řr]eda|[čc]tvrtek|p[áa]tek|sobota)/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^n/i, /^p/i, /^[úu]/i, /^s/i, /^[čc]/i, /^p/i, /^s/i],
+ any: [/^ne/i, /^po/i, /^ut/i, /^st/i, /^[čc]t/i, /^p/i, /^so/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^dopoledne|dop\.?|odpoledne|odp\.?|půlnoc|poledne|r[áa]no|odpoledne|ve[čc]er|(v )?noci/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^dop/i,
+ pm: /^odp/i,
+ midnight: /^p[ůu]lnoc/i,
+ noon: /^poledne/i,
+ morning: /r[áa]no/i,
+ afternoon: /odpoledne/i,
+ evening: /ve[čc]er/i,
+ night: /noc/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/cs/index.d.ts b/date-fns/src/locale/cs/index.d.ts
new file mode 100644
index 0000000..a17dd22
--- /dev/null
+++ b/date-fns/src/locale/cs/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { cs } from 'date-fns/locale'
+export default cs
diff --git a/date-fns/src/locale/cs/index.js b/date-fns/src/locale/cs/index.js
new file mode 100644
index 0000000..b878ce9
--- /dev/null
+++ b/date-fns/src/locale/cs/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Czech locale.
+ * @language Czech
+ * @iso-639-2 ces
+ * @author David Rus [@davidrus]{@link https://github.com/davidrus}
+ * @author Pavel Hrách [@SilenY]{@link https://github.com/SilenY}
+ * @author Jozef Bíroš [@JozefBiros]{@link https://github.com/JozefBiros}
+ */
+var locale = {
+ code: 'cs',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/cs/index.js.flow b/date-fns/src/locale/cs/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/cs/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/cs/snapshot.md b/date-fns/src/locale/cs/snapshot.md
new file mode 100644
index 0000000..9fa9d6e
--- /dev/null
+++ b/date-fns/src/locale/cs/snapshot.md
@@ -0,0 +1,304 @@
+# Czech (cs) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1. čtvrtletí | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. čtvrtletí | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. čtvrtletí | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. čtvrtletí | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. čtvrtletí | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. čtvrtletí | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. čtvrtletí | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. čtvrtletí | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | úno | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | čvc | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | února | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | července | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Ú | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Č | 2019-06-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | úno | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | čvc | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | únor | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | červenec | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Ú | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Č | 2019-06-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pát | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pát | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pát | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | pondělí | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pátek | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | po | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pá | Invalid Date |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pá | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pát | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | pondělí | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pátek | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | po | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pá | Invalid Date |
+| | iiiiii | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pá | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pát | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | pondělí | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pátek | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | po | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pá | Invalid Date |
+| | eeeeee | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pá | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pát | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | pondělí | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pátek | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | po | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pá | Invalid Date |
+| | cccccc | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pá | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | dopoledne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dopoledne | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | dopoledne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dopoledne | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | odp. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noc | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noc | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noc | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noc | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | odpoledne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noc | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. 2. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 5. 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. února 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. května 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | středa, 11. února 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | neděle, 29. května 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. 2. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 5. 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. února 1987 v 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. května 1453 v 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | středa, 11. února 1987 v 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | neděle, 29. května 1453 v 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | přibližně 6 roků | přibližně 6 roků | přibližně za 6 roků |
+| 2005-01-01T00:00:00.000Z | přibližně 5 roků | přibližně 5 roků | přibližně za 5 roků |
+| 2004-01-01T00:00:00.000Z | přibližně 4 roky | přibližně 4 roky | přibližně za 4 roky |
+| 2003-01-01T00:00:00.000Z | přibližně 3 roky | přibližně 3 roky | přibližně za 3 roky |
+| 2002-01-01T00:00:00.000Z | přibližně 2 roky | přibližně 2 roky | přibližně za 2 roky |
+| 2001-06-01T00:00:00.000Z | více než rok | více než rok | za více než rok |
+| 2001-02-01T00:00:00.000Z | přibližně rok | přibližně rok | přibližně za rok |
+| 2001-01-01T00:00:00.000Z | přibližně rok | přibližně rok | přibližně za rok |
+| 2000-06-01T00:00:00.000Z | 5 měsíců | 5 měsíců | za 5 měsíců |
+| 2000-03-01T00:00:00.000Z | 2 měsíce | 2 měsíce | za 2 měsíce |
+| 2000-02-01T00:00:00.000Z | přibližně měsíc | přibližně měsíc | přibližně za měsíc |
+| 2000-01-15T00:00:00.000Z | 14 dní | 14 dní | za 14 dní |
+| 2000-01-02T00:00:00.000Z | den | den | za den |
+| 2000-01-01T06:00:00.000Z | přibližně 6 hodin | přibližně 6 hodin | přibližně za 6 hodin |
+| 2000-01-01T01:00:00.000Z | přibližně hodina | přibližně hodina | přibližně za hodinu |
+| 2000-01-01T00:45:00.000Z | přibližně hodina | přibližně hodina | přibližně za hodinu |
+| 2000-01-01T00:30:00.000Z | 30 minut | 30 minut | za 30 minut |
+| 2000-01-01T00:15:00.000Z | 15 minut | 15 minut | za 15 minut |
+| 2000-01-01T00:01:00.000Z | minuta | minuta | za minutu |
+| 2000-01-01T00:00:25.000Z | méně než minuta | půl minuty | za méně než minutu |
+| 2000-01-01T00:00:15.000Z | méně než minuta | méně než 20 vteřin | za méně než minutu |
+| 2000-01-01T00:00:05.000Z | méně než minuta | méně než 10 vteřin | za méně než minutu |
+| 2000-01-01T00:00:00.000Z | méně než minuta | méně než 5 vteřin | méně než minuta |
+| 1999-12-31T23:59:55.000Z | méně než minuta | méně než 10 vteřin | před méně než minutou |
+| 1999-12-31T23:59:45.000Z | méně než minuta | méně než 20 vteřin | před méně než minutou |
+| 1999-12-31T23:59:35.000Z | méně než minuta | půl minuty | před méně než minutou |
+| 1999-12-31T23:59:00.000Z | minuta | minuta | před minutou |
+| 1999-12-31T23:45:00.000Z | 15 minut | 15 minut | před 15 minutami |
+| 1999-12-31T23:30:00.000Z | 30 minut | 30 minut | před 30 minutami |
+| 1999-12-31T23:15:00.000Z | přibližně hodina | přibližně hodina | přibližně před hodinou |
+| 1999-12-31T23:00:00.000Z | přibližně hodina | přibližně hodina | přibližně před hodinou |
+| 1999-12-31T18:00:00.000Z | přibližně 6 hodin | přibližně 6 hodin | přibližně před 6 hodinami |
+| 1999-12-30T00:00:00.000Z | 2 dny | 2 dny | před 2 dny |
+| 1999-12-15T00:00:00.000Z | 17 dní | 17 dní | před 17 dny |
+| 1999-12-01T00:00:00.000Z | přibližně měsíc | přibližně měsíc | přibližně před měsícem |
+| 1999-11-01T00:00:00.000Z | 2 měsíce | 2 měsíce | před 2 měsíci |
+| 1999-06-01T00:00:00.000Z | 7 měsíců | 7 měsíců | před 7 měsíci |
+| 1999-01-01T00:00:00.000Z | přibližně rok | přibližně rok | přibližně před rokem |
+| 1998-12-01T00:00:00.000Z | přibližně rok | přibližně rok | přibližně před rokem |
+| 1998-06-01T00:00:00.000Z | více než rok | více než rok | před více než rokem |
+| 1998-01-01T00:00:00.000Z | přibližně 2 roky | přibližně 2 roky | přibližně před 2 roky |
+| 1997-01-01T00:00:00.000Z | přibližně 3 roky | přibližně 3 roky | přibližně před 3 roky |
+| 1996-01-01T00:00:00.000Z | přibližně 4 roky | přibližně 4 roky | přibližně před 4 roky |
+| 1995-01-01T00:00:00.000Z | přibližně 5 roků | přibližně 5 roků | přibližně před 5 roky |
+| 1994-01-01T00:00:00.000Z | přibližně 6 roků | přibližně 6 roků | přibližně před 6 roky |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 roků | za 6 roků | 52608 hodin |
+| 2005-01-01T00:00:00.000Z | 5 roků | za 5 roků | 43848 hodin |
+| 2004-01-01T00:00:00.000Z | 4 roky | za 4 roky | 35064 hodin |
+| 2003-01-01T00:00:00.000Z | 3 roky | za 3 roky | 26304 hodin |
+| 2002-01-01T00:00:00.000Z | 2 roky | za 2 roky | 17544 hodin |
+| 2001-06-01T00:00:00.000Z | rok | za rok | 12408 hodin |
+| 2001-02-01T00:00:00.000Z | rok | za rok | 9528 hodin |
+| 2001-01-01T00:00:00.000Z | rok | za rok | 8784 hodin |
+| 2000-06-01T00:00:00.000Z | 5 měsíců | za 5 měsíců | 3648 hodin |
+| 2000-03-01T00:00:00.000Z | 2 měsíce | za 2 měsíce | 1440 hodin |
+| 2000-02-01T00:00:00.000Z | měsíc | za měsíc | 744 hodin |
+| 2000-01-15T00:00:00.000Z | 14 dní | za 14 dní | 336 hodin |
+| 2000-01-02T00:00:00.000Z | den | za den | 24 hodin |
+| 2000-01-01T06:00:00.000Z | 6 hodin | za 6 hodin | 6 hodin |
+| 2000-01-01T01:00:00.000Z | hodina | za hodinu | hodina |
+| 2000-01-01T00:45:00.000Z | 45 minut | za 45 minut | hodina |
+| 2000-01-01T00:30:00.000Z | 30 minut | za 30 minut | hodina |
+| 2000-01-01T00:15:00.000Z | 15 minut | za 15 minut | 0 hodiny |
+| 2000-01-01T00:01:00.000Z | minuta | za minutu | 0 hodiny |
+| 2000-01-01T00:00:25.000Z | 25 vteřin | za 25 vteřin | 0 hodiny |
+| 2000-01-01T00:00:15.000Z | 15 vteřin | za 15 vteřin | 0 hodiny |
+| 2000-01-01T00:00:05.000Z | 5 vteřin | za 5 vteřin | 0 hodiny |
+| 2000-01-01T00:00:00.000Z | 0 vteřiny | 0 vteřiny | 0 hodiny |
+| 1999-12-31T23:59:55.000Z | 5 vteřin | před 5 vteřinami | 0 hodiny |
+| 1999-12-31T23:59:45.000Z | 15 vteřin | před 15 vteřinami | 0 hodiny |
+| 1999-12-31T23:59:35.000Z | 25 vteřin | před 25 vteřinami | 0 hodiny |
+| 1999-12-31T23:59:00.000Z | minuta | před minutou | 0 hodiny |
+| 1999-12-31T23:45:00.000Z | 15 minut | před 15 minutami | 0 hodiny |
+| 1999-12-31T23:30:00.000Z | 30 minut | před 30 minutami | hodina |
+| 1999-12-31T23:15:00.000Z | 45 minut | před 45 minutami | hodina |
+| 1999-12-31T23:00:00.000Z | hodina | před hodinou | hodina |
+| 1999-12-31T18:00:00.000Z | 6 hodin | před 6 hodinami | 6 hodin |
+| 1999-12-30T00:00:00.000Z | 2 dny | před 2 dny | 48 hodin |
+| 1999-12-15T00:00:00.000Z | 17 dní | před 17 dny | 408 hodin |
+| 1999-12-01T00:00:00.000Z | měsíc | před měsícem | 744 hodin |
+| 1999-11-01T00:00:00.000Z | 2 měsíce | před 2 měsíci | 1464 hodin |
+| 1999-06-01T00:00:00.000Z | 7 měsíců | před 7 měsíci | 5136 hodin |
+| 1999-01-01T00:00:00.000Z | rok | před rokem | 8760 hodin |
+| 1998-12-01T00:00:00.000Z | rok | před rokem | 9504 hodin |
+| 1998-06-01T00:00:00.000Z | 2 roky | před 2 roky | 13896 hodin |
+| 1998-01-01T00:00:00.000Z | 2 roky | před 2 roky | 17520 hodin |
+| 1997-01-01T00:00:00.000Z | 3 roky | před 3 roky | 26280 hodin |
+| 1996-01-01T00:00:00.000Z | 4 roky | před 4 roky | 35064 hodin |
+| 1995-01-01T00:00:00.000Z | 5 roků | před 5 roky | 43824 hodin |
+| 1994-01-01T00:00:00.000Z | 6 roků | před 6 roky | 52584 hodin |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | v středu o 0:00 |
+| 2000-01-02T00:00:00.000Z | zítra v 0:00 |
+| 2000-01-01T00:00:00.000Z | dnes v 0:00 |
+| 1999-12-31T00:00:00.000Z | včera v 0:00 |
+| 1999-12-27T00:00:00.000Z | poslední pondělí ve 0:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/cy/_lib/formatDistance/index.js b/date-fns/src/locale/cy/_lib/formatDistance/index.js
new file mode 100644
index 0000000..6f0af31
--- /dev/null
+++ b/date-fns/src/locale/cy/_lib/formatDistance/index.js
@@ -0,0 +1,114 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'llai na eiliad',
+ other: 'llai na {{count}} eiliad'
+ },
+
+ xSeconds: {
+ one: '1 eiliad',
+ other: '{{count}} eiliad'
+ },
+
+ halfAMinute: 'hanner munud',
+
+ lessThanXMinutes: {
+ one: 'llai na munud',
+ two: 'llai na 2 funud',
+ other: 'llai na {{count}} munud'
+ },
+
+ xMinutes: {
+ one: '1 munud',
+ two: '2 funud',
+ other: '{{count}} munud'
+ },
+
+ aboutXHours: {
+ one: 'tua 1 awr',
+ other: 'tua {{count}} awr'
+ },
+
+ xHours: {
+ one: '1 awr',
+ other: '{{count}} awr'
+ },
+
+ xDays: {
+ one: '1 diwrnod',
+ two: '2 ddiwrnod',
+ other: '{{count}} diwrnod'
+ },
+
+ aboutXWeeks: {
+ one: 'tua 1 wythnos',
+ two: 'tua pythefnos',
+ other: 'tua {{count}} wythnos'
+ },
+
+ xWeeks: {
+ one: '1 wythnos',
+ two: 'pythefnos',
+ other: '{{count}} wythnos'
+ },
+
+ aboutXMonths: {
+ one: 'tua 1 mis',
+ two: 'tua 2 fis',
+ other: 'tua {{count}} mis'
+ },
+
+ xMonths: {
+ one: '1 mis',
+ two: '2 fis',
+ other: '{{count}} mis'
+ },
+
+ aboutXYears: {
+ one: 'tua 1 flwyddyn',
+ two: 'tua 2 flynedd',
+ other: 'tua {{count}} mlynedd'
+ },
+
+ xYears: {
+ one: '1 flwyddyn',
+ two: '2 flynedd',
+ other: '{{count}} mlynedd'
+ },
+
+ overXYears: {
+ one: 'dros 1 flwyddyn',
+ two: 'dros 2 flynedd',
+ other: 'dros {{count}} mlynedd'
+ },
+
+ almostXYears: {
+ one: 'bron 1 flwyddyn',
+ two: 'bron 2 flynedd',
+ other: 'bron {{count}} mlynedd'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 2 && !!formatDistanceLocale[token].two) {
+ result = formatDistanceLocale[token].two
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'mewn ' + result
+ } else {
+ return result + ' yn ôl'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/cy/_lib/formatLong/index.js b/date-fns/src/locale/cy/_lib/formatLong/index.js
new file mode 100644
index 0000000..a77bdae
--- /dev/null
+++ b/date-fns/src/locale/cy/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'am' {{time}}",
+ long: "{{date}} 'am' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/cy/_lib/formatRelative/index.js b/date-fns/src/locale/cy/_lib/formatRelative/index.js
new file mode 100644
index 0000000..5764077
--- /dev/null
+++ b/date-fns/src/locale/cy/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'diwethaf am' p",
+ yesterday: "'ddoe am' p",
+ today: "'heddiw am' p",
+ tomorrow: "'yfory am' p",
+ nextWeek: "eeee 'am' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/cy/_lib/localize/index.js b/date-fns/src/locale/cy/_lib/localize/index.js
new file mode 100644
index 0000000..bf89501
--- /dev/null
+++ b/date-fns/src/locale/cy/_lib/localize/index.js
@@ -0,0 +1,204 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['C', 'O'],
+ abbreviated: ['CC', 'OC'],
+ wide: ['Cyn Crist', 'Ar ôl Crist']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Ch1', 'Ch2', 'Ch3', 'Ch4'],
+ wide: ['Chwarter 1af', '2ail chwarter', '3ydd chwarter', '4ydd chwarter']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['I', 'Ch', 'Ma', 'E', 'Mi', 'Me', 'G', 'A', 'Md', 'H', 'T', 'Rh'],
+ abbreviated: [
+ 'Ion',
+ 'Chwe',
+ 'Maw',
+ 'Ebr',
+ 'Mai',
+ 'Meh',
+ 'Gor',
+ 'Aws',
+ 'Med',
+ 'Hyd',
+ 'Tach',
+ 'Rhag'
+ ],
+ wide: [
+ 'Ionawr',
+ 'Chwefror',
+ 'Mawrth',
+ 'Ebrill',
+ 'Mai',
+ 'Mehefin',
+ 'Gorffennaf',
+ 'Awst',
+ 'Medi',
+ 'Hydref',
+ 'Tachwedd',
+ 'Rhagfyr'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'Ll', 'M', 'M', 'I', 'G', 'S'],
+ short: ['Su', 'Ll', 'Ma', 'Me', 'Ia', 'Gw', 'Sa'],
+ abbreviated: ['Sul', 'Llun', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'],
+ wide: [
+ 'dydd Sul',
+ 'dydd Llun',
+ 'dydd Mawrth',
+ 'dydd Mercher',
+ 'dydd Iau',
+ 'dydd Gwener',
+ 'dydd Sadwrn'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'b',
+ pm: 'h',
+ midnight: 'hn',
+ noon: 'hd',
+ morning: 'bore',
+ afternoon: 'prynhawn',
+ evening: "gyda'r nos",
+ night: 'nos'
+ },
+ abbreviated: {
+ am: 'yb',
+ pm: 'yh',
+ midnight: 'hanner nos',
+ noon: 'hanner dydd',
+ morning: 'bore',
+ afternoon: 'prynhawn',
+ evening: "gyda'r nos",
+ night: 'nos'
+ },
+ wide: {
+ am: 'y.b.',
+ pm: 'y.h.',
+ midnight: 'hanner nos',
+ noon: 'hanner dydd',
+ morning: 'bore',
+ afternoon: 'prynhawn',
+ evening: "gyda'r nos",
+ night: 'nos'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'b',
+ pm: 'h',
+ midnight: 'hn',
+ noon: 'hd',
+ morning: 'yn y bore',
+ afternoon: 'yn y prynhawn',
+ evening: "gyda'r nos",
+ night: 'yn y nos'
+ },
+ abbreviated: {
+ am: 'yb',
+ pm: 'yh',
+ midnight: 'hanner nos',
+ noon: 'hanner dydd',
+ morning: 'yn y bore',
+ afternoon: 'yn y prynhawn',
+ evening: "gyda'r nos",
+ night: 'yn y nos'
+ },
+ wide: {
+ am: 'y.b.',
+ pm: 'y.h.',
+ midnight: 'hanner nos',
+ noon: 'hanner dydd',
+ morning: 'yn y bore',
+ afternoon: 'yn y prynhawn',
+ evening: "gyda'r nos",
+ night: 'yn y nos'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ if (number < 20) {
+ switch (number) {
+ case 0:
+ return number + 'fed'
+ case 1:
+ return number + 'af'
+ case 2:
+ return number + 'ail'
+ case 3:
+ case 4:
+ return number + 'ydd'
+ case 5:
+ case 6:
+ return number + 'ed'
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 12:
+ case 15:
+ case 18:
+ return number + 'fed'
+ case 11:
+ case 13:
+ case 14:
+ case 16:
+ case 17:
+ case 19:
+ return number + 'eg'
+ }
+ } else if ((number >= 50 && number <= 60) || number === 80 || number >= 100) {
+ return number + 'fed'
+ }
+ return number + 'ain'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/cy/_lib/match/index.js b/date-fns/src/locale/cy/_lib/match/index.js
new file mode 100644
index 0000000..d2657ad
--- /dev/null
+++ b/date-fns/src/locale/cy/_lib/match/index.js
@@ -0,0 +1,147 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(af|ail|ydd|ed|fed|eg|ain)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(c|o)/i,
+ abbreviated: /^(c\.?\s?c\.?|o\.?\s?c\.?)/i,
+ wide: /^(cyn christ|ar ôl crist|ar ol crist)/i
+}
+var parseEraPatterns = {
+ wide: [/^c/i, /^(ar ôl crist|ar ol crist)/i],
+ any: [/^c/i, /^o/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^ch[1234]/i,
+ wide: /^(chwarter 1af)|([234](ail|ydd)? chwarter)/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(i|ch|m|e|g|a|h|t|rh)/i,
+ abbreviated: /^(ion|chwe|maw|ebr|mai|meh|gor|aws|med|hyd|tach|rhag)/i,
+ wide: /^(ionawr|chwefror|mawrth|ebrill|mai|mehefin|gorffennaf|awst|medi|hydref|tachwedd|rhagfyr)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^i/i,
+ /^ch/i,
+ /^m/i,
+ /^e/i,
+ /^m/i,
+ /^m/i,
+ /^g/i,
+ /^a/i,
+ /^m/i,
+ /^h/i,
+ /^t/i,
+ /^rh/i
+ ],
+ any: [
+ /^io/i,
+ /^ch/i,
+ /^maw/i,
+ /^e/i,
+ /^mai/i,
+ /^meh/i,
+ /^g/i,
+ /^a/i,
+ /^med/i,
+ /^h/i,
+ /^t/i,
+ /^rh/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(s|ll|m|i|g)/i,
+ short: /^(su|ll|ma|me|ia|gw|sa)/i,
+ abbreviated: /^(sul|llun|maw|mer|iau|gwe|sad)/i,
+ wide: /^dydd (sul|llun|mawrth|mercher|iau|gwener|sadwrn)/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^ll/i, /^m/i, /^m/i, /^i/i, /^g/i, /^s/i],
+ wide: [
+ /^dydd su/i,
+ /^dydd ll/i,
+ /^dydd ma/i,
+ /^dydd me/i,
+ /^dydd i/i,
+ /^dydd g/i,
+ /^dydd sa/i
+ ],
+ any: [/^su/i, /^ll/i, /^ma/i, /^me/i, /^i/i, /^g/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(b|h|hn|hd|(yn y|y|yr|gyda'r) (bore|prynhawn|nos|hwyr))/i,
+ any: /^(y\.?\s?[bh]\.?|hanner nos|hanner dydd|(yn y|y|yr|gyda'r) (bore|prynhawn|nos|hwyr))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^b|(y\.?\s?b\.?)/i,
+ pm: /^h|(y\.?\s?h\.?)|(yr hwyr)/i,
+ midnight: /^hn|hanner nos/i,
+ noon: /^hd|hanner dydd/i,
+ morning: /bore/i,
+ afternoon: /prynhawn/i,
+ evening: /^gyda'r nos$/i,
+ night: /blah/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/cy/index.d.ts b/date-fns/src/locale/cy/index.d.ts
new file mode 100644
index 0000000..8c1286b
--- /dev/null
+++ b/date-fns/src/locale/cy/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { cy } from 'date-fns/locale'
+export default cy
diff --git a/date-fns/src/locale/cy/index.js b/date-fns/src/locale/cy/index.js
new file mode 100644
index 0000000..22167cf
--- /dev/null
+++ b/date-fns/src/locale/cy/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Welsh locale.
+ * @language Welsh
+ * @iso-639-2 cym
+ * @author Elwyn Malethan [@elmomalmo]{@link https://github.com/elmomalmo}
+ */
+var locale = {
+ code: 'cy',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/cy/index.js.flow b/date-fns/src/locale/cy/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/cy/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/cy/snapshot.md b/date-fns/src/locale/cy/snapshot.md
new file mode 100644
index 0000000..af13081
--- /dev/null
+++ b/date-fns/src/locale/cy/snapshot.md
@@ -0,0 +1,304 @@
+# Welsh (cy) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987fed | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ed | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987fed | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ed | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1af | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ail | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Ch1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Ch2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | Chwarter 1af | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ail chwarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1af | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ail | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Ch1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Ch2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | Chwarter 1af | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ail chwarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2ail | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7fed | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Chwe | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Gor | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Chwefror | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Gorffennaf | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Ch | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | G | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2ail | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7fed | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Chwe | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Gor | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Chwefror | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Gorffennaf | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Ch | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | G | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1af | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49ain | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1af | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ain | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11eg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28ain | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42ain | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365fed | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gwe | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gwe | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gwe | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | dydd Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dydd Gwener | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | G | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gw | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1af | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ed | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gwe | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | dydd Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dydd Gwener | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | G | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gw | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2ail | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6ed | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gwe | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | dydd Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dydd Gwener | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | G | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gw | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2ail | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6ed | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gwe | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | dydd Llun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | dydd Gwener | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | G | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Ll | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Gw | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | y.b. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | y.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | y.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | y.b. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | b | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | h | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | h | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | b | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | yh | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yb | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | y.b. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | y.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | y.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | y.b. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | b | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | h | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | h | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | b | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | yn y bore | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yn y prynhawn | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | gyda'r nos | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yn y nos | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | yn y bore | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yn y prynhawn | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | gyda'r nos | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yn y nos | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | yn y bore | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yn y prynhawn | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | gyda'r nos | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yn y nos | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | yn y bore | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yn y prynhawn | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | gyda'r nos | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yn y nos | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | yn y bore | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | yn y prynhawn | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | gyda'r nos | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yn y nos | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11eg | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11eg | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11eg | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ain | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11eg | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11eg | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11eg | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ain | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1af | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55fed | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1af | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55fed | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Chwe 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Chwefror 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | dydd Mercher, 11 Chwefror 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | dydd Sul, 29 Mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 yh | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 yh | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 yh | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 yh | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 yh GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 yh GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 yh GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 yh GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 yh | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 yh | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Chwe 1987, 12:13:14 yh | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mai 1453, 11:59:59 yh | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Chwefror 1987 am 12:13:14 yh GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 Mai 1453 am 11:59:59 yh GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | dydd Mercher, 11 Chwefror 1987 am 12:13:14 yh GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | dydd Sul, 29 Mai 1453 am 11:59:59 yh GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------- | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | tua 6 mlynedd | tua 6 mlynedd | mewn tua 6 mlynedd |
+| 2005-01-01T00:00:00.000Z | tua 5 mlynedd | tua 5 mlynedd | mewn tua 5 mlynedd |
+| 2004-01-01T00:00:00.000Z | tua 4 mlynedd | tua 4 mlynedd | mewn tua 4 mlynedd |
+| 2003-01-01T00:00:00.000Z | tua 3 mlynedd | tua 3 mlynedd | mewn tua 3 mlynedd |
+| 2002-01-01T00:00:00.000Z | tua 2 flynedd | tua 2 flynedd | mewn tua 2 flynedd |
+| 2001-06-01T00:00:00.000Z | dros 1 flwyddyn | dros 1 flwyddyn | mewn dros 1 flwyddyn |
+| 2001-02-01T00:00:00.000Z | tua 1 flwyddyn | tua 1 flwyddyn | mewn tua 1 flwyddyn |
+| 2001-01-01T00:00:00.000Z | tua 1 flwyddyn | tua 1 flwyddyn | mewn tua 1 flwyddyn |
+| 2000-06-01T00:00:00.000Z | 5 mis | 5 mis | mewn 5 mis |
+| 2000-03-01T00:00:00.000Z | 2 fis | 2 fis | mewn 2 fis |
+| 2000-02-01T00:00:00.000Z | tua 1 mis | tua 1 mis | mewn tua 1 mis |
+| 2000-01-15T00:00:00.000Z | 14 diwrnod | 14 diwrnod | mewn 14 diwrnod |
+| 2000-01-02T00:00:00.000Z | 1 diwrnod | 1 diwrnod | mewn 1 diwrnod |
+| 2000-01-01T06:00:00.000Z | tua 6 awr | tua 6 awr | mewn tua 6 awr |
+| 2000-01-01T01:00:00.000Z | tua 1 awr | tua 1 awr | mewn tua 1 awr |
+| 2000-01-01T00:45:00.000Z | tua 1 awr | tua 1 awr | mewn tua 1 awr |
+| 2000-01-01T00:30:00.000Z | 30 munud | 30 munud | mewn 30 munud |
+| 2000-01-01T00:15:00.000Z | 15 munud | 15 munud | mewn 15 munud |
+| 2000-01-01T00:01:00.000Z | 1 munud | 1 munud | mewn 1 munud |
+| 2000-01-01T00:00:25.000Z | llai na munud | hanner munud | mewn llai na munud |
+| 2000-01-01T00:00:15.000Z | llai na munud | llai na 20 eiliad | mewn llai na munud |
+| 2000-01-01T00:00:05.000Z | llai na munud | llai na 10 eiliad | mewn llai na munud |
+| 2000-01-01T00:00:00.000Z | llai na munud | llai na 5 eiliad | llai na munud yn ôl |
+| 1999-12-31T23:59:55.000Z | llai na munud | llai na 10 eiliad | llai na munud yn ôl |
+| 1999-12-31T23:59:45.000Z | llai na munud | llai na 20 eiliad | llai na munud yn ôl |
+| 1999-12-31T23:59:35.000Z | llai na munud | hanner munud | llai na munud yn ôl |
+| 1999-12-31T23:59:00.000Z | 1 munud | 1 munud | 1 munud yn ôl |
+| 1999-12-31T23:45:00.000Z | 15 munud | 15 munud | 15 munud yn ôl |
+| 1999-12-31T23:30:00.000Z | 30 munud | 30 munud | 30 munud yn ôl |
+| 1999-12-31T23:15:00.000Z | tua 1 awr | tua 1 awr | tua 1 awr yn ôl |
+| 1999-12-31T23:00:00.000Z | tua 1 awr | tua 1 awr | tua 1 awr yn ôl |
+| 1999-12-31T18:00:00.000Z | tua 6 awr | tua 6 awr | tua 6 awr yn ôl |
+| 1999-12-30T00:00:00.000Z | 2 ddiwrnod | 2 ddiwrnod | 2 ddiwrnod yn ôl |
+| 1999-12-15T00:00:00.000Z | 17 diwrnod | 17 diwrnod | 17 diwrnod yn ôl |
+| 1999-12-01T00:00:00.000Z | tua 1 mis | tua 1 mis | tua 1 mis yn ôl |
+| 1999-11-01T00:00:00.000Z | 2 fis | 2 fis | 2 fis yn ôl |
+| 1999-06-01T00:00:00.000Z | 7 mis | 7 mis | 7 mis yn ôl |
+| 1999-01-01T00:00:00.000Z | tua 1 flwyddyn | tua 1 flwyddyn | tua 1 flwyddyn yn ôl |
+| 1998-12-01T00:00:00.000Z | tua 1 flwyddyn | tua 1 flwyddyn | tua 1 flwyddyn yn ôl |
+| 1998-06-01T00:00:00.000Z | dros 1 flwyddyn | dros 1 flwyddyn | dros 1 flwyddyn yn ôl |
+| 1998-01-01T00:00:00.000Z | tua 2 flynedd | tua 2 flynedd | tua 2 flynedd yn ôl |
+| 1997-01-01T00:00:00.000Z | tua 3 mlynedd | tua 3 mlynedd | tua 3 mlynedd yn ôl |
+| 1996-01-01T00:00:00.000Z | tua 4 mlynedd | tua 4 mlynedd | tua 4 mlynedd yn ôl |
+| 1995-01-01T00:00:00.000Z | tua 5 mlynedd | tua 5 mlynedd | tua 5 mlynedd yn ôl |
+| 1994-01-01T00:00:00.000Z | tua 6 mlynedd | tua 6 mlynedd | tua 6 mlynedd yn ôl |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 mlynedd | mewn 6 mlynedd | 52608 awr |
+| 2005-01-01T00:00:00.000Z | 5 mlynedd | mewn 5 mlynedd | 43848 awr |
+| 2004-01-01T00:00:00.000Z | 4 mlynedd | mewn 4 mlynedd | 35064 awr |
+| 2003-01-01T00:00:00.000Z | 3 mlynedd | mewn 3 mlynedd | 26304 awr |
+| 2002-01-01T00:00:00.000Z | 2 flynedd | mewn 2 flynedd | 17544 awr |
+| 2001-06-01T00:00:00.000Z | 1 flwyddyn | mewn 1 flwyddyn | 12408 awr |
+| 2001-02-01T00:00:00.000Z | 1 flwyddyn | mewn 1 flwyddyn | 9528 awr |
+| 2001-01-01T00:00:00.000Z | 1 flwyddyn | mewn 1 flwyddyn | 8784 awr |
+| 2000-06-01T00:00:00.000Z | 5 mis | mewn 5 mis | 3648 awr |
+| 2000-03-01T00:00:00.000Z | 2 fis | mewn 2 fis | 1440 awr |
+| 2000-02-01T00:00:00.000Z | 1 mis | mewn 1 mis | 744 awr |
+| 2000-01-15T00:00:00.000Z | 14 diwrnod | mewn 14 diwrnod | 336 awr |
+| 2000-01-02T00:00:00.000Z | 1 diwrnod | mewn 1 diwrnod | 24 awr |
+| 2000-01-01T06:00:00.000Z | 6 awr | mewn 6 awr | 6 awr |
+| 2000-01-01T01:00:00.000Z | 1 awr | mewn 1 awr | 1 awr |
+| 2000-01-01T00:45:00.000Z | 45 munud | mewn 45 munud | 1 awr |
+| 2000-01-01T00:30:00.000Z | 30 munud | mewn 30 munud | 1 awr |
+| 2000-01-01T00:15:00.000Z | 15 munud | mewn 15 munud | 0 awr |
+| 2000-01-01T00:01:00.000Z | 1 munud | mewn 1 munud | 0 awr |
+| 2000-01-01T00:00:25.000Z | 25 eiliad | mewn 25 eiliad | 0 awr |
+| 2000-01-01T00:00:15.000Z | 15 eiliad | mewn 15 eiliad | 0 awr |
+| 2000-01-01T00:00:05.000Z | 5 eiliad | mewn 5 eiliad | 0 awr |
+| 2000-01-01T00:00:00.000Z | 0 eiliad | 0 eiliad yn ôl | 0 awr |
+| 1999-12-31T23:59:55.000Z | 5 eiliad | 5 eiliad yn ôl | 0 awr |
+| 1999-12-31T23:59:45.000Z | 15 eiliad | 15 eiliad yn ôl | 0 awr |
+| 1999-12-31T23:59:35.000Z | 25 eiliad | 25 eiliad yn ôl | 0 awr |
+| 1999-12-31T23:59:00.000Z | 1 munud | 1 munud yn ôl | 0 awr |
+| 1999-12-31T23:45:00.000Z | 15 munud | 15 munud yn ôl | 0 awr |
+| 1999-12-31T23:30:00.000Z | 30 munud | 30 munud yn ôl | 1 awr |
+| 1999-12-31T23:15:00.000Z | 45 munud | 45 munud yn ôl | 1 awr |
+| 1999-12-31T23:00:00.000Z | 1 awr | 1 awr yn ôl | 1 awr |
+| 1999-12-31T18:00:00.000Z | 6 awr | 6 awr yn ôl | 6 awr |
+| 1999-12-30T00:00:00.000Z | 2 ddiwrnod | 2 ddiwrnod yn ôl | 48 awr |
+| 1999-12-15T00:00:00.000Z | 17 diwrnod | 17 diwrnod yn ôl | 408 awr |
+| 1999-12-01T00:00:00.000Z | 1 mis | 1 mis yn ôl | 744 awr |
+| 1999-11-01T00:00:00.000Z | 2 fis | 2 fis yn ôl | 1464 awr |
+| 1999-06-01T00:00:00.000Z | 7 mis | 7 mis yn ôl | 5136 awr |
+| 1999-01-01T00:00:00.000Z | 1 flwyddyn | 1 flwyddyn yn ôl | 8760 awr |
+| 1998-12-01T00:00:00.000Z | 1 flwyddyn | 1 flwyddyn yn ôl | 9504 awr |
+| 1998-06-01T00:00:00.000Z | 2 flynedd | 2 flynedd yn ôl | 13896 awr |
+| 1998-01-01T00:00:00.000Z | 2 flynedd | 2 flynedd yn ôl | 17520 awr |
+| 1997-01-01T00:00:00.000Z | 3 mlynedd | 3 mlynedd yn ôl | 26280 awr |
+| 1996-01-01T00:00:00.000Z | 4 mlynedd | 4 mlynedd yn ôl | 35064 awr |
+| 1995-01-01T00:00:00.000Z | 5 mlynedd | 5 mlynedd yn ôl | 43824 awr |
+| 1994-01-01T00:00:00.000Z | 6 mlynedd | 6 mlynedd yn ôl | 52584 awr |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------------ |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | dydd Mercher am 12:00 yb |
+| 2000-01-02T00:00:00.000Z | yfory am 12:00 yb |
+| 2000-01-01T00:00:00.000Z | heddiw am 12:00 yb |
+| 1999-12-31T00:00:00.000Z | ddoe am 12:00 yb |
+| 1999-12-27T00:00:00.000Z | dydd Llun diwethaf am 12:00 yb |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/da/_lib/formatDistance/index.js b/date-fns/src/locale/da/_lib/formatDistance/index.js
new file mode 100644
index 0000000..7eb8672
--- /dev/null
+++ b/date-fns/src/locale/da/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'mindre end ét sekund',
+ other: 'mindre end {{count}} sekunder'
+ },
+
+ xSeconds: {
+ one: '1 sekund',
+ other: '{{count}} sekunder'
+ },
+
+ halfAMinute: 'ét halvt minut',
+
+ lessThanXMinutes: {
+ one: 'mindre end ét minut',
+ other: 'mindre end {{count}} minutter'
+ },
+
+ xMinutes: {
+ one: '1 minut',
+ other: '{{count}} minutter'
+ },
+
+ aboutXHours: {
+ one: 'cirka 1 time',
+ other: 'cirka {{count}} timer'
+ },
+
+ xHours: {
+ one: '1 time',
+ other: '{{count}} timer'
+ },
+
+ xDays: {
+ one: '1 dag',
+ other: '{{count}} dage'
+ },
+
+ aboutXWeeks: {
+ one: 'cirka 1 uge',
+ other: 'cirka {{count}} uger'
+ },
+
+ xWeeks: {
+ one: '1 uge',
+ other: '{{count}} uger'
+ },
+
+ aboutXMonths: {
+ one: 'cirka 1 måned',
+ other: 'cirka {{count}} måneder'
+ },
+
+ xMonths: {
+ one: '1 måned',
+ other: '{{count}} måneder'
+ },
+
+ aboutXYears: {
+ one: 'cirka 1 år',
+ other: 'cirka {{count}} år'
+ },
+
+ xYears: {
+ one: '1 år',
+ other: '{{count}} år'
+ },
+
+ overXYears: {
+ one: 'over 1 år',
+ other: 'over {{count}} år'
+ },
+
+ almostXYears: {
+ one: 'næsten 1 år',
+ other: 'næsten {{count}} år'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'om ' + result
+ } else {
+ return result + ' siden'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/da/_lib/formatLong/index.js b/date-fns/src/locale/da/_lib/formatLong/index.js
new file mode 100644
index 0000000..4544f5d
--- /dev/null
+++ b/date-fns/src/locale/da/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE 'den' d. MMMM y",
+ long: 'd. MMMM y',
+ medium: 'd. MMM y',
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'kl'. {{time}}",
+ long: "{{date}} 'kl'. {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/da/_lib/formatRelative/index.js b/date-fns/src/locale/da/_lib/formatRelative/index.js
new file mode 100644
index 0000000..85fab13
--- /dev/null
+++ b/date-fns/src/locale/da/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'sidste' eeee 'kl.' p",
+ yesterday: "'i går kl.' p",
+ today: "'i dag kl.' p",
+ tomorrow: "'i morgen kl.' p",
+ nextWeek: "'på' eeee 'kl.' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/da/_lib/localize/index.js b/date-fns/src/locale/da/_lib/localize/index.js
new file mode 100644
index 0000000..243315c
--- /dev/null
+++ b/date-fns/src/locale/da/_lib/localize/index.js
@@ -0,0 +1,162 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['fvt', 'vt'],
+ abbreviated: ['f.v.t.', 'v.t.'],
+ wide: ['før vesterlandsk tidsregning', 'vesterlandsk tidsregning']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1. kvt.', '2. kvt.', '3. kvt.', '4. kvt.'],
+ wide: ['1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mar.',
+ 'apr.',
+ 'maj',
+ 'jun.',
+ 'jul.',
+ 'aug.',
+ 'sep.',
+ 'okt.',
+ 'nov.',
+ 'dec.'
+ ],
+ wide: [
+ 'januar',
+ 'februar',
+ 'marts',
+ 'april',
+ 'maj',
+ 'juni',
+ 'juli',
+ 'august',
+ 'september',
+ 'oktober',
+ 'november',
+ 'december'
+ ]
+}
+
+// Note that 'Days - abbreviated - Formatting' has periods at the end.
+// https://www.unicode.org/cldr/charts/32/summary/da.html#1760
+// This makes grammatical sense in danish, as most abbreviations have periods.
+var dayValues = {
+ narrow: ['S', 'M', 'T', 'O', 'T', 'F', 'L'],
+ short: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'],
+ abbreviated: ['søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.'],
+ wide: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'midnat',
+ noon: 'middag',
+ morning: 'morgen',
+ afternoon: 'eftermiddag',
+ evening: 'aften',
+ night: 'nat'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'midnat',
+ noon: 'middag',
+ morning: 'morgen',
+ afternoon: 'eftermiddag',
+ evening: 'aften',
+ night: 'nat'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnat',
+ noon: 'middag',
+ morning: 'morgen',
+ afternoon: 'eftermiddag',
+ evening: 'aften',
+ night: 'nat'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'midnat',
+ noon: 'middag',
+ morning: 'om morgenen',
+ afternoon: 'om eftermiddagen',
+ evening: 'om aftenen',
+ night: 'om natten'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'midnat',
+ noon: 'middag',
+ morning: 'om morgenen',
+ afternoon: 'om eftermiddagen',
+ evening: 'om aftenen',
+ night: 'om natten'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnat',
+ noon: 'middag',
+ morning: 'om morgenen',
+ afternoon: 'om eftermiddagen',
+ evening: 'om aftenen',
+ night: 'om natten'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/da/_lib/match/index.js b/date-fns/src/locale/da/_lib/match/index.js
new file mode 100644
index 0000000..1972602
--- /dev/null
+++ b/date-fns/src/locale/da/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(\.)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(fKr|fvt|eKr|vt)/i,
+ abbreviated: /^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,
+ wide: /^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i
+}
+var parseEraPatterns = {
+ any: [/^f/i, /^(v|e)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]. kvt\./i,
+ wide: /^[1234]\.? kvartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
+ wide: /^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^maj/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smtofl]/i,
+ short: /^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,
+ abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
+ wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^t/i, /^o/i, /^t/i, /^f/i, /^l/i],
+ any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,
+ any: /^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /midnat/i,
+ noon: /middag/i,
+ morning: /morgen/i,
+ afternoon: /eftermiddag/i,
+ evening: /aften/i,
+ night: /nat/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+export default match
diff --git a/date-fns/src/locale/da/index.d.ts b/date-fns/src/locale/da/index.d.ts
new file mode 100644
index 0000000..1cd188a
--- /dev/null
+++ b/date-fns/src/locale/da/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { da } from 'date-fns/locale'
+export default da
diff --git a/date-fns/src/locale/da/index.js b/date-fns/src/locale/da/index.js
new file mode 100644
index 0000000..201c3d1
--- /dev/null
+++ b/date-fns/src/locale/da/index.js
@@ -0,0 +1,31 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Danish locale.
+ * @language Danish
+ * @iso-639-2 dan
+ * @author Mathias Wøbbe [@MathiasKandelborg]{@link https://github.com/MathiasKandelborg}
+ * @author Anders B. Hansen [@Andersbiha]{@link https://github.com/Andersbiha}
+ * @author [@kgram]{@link https://github.com/kgram}
+ * @author [@stefanbugge]{@link https://github.com/stefanbugge}
+ */
+var locale = {
+ code: 'da',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/da/index.js.flow b/date-fns/src/locale/da/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/da/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/da/snapshot.md b/date-fns/src/locale/da/snapshot.md
new file mode 100644
index 0000000..a73d4b8
--- /dev/null
+++ b/date-fns/src/locale/da/snapshot.md
@@ -0,0 +1,304 @@
+# Danish (da) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1. kvt. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvt. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. kvt. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvt. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | man. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fre. | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | man. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fre. | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | man. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fre. | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ma | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fr | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | man. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fre. | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ma | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fr | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | man. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fre. | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ma | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fr | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | man. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fre. | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ma | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | fr | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | om morgenen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | om eftermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | om aftenen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | om natten | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | om morgenen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | om eftermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | om aftenen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | om natten | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | om morgenen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | om eftermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | om aftenen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | om natten | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | om morgenen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | om eftermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | om aftenen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | om natten | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | om morgenen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | om eftermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | om aftenen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | om natten | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | onsdag den 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | søndag den 29. maj 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. feb. 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. februar 1987 kl. 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 kl. 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | onsdag den 11. februar 1987 kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | søndag den 29. maj 1453 kl. 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------- | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | cirka 6 år | cirka 6 år | om cirka 6 år |
+| 2005-01-01T00:00:00.000Z | cirka 5 år | cirka 5 år | om cirka 5 år |
+| 2004-01-01T00:00:00.000Z | cirka 4 år | cirka 4 år | om cirka 4 år |
+| 2003-01-01T00:00:00.000Z | cirka 3 år | cirka 3 år | om cirka 3 år |
+| 2002-01-01T00:00:00.000Z | cirka 2 år | cirka 2 år | om cirka 2 år |
+| 2001-06-01T00:00:00.000Z | over 1 år | over 1 år | om over 1 år |
+| 2001-02-01T00:00:00.000Z | cirka 1 år | cirka 1 år | om cirka 1 år |
+| 2001-01-01T00:00:00.000Z | cirka 1 år | cirka 1 år | om cirka 1 år |
+| 2000-06-01T00:00:00.000Z | 5 måneder | 5 måneder | om 5 måneder |
+| 2000-03-01T00:00:00.000Z | 2 måneder | 2 måneder | om 2 måneder |
+| 2000-02-01T00:00:00.000Z | cirka 1 måned | cirka 1 måned | om cirka 1 måned |
+| 2000-01-15T00:00:00.000Z | 14 dage | 14 dage | om 14 dage |
+| 2000-01-02T00:00:00.000Z | 1 dag | 1 dag | om 1 dag |
+| 2000-01-01T06:00:00.000Z | cirka 6 timer | cirka 6 timer | om cirka 6 timer |
+| 2000-01-01T01:00:00.000Z | cirka 1 time | cirka 1 time | om cirka 1 time |
+| 2000-01-01T00:45:00.000Z | cirka 1 time | cirka 1 time | om cirka 1 time |
+| 2000-01-01T00:30:00.000Z | 30 minutter | 30 minutter | om 30 minutter |
+| 2000-01-01T00:15:00.000Z | 15 minutter | 15 minutter | om 15 minutter |
+| 2000-01-01T00:01:00.000Z | 1 minut | 1 minut | om 1 minut |
+| 2000-01-01T00:00:25.000Z | mindre end ét minut | ét halvt minut | om mindre end ét minut |
+| 2000-01-01T00:00:15.000Z | mindre end ét minut | mindre end 20 sekunder | om mindre end ét minut |
+| 2000-01-01T00:00:05.000Z | mindre end ét minut | mindre end 10 sekunder | om mindre end ét minut |
+| 2000-01-01T00:00:00.000Z | mindre end ét minut | mindre end 5 sekunder | mindre end ét minut siden |
+| 1999-12-31T23:59:55.000Z | mindre end ét minut | mindre end 10 sekunder | mindre end ét minut siden |
+| 1999-12-31T23:59:45.000Z | mindre end ét minut | mindre end 20 sekunder | mindre end ét minut siden |
+| 1999-12-31T23:59:35.000Z | mindre end ét minut | ét halvt minut | mindre end ét minut siden |
+| 1999-12-31T23:59:00.000Z | 1 minut | 1 minut | 1 minut siden |
+| 1999-12-31T23:45:00.000Z | 15 minutter | 15 minutter | 15 minutter siden |
+| 1999-12-31T23:30:00.000Z | 30 minutter | 30 minutter | 30 minutter siden |
+| 1999-12-31T23:15:00.000Z | cirka 1 time | cirka 1 time | cirka 1 time siden |
+| 1999-12-31T23:00:00.000Z | cirka 1 time | cirka 1 time | cirka 1 time siden |
+| 1999-12-31T18:00:00.000Z | cirka 6 timer | cirka 6 timer | cirka 6 timer siden |
+| 1999-12-30T00:00:00.000Z | 2 dage | 2 dage | 2 dage siden |
+| 1999-12-15T00:00:00.000Z | 17 dage | 17 dage | 17 dage siden |
+| 1999-12-01T00:00:00.000Z | cirka 1 måned | cirka 1 måned | cirka 1 måned siden |
+| 1999-11-01T00:00:00.000Z | 2 måneder | 2 måneder | 2 måneder siden |
+| 1999-06-01T00:00:00.000Z | 7 måneder | 7 måneder | 7 måneder siden |
+| 1999-01-01T00:00:00.000Z | cirka 1 år | cirka 1 år | cirka 1 år siden |
+| 1998-12-01T00:00:00.000Z | cirka 1 år | cirka 1 år | cirka 1 år siden |
+| 1998-06-01T00:00:00.000Z | over 1 år | over 1 år | over 1 år siden |
+| 1998-01-01T00:00:00.000Z | cirka 2 år | cirka 2 år | cirka 2 år siden |
+| 1997-01-01T00:00:00.000Z | cirka 3 år | cirka 3 år | cirka 3 år siden |
+| 1996-01-01T00:00:00.000Z | cirka 4 år | cirka 4 år | cirka 4 år siden |
+| 1995-01-01T00:00:00.000Z | cirka 5 år | cirka 5 år | cirka 5 år siden |
+| 1994-01-01T00:00:00.000Z | cirka 6 år | cirka 6 år | cirka 6 år siden |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 år | om 6 år | 52608 timer |
+| 2005-01-01T00:00:00.000Z | 5 år | om 5 år | 43848 timer |
+| 2004-01-01T00:00:00.000Z | 4 år | om 4 år | 35064 timer |
+| 2003-01-01T00:00:00.000Z | 3 år | om 3 år | 26304 timer |
+| 2002-01-01T00:00:00.000Z | 2 år | om 2 år | 17544 timer |
+| 2001-06-01T00:00:00.000Z | 1 år | om 1 år | 12408 timer |
+| 2001-02-01T00:00:00.000Z | 1 år | om 1 år | 9528 timer |
+| 2001-01-01T00:00:00.000Z | 1 år | om 1 år | 8784 timer |
+| 2000-06-01T00:00:00.000Z | 5 måneder | om 5 måneder | 3648 timer |
+| 2000-03-01T00:00:00.000Z | 2 måneder | om 2 måneder | 1440 timer |
+| 2000-02-01T00:00:00.000Z | 1 måned | om 1 måned | 744 timer |
+| 2000-01-15T00:00:00.000Z | 14 dage | om 14 dage | 336 timer |
+| 2000-01-02T00:00:00.000Z | 1 dag | om 1 dag | 24 timer |
+| 2000-01-01T06:00:00.000Z | 6 timer | om 6 timer | 6 timer |
+| 2000-01-01T01:00:00.000Z | 1 time | om 1 time | 1 time |
+| 2000-01-01T00:45:00.000Z | 45 minutter | om 45 minutter | 1 time |
+| 2000-01-01T00:30:00.000Z | 30 minutter | om 30 minutter | 1 time |
+| 2000-01-01T00:15:00.000Z | 15 minutter | om 15 minutter | 0 timer |
+| 2000-01-01T00:01:00.000Z | 1 minut | om 1 minut | 0 timer |
+| 2000-01-01T00:00:25.000Z | 25 sekunder | om 25 sekunder | 0 timer |
+| 2000-01-01T00:00:15.000Z | 15 sekunder | om 15 sekunder | 0 timer |
+| 2000-01-01T00:00:05.000Z | 5 sekunder | om 5 sekunder | 0 timer |
+| 2000-01-01T00:00:00.000Z | 0 sekunder | 0 sekunder siden | 0 timer |
+| 1999-12-31T23:59:55.000Z | 5 sekunder | 5 sekunder siden | 0 timer |
+| 1999-12-31T23:59:45.000Z | 15 sekunder | 15 sekunder siden | 0 timer |
+| 1999-12-31T23:59:35.000Z | 25 sekunder | 25 sekunder siden | 0 timer |
+| 1999-12-31T23:59:00.000Z | 1 minut | 1 minut siden | 0 timer |
+| 1999-12-31T23:45:00.000Z | 15 minutter | 15 minutter siden | 0 timer |
+| 1999-12-31T23:30:00.000Z | 30 minutter | 30 minutter siden | 1 time |
+| 1999-12-31T23:15:00.000Z | 45 minutter | 45 minutter siden | 1 time |
+| 1999-12-31T23:00:00.000Z | 1 time | 1 time siden | 1 time |
+| 1999-12-31T18:00:00.000Z | 6 timer | 6 timer siden | 6 timer |
+| 1999-12-30T00:00:00.000Z | 2 dage | 2 dage siden | 48 timer |
+| 1999-12-15T00:00:00.000Z | 17 dage | 17 dage siden | 408 timer |
+| 1999-12-01T00:00:00.000Z | 1 måned | 1 måned siden | 744 timer |
+| 1999-11-01T00:00:00.000Z | 2 måneder | 2 måneder siden | 1464 timer |
+| 1999-06-01T00:00:00.000Z | 7 måneder | 7 måneder siden | 5136 timer |
+| 1999-01-01T00:00:00.000Z | 1 år | 1 år siden | 8760 timer |
+| 1998-12-01T00:00:00.000Z | 1 år | 1 år siden | 9504 timer |
+| 1998-06-01T00:00:00.000Z | 2 år | 2 år siden | 13896 timer |
+| 1998-01-01T00:00:00.000Z | 2 år | 2 år siden | 17520 timer |
+| 1997-01-01T00:00:00.000Z | 3 år | 3 år siden | 26280 timer |
+| 1996-01-01T00:00:00.000Z | 4 år | 4 år siden | 35064 timer |
+| 1995-01-01T00:00:00.000Z | 5 år | 5 år siden | 43824 timer |
+| 1994-01-01T00:00:00.000Z | 6 år | 6 år siden | 52584 timer |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | på onsdag kl. 00:00 |
+| 2000-01-02T00:00:00.000Z | i morgen kl. 00:00 |
+| 2000-01-01T00:00:00.000Z | i dag kl. 00:00 |
+| 1999-12-31T00:00:00.000Z | i går kl. 00:00 |
+| 1999-12-27T00:00:00.000Z | sidste mandag kl. 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/de-AT/_lib/localize/index.js b/date-fns/src/locale/de-AT/_lib/localize/index.js
new file mode 100644
index 0000000..2a7b0ff
--- /dev/null
+++ b/date-fns/src/locale/de-AT/_lib/localize/index.js
@@ -0,0 +1,172 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['v.Chr.', 'n.Chr.'],
+ abbreviated: ['v.Chr.', 'n.Chr.'],
+ wide: ['vor Christus', 'nach Christus'],
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal'],
+}
+
+// Note: in German, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jän',
+ 'Feb',
+ 'Mär',
+ 'Apr',
+ 'Mai',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Okt',
+ 'Nov',
+ 'Dez',
+ ],
+ wide: [
+ 'Jänner',
+ 'Februar',
+ 'März',
+ 'April',
+ 'Mai',
+ 'Juni',
+ 'Juli',
+ 'August',
+ 'September',
+ 'Oktober',
+ 'November',
+ 'Dezember',
+ ],
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
+ short: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+ abbreviated: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
+ wide: [
+ 'Sonntag',
+ 'Montag',
+ 'Dienstag',
+ 'Mittwoch',
+ 'Donnerstag',
+ 'Freitag',
+ 'Samstag',
+ ],
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/de.html#1881
+var dayPeriodValues = {
+ narrow: {
+ am: 'vm.',
+ pm: 'nm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'Morgen',
+ afternoon: 'Nachm.',
+ evening: 'Abend',
+ night: 'Nacht',
+ },
+ abbreviated: {
+ am: 'vorm.',
+ pm: 'nachm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'Morgen',
+ afternoon: 'Nachmittag',
+ evening: 'Abend',
+ night: 'Nacht',
+ },
+ wide: {
+ am: 'vormittags',
+ pm: 'nachmittags',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'Morgen',
+ afternoon: 'Nachmittag',
+ evening: 'Abend',
+ night: 'Nacht',
+ },
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'vm.',
+ pm: 'nm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'morgens',
+ afternoon: 'nachm.',
+ evening: 'abends',
+ night: 'nachts',
+ },
+ abbreviated: {
+ am: 'vorm.',
+ pm: 'nachm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'morgens',
+ afternoon: 'nachmittags',
+ evening: 'abends',
+ night: 'nachts',
+ },
+ wide: {
+ am: 'vormittags',
+ pm: 'nachmittags',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'morgens',
+ afternoon: 'nachmittags',
+ evening: 'abends',
+ night: 'nachts',
+ },
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide',
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function (quarter) {
+ return Number(quarter) - 1
+ },
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide',
+ }),
+}
+
+export default localize
diff --git a/date-fns/src/locale/de-AT/index.d.ts b/date-fns/src/locale/de-AT/index.d.ts
new file mode 100644
index 0000000..a7d6680
--- /dev/null
+++ b/date-fns/src/locale/de-AT/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { deAT } from 'date-fns/locale'
+export default deAT
diff --git a/date-fns/src/locale/de-AT/index.js b/date-fns/src/locale/de-AT/index.js
new file mode 100644
index 0000000..2e3f440
--- /dev/null
+++ b/date-fns/src/locale/de-AT/index.js
@@ -0,0 +1,29 @@
+import formatDistance from '../de/_lib/formatDistance/index'
+import formatLong from '../de/_lib/formatLong/index'
+import formatRelative from '../de/_lib/formatRelative/index'
+import match from '../de/_lib/match/index'
+// difference to 'de' locale
+import localize from './_lib/localize/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary German locale (Austria).
+ * @language German
+ * @iso-639-2 deu
+ * @author Christoph Tobias Stenglein [@cstenglein]{@link https://github.com/cstenglein}
+ */
+var locale = {
+ code: 'de-AT',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4,
+ },
+}
+
+export default locale
diff --git a/date-fns/src/locale/de-AT/index.js.flow b/date-fns/src/locale/de-AT/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/de-AT/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/de-AT/snapshot.md b/date-fns/src/locale/de-AT/snapshot.md
new file mode 100644
index 0000000..b0fb2f1
--- /dev/null
+++ b/date-fns/src/locale/de-AT/snapshot.md
@@ -0,0 +1,304 @@
+# German (de-AT) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. Quartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. Quartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. Quartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. Quartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. Feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai. 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. Februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Mittwoch, 11. Februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sonntag, 29. Mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. Feb. 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai. 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. Februar 1987 um 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai 1453 um 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Mittwoch, 11. Februar 1987 um 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sonntag, 29. Mai 1453 um 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------------- | ----------------------- | ---------------------------- |
+| 2006-01-01T00:00:00.000Z | etwa 6 Jahre | etwa 6 Jahre | in etwa 6 Jahren |
+| 2005-01-01T00:00:00.000Z | etwa 5 Jahre | etwa 5 Jahre | in etwa 5 Jahren |
+| 2004-01-01T00:00:00.000Z | etwa 4 Jahre | etwa 4 Jahre | in etwa 4 Jahren |
+| 2003-01-01T00:00:00.000Z | etwa 3 Jahre | etwa 3 Jahre | in etwa 3 Jahren |
+| 2002-01-01T00:00:00.000Z | etwa 2 Jahre | etwa 2 Jahre | in etwa 2 Jahren |
+| 2001-06-01T00:00:00.000Z | mehr als ein Jahr | mehr als ein Jahr | in mehr als einem Jahr |
+| 2001-02-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | in etwa einem Jahr |
+| 2001-01-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | in etwa einem Jahr |
+| 2000-06-01T00:00:00.000Z | 5 Monate | 5 Monate | in 5 Monaten |
+| 2000-03-01T00:00:00.000Z | 2 Monate | 2 Monate | in 2 Monaten |
+| 2000-02-01T00:00:00.000Z | etwa ein Monat | etwa ein Monat | in etwa einem Monat |
+| 2000-01-15T00:00:00.000Z | 14 Tage | 14 Tage | in 14 Tagen |
+| 2000-01-02T00:00:00.000Z | ein Tag | ein Tag | in einem Tag |
+| 2000-01-01T06:00:00.000Z | etwa 6 Stunden | etwa 6 Stunden | in etwa 6 Stunden |
+| 2000-01-01T01:00:00.000Z | etwa eine Stunde | etwa eine Stunde | in etwa einer Stunde |
+| 2000-01-01T00:45:00.000Z | etwa eine Stunde | etwa eine Stunde | in etwa einer Stunde |
+| 2000-01-01T00:30:00.000Z | 30 Minuten | 30 Minuten | in 30 Minuten |
+| 2000-01-01T00:15:00.000Z | 15 Minuten | 15 Minuten | in 15 Minuten |
+| 2000-01-01T00:01:00.000Z | eine Minute | eine Minute | in einer Minute |
+| 2000-01-01T00:00:25.000Z | weniger als eine Minute | eine halbe Minute | in weniger als einer Minute |
+| 2000-01-01T00:00:15.000Z | weniger als eine Minute | weniger als 20 Sekunden | in weniger als einer Minute |
+| 2000-01-01T00:00:05.000Z | weniger als eine Minute | weniger als 10 Sekunden | in weniger als einer Minute |
+| 2000-01-01T00:00:00.000Z | weniger als eine Minute | weniger als 5 Sekunden | vor weniger als einer Minute |
+| 1999-12-31T23:59:55.000Z | weniger als eine Minute | weniger als 10 Sekunden | vor weniger als einer Minute |
+| 1999-12-31T23:59:45.000Z | weniger als eine Minute | weniger als 20 Sekunden | vor weniger als einer Minute |
+| 1999-12-31T23:59:35.000Z | weniger als eine Minute | eine halbe Minute | vor weniger als einer Minute |
+| 1999-12-31T23:59:00.000Z | eine Minute | eine Minute | vor einer Minute |
+| 1999-12-31T23:45:00.000Z | 15 Minuten | 15 Minuten | vor 15 Minuten |
+| 1999-12-31T23:30:00.000Z | 30 Minuten | 30 Minuten | vor 30 Minuten |
+| 1999-12-31T23:15:00.000Z | etwa eine Stunde | etwa eine Stunde | vor etwa einer Stunde |
+| 1999-12-31T23:00:00.000Z | etwa eine Stunde | etwa eine Stunde | vor etwa einer Stunde |
+| 1999-12-31T18:00:00.000Z | etwa 6 Stunden | etwa 6 Stunden | vor etwa 6 Stunden |
+| 1999-12-30T00:00:00.000Z | 2 Tage | 2 Tage | vor 2 Tagen |
+| 1999-12-15T00:00:00.000Z | 17 Tage | 17 Tage | vor 17 Tagen |
+| 1999-12-01T00:00:00.000Z | etwa ein Monat | etwa ein Monat | vor etwa einem Monat |
+| 1999-11-01T00:00:00.000Z | 2 Monate | 2 Monate | vor 2 Monaten |
+| 1999-06-01T00:00:00.000Z | 7 Monate | 7 Monate | vor 7 Monaten |
+| 1999-01-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | vor etwa einem Jahr |
+| 1998-12-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | vor etwa einem Jahr |
+| 1998-06-01T00:00:00.000Z | mehr als ein Jahr | mehr als ein Jahr | vor mehr als einem Jahr |
+| 1998-01-01T00:00:00.000Z | etwa 2 Jahre | etwa 2 Jahre | vor etwa 2 Jahren |
+| 1997-01-01T00:00:00.000Z | etwa 3 Jahre | etwa 3 Jahre | vor etwa 3 Jahren |
+| 1996-01-01T00:00:00.000Z | etwa 4 Jahre | etwa 4 Jahre | vor etwa 4 Jahren |
+| 1995-01-01T00:00:00.000Z | etwa 5 Jahre | etwa 5 Jahre | vor etwa 5 Jahren |
+| 1994-01-01T00:00:00.000Z | etwa 6 Jahre | etwa 6 Jahre | vor etwa 6 Jahren |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 Jahre | in 6 Jahren | 52608 Stunden |
+| 2005-01-01T00:00:00.000Z | 5 Jahre | in 5 Jahren | 43848 Stunden |
+| 2004-01-01T00:00:00.000Z | 4 Jahre | in 4 Jahren | 35064 Stunden |
+| 2003-01-01T00:00:00.000Z | 3 Jahre | in 3 Jahren | 26304 Stunden |
+| 2002-01-01T00:00:00.000Z | 2 Jahre | in 2 Jahren | 17544 Stunden |
+| 2001-06-01T00:00:00.000Z | ein Jahr | in einem Jahr | 12408 Stunden |
+| 2001-02-01T00:00:00.000Z | ein Jahr | in einem Jahr | 9528 Stunden |
+| 2001-01-01T00:00:00.000Z | ein Jahr | in einem Jahr | 8784 Stunden |
+| 2000-06-01T00:00:00.000Z | 5 Monate | in 5 Monaten | 3648 Stunden |
+| 2000-03-01T00:00:00.000Z | 2 Monate | in 2 Monaten | 1440 Stunden |
+| 2000-02-01T00:00:00.000Z | ein Monat | in einem Monat | 744 Stunden |
+| 2000-01-15T00:00:00.000Z | 14 Tage | in 14 Tagen | 336 Stunden |
+| 2000-01-02T00:00:00.000Z | ein Tag | in einem Tag | 24 Stunden |
+| 2000-01-01T06:00:00.000Z | 6 Stunden | in 6 Stunden | 6 Stunden |
+| 2000-01-01T01:00:00.000Z | eine Stunde | in einer Stunde | eine Stunde |
+| 2000-01-01T00:45:00.000Z | 45 Minuten | in 45 Minuten | eine Stunde |
+| 2000-01-01T00:30:00.000Z | 30 Minuten | in 30 Minuten | eine Stunde |
+| 2000-01-01T00:15:00.000Z | 15 Minuten | in 15 Minuten | 0 Stunden |
+| 2000-01-01T00:01:00.000Z | eine Minute | in einer Minute | 0 Stunden |
+| 2000-01-01T00:00:25.000Z | 25 Sekunden | in 25 Sekunden | 0 Stunden |
+| 2000-01-01T00:00:15.000Z | 15 Sekunden | in 15 Sekunden | 0 Stunden |
+| 2000-01-01T00:00:05.000Z | 5 Sekunden | in 5 Sekunden | 0 Stunden |
+| 2000-01-01T00:00:00.000Z | 0 Sekunden | vor 0 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:55.000Z | 5 Sekunden | vor 5 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:45.000Z | 15 Sekunden | vor 15 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:35.000Z | 25 Sekunden | vor 25 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:00.000Z | eine Minute | vor einer Minute | 0 Stunden |
+| 1999-12-31T23:45:00.000Z | 15 Minuten | vor 15 Minuten | 0 Stunden |
+| 1999-12-31T23:30:00.000Z | 30 Minuten | vor 30 Minuten | eine Stunde |
+| 1999-12-31T23:15:00.000Z | 45 Minuten | vor 45 Minuten | eine Stunde |
+| 1999-12-31T23:00:00.000Z | eine Stunde | vor einer Stunde | eine Stunde |
+| 1999-12-31T18:00:00.000Z | 6 Stunden | vor 6 Stunden | 6 Stunden |
+| 1999-12-30T00:00:00.000Z | 2 Tage | vor 2 Tagen | 48 Stunden |
+| 1999-12-15T00:00:00.000Z | 17 Tage | vor 17 Tagen | 408 Stunden |
+| 1999-12-01T00:00:00.000Z | ein Monat | vor einem Monat | 744 Stunden |
+| 1999-11-01T00:00:00.000Z | 2 Monate | vor 2 Monaten | 1464 Stunden |
+| 1999-06-01T00:00:00.000Z | 7 Monate | vor 7 Monaten | 5136 Stunden |
+| 1999-01-01T00:00:00.000Z | ein Jahr | vor einem Jahr | 8760 Stunden |
+| 1998-12-01T00:00:00.000Z | ein Jahr | vor einem Jahr | 9504 Stunden |
+| 1998-06-01T00:00:00.000Z | 2 Jahre | vor 2 Jahren | 13896 Stunden |
+| 1998-01-01T00:00:00.000Z | 2 Jahre | vor 2 Jahren | 17520 Stunden |
+| 1997-01-01T00:00:00.000Z | 3 Jahre | vor 3 Jahren | 26280 Stunden |
+| 1996-01-01T00:00:00.000Z | 4 Jahre | vor 4 Jahren | 35064 Stunden |
+| 1995-01-01T00:00:00.000Z | 5 Jahre | vor 5 Jahren | 43824 Stunden |
+| 1994-01-01T00:00:00.000Z | 6 Jahre | vor 6 Jahren | 52584 Stunden |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | Mittwoch um 00:00 |
+| 2000-01-02T00:00:00.000Z | morgen um 00:00 |
+| 2000-01-01T00:00:00.000Z | heute um 00:00 |
+| 1999-12-31T00:00:00.000Z | gestern um 00:00 |
+| 1999-12-27T00:00:00.000Z | letzten Montag um 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/de/_lib/formatDistance/index.js b/date-fns/src/locale/de/_lib/formatDistance/index.js
new file mode 100644
index 0000000..f1a1fc7
--- /dev/null
+++ b/date-fns/src/locale/de/_lib/formatDistance/index.js
@@ -0,0 +1,198 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ standalone: {
+ one: 'weniger als eine Sekunde',
+ other: 'weniger als {{count}} Sekunden'
+ },
+ withPreposition: {
+ one: 'weniger als einer Sekunde',
+ other: 'weniger als {{count}} Sekunden'
+ }
+ },
+
+ xSeconds: {
+ standalone: {
+ one: 'eine Sekunde',
+ other: '{{count}} Sekunden'
+ },
+ withPreposition: {
+ one: 'einer Sekunde',
+ other: '{{count}} Sekunden'
+ }
+ },
+
+ halfAMinute: {
+ standalone: 'eine halbe Minute',
+ withPreposition: 'einer halben Minute'
+ },
+
+ lessThanXMinutes: {
+ standalone: {
+ one: 'weniger als eine Minute',
+ other: 'weniger als {{count}} Minuten'
+ },
+ withPreposition: {
+ one: 'weniger als einer Minute',
+ other: 'weniger als {{count}} Minuten'
+ }
+ },
+
+ xMinutes: {
+ standalone: {
+ one: 'eine Minute',
+ other: '{{count}} Minuten'
+ },
+ withPreposition: {
+ one: 'einer Minute',
+ other: '{{count}} Minuten'
+ }
+ },
+
+ aboutXHours: {
+ standalone: {
+ one: 'etwa eine Stunde',
+ other: 'etwa {{count}} Stunden'
+ },
+ withPreposition: {
+ one: 'etwa einer Stunde',
+ other: 'etwa {{count}} Stunden'
+ }
+ },
+
+ xHours: {
+ standalone: {
+ one: 'eine Stunde',
+ other: '{{count}} Stunden'
+ },
+ withPreposition: {
+ one: 'einer Stunde',
+ other: '{{count}} Stunden'
+ }
+ },
+
+ xDays: {
+ standalone: {
+ one: 'ein Tag',
+ other: '{{count}} Tage'
+ },
+ withPreposition: {
+ one: 'einem Tag',
+ other: '{{count}} Tagen'
+ }
+ },
+
+ aboutXWeeks: {
+ standalone: {
+ one: 'etwa ein Woche',
+ other: 'etwa {{count}} Wochen'
+ },
+ withPreposition: {
+ one: 'etwa einem Woche',
+ other: 'etwa {{count}} Wochen'
+ }
+ },
+
+ xWeeks: {
+ standalone: {
+ one: 'ein Woche',
+ other: '{{count}} Wochen'
+ },
+ withPreposition: {
+ one: 'einem Woche',
+ other: '{{count}} Wochen'
+ }
+ },
+
+ aboutXMonths: {
+ standalone: {
+ one: 'etwa ein Monat',
+ other: 'etwa {{count}} Monate'
+ },
+ withPreposition: {
+ one: 'etwa einem Monat',
+ other: 'etwa {{count}} Monaten'
+ }
+ },
+
+ xMonths: {
+ standalone: {
+ one: 'ein Monat',
+ other: '{{count}} Monate'
+ },
+ withPreposition: {
+ one: 'einem Monat',
+ other: '{{count}} Monaten'
+ }
+ },
+
+ aboutXYears: {
+ standalone: {
+ one: 'etwa ein Jahr',
+ other: 'etwa {{count}} Jahre'
+ },
+ withPreposition: {
+ one: 'etwa einem Jahr',
+ other: 'etwa {{count}} Jahren'
+ }
+ },
+
+ xYears: {
+ standalone: {
+ one: 'ein Jahr',
+ other: '{{count}} Jahre'
+ },
+ withPreposition: {
+ one: 'einem Jahr',
+ other: '{{count}} Jahren'
+ }
+ },
+
+ overXYears: {
+ standalone: {
+ one: 'mehr als ein Jahr',
+ other: 'mehr als {{count}} Jahre'
+ },
+ withPreposition: {
+ one: 'mehr als einem Jahr',
+ other: 'mehr als {{count}} Jahren'
+ }
+ },
+
+ almostXYears: {
+ standalone: {
+ one: 'fast ein Jahr',
+ other: 'fast {{count}} Jahre'
+ },
+ withPreposition: {
+ one: 'fast einem Jahr',
+ other: 'fast {{count}} Jahren'
+ }
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var usageGroup = options.addSuffix
+ ? formatDistanceLocale[token].withPreposition
+ : formatDistanceLocale[token].standalone
+
+ var result
+ if (typeof usageGroup === 'string') {
+ result = usageGroup
+ } else if (count === 1) {
+ result = usageGroup.one
+ } else {
+ result = usageGroup.other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'in ' + result
+ } else {
+ return 'vor ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/de/_lib/formatLong/index.js b/date-fns/src/locale/de/_lib/formatLong/index.js
new file mode 100644
index 0000000..2cd721e
--- /dev/null
+++ b/date-fns/src/locale/de/_lib/formatLong/index.js
@@ -0,0 +1,42 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+// DIN 5008: https://de.wikipedia.org/wiki/Datumsformat#DIN_5008
+var dateFormats = {
+ full: 'EEEE, do MMMM y', // Montag, 7. Januar 2018
+ long: 'do MMMM y', // 7. Januar 2018
+ medium: 'do MMM. y', // 7. Jan. 2018
+ short: 'dd.MM.y' // 07.01.2018
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'um' {{time}}",
+ long: "{{date}} 'um' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/de/_lib/formatRelative/index.js b/date-fns/src/locale/de/_lib/formatRelative/index.js
new file mode 100644
index 0000000..aa46933
--- /dev/null
+++ b/date-fns/src/locale/de/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'letzten' eeee 'um' p",
+ yesterday: "'gestern um' p",
+ today: "'heute um' p",
+ tomorrow: "'morgen um' p",
+ nextWeek: "eeee 'um' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/de/_lib/localize/index.js b/date-fns/src/locale/de/_lib/localize/index.js
new file mode 100644
index 0000000..cdafe27
--- /dev/null
+++ b/date-fns/src/locale/de/_lib/localize/index.js
@@ -0,0 +1,172 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['v.Chr.', 'n.Chr.'],
+ abbreviated: ['v.Chr.', 'n.Chr.'],
+ wide: ['vor Christus', 'nach Christus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal']
+}
+
+// Note: in German, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Feb',
+ 'Mär',
+ 'Apr',
+ 'Mai',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Okt',
+ 'Nov',
+ 'Dez'
+ ],
+ wide: [
+ 'Januar',
+ 'Februar',
+ 'März',
+ 'April',
+ 'Mai',
+ 'Juni',
+ 'Juli',
+ 'August',
+ 'September',
+ 'Oktober',
+ 'November',
+ 'Dezember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
+ short: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
+ abbreviated: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
+ wide: [
+ 'Sonntag',
+ 'Montag',
+ 'Dienstag',
+ 'Mittwoch',
+ 'Donnerstag',
+ 'Freitag',
+ 'Samstag'
+ ]
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/de.html#1881
+var dayPeriodValues = {
+ narrow: {
+ am: 'vm.',
+ pm: 'nm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'Morgen',
+ afternoon: 'Nachm.',
+ evening: 'Abend',
+ night: 'Nacht'
+ },
+ abbreviated: {
+ am: 'vorm.',
+ pm: 'nachm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'Morgen',
+ afternoon: 'Nachmittag',
+ evening: 'Abend',
+ night: 'Nacht'
+ },
+ wide: {
+ am: 'vormittags',
+ pm: 'nachmittags',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'Morgen',
+ afternoon: 'Nachmittag',
+ evening: 'Abend',
+ night: 'Nacht'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'vm.',
+ pm: 'nm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'morgens',
+ afternoon: 'nachm.',
+ evening: 'abends',
+ night: 'nachts'
+ },
+ abbreviated: {
+ am: 'vorm.',
+ pm: 'nachm.',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'morgens',
+ afternoon: 'nachmittags',
+ evening: 'abends',
+ night: 'nachts'
+ },
+ wide: {
+ am: 'vormittags',
+ pm: 'nachmittags',
+ midnight: 'Mitternacht',
+ noon: 'Mittag',
+ morning: 'morgens',
+ afternoon: 'nachmittags',
+ evening: 'abends',
+ night: 'nachts'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/de/_lib/match/index.js b/date-fns/src/locale/de/_lib/match/index.js
new file mode 100644
index 0000000..5f5df3c
--- /dev/null
+++ b/date-fns/src/locale/de/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(\.)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
+ abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
+ wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
+}
+var parseEraPatterns = {
+ any: [/^v/i, /^n/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](\.)? Quartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mär|apr|mai|jun|jul|aug|sep|okt|nov|dez)/i,
+ wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mär/i,
+ /^ap/i,
+ /^mai/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smdmf]/i,
+ short: /^(so|mo|di|mi|do|fr|sa)/i,
+ abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
+ wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
+}
+var parseDayPatterns = {
+ any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
+ abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
+ wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^v/i,
+ pm: /^n/i,
+ midnight: /^Mitte/i,
+ noon: /^Mitta/i,
+ morning: /morgens/i,
+ afternoon: /nachmittags/i, // will never be matched. Afternoon is matched by `pm`
+ evening: /abends/i,
+ night: /nachts/i // will never be matched. Night is matched by `pm`
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/de/index.d.ts b/date-fns/src/locale/de/index.d.ts
new file mode 100644
index 0000000..ef552da
--- /dev/null
+++ b/date-fns/src/locale/de/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { de } from 'date-fns/locale'
+export default de
diff --git a/date-fns/src/locale/de/index.js b/date-fns/src/locale/de/index.js
new file mode 100644
index 0000000..f2ea556
--- /dev/null
+++ b/date-fns/src/locale/de/index.js
@@ -0,0 +1,32 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary German locale.
+ * @language German
+ * @iso-639-2 deu
+ * @author Thomas Eilmsteiner [@DeMuu]{@link https://github.com/DeMuu}
+ * @author Asia [@asia-t]{@link https://github.com/asia-t}
+ * @author Van Vuong Ngo [@vanvuongngo]{@link https://github.com/vanvuongngo}
+ * @author RomanErnst [@pex]{@link https://github.com/pex}
+ * @author Philipp Keck [@Philipp91]{@link https://github.com/Philipp91}
+ */
+var locale = {
+ code: 'de',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/de/index.js.flow b/date-fns/src/locale/de/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/de/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/de/snapshot.md b/date-fns/src/locale/de/snapshot.md
new file mode 100644
index 0000000..9264122
--- /dev/null
+++ b/date-fns/src/locale/de/snapshot.md
@@ -0,0 +1,304 @@
+# German (de) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. Quartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. Quartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. Quartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. Quartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Montag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freitag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vorm. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vormittags | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | vm. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachmittags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | morgens | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nachm. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | abends | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nachts | 2019-02-11T12:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. Feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai. 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. Februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Mittwoch, 11. Februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sonntag, 29. Mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. Feb. 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai. 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. Februar 1987 um 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. Mai 1453 um 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Mittwoch, 11. Februar 1987 um 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sonntag, 29. Mai 1453 um 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------------- | ----------------------- | ---------------------------- |
+| 2006-01-01T00:00:00.000Z | etwa 6 Jahre | etwa 6 Jahre | in etwa 6 Jahren |
+| 2005-01-01T00:00:00.000Z | etwa 5 Jahre | etwa 5 Jahre | in etwa 5 Jahren |
+| 2004-01-01T00:00:00.000Z | etwa 4 Jahre | etwa 4 Jahre | in etwa 4 Jahren |
+| 2003-01-01T00:00:00.000Z | etwa 3 Jahre | etwa 3 Jahre | in etwa 3 Jahren |
+| 2002-01-01T00:00:00.000Z | etwa 2 Jahre | etwa 2 Jahre | in etwa 2 Jahren |
+| 2001-06-01T00:00:00.000Z | mehr als ein Jahr | mehr als ein Jahr | in mehr als einem Jahr |
+| 2001-02-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | in etwa einem Jahr |
+| 2001-01-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | in etwa einem Jahr |
+| 2000-06-01T00:00:00.000Z | 5 Monate | 5 Monate | in 5 Monaten |
+| 2000-03-01T00:00:00.000Z | 2 Monate | 2 Monate | in 2 Monaten |
+| 2000-02-01T00:00:00.000Z | etwa ein Monat | etwa ein Monat | in etwa einem Monat |
+| 2000-01-15T00:00:00.000Z | 14 Tage | 14 Tage | in 14 Tagen |
+| 2000-01-02T00:00:00.000Z | ein Tag | ein Tag | in einem Tag |
+| 2000-01-01T06:00:00.000Z | etwa 6 Stunden | etwa 6 Stunden | in etwa 6 Stunden |
+| 2000-01-01T01:00:00.000Z | etwa eine Stunde | etwa eine Stunde | in etwa einer Stunde |
+| 2000-01-01T00:45:00.000Z | etwa eine Stunde | etwa eine Stunde | in etwa einer Stunde |
+| 2000-01-01T00:30:00.000Z | 30 Minuten | 30 Minuten | in 30 Minuten |
+| 2000-01-01T00:15:00.000Z | 15 Minuten | 15 Minuten | in 15 Minuten |
+| 2000-01-01T00:01:00.000Z | eine Minute | eine Minute | in einer Minute |
+| 2000-01-01T00:00:25.000Z | weniger als eine Minute | eine halbe Minute | in weniger als einer Minute |
+| 2000-01-01T00:00:15.000Z | weniger als eine Minute | weniger als 20 Sekunden | in weniger als einer Minute |
+| 2000-01-01T00:00:05.000Z | weniger als eine Minute | weniger als 10 Sekunden | in weniger als einer Minute |
+| 2000-01-01T00:00:00.000Z | weniger als eine Minute | weniger als 5 Sekunden | vor weniger als einer Minute |
+| 1999-12-31T23:59:55.000Z | weniger als eine Minute | weniger als 10 Sekunden | vor weniger als einer Minute |
+| 1999-12-31T23:59:45.000Z | weniger als eine Minute | weniger als 20 Sekunden | vor weniger als einer Minute |
+| 1999-12-31T23:59:35.000Z | weniger als eine Minute | eine halbe Minute | vor weniger als einer Minute |
+| 1999-12-31T23:59:00.000Z | eine Minute | eine Minute | vor einer Minute |
+| 1999-12-31T23:45:00.000Z | 15 Minuten | 15 Minuten | vor 15 Minuten |
+| 1999-12-31T23:30:00.000Z | 30 Minuten | 30 Minuten | vor 30 Minuten |
+| 1999-12-31T23:15:00.000Z | etwa eine Stunde | etwa eine Stunde | vor etwa einer Stunde |
+| 1999-12-31T23:00:00.000Z | etwa eine Stunde | etwa eine Stunde | vor etwa einer Stunde |
+| 1999-12-31T18:00:00.000Z | etwa 6 Stunden | etwa 6 Stunden | vor etwa 6 Stunden |
+| 1999-12-30T00:00:00.000Z | 2 Tage | 2 Tage | vor 2 Tagen |
+| 1999-12-15T00:00:00.000Z | 17 Tage | 17 Tage | vor 17 Tagen |
+| 1999-12-01T00:00:00.000Z | etwa ein Monat | etwa ein Monat | vor etwa einem Monat |
+| 1999-11-01T00:00:00.000Z | 2 Monate | 2 Monate | vor 2 Monaten |
+| 1999-06-01T00:00:00.000Z | 7 Monate | 7 Monate | vor 7 Monaten |
+| 1999-01-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | vor etwa einem Jahr |
+| 1998-12-01T00:00:00.000Z | etwa ein Jahr | etwa ein Jahr | vor etwa einem Jahr |
+| 1998-06-01T00:00:00.000Z | mehr als ein Jahr | mehr als ein Jahr | vor mehr als einem Jahr |
+| 1998-01-01T00:00:00.000Z | etwa 2 Jahre | etwa 2 Jahre | vor etwa 2 Jahren |
+| 1997-01-01T00:00:00.000Z | etwa 3 Jahre | etwa 3 Jahre | vor etwa 3 Jahren |
+| 1996-01-01T00:00:00.000Z | etwa 4 Jahre | etwa 4 Jahre | vor etwa 4 Jahren |
+| 1995-01-01T00:00:00.000Z | etwa 5 Jahre | etwa 5 Jahre | vor etwa 5 Jahren |
+| 1994-01-01T00:00:00.000Z | etwa 6 Jahre | etwa 6 Jahre | vor etwa 6 Jahren |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 Jahre | in 6 Jahren | 52608 Stunden |
+| 2005-01-01T00:00:00.000Z | 5 Jahre | in 5 Jahren | 43848 Stunden |
+| 2004-01-01T00:00:00.000Z | 4 Jahre | in 4 Jahren | 35064 Stunden |
+| 2003-01-01T00:00:00.000Z | 3 Jahre | in 3 Jahren | 26304 Stunden |
+| 2002-01-01T00:00:00.000Z | 2 Jahre | in 2 Jahren | 17544 Stunden |
+| 2001-06-01T00:00:00.000Z | ein Jahr | in einem Jahr | 12408 Stunden |
+| 2001-02-01T00:00:00.000Z | ein Jahr | in einem Jahr | 9528 Stunden |
+| 2001-01-01T00:00:00.000Z | ein Jahr | in einem Jahr | 8784 Stunden |
+| 2000-06-01T00:00:00.000Z | 5 Monate | in 5 Monaten | 3648 Stunden |
+| 2000-03-01T00:00:00.000Z | 2 Monate | in 2 Monaten | 1440 Stunden |
+| 2000-02-01T00:00:00.000Z | ein Monat | in einem Monat | 744 Stunden |
+| 2000-01-15T00:00:00.000Z | 14 Tage | in 14 Tagen | 336 Stunden |
+| 2000-01-02T00:00:00.000Z | ein Tag | in einem Tag | 24 Stunden |
+| 2000-01-01T06:00:00.000Z | 6 Stunden | in 6 Stunden | 6 Stunden |
+| 2000-01-01T01:00:00.000Z | eine Stunde | in einer Stunde | eine Stunde |
+| 2000-01-01T00:45:00.000Z | 45 Minuten | in 45 Minuten | eine Stunde |
+| 2000-01-01T00:30:00.000Z | 30 Minuten | in 30 Minuten | eine Stunde |
+| 2000-01-01T00:15:00.000Z | 15 Minuten | in 15 Minuten | 0 Stunden |
+| 2000-01-01T00:01:00.000Z | eine Minute | in einer Minute | 0 Stunden |
+| 2000-01-01T00:00:25.000Z | 25 Sekunden | in 25 Sekunden | 0 Stunden |
+| 2000-01-01T00:00:15.000Z | 15 Sekunden | in 15 Sekunden | 0 Stunden |
+| 2000-01-01T00:00:05.000Z | 5 Sekunden | in 5 Sekunden | 0 Stunden |
+| 2000-01-01T00:00:00.000Z | 0 Sekunden | vor 0 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:55.000Z | 5 Sekunden | vor 5 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:45.000Z | 15 Sekunden | vor 15 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:35.000Z | 25 Sekunden | vor 25 Sekunden | 0 Stunden |
+| 1999-12-31T23:59:00.000Z | eine Minute | vor einer Minute | 0 Stunden |
+| 1999-12-31T23:45:00.000Z | 15 Minuten | vor 15 Minuten | 0 Stunden |
+| 1999-12-31T23:30:00.000Z | 30 Minuten | vor 30 Minuten | eine Stunde |
+| 1999-12-31T23:15:00.000Z | 45 Minuten | vor 45 Minuten | eine Stunde |
+| 1999-12-31T23:00:00.000Z | eine Stunde | vor einer Stunde | eine Stunde |
+| 1999-12-31T18:00:00.000Z | 6 Stunden | vor 6 Stunden | 6 Stunden |
+| 1999-12-30T00:00:00.000Z | 2 Tage | vor 2 Tagen | 48 Stunden |
+| 1999-12-15T00:00:00.000Z | 17 Tage | vor 17 Tagen | 408 Stunden |
+| 1999-12-01T00:00:00.000Z | ein Monat | vor einem Monat | 744 Stunden |
+| 1999-11-01T00:00:00.000Z | 2 Monate | vor 2 Monaten | 1464 Stunden |
+| 1999-06-01T00:00:00.000Z | 7 Monate | vor 7 Monaten | 5136 Stunden |
+| 1999-01-01T00:00:00.000Z | ein Jahr | vor einem Jahr | 8760 Stunden |
+| 1998-12-01T00:00:00.000Z | ein Jahr | vor einem Jahr | 9504 Stunden |
+| 1998-06-01T00:00:00.000Z | 2 Jahre | vor 2 Jahren | 13896 Stunden |
+| 1998-01-01T00:00:00.000Z | 2 Jahre | vor 2 Jahren | 17520 Stunden |
+| 1997-01-01T00:00:00.000Z | 3 Jahre | vor 3 Jahren | 26280 Stunden |
+| 1996-01-01T00:00:00.000Z | 4 Jahre | vor 4 Jahren | 35064 Stunden |
+| 1995-01-01T00:00:00.000Z | 5 Jahre | vor 5 Jahren | 43824 Stunden |
+| 1994-01-01T00:00:00.000Z | 6 Jahre | vor 6 Jahren | 52584 Stunden |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | Mittwoch um 00:00 |
+| 2000-01-02T00:00:00.000Z | morgen um 00:00 |
+| 2000-01-01T00:00:00.000Z | heute um 00:00 |
+| 1999-12-31T00:00:00.000Z | gestern um 00:00 |
+| 1999-12-27T00:00:00.000Z | letzten Montag um 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/el/_lib/formatDistance/index.js b/date-fns/src/locale/el/_lib/formatDistance/index.js
new file mode 100644
index 0000000..20f9cfc
--- /dev/null
+++ b/date-fns/src/locale/el/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'λιγότερο από ένα δευτερόλεπτο',
+ other: 'λιγότερο από {{count}} δευτερόλεπτα'
+ },
+
+ xSeconds: {
+ one: '1 δευτερόλεπτο',
+ other: '{{count}} δευτερόλεπτα'
+ },
+
+ halfAMinute: 'μισό λεπτό',
+
+ lessThanXMinutes: {
+ one: 'λιγότερο από ένα λεπτό',
+ other: 'λιγότερο από {{count}} λεπτά'
+ },
+
+ xMinutes: {
+ one: '1 λεπτό',
+ other: '{{count}} λεπτά'
+ },
+
+ aboutXHours: {
+ one: 'περίπου 1 ώρα',
+ other: 'περίπου {{count}} ώρες'
+ },
+
+ xHours: {
+ one: '1 ώρα',
+ other: '{{count}} ώρες'
+ },
+
+ xDays: {
+ one: '1 ημέρα',
+ other: '{{count}} ημέρες'
+ },
+
+ aboutXWeeks: {
+ one: 'περίπου 1 εβδομάδα',
+ other: 'περίπου {{count}} εβδομάδες'
+ },
+
+ xWeeks: {
+ one: '1 εβδομάδα',
+ other: '{{count}} εβδομάδες'
+ },
+
+ aboutXMonths: {
+ one: 'περίπου 1 μήνας',
+ other: 'περίπου {{count}} μήνες'
+ },
+
+ xMonths: {
+ one: '1 μήνας',
+ other: '{{count}} μήνες'
+ },
+
+ aboutXYears: {
+ one: 'περίπου 1 χρόνο',
+ other: 'περίπου {{count}} χρόνια'
+ },
+
+ xYears: {
+ one: '1 χρόνο',
+ other: '{{count}} χρόνια'
+ },
+
+ overXYears: {
+ one: 'πάνω από 1 χρόνο',
+ other: 'πάνω από {{count}} χρόνια'
+ },
+
+ almostXYears: {
+ one: 'περίπου 1 χρόνο',
+ other: 'περίπου {{count}} χρόνια'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'σε ' + result
+ } else {
+ return result + ' πριν'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/el/_lib/formatLong/index.js b/date-fns/src/locale/el/_lib/formatLong/index.js
new file mode 100644
index 0000000..b5237ba
--- /dev/null
+++ b/date-fns/src/locale/el/_lib/formatLong/index.js
@@ -0,0 +1,39 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'd/M/yy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} - {{time}}',
+ long: '{{date}} - {{time}}',
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/el/_lib/formatRelative/index.js b/date-fns/src/locale/el/_lib/formatRelative/index.js
new file mode 100644
index 0000000..6a1d8fe
--- /dev/null
+++ b/date-fns/src/locale/el/_lib/formatRelative/index.js
@@ -0,0 +1,23 @@
+var formatRelativeLocale = {
+ lastWeek: function(date) {
+ switch (date.getUTCDay()) {
+ case 6: //Σάββατο
+ return "'το προηγούμενο' eeee 'στις' p"
+ default:
+ return "'την προηγούμενη' eeee 'στις' p"
+ }
+ },
+ yesterday: "'χθες στις' p",
+ today: "'σήμερα στις' p",
+ tomorrow: "'αύριο στις' p",
+ nextWeek: "eeee 'στις' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') return format(date, baseDate, options)
+
+ return format
+}
diff --git a/date-fns/src/locale/el/_lib/localize/index.js b/date-fns/src/locale/el/_lib/localize/index.js
new file mode 100644
index 0000000..1b335fc
--- /dev/null
+++ b/date-fns/src/locale/el/_lib/localize/index.js
@@ -0,0 +1,178 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['πΧ', 'μΧ'],
+ abbreviated: ['π.Χ.', 'μ.Χ.'],
+ wide: ['προ Χριστού', 'μετά Χριστόν']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Τ1', 'Τ2', 'Τ3', 'Τ4'],
+ wide: ['1ο τρίμηνο', '2ο τρίμηνο', '3ο τρίμηνο', '4ο τρίμηνο']
+}
+
+var monthValues = {
+ narrow: ['Ι', 'Φ', 'Μ', 'Α', 'Μ', 'Ι', 'Ι', 'Α', 'Σ', 'Ο', 'Ν', 'Δ'],
+ abbreviated: [
+ 'Ιαν',
+ 'Φεβ',
+ 'Μάρ',
+ 'Απρ',
+ 'Μάι',
+ 'Ιούν',
+ 'Ιούλ',
+ 'Αύγ',
+ 'Σεπ',
+ 'Οκτ',
+ 'Νοέ',
+ 'Δεκ'
+ ],
+ wide: [
+ 'Ιανουάριος',
+ 'Φεβρουάριος',
+ 'Μάρτιος',
+ 'Απρίλιος',
+ 'Μάιος',
+ 'Ιούνιος',
+ 'Ιούλιος',
+ 'Αύγουστος',
+ 'Σεπτέμβριος',
+ 'Οκτώβριος',
+ 'Νοέμβριος',
+ 'Δεκέμβριος'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: ['Ι', 'Φ', 'Μ', 'Α', 'Μ', 'Ι', 'Ι', 'Α', 'Σ', 'Ο', 'Ν', 'Δ'],
+ abbreviated: [
+ 'Ιαν',
+ 'Φεβ',
+ 'Μαρ',
+ 'Απρ',
+ 'Μαΐ',
+ 'Ιουν',
+ 'Ιουλ',
+ 'Αυγ',
+ 'Σεπ',
+ 'Οκτ',
+ 'Νοε',
+ 'Δεκ'
+ ],
+ wide: [
+ 'Ιανουαρίου',
+ 'Φεβρουαρίου',
+ 'Μαρτίου',
+ 'Απριλίου',
+ 'Μαΐου',
+ 'Ιουνίου',
+ 'Ιουλίου',
+ 'Αυγούστου',
+ 'Σεπτεμβρίου',
+ 'Οκτωβρίου',
+ 'Νοεμβρίου',
+ 'Δεκεμβρίου'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Κ', 'Δ', 'T', 'Τ', 'Π', 'Π', 'Σ'],
+ short: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πέ', 'Πα', 'Σά'],
+ abbreviated: ['Κυρ', 'Δευ', 'Τρί', 'Τετ', 'Πέμ', 'Παρ', 'Σάβ'],
+ wide: [
+ 'Κυριακή',
+ 'Δευτέρα',
+ 'Τρίτη',
+ 'Τετάρτη',
+ 'Πέμπτη',
+ 'Παρασκευή',
+ 'Σάββατο'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'πμ',
+ pm: 'μμ',
+ midnight: 'μεσάνυχτα',
+ noon: 'μεσημέρι',
+ morning: 'πρωί',
+ afternoon: 'απόγευμα',
+ evening: 'βράδυ',
+ night: 'νύχτα'
+ },
+ abbreviated: {
+ am: 'π.μ.',
+ pm: 'μ.μ.',
+ midnight: 'μεσάνυχτα',
+ noon: 'μεσημέρι',
+ morning: 'πρωί',
+ afternoon: 'απόγευμα',
+ evening: 'βράδυ',
+ night: 'νύχτα'
+ },
+ wide: {
+ am: 'π.μ.',
+ pm: 'μ.μ.',
+ midnight: 'μεσάνυχτα',
+ noon: 'μεσημέρι',
+ morning: 'πρωί',
+ afternoon: 'απόγευμα',
+ evening: 'βράδυ',
+ night: 'νύχτα'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var suffix
+
+ if (unit === 'year' || unit === 'month') {
+ suffix = 'ος'
+ } else if (
+ unit === 'week' ||
+ unit === 'dayOfYear' ||
+ unit === 'day' ||
+ unit === 'hour' ||
+ unit === 'date'
+ ) {
+ suffix = 'η'
+ } else {
+ suffix = 'ο'
+ }
+
+ return dirtyNumber + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/el/_lib/match/index.js b/date-fns/src/locale/el/_lib/match/index.js
new file mode 100644
index 0000000..32d646e
--- /dev/null
+++ b/date-fns/src/locale/el/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(ος|η|ο)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(πΧ|μΧ)/i,
+ abbreviated: /^(π\.?\s?χ\.?|π\.?\s?κ\.?\s?χ\.?|μ\.?\s?χ\.?|κ\.?\s?χ\.?)/i,
+ wide: /^(προ Χριστο(ύ|υ)|πριν απ(ό|ο) την Κοιν(ή|η) Χρονολογ(ί|ι)α|μετ(ά|α) Χριστ(ό|ο)ν|Κοιν(ή|η) Χρονολογ(ί|ι)α)/i
+}
+var parseEraPatterns = {
+ any: [/^π/i, /^(μ|κ)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^τ[1234]/i,
+ wide: /^[1234]ο? τρ(ί|ι)μηνο/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[ιφμαμιιασονδ]/i,
+ abbreviated: /^(ιαν|φεβ|μ[άα]ρ|απρ|μ[άα][ιΐ]|ιο[ύυ]ν|ιο[ύυ]λ|α[ύυ]γ|σεπ|οκτ|νο[έε]|δεκ)/i,
+ wide: /^(μ[άα][ιΐ]|α[ύυ]γο[υύ]στ)(ος|ου)|(ιανου[άα]ρ|φεβρου[άα]ρ|μ[άα]ρτ|απρ[ίι]λ|ιο[ύυ]ν|ιο[ύυ]λ|σεπτ[έε]μβρ|οκτ[ώω]βρ|νο[έε]μβρ|δεκ[έε]μβρ)(ιος|ίου)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^ι/i,
+ /^φ/i,
+ /^μ/i,
+ /^α/i,
+ /^μ/i,
+ /^ι/i,
+ /^ι/i,
+ /^α/i,
+ /^σ/i,
+ /^ο/i,
+ /^ν/i,
+ /^δ/i
+ ],
+ any: [
+ /^ια/i,
+ /^φ/i,
+ /^μ[άα]ρ/i,
+ /^απ/i,
+ /^μ[άα][ιΐ]/i,
+ /^ιο[ύυ]ν/i,
+ /^ιο[ύυ]λ/i,
+ /^α[ύυ]/i,
+ /^σ/i,
+ /^ο/i,
+ /^ν/i,
+ /^δ/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[κδτπσ]/i,
+ short: /^(κυ|δε|τρ|τε|π[εέ]|π[αά]|σ[αά])/i,
+ abbreviated: /^(κυρ|δευ|τρι|τετ|πεμ|παρ|σαβ)/i,
+ wide: /^(κυριακ(ή|η)|δευτ(έ|ε)ρα|τρ(ί|ι)τη|τετ(ά|α)ρτη|π(έ|ε)μπτη|παρασκευ(ή|η)|σ(ά|α)ββατο)/i
+}
+var parseDayPatterns = {
+ narrow: [/^κ/i, /^δ/i, /^τ/i, /^τ/i, /^π/i, /^π/i, /^σ/i],
+ any: [/^κ/i, /^δ/i, /^τρ/i, /^τε/i, /^π[εέ]/i, /^π[αά]/i, /^σ/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(πμ|μμ|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,
+ any: /^([πμ]\.?\s?μ\.?|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^πμ|π\.\s?μ\./i,
+ pm: /^μμ|μ\.\s?μ\./i,
+ midnight: /^μεσάν/i,
+ noon: /^μεσημ(έ|ε)/i,
+ morning: /πρω(ί|ι)/i,
+ afternoon: /απ(ό|ο)γευμα/i,
+ evening: /βρ(ά|α)δυ/i,
+ night: /ν(ύ|υ)χτα/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/el/index.d.ts b/date-fns/src/locale/el/index.d.ts
new file mode 100644
index 0000000..551ad06
--- /dev/null
+++ b/date-fns/src/locale/el/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { el } from 'date-fns/locale'
+export default el
diff --git a/date-fns/src/locale/el/index.js b/date-fns/src/locale/el/index.js
new file mode 100644
index 0000000..75d70aa
--- /dev/null
+++ b/date-fns/src/locale/el/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Greek locale.
+ * @language Greek
+ * @iso-639-2 ell
+ * @author Fanis Katsimpas [@fanixk]{@link https://github.com/fanixk}
+ * @author Theodoros Orfanidis [@teoulas]{@link https://github.com/teoulas}
+ */
+var locale = {
+ code: 'el',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/el/index.js.flow b/date-fns/src/locale/el/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/el/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/el/snapshot.md b/date-fns/src/locale/el/snapshot.md
new file mode 100644
index 0000000..c9f1b47
--- /dev/null
+++ b/date-fns/src/locale/el/snapshot.md
@@ -0,0 +1,304 @@
+# Greek (el) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987ος | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ος | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987ος | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4ος | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1ο | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ο | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Τ1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Τ2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1ο τρίμηνο | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ο τρίμηνο | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1ο | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ο | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Τ1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Τ2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1ο τρίμηνο | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ο τρίμηνο | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2ος | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ος | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Φεβ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ιουλ | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Φεβρουαρίου | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ιουλίου | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Φ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ι | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2ος | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ος | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Φεβ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ιούλ | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Φεβρουάριος | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ιούλιος | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Φ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ι | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1η | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48η | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1η | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48η | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11η | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28η | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42η | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365η | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Δευ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρ | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Δευ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρ | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Δευ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρ | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Δευτέρα | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρασκευή | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | Δ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Π | 2019-02-14T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Δε | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Πα | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1η | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5η | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Δευ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρ | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Δευτέρα | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρασκευή | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | Δ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Π | 2019-02-14T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Δε | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Πα | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1η | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5η | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Δευ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρ | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Δευτέρα | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρασκευή | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | Δ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Π | 2019-02-14T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Δε | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Πα | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1η | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5η | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Δευ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρ | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Δευτέρα | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Παρασκευή | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | Δ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Π | 2019-02-14T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Δε | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Πα | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | πμ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μμ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μμ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | πμ | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μ.μ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | π.μ. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | πμ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | μμ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | μμ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | πμ | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | πρωί | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | απόγευμα | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | βράδυ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | νύχτα | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | πρωί | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | απόγευμα | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | βράδυ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | νύχτα | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | πρωί | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | απόγευμα | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | βράδυ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | νύχτα | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | πρωί | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | απόγευμα | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | βράδυ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | νύχτα | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | πρωί | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | απόγευμα | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | βράδυ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | νύχτα | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11η | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11η | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11η | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23η | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11η | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11η | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11η | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23η | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1ο | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55ο | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1ο | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55ο | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/2/87 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Φεβ 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Μαΐ 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Φεβρουαρίου 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Μαΐου 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Τετάρτη, 11 Φεβρουαρίου 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Κυριακή, 29 Μαΐου 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 μ.μ. | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 μ.μ. | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 μ.μ. | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 μ.μ. | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 μ.μ. GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 μ.μ. GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 μ.μ. GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 μ.μ. GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/2/87, 12:13 μ.μ. | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53, 11:59 μ.μ. | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Φεβ 1987, 12:13:14 μ.μ. | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Μαΐ 1453, 11:59:59 μ.μ. | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Φεβρουαρίου 1987 - 12:13:14 μ.μ. GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 Μαΐου 1453 - 11:59:59 μ.μ. GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Τετάρτη, 11 Φεβρουαρίου 1987 - 12:13:14 μ.μ. GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Κυριακή, 29 Μαΐου 1453 - 11:59:59 μ.μ. GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------------- | ---------------------------- | --------------------------- |
+| 2006-01-01T00:00:00.000Z | περίπου 6 χρόνια | περίπου 6 χρόνια | σε περίπου 6 χρόνια |
+| 2005-01-01T00:00:00.000Z | περίπου 5 χρόνια | περίπου 5 χρόνια | σε περίπου 5 χρόνια |
+| 2004-01-01T00:00:00.000Z | περίπου 4 χρόνια | περίπου 4 χρόνια | σε περίπου 4 χρόνια |
+| 2003-01-01T00:00:00.000Z | περίπου 3 χρόνια | περίπου 3 χρόνια | σε περίπου 3 χρόνια |
+| 2002-01-01T00:00:00.000Z | περίπου 2 χρόνια | περίπου 2 χρόνια | σε περίπου 2 χρόνια |
+| 2001-06-01T00:00:00.000Z | πάνω από 1 χρόνο | πάνω από 1 χρόνο | σε πάνω από 1 χρόνο |
+| 2001-02-01T00:00:00.000Z | περίπου 1 χρόνο | περίπου 1 χρόνο | σε περίπου 1 χρόνο |
+| 2001-01-01T00:00:00.000Z | περίπου 1 χρόνο | περίπου 1 χρόνο | σε περίπου 1 χρόνο |
+| 2000-06-01T00:00:00.000Z | 5 μήνες | 5 μήνες | σε 5 μήνες |
+| 2000-03-01T00:00:00.000Z | 2 μήνες | 2 μήνες | σε 2 μήνες |
+| 2000-02-01T00:00:00.000Z | περίπου 1 μήνας | περίπου 1 μήνας | σε περίπου 1 μήνας |
+| 2000-01-15T00:00:00.000Z | 14 ημέρες | 14 ημέρες | σε 14 ημέρες |
+| 2000-01-02T00:00:00.000Z | 1 ημέρα | 1 ημέρα | σε 1 ημέρα |
+| 2000-01-01T06:00:00.000Z | περίπου 6 ώρες | περίπου 6 ώρες | σε περίπου 6 ώρες |
+| 2000-01-01T01:00:00.000Z | περίπου 1 ώρα | περίπου 1 ώρα | σε περίπου 1 ώρα |
+| 2000-01-01T00:45:00.000Z | περίπου 1 ώρα | περίπου 1 ώρα | σε περίπου 1 ώρα |
+| 2000-01-01T00:30:00.000Z | 30 λεπτά | 30 λεπτά | σε 30 λεπτά |
+| 2000-01-01T00:15:00.000Z | 15 λεπτά | 15 λεπτά | σε 15 λεπτά |
+| 2000-01-01T00:01:00.000Z | 1 λεπτό | 1 λεπτό | σε 1 λεπτό |
+| 2000-01-01T00:00:25.000Z | λιγότερο από ένα λεπτό | μισό λεπτό | σε λιγότερο από ένα λεπτό |
+| 2000-01-01T00:00:15.000Z | λιγότερο από ένα λεπτό | λιγότερο από 20 δευτερόλεπτα | σε λιγότερο από ένα λεπτό |
+| 2000-01-01T00:00:05.000Z | λιγότερο από ένα λεπτό | λιγότερο από 10 δευτερόλεπτα | σε λιγότερο από ένα λεπτό |
+| 2000-01-01T00:00:00.000Z | λιγότερο από ένα λεπτό | λιγότερο από 5 δευτερόλεπτα | λιγότερο από ένα λεπτό πριν |
+| 1999-12-31T23:59:55.000Z | λιγότερο από ένα λεπτό | λιγότερο από 10 δευτερόλεπτα | λιγότερο από ένα λεπτό πριν |
+| 1999-12-31T23:59:45.000Z | λιγότερο από ένα λεπτό | λιγότερο από 20 δευτερόλεπτα | λιγότερο από ένα λεπτό πριν |
+| 1999-12-31T23:59:35.000Z | λιγότερο από ένα λεπτό | μισό λεπτό | λιγότερο από ένα λεπτό πριν |
+| 1999-12-31T23:59:00.000Z | 1 λεπτό | 1 λεπτό | 1 λεπτό πριν |
+| 1999-12-31T23:45:00.000Z | 15 λεπτά | 15 λεπτά | 15 λεπτά πριν |
+| 1999-12-31T23:30:00.000Z | 30 λεπτά | 30 λεπτά | 30 λεπτά πριν |
+| 1999-12-31T23:15:00.000Z | περίπου 1 ώρα | περίπου 1 ώρα | περίπου 1 ώρα πριν |
+| 1999-12-31T23:00:00.000Z | περίπου 1 ώρα | περίπου 1 ώρα | περίπου 1 ώρα πριν |
+| 1999-12-31T18:00:00.000Z | περίπου 6 ώρες | περίπου 6 ώρες | περίπου 6 ώρες πριν |
+| 1999-12-30T00:00:00.000Z | 2 ημέρες | 2 ημέρες | 2 ημέρες πριν |
+| 1999-12-15T00:00:00.000Z | 17 ημέρες | 17 ημέρες | 17 ημέρες πριν |
+| 1999-12-01T00:00:00.000Z | περίπου 1 μήνας | περίπου 1 μήνας | περίπου 1 μήνας πριν |
+| 1999-11-01T00:00:00.000Z | 2 μήνες | 2 μήνες | 2 μήνες πριν |
+| 1999-06-01T00:00:00.000Z | 7 μήνες | 7 μήνες | 7 μήνες πριν |
+| 1999-01-01T00:00:00.000Z | περίπου 1 χρόνο | περίπου 1 χρόνο | περίπου 1 χρόνο πριν |
+| 1998-12-01T00:00:00.000Z | περίπου 1 χρόνο | περίπου 1 χρόνο | περίπου 1 χρόνο πριν |
+| 1998-06-01T00:00:00.000Z | πάνω από 1 χρόνο | πάνω από 1 χρόνο | πάνω από 1 χρόνο πριν |
+| 1998-01-01T00:00:00.000Z | περίπου 2 χρόνια | περίπου 2 χρόνια | περίπου 2 χρόνια πριν |
+| 1997-01-01T00:00:00.000Z | περίπου 3 χρόνια | περίπου 3 χρόνια | περίπου 3 χρόνια πριν |
+| 1996-01-01T00:00:00.000Z | περίπου 4 χρόνια | περίπου 4 χρόνια | περίπου 4 χρόνια πριν |
+| 1995-01-01T00:00:00.000Z | περίπου 5 χρόνια | περίπου 5 χρόνια | περίπου 5 χρόνια πριν |
+| 1994-01-01T00:00:00.000Z | περίπου 6 χρόνια | περίπου 6 χρόνια | περίπου 6 χρόνια πριν |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------------- | -------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 χρόνια | σε 6 χρόνια | 52608 ώρες |
+| 2005-01-01T00:00:00.000Z | 5 χρόνια | σε 5 χρόνια | 43848 ώρες |
+| 2004-01-01T00:00:00.000Z | 4 χρόνια | σε 4 χρόνια | 35064 ώρες |
+| 2003-01-01T00:00:00.000Z | 3 χρόνια | σε 3 χρόνια | 26304 ώρες |
+| 2002-01-01T00:00:00.000Z | 2 χρόνια | σε 2 χρόνια | 17544 ώρες |
+| 2001-06-01T00:00:00.000Z | 1 χρόνο | σε 1 χρόνο | 12408 ώρες |
+| 2001-02-01T00:00:00.000Z | 1 χρόνο | σε 1 χρόνο | 9528 ώρες |
+| 2001-01-01T00:00:00.000Z | 1 χρόνο | σε 1 χρόνο | 8784 ώρες |
+| 2000-06-01T00:00:00.000Z | 5 μήνες | σε 5 μήνες | 3648 ώρες |
+| 2000-03-01T00:00:00.000Z | 2 μήνες | σε 2 μήνες | 1440 ώρες |
+| 2000-02-01T00:00:00.000Z | 1 μήνας | σε 1 μήνας | 744 ώρες |
+| 2000-01-15T00:00:00.000Z | 14 ημέρες | σε 14 ημέρες | 336 ώρες |
+| 2000-01-02T00:00:00.000Z | 1 ημέρα | σε 1 ημέρα | 24 ώρες |
+| 2000-01-01T06:00:00.000Z | 6 ώρες | σε 6 ώρες | 6 ώρες |
+| 2000-01-01T01:00:00.000Z | 1 ώρα | σε 1 ώρα | 1 ώρα |
+| 2000-01-01T00:45:00.000Z | 45 λεπτά | σε 45 λεπτά | 1 ώρα |
+| 2000-01-01T00:30:00.000Z | 30 λεπτά | σε 30 λεπτά | 1 ώρα |
+| 2000-01-01T00:15:00.000Z | 15 λεπτά | σε 15 λεπτά | 0 ώρες |
+| 2000-01-01T00:01:00.000Z | 1 λεπτό | σε 1 λεπτό | 0 ώρες |
+| 2000-01-01T00:00:25.000Z | 25 δευτερόλεπτα | σε 25 δευτερόλεπτα | 0 ώρες |
+| 2000-01-01T00:00:15.000Z | 15 δευτερόλεπτα | σε 15 δευτερόλεπτα | 0 ώρες |
+| 2000-01-01T00:00:05.000Z | 5 δευτερόλεπτα | σε 5 δευτερόλεπτα | 0 ώρες |
+| 2000-01-01T00:00:00.000Z | 0 δευτερόλεπτα | 0 δευτερόλεπτα πριν | 0 ώρες |
+| 1999-12-31T23:59:55.000Z | 5 δευτερόλεπτα | 5 δευτερόλεπτα πριν | 0 ώρες |
+| 1999-12-31T23:59:45.000Z | 15 δευτερόλεπτα | 15 δευτερόλεπτα πριν | 0 ώρες |
+| 1999-12-31T23:59:35.000Z | 25 δευτερόλεπτα | 25 δευτερόλεπτα πριν | 0 ώρες |
+| 1999-12-31T23:59:00.000Z | 1 λεπτό | 1 λεπτό πριν | 0 ώρες |
+| 1999-12-31T23:45:00.000Z | 15 λεπτά | 15 λεπτά πριν | 0 ώρες |
+| 1999-12-31T23:30:00.000Z | 30 λεπτά | 30 λεπτά πριν | 1 ώρα |
+| 1999-12-31T23:15:00.000Z | 45 λεπτά | 45 λεπτά πριν | 1 ώρα |
+| 1999-12-31T23:00:00.000Z | 1 ώρα | 1 ώρα πριν | 1 ώρα |
+| 1999-12-31T18:00:00.000Z | 6 ώρες | 6 ώρες πριν | 6 ώρες |
+| 1999-12-30T00:00:00.000Z | 2 ημέρες | 2 ημέρες πριν | 48 ώρες |
+| 1999-12-15T00:00:00.000Z | 17 ημέρες | 17 ημέρες πριν | 408 ώρες |
+| 1999-12-01T00:00:00.000Z | 1 μήνας | 1 μήνας πριν | 744 ώρες |
+| 1999-11-01T00:00:00.000Z | 2 μήνες | 2 μήνες πριν | 1464 ώρες |
+| 1999-06-01T00:00:00.000Z | 7 μήνες | 7 μήνες πριν | 5136 ώρες |
+| 1999-01-01T00:00:00.000Z | 1 χρόνο | 1 χρόνο πριν | 8760 ώρες |
+| 1998-12-01T00:00:00.000Z | 1 χρόνο | 1 χρόνο πριν | 9504 ώρες |
+| 1998-06-01T00:00:00.000Z | 2 χρόνια | 2 χρόνια πριν | 13896 ώρες |
+| 1998-01-01T00:00:00.000Z | 2 χρόνια | 2 χρόνια πριν | 17520 ώρες |
+| 1997-01-01T00:00:00.000Z | 3 χρόνια | 3 χρόνια πριν | 26280 ώρες |
+| 1996-01-01T00:00:00.000Z | 4 χρόνια | 4 χρόνια πριν | 35064 ώρες |
+| 1995-01-01T00:00:00.000Z | 5 χρόνια | 5 χρόνια πριν | 43824 ώρες |
+| 1994-01-01T00:00:00.000Z | 6 χρόνια | 6 χρόνια πριν | 52584 ώρες |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/1/00 |
+| 2000-01-05T00:00:00.000Z | Τετάρτη στις 12:00 π.μ. |
+| 2000-01-02T00:00:00.000Z | αύριο στις 12:00 π.μ. |
+| 2000-01-01T00:00:00.000Z | σήμερα στις 12:00 π.μ. |
+| 1999-12-31T00:00:00.000Z | χθες στις 12:00 π.μ. |
+| 1999-12-27T00:00:00.000Z | την προηγούμενη Δευτέρα στις 12:00 π.μ. |
+| 1999-12-21T00:00:00.000Z | 21/12/99 |
diff --git a/date-fns/src/locale/en-AU/_lib/formatLong/index.js b/date-fns/src/locale/en-AU/_lib/formatLong/index.js
new file mode 100644
index 0000000..8e674cd
--- /dev/null
+++ b/date-fns/src/locale/en-AU/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/en-AU/index.d.ts b/date-fns/src/locale/en-AU/index.d.ts
new file mode 100644
index 0000000..c1343a6
--- /dev/null
+++ b/date-fns/src/locale/en-AU/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { enAU } from 'date-fns/locale'
+export default enAU
diff --git a/date-fns/src/locale/en-AU/index.js b/date-fns/src/locale/en-AU/index.js
new file mode 100644
index 0000000..112306a
--- /dev/null
+++ b/date-fns/src/locale/en-AU/index.js
@@ -0,0 +1,28 @@
+import formatDistance from '../en-US/_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from '../en-US/_lib/formatRelative/index'
+import localize from '../en-US/_lib/localize/index'
+import match from '../en-US/_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary English locale (Australia).
+ * @language English
+ * @iso-639-2 eng
+ * @author Julien Malige [@JulienMalige]{@link https://github.com/JulienMalige}
+ */
+var locale = {
+ code: 'en-AU',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/en-AU/index.js.flow b/date-fns/src/locale/en-AU/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/en-AU/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/en-AU/snapshot.md b/date-fns/src/locale/en-AU/snapshot.md
new file mode 100644
index 0000000..75c0ff5
--- /dev/null
+++ b/date-fns/src/locale/en-AU/snapshot.md
@@ -0,0 +1,304 @@
+# English (en-AU) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987th | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987th | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4th | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11th | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28th | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365th | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1st | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55th | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1st | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55th | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb 1987, 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453, 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 February 1987 at 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 at 11:59:59 PM GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 at 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 at 11:59:59 PM GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | about 6 years | about 6 years | in about 6 years |
+| 2005-01-01T00:00:00.000Z | about 5 years | about 5 years | in about 5 years |
+| 2004-01-01T00:00:00.000Z | about 4 years | about 4 years | in about 4 years |
+| 2003-01-01T00:00:00.000Z | about 3 years | about 3 years | in about 3 years |
+| 2002-01-01T00:00:00.000Z | about 2 years | about 2 years | in about 2 years |
+| 2001-06-01T00:00:00.000Z | over 1 year | over 1 year | in over 1 year |
+| 2001-02-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2001-01-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2000-06-01T00:00:00.000Z | 5 months | 5 months | in 5 months |
+| 2000-03-01T00:00:00.000Z | 2 months | 2 months | in 2 months |
+| 2000-02-01T00:00:00.000Z | about 1 month | about 1 month | in about 1 month |
+| 2000-01-15T00:00:00.000Z | 14 days | 14 days | in 14 days |
+| 2000-01-02T00:00:00.000Z | 1 day | 1 day | in 1 day |
+| 2000-01-01T06:00:00.000Z | about 6 hours | about 6 hours | in about 6 hours |
+| 2000-01-01T01:00:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:45:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | in 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | in 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | in 1 minute |
+| 2000-01-01T00:00:25.000Z | less than a minute | half a minute | in less than a minute |
+| 2000-01-01T00:00:15.000Z | less than a minute | less than 20 seconds | in less than a minute |
+| 2000-01-01T00:00:05.000Z | less than a minute | less than 10 seconds | in less than a minute |
+| 2000-01-01T00:00:00.000Z | less than a minute | less than 5 seconds | less than a minute ago |
+| 1999-12-31T23:59:55.000Z | less than a minute | less than 10 seconds | less than a minute ago |
+| 1999-12-31T23:59:45.000Z | less than a minute | less than 20 seconds | less than a minute ago |
+| 1999-12-31T23:59:35.000Z | less than a minute | half a minute | less than a minute ago |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | 1 minute ago |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | 15 minutes ago |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | 30 minutes ago |
+| 1999-12-31T23:15:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T23:00:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T18:00:00.000Z | about 6 hours | about 6 hours | about 6 hours ago |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days | 2 days ago |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days | 17 days ago |
+| 1999-12-01T00:00:00.000Z | about 1 month | about 1 month | about 1 month ago |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months | 2 months ago |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months | 7 months ago |
+| 1999-01-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-12-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-06-01T00:00:00.000Z | over 1 year | over 1 year | over 1 year ago |
+| 1998-01-01T00:00:00.000Z | about 2 years | about 2 years | about 2 years ago |
+| 1997-01-01T00:00:00.000Z | about 3 years | about 3 years | about 3 years ago |
+| 1996-01-01T00:00:00.000Z | about 4 years | about 4 years | about 4 years ago |
+| 1995-01-01T00:00:00.000Z | about 5 years | about 5 years | about 5 years ago |
+| 1994-01-01T00:00:00.000Z | about 6 years | about 6 years | about 6 years ago |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 years | in 6 years | 52608 hours |
+| 2005-01-01T00:00:00.000Z | 5 years | in 5 years | 43848 hours |
+| 2004-01-01T00:00:00.000Z | 4 years | in 4 years | 35064 hours |
+| 2003-01-01T00:00:00.000Z | 3 years | in 3 years | 26304 hours |
+| 2002-01-01T00:00:00.000Z | 2 years | in 2 years | 17544 hours |
+| 2001-06-01T00:00:00.000Z | 1 year | in 1 year | 12408 hours |
+| 2001-02-01T00:00:00.000Z | 1 year | in 1 year | 9528 hours |
+| 2001-01-01T00:00:00.000Z | 1 year | in 1 year | 8784 hours |
+| 2000-06-01T00:00:00.000Z | 5 months | in 5 months | 3648 hours |
+| 2000-03-01T00:00:00.000Z | 2 months | in 2 months | 1440 hours |
+| 2000-02-01T00:00:00.000Z | 1 month | in 1 month | 744 hours |
+| 2000-01-15T00:00:00.000Z | 14 days | in 14 days | 336 hours |
+| 2000-01-02T00:00:00.000Z | 1 day | in 1 day | 24 hours |
+| 2000-01-01T06:00:00.000Z | 6 hours | in 6 hours | 6 hours |
+| 2000-01-01T01:00:00.000Z | 1 hour | in 1 hour | 1 hour |
+| 2000-01-01T00:45:00.000Z | 45 minutes | in 45 minutes | 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | in 30 minutes | 1 hour |
+| 2000-01-01T00:15:00.000Z | 15 minutes | in 15 minutes | 0 hours |
+| 2000-01-01T00:01:00.000Z | 1 minute | in 1 minute | 0 hours |
+| 2000-01-01T00:00:25.000Z | 25 seconds | in 25 seconds | 0 hours |
+| 2000-01-01T00:00:15.000Z | 15 seconds | in 15 seconds | 0 hours |
+| 2000-01-01T00:00:05.000Z | 5 seconds | in 5 seconds | 0 hours |
+| 2000-01-01T00:00:00.000Z | 0 seconds | 0 seconds ago | 0 hours |
+| 1999-12-31T23:59:55.000Z | 5 seconds | 5 seconds ago | 0 hours |
+| 1999-12-31T23:59:45.000Z | 15 seconds | 15 seconds ago | 0 hours |
+| 1999-12-31T23:59:35.000Z | 25 seconds | 25 seconds ago | 0 hours |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute ago | 0 hours |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes ago | 0 hours |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes ago | 1 hour |
+| 1999-12-31T23:15:00.000Z | 45 minutes | 45 minutes ago | 1 hour |
+| 1999-12-31T23:00:00.000Z | 1 hour | 1 hour ago | 1 hour |
+| 1999-12-31T18:00:00.000Z | 6 hours | 6 hours ago | 6 hours |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days ago | 48 hours |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days ago | 408 hours |
+| 1999-12-01T00:00:00.000Z | 1 month | 1 month ago | 744 hours |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months ago | 1464 hours |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months ago | 5136 hours |
+| 1999-01-01T00:00:00.000Z | 1 year | 1 year ago | 8760 hours |
+| 1998-12-01T00:00:00.000Z | 1 year | 1 year ago | 9504 hours |
+| 1998-06-01T00:00:00.000Z | 2 years | 2 years ago | 13896 hours |
+| 1998-01-01T00:00:00.000Z | 2 years | 2 years ago | 17520 hours |
+| 1997-01-01T00:00:00.000Z | 3 years | 3 years ago | 26280 hours |
+| 1996-01-01T00:00:00.000Z | 4 years | 4 years ago | 35064 hours |
+| 1995-01-01T00:00:00.000Z | 5 years | 5 years ago | 43824 hours |
+| 1994-01-01T00:00:00.000Z | 6 years | 6 years ago | 52584 hours |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | Wednesday at 12:00 AM |
+| 2000-01-02T00:00:00.000Z | tomorrow at 12:00 AM |
+| 2000-01-01T00:00:00.000Z | today at 12:00 AM |
+| 1999-12-31T00:00:00.000Z | yesterday at 12:00 AM |
+| 1999-12-27T00:00:00.000Z | last Monday at 12:00 AM |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/en-CA/_lib/formatDistance/index.js b/date-fns/src/locale/en-CA/_lib/formatDistance/index.js
new file mode 100644
index 0000000..c818314
--- /dev/null
+++ b/date-fns/src/locale/en-CA/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'less than a second',
+ other: 'less than {{count}} seconds'
+ },
+
+ xSeconds: {
+ one: 'a second',
+ other: '{{count}} seconds'
+ },
+
+ halfAMinute: 'half a minute',
+
+ lessThanXMinutes: {
+ one: 'less than a minute',
+ other: 'less than {{count}} minutes'
+ },
+
+ xMinutes: {
+ one: 'a minute',
+ other: '{{count}} minutes'
+ },
+
+ aboutXHours: {
+ one: 'about an hour',
+ other: 'about {{count}} hours'
+ },
+
+ xHours: {
+ one: 'an hour',
+ other: '{{count}} hours'
+ },
+
+ xDays: {
+ one: 'a day',
+ other: '{{count}} days'
+ },
+
+ aboutXWeeks: {
+ one: 'about a week',
+ other: 'about {{count}} weeks'
+ },
+
+ xWeeks: {
+ one: 'a week',
+ other: '{{count}} weeks'
+ },
+
+ aboutXMonths: {
+ one: 'about a month',
+ other: 'about {{count}} months'
+ },
+
+ xMonths: {
+ one: 'a month',
+ other: '{{count}} months'
+ },
+
+ aboutXYears: {
+ one: 'about a year',
+ other: 'about {{count}} years'
+ },
+
+ xYears: {
+ one: 'a year',
+ other: '{{count}} years'
+ },
+
+ overXYears: {
+ one: 'over a year',
+ other: 'over {{count}} years'
+ },
+
+ almostXYears: {
+ one: 'almost a year',
+ other: 'almost {{count}} years'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'in ' + result
+ } else {
+ return result + ' ago'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/en-CA/_lib/formatLong/index.js b/date-fns/src/locale/en-CA/_lib/formatLong/index.js
new file mode 100644
index 0000000..7bcee0d
--- /dev/null
+++ b/date-fns/src/locale/en-CA/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, yyyy',
+ long: 'MMMM do, yyyy',
+ medium: 'MMM d, yyyy',
+ short: 'yyyy-MM-dd'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/en-CA/index.d.ts b/date-fns/src/locale/en-CA/index.d.ts
new file mode 100644
index 0000000..e97efb4
--- /dev/null
+++ b/date-fns/src/locale/en-CA/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { enCA } from 'date-fns/locale'
+export default enCA
diff --git a/date-fns/src/locale/en-CA/index.js b/date-fns/src/locale/en-CA/index.js
new file mode 100644
index 0000000..863aa31
--- /dev/null
+++ b/date-fns/src/locale/en-CA/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from '../en-US/_lib/formatRelative/index'
+import localize from '../en-US/_lib/localize/index'
+import match from '../en-US/_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary English locale (Canada).
+ * @language English
+ * @iso-639-2 eng
+ * @author Mark Owsiak [@markowsiak]{@link https://github.com/markowsiak}
+ * @author Marco Imperatore [@mimperatore]{@link https://github.com/mimperatore}
+ */
+var locale = {
+ code: 'en-CA',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/en-CA/index.js.flow b/date-fns/src/locale/en-CA/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/en-CA/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/en-CA/snapshot.md b/date-fns/src/locale/en-CA/snapshot.md
new file mode 100644
index 0000000..4b8f145
--- /dev/null
+++ b/date-fns/src/locale/en-CA/snapshot.md
@@ -0,0 +1,304 @@
+# English (en-CA) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987th | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987th | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1st | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49th | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11th | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28th | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365th | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6th | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6th | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1st | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55th | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1st | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55th | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | Feb 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | May 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | February 11th, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | May 29th, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Wednesday, February 11th, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sunday, May 29th, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987-02-11, 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29, 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | Feb 11, 1987, 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | May 29, 1453, 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | February 11th, 1987 at 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | May 29th, 1453 at 11:59:59 PM GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Wednesday, February 11th, 1987 at 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sunday, May 29th, 1453 at 11:59:59 PM GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | about 6 years | about 6 years | in about 6 years |
+| 2005-01-01T00:00:00.000Z | about 5 years | about 5 years | in about 5 years |
+| 2004-01-01T00:00:00.000Z | about 4 years | about 4 years | in about 4 years |
+| 2003-01-01T00:00:00.000Z | about 3 years | about 3 years | in about 3 years |
+| 2002-01-01T00:00:00.000Z | about 2 years | about 2 years | in about 2 years |
+| 2001-06-01T00:00:00.000Z | over a year | over a year | in over a year |
+| 2001-02-01T00:00:00.000Z | about a year | about a year | in about a year |
+| 2001-01-01T00:00:00.000Z | about a year | about a year | in about a year |
+| 2000-06-01T00:00:00.000Z | 5 months | 5 months | in 5 months |
+| 2000-03-01T00:00:00.000Z | 2 months | 2 months | in 2 months |
+| 2000-02-01T00:00:00.000Z | about a month | about a month | in about a month |
+| 2000-01-15T00:00:00.000Z | 14 days | 14 days | in 14 days |
+| 2000-01-02T00:00:00.000Z | a day | a day | in a day |
+| 2000-01-01T06:00:00.000Z | about 6 hours | about 6 hours | in about 6 hours |
+| 2000-01-01T01:00:00.000Z | about an hour | about an hour | in about an hour |
+| 2000-01-01T00:45:00.000Z | about an hour | about an hour | in about an hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | in 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | in 15 minutes |
+| 2000-01-01T00:01:00.000Z | a minute | a minute | in a minute |
+| 2000-01-01T00:00:25.000Z | less than a minute | half a minute | in less than a minute |
+| 2000-01-01T00:00:15.000Z | less than a minute | less than 20 seconds | in less than a minute |
+| 2000-01-01T00:00:05.000Z | less than a minute | less than 10 seconds | in less than a minute |
+| 2000-01-01T00:00:00.000Z | less than a minute | less than 5 seconds | less than a minute ago |
+| 1999-12-31T23:59:55.000Z | less than a minute | less than 10 seconds | less than a minute ago |
+| 1999-12-31T23:59:45.000Z | less than a minute | less than 20 seconds | less than a minute ago |
+| 1999-12-31T23:59:35.000Z | less than a minute | half a minute | less than a minute ago |
+| 1999-12-31T23:59:00.000Z | a minute | a minute | a minute ago |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | 15 minutes ago |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | 30 minutes ago |
+| 1999-12-31T23:15:00.000Z | about an hour | about an hour | about an hour ago |
+| 1999-12-31T23:00:00.000Z | about an hour | about an hour | about an hour ago |
+| 1999-12-31T18:00:00.000Z | about 6 hours | about 6 hours | about 6 hours ago |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days | 2 days ago |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days | 17 days ago |
+| 1999-12-01T00:00:00.000Z | about a month | about a month | about a month ago |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months | 2 months ago |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months | 7 months ago |
+| 1999-01-01T00:00:00.000Z | about a year | about a year | about a year ago |
+| 1998-12-01T00:00:00.000Z | about a year | about a year | about a year ago |
+| 1998-06-01T00:00:00.000Z | over a year | over a year | over a year ago |
+| 1998-01-01T00:00:00.000Z | about 2 years | about 2 years | about 2 years ago |
+| 1997-01-01T00:00:00.000Z | about 3 years | about 3 years | about 3 years ago |
+| 1996-01-01T00:00:00.000Z | about 4 years | about 4 years | about 4 years ago |
+| 1995-01-01T00:00:00.000Z | about 5 years | about 5 years | about 5 years ago |
+| 1994-01-01T00:00:00.000Z | about 6 years | about 6 years | about 6 years ago |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 years | in 6 years | 52608 hours |
+| 2005-01-01T00:00:00.000Z | 5 years | in 5 years | 43848 hours |
+| 2004-01-01T00:00:00.000Z | 4 years | in 4 years | 35064 hours |
+| 2003-01-01T00:00:00.000Z | 3 years | in 3 years | 26304 hours |
+| 2002-01-01T00:00:00.000Z | 2 years | in 2 years | 17544 hours |
+| 2001-06-01T00:00:00.000Z | a year | in a year | 12408 hours |
+| 2001-02-01T00:00:00.000Z | a year | in a year | 9528 hours |
+| 2001-01-01T00:00:00.000Z | a year | in a year | 8784 hours |
+| 2000-06-01T00:00:00.000Z | 5 months | in 5 months | 3648 hours |
+| 2000-03-01T00:00:00.000Z | 2 months | in 2 months | 1440 hours |
+| 2000-02-01T00:00:00.000Z | a month | in a month | 744 hours |
+| 2000-01-15T00:00:00.000Z | 14 days | in 14 days | 336 hours |
+| 2000-01-02T00:00:00.000Z | a day | in a day | 24 hours |
+| 2000-01-01T06:00:00.000Z | 6 hours | in 6 hours | 6 hours |
+| 2000-01-01T01:00:00.000Z | an hour | in an hour | an hour |
+| 2000-01-01T00:45:00.000Z | 45 minutes | in 45 minutes | an hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | in 30 minutes | an hour |
+| 2000-01-01T00:15:00.000Z | 15 minutes | in 15 minutes | 0 hours |
+| 2000-01-01T00:01:00.000Z | a minute | in a minute | 0 hours |
+| 2000-01-01T00:00:25.000Z | 25 seconds | in 25 seconds | 0 hours |
+| 2000-01-01T00:00:15.000Z | 15 seconds | in 15 seconds | 0 hours |
+| 2000-01-01T00:00:05.000Z | 5 seconds | in 5 seconds | 0 hours |
+| 2000-01-01T00:00:00.000Z | 0 seconds | 0 seconds ago | 0 hours |
+| 1999-12-31T23:59:55.000Z | 5 seconds | 5 seconds ago | 0 hours |
+| 1999-12-31T23:59:45.000Z | 15 seconds | 15 seconds ago | 0 hours |
+| 1999-12-31T23:59:35.000Z | 25 seconds | 25 seconds ago | 0 hours |
+| 1999-12-31T23:59:00.000Z | a minute | a minute ago | 0 hours |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes ago | 0 hours |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes ago | an hour |
+| 1999-12-31T23:15:00.000Z | 45 minutes | 45 minutes ago | an hour |
+| 1999-12-31T23:00:00.000Z | an hour | an hour ago | an hour |
+| 1999-12-31T18:00:00.000Z | 6 hours | 6 hours ago | 6 hours |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days ago | 48 hours |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days ago | 408 hours |
+| 1999-12-01T00:00:00.000Z | a month | a month ago | 744 hours |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months ago | 1464 hours |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months ago | 5136 hours |
+| 1999-01-01T00:00:00.000Z | a year | a year ago | 8760 hours |
+| 1998-12-01T00:00:00.000Z | a year | a year ago | 9504 hours |
+| 1998-06-01T00:00:00.000Z | 2 years | 2 years ago | 13896 hours |
+| 1998-01-01T00:00:00.000Z | 2 years | 2 years ago | 17520 hours |
+| 1997-01-01T00:00:00.000Z | 3 years | 3 years ago | 26280 hours |
+| 1996-01-01T00:00:00.000Z | 4 years | 4 years ago | 35064 hours |
+| 1995-01-01T00:00:00.000Z | 5 years | 5 years ago | 43824 hours |
+| 1994-01-01T00:00:00.000Z | 6 years | 6 years ago | 52584 hours |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 2000-01-10 |
+| 2000-01-05T00:00:00.000Z | Wednesday at 12:00 AM |
+| 2000-01-02T00:00:00.000Z | tomorrow at 12:00 AM |
+| 2000-01-01T00:00:00.000Z | today at 12:00 AM |
+| 1999-12-31T00:00:00.000Z | yesterday at 12:00 AM |
+| 1999-12-27T00:00:00.000Z | last Monday at 12:00 AM |
+| 1999-12-21T00:00:00.000Z | 1999-12-21 |
diff --git a/date-fns/src/locale/en-GB/_lib/formatLong/index.js b/date-fns/src/locale/en-GB/_lib/formatLong/index.js
new file mode 100644
index 0000000..1dc1837
--- /dev/null
+++ b/date-fns/src/locale/en-GB/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/en-GB/index.d.ts b/date-fns/src/locale/en-GB/index.d.ts
new file mode 100644
index 0000000..74fc784
--- /dev/null
+++ b/date-fns/src/locale/en-GB/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { enGB } from 'date-fns/locale'
+export default enGB
diff --git a/date-fns/src/locale/en-GB/index.js b/date-fns/src/locale/en-GB/index.js
new file mode 100644
index 0000000..1ab0ea0
--- /dev/null
+++ b/date-fns/src/locale/en-GB/index.js
@@ -0,0 +1,28 @@
+import formatDistance from '../en-US/_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from '../en-US/_lib/formatRelative/index'
+import localize from '../en-US/_lib/localize/index'
+import match from '../en-US/_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary English locale (United Kingdom).
+ * @language English
+ * @iso-639-2 eng
+ * @author Alex [@glintik]{@link https://github.com/glintik}
+ */
+var locale = {
+ code: 'en-GB',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/en-GB/index.js.flow b/date-fns/src/locale/en-GB/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/en-GB/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/en-GB/snapshot.md b/date-fns/src/locale/en-GB/snapshot.md
new file mode 100644
index 0000000..934e28d
--- /dev/null
+++ b/date-fns/src/locale/en-GB/snapshot.md
@@ -0,0 +1,304 @@
+# English (en-GB) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987th | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987th | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4th | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11th | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28th | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365th | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1st | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55th | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1st | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55th | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 February 1987 at 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 at 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 at 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 at 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | about 6 years | about 6 years | in about 6 years |
+| 2005-01-01T00:00:00.000Z | about 5 years | about 5 years | in about 5 years |
+| 2004-01-01T00:00:00.000Z | about 4 years | about 4 years | in about 4 years |
+| 2003-01-01T00:00:00.000Z | about 3 years | about 3 years | in about 3 years |
+| 2002-01-01T00:00:00.000Z | about 2 years | about 2 years | in about 2 years |
+| 2001-06-01T00:00:00.000Z | over 1 year | over 1 year | in over 1 year |
+| 2001-02-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2001-01-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2000-06-01T00:00:00.000Z | 5 months | 5 months | in 5 months |
+| 2000-03-01T00:00:00.000Z | 2 months | 2 months | in 2 months |
+| 2000-02-01T00:00:00.000Z | about 1 month | about 1 month | in about 1 month |
+| 2000-01-15T00:00:00.000Z | 14 days | 14 days | in 14 days |
+| 2000-01-02T00:00:00.000Z | 1 day | 1 day | in 1 day |
+| 2000-01-01T06:00:00.000Z | about 6 hours | about 6 hours | in about 6 hours |
+| 2000-01-01T01:00:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:45:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | in 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | in 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | in 1 minute |
+| 2000-01-01T00:00:25.000Z | less than a minute | half a minute | in less than a minute |
+| 2000-01-01T00:00:15.000Z | less than a minute | less than 20 seconds | in less than a minute |
+| 2000-01-01T00:00:05.000Z | less than a minute | less than 10 seconds | in less than a minute |
+| 2000-01-01T00:00:00.000Z | less than a minute | less than 5 seconds | less than a minute ago |
+| 1999-12-31T23:59:55.000Z | less than a minute | less than 10 seconds | less than a minute ago |
+| 1999-12-31T23:59:45.000Z | less than a minute | less than 20 seconds | less than a minute ago |
+| 1999-12-31T23:59:35.000Z | less than a minute | half a minute | less than a minute ago |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | 1 minute ago |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | 15 minutes ago |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | 30 minutes ago |
+| 1999-12-31T23:15:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T23:00:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T18:00:00.000Z | about 6 hours | about 6 hours | about 6 hours ago |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days | 2 days ago |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days | 17 days ago |
+| 1999-12-01T00:00:00.000Z | about 1 month | about 1 month | about 1 month ago |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months | 2 months ago |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months | 7 months ago |
+| 1999-01-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-12-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-06-01T00:00:00.000Z | over 1 year | over 1 year | over 1 year ago |
+| 1998-01-01T00:00:00.000Z | about 2 years | about 2 years | about 2 years ago |
+| 1997-01-01T00:00:00.000Z | about 3 years | about 3 years | about 3 years ago |
+| 1996-01-01T00:00:00.000Z | about 4 years | about 4 years | about 4 years ago |
+| 1995-01-01T00:00:00.000Z | about 5 years | about 5 years | about 5 years ago |
+| 1994-01-01T00:00:00.000Z | about 6 years | about 6 years | about 6 years ago |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 years | in 6 years | 52608 hours |
+| 2005-01-01T00:00:00.000Z | 5 years | in 5 years | 43848 hours |
+| 2004-01-01T00:00:00.000Z | 4 years | in 4 years | 35064 hours |
+| 2003-01-01T00:00:00.000Z | 3 years | in 3 years | 26304 hours |
+| 2002-01-01T00:00:00.000Z | 2 years | in 2 years | 17544 hours |
+| 2001-06-01T00:00:00.000Z | 1 year | in 1 year | 12408 hours |
+| 2001-02-01T00:00:00.000Z | 1 year | in 1 year | 9528 hours |
+| 2001-01-01T00:00:00.000Z | 1 year | in 1 year | 8784 hours |
+| 2000-06-01T00:00:00.000Z | 5 months | in 5 months | 3648 hours |
+| 2000-03-01T00:00:00.000Z | 2 months | in 2 months | 1440 hours |
+| 2000-02-01T00:00:00.000Z | 1 month | in 1 month | 744 hours |
+| 2000-01-15T00:00:00.000Z | 14 days | in 14 days | 336 hours |
+| 2000-01-02T00:00:00.000Z | 1 day | in 1 day | 24 hours |
+| 2000-01-01T06:00:00.000Z | 6 hours | in 6 hours | 6 hours |
+| 2000-01-01T01:00:00.000Z | 1 hour | in 1 hour | 1 hour |
+| 2000-01-01T00:45:00.000Z | 45 minutes | in 45 minutes | 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | in 30 minutes | 1 hour |
+| 2000-01-01T00:15:00.000Z | 15 minutes | in 15 minutes | 0 hours |
+| 2000-01-01T00:01:00.000Z | 1 minute | in 1 minute | 0 hours |
+| 2000-01-01T00:00:25.000Z | 25 seconds | in 25 seconds | 0 hours |
+| 2000-01-01T00:00:15.000Z | 15 seconds | in 15 seconds | 0 hours |
+| 2000-01-01T00:00:05.000Z | 5 seconds | in 5 seconds | 0 hours |
+| 2000-01-01T00:00:00.000Z | 0 seconds | 0 seconds ago | 0 hours |
+| 1999-12-31T23:59:55.000Z | 5 seconds | 5 seconds ago | 0 hours |
+| 1999-12-31T23:59:45.000Z | 15 seconds | 15 seconds ago | 0 hours |
+| 1999-12-31T23:59:35.000Z | 25 seconds | 25 seconds ago | 0 hours |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute ago | 0 hours |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes ago | 0 hours |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes ago | 1 hour |
+| 1999-12-31T23:15:00.000Z | 45 minutes | 45 minutes ago | 1 hour |
+| 1999-12-31T23:00:00.000Z | 1 hour | 1 hour ago | 1 hour |
+| 1999-12-31T18:00:00.000Z | 6 hours | 6 hours ago | 6 hours |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days ago | 48 hours |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days ago | 408 hours |
+| 1999-12-01T00:00:00.000Z | 1 month | 1 month ago | 744 hours |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months ago | 1464 hours |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months ago | 5136 hours |
+| 1999-01-01T00:00:00.000Z | 1 year | 1 year ago | 8760 hours |
+| 1998-12-01T00:00:00.000Z | 1 year | 1 year ago | 9504 hours |
+| 1998-06-01T00:00:00.000Z | 2 years | 2 years ago | 13896 hours |
+| 1998-01-01T00:00:00.000Z | 2 years | 2 years ago | 17520 hours |
+| 1997-01-01T00:00:00.000Z | 3 years | 3 years ago | 26280 hours |
+| 1996-01-01T00:00:00.000Z | 4 years | 4 years ago | 35064 hours |
+| 1995-01-01T00:00:00.000Z | 5 years | 5 years ago | 43824 hours |
+| 1994-01-01T00:00:00.000Z | 6 years | 6 years ago | 52584 hours |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | Wednesday at 00:00 |
+| 2000-01-02T00:00:00.000Z | tomorrow at 00:00 |
+| 2000-01-01T00:00:00.000Z | today at 00:00 |
+| 1999-12-31T00:00:00.000Z | yesterday at 00:00 |
+| 1999-12-27T00:00:00.000Z | last Monday at 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/en-IN/_lib/formatLong/index.js b/date-fns/src/locale/en-IN/_lib/formatLong/index.js
new file mode 100644
index 0000000..70aa51c
--- /dev/null
+++ b/date-fns/src/locale/en-IN/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM, yyyy',
+ medium: 'd MMM, yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/en-IN/index.d.ts b/date-fns/src/locale/en-IN/index.d.ts
new file mode 100644
index 0000000..a1fc542
--- /dev/null
+++ b/date-fns/src/locale/en-IN/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { enIN } from 'date-fns/locale'
+export default enIN
diff --git a/date-fns/src/locale/en-IN/index.js b/date-fns/src/locale/en-IN/index.js
new file mode 100644
index 0000000..6ddfbcf
--- /dev/null
+++ b/date-fns/src/locale/en-IN/index.js
@@ -0,0 +1,28 @@
+import formatDistance from '../en-US/_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from '../en-US/_lib/formatRelative/index'
+import localize from '../en-US/_lib/localize/index'
+import match from '../en-US/_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary English locale (India).
+ * @language English
+ * @iso-639-2 eng
+ * @author Galeel Bhasha Satthar [@gbhasha]{@link https://github.com/gbhasha}
+ */
+var locale = {
+ code: 'en-IN',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1, // Monday is the first day of the week.
+ firstWeekContainsDate: 4 // The week that contains Jan 4th is the first week of the year.
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/en-IN/index.js.flow b/date-fns/src/locale/en-IN/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/en-IN/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/en-IN/snapshot.md b/date-fns/src/locale/en-IN/snapshot.md
new file mode 100644
index 0000000..d71ac5e
--- /dev/null
+++ b/date-fns/src/locale/en-IN/snapshot.md
@@ -0,0 +1,304 @@
+# English (en-IN) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987th | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987th | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4th | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11th | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28th | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365th | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1st | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55th | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1st | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55th | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 February, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb, 1987, 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453, 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 February, 1987 at 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453 at 11:59:59 PM GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 at 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 at 11:59:59 PM GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | about 6 years | about 6 years | in about 6 years |
+| 2005-01-01T00:00:00.000Z | about 5 years | about 5 years | in about 5 years |
+| 2004-01-01T00:00:00.000Z | about 4 years | about 4 years | in about 4 years |
+| 2003-01-01T00:00:00.000Z | about 3 years | about 3 years | in about 3 years |
+| 2002-01-01T00:00:00.000Z | about 2 years | about 2 years | in about 2 years |
+| 2001-06-01T00:00:00.000Z | over 1 year | over 1 year | in over 1 year |
+| 2001-02-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2001-01-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2000-06-01T00:00:00.000Z | 5 months | 5 months | in 5 months |
+| 2000-03-01T00:00:00.000Z | 2 months | 2 months | in 2 months |
+| 2000-02-01T00:00:00.000Z | about 1 month | about 1 month | in about 1 month |
+| 2000-01-15T00:00:00.000Z | 14 days | 14 days | in 14 days |
+| 2000-01-02T00:00:00.000Z | 1 day | 1 day | in 1 day |
+| 2000-01-01T06:00:00.000Z | about 6 hours | about 6 hours | in about 6 hours |
+| 2000-01-01T01:00:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:45:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | in 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | in 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | in 1 minute |
+| 2000-01-01T00:00:25.000Z | less than a minute | half a minute | in less than a minute |
+| 2000-01-01T00:00:15.000Z | less than a minute | less than 20 seconds | in less than a minute |
+| 2000-01-01T00:00:05.000Z | less than a minute | less than 10 seconds | in less than a minute |
+| 2000-01-01T00:00:00.000Z | less than a minute | less than 5 seconds | less than a minute ago |
+| 1999-12-31T23:59:55.000Z | less than a minute | less than 10 seconds | less than a minute ago |
+| 1999-12-31T23:59:45.000Z | less than a minute | less than 20 seconds | less than a minute ago |
+| 1999-12-31T23:59:35.000Z | less than a minute | half a minute | less than a minute ago |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | 1 minute ago |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | 15 minutes ago |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | 30 minutes ago |
+| 1999-12-31T23:15:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T23:00:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T18:00:00.000Z | about 6 hours | about 6 hours | about 6 hours ago |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days | 2 days ago |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days | 17 days ago |
+| 1999-12-01T00:00:00.000Z | about 1 month | about 1 month | about 1 month ago |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months | 2 months ago |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months | 7 months ago |
+| 1999-01-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-12-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-06-01T00:00:00.000Z | over 1 year | over 1 year | over 1 year ago |
+| 1998-01-01T00:00:00.000Z | about 2 years | about 2 years | about 2 years ago |
+| 1997-01-01T00:00:00.000Z | about 3 years | about 3 years | about 3 years ago |
+| 1996-01-01T00:00:00.000Z | about 4 years | about 4 years | about 4 years ago |
+| 1995-01-01T00:00:00.000Z | about 5 years | about 5 years | about 5 years ago |
+| 1994-01-01T00:00:00.000Z | about 6 years | about 6 years | about 6 years ago |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 years | in 6 years | 52608 hours |
+| 2005-01-01T00:00:00.000Z | 5 years | in 5 years | 43848 hours |
+| 2004-01-01T00:00:00.000Z | 4 years | in 4 years | 35064 hours |
+| 2003-01-01T00:00:00.000Z | 3 years | in 3 years | 26304 hours |
+| 2002-01-01T00:00:00.000Z | 2 years | in 2 years | 17544 hours |
+| 2001-06-01T00:00:00.000Z | 1 year | in 1 year | 12408 hours |
+| 2001-02-01T00:00:00.000Z | 1 year | in 1 year | 9528 hours |
+| 2001-01-01T00:00:00.000Z | 1 year | in 1 year | 8784 hours |
+| 2000-06-01T00:00:00.000Z | 5 months | in 5 months | 3648 hours |
+| 2000-03-01T00:00:00.000Z | 2 months | in 2 months | 1440 hours |
+| 2000-02-01T00:00:00.000Z | 1 month | in 1 month | 744 hours |
+| 2000-01-15T00:00:00.000Z | 14 days | in 14 days | 336 hours |
+| 2000-01-02T00:00:00.000Z | 1 day | in 1 day | 24 hours |
+| 2000-01-01T06:00:00.000Z | 6 hours | in 6 hours | 6 hours |
+| 2000-01-01T01:00:00.000Z | 1 hour | in 1 hour | 1 hour |
+| 2000-01-01T00:45:00.000Z | 45 minutes | in 45 minutes | 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | in 30 minutes | 1 hour |
+| 2000-01-01T00:15:00.000Z | 15 minutes | in 15 minutes | 0 hours |
+| 2000-01-01T00:01:00.000Z | 1 minute | in 1 minute | 0 hours |
+| 2000-01-01T00:00:25.000Z | 25 seconds | in 25 seconds | 0 hours |
+| 2000-01-01T00:00:15.000Z | 15 seconds | in 15 seconds | 0 hours |
+| 2000-01-01T00:00:05.000Z | 5 seconds | in 5 seconds | 0 hours |
+| 2000-01-01T00:00:00.000Z | 0 seconds | 0 seconds ago | 0 hours |
+| 1999-12-31T23:59:55.000Z | 5 seconds | 5 seconds ago | 0 hours |
+| 1999-12-31T23:59:45.000Z | 15 seconds | 15 seconds ago | 0 hours |
+| 1999-12-31T23:59:35.000Z | 25 seconds | 25 seconds ago | 0 hours |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute ago | 0 hours |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes ago | 0 hours |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes ago | 1 hour |
+| 1999-12-31T23:15:00.000Z | 45 minutes | 45 minutes ago | 1 hour |
+| 1999-12-31T23:00:00.000Z | 1 hour | 1 hour ago | 1 hour |
+| 1999-12-31T18:00:00.000Z | 6 hours | 6 hours ago | 6 hours |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days ago | 48 hours |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days ago | 408 hours |
+| 1999-12-01T00:00:00.000Z | 1 month | 1 month ago | 744 hours |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months ago | 1464 hours |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months ago | 5136 hours |
+| 1999-01-01T00:00:00.000Z | 1 year | 1 year ago | 8760 hours |
+| 1998-12-01T00:00:00.000Z | 1 year | 1 year ago | 9504 hours |
+| 1998-06-01T00:00:00.000Z | 2 years | 2 years ago | 13896 hours |
+| 1998-01-01T00:00:00.000Z | 2 years | 2 years ago | 17520 hours |
+| 1997-01-01T00:00:00.000Z | 3 years | 3 years ago | 26280 hours |
+| 1996-01-01T00:00:00.000Z | 4 years | 4 years ago | 35064 hours |
+| 1995-01-01T00:00:00.000Z | 5 years | 5 years ago | 43824 hours |
+| 1994-01-01T00:00:00.000Z | 6 years | 6 years ago | 52584 hours |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | Wednesday at 12:00 AM |
+| 2000-01-02T00:00:00.000Z | tomorrow at 12:00 AM |
+| 2000-01-01T00:00:00.000Z | today at 12:00 AM |
+| 1999-12-31T00:00:00.000Z | yesterday at 12:00 AM |
+| 1999-12-27T00:00:00.000Z | last Monday at 12:00 AM |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/en-NZ/_lib/formatLong/index.js b/date-fns/src/locale/en-NZ/_lib/formatLong/index.js
new file mode 100644
index 0000000..8e674cd
--- /dev/null
+++ b/date-fns/src/locale/en-NZ/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/en-NZ/index.d.ts b/date-fns/src/locale/en-NZ/index.d.ts
new file mode 100644
index 0000000..dbf083d
--- /dev/null
+++ b/date-fns/src/locale/en-NZ/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { enNZ } from 'date-fns/locale'
+export default enNZ
diff --git a/date-fns/src/locale/en-NZ/index.js b/date-fns/src/locale/en-NZ/index.js
new file mode 100644
index 0000000..95cac51
--- /dev/null
+++ b/date-fns/src/locale/en-NZ/index.js
@@ -0,0 +1,28 @@
+import formatDistance from '../en-US/_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from '../en-US/_lib/formatRelative/index'
+import localize from '../en-US/_lib/localize/index'
+import match from '../en-US/_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary English locale (New Zealand).
+ * @language English
+ * @iso-639-2 eng
+ * @author Murray Lucas [@muntact]{@link https://github.com/muntact}
+ */
+var locale = {
+ code: 'en-NZ',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/en-NZ/index.js.flow b/date-fns/src/locale/en-NZ/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/en-NZ/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/en-NZ/snapshot.md b/date-fns/src/locale/en-NZ/snapshot.md
new file mode 100644
index 0000000..237ed72
--- /dev/null
+++ b/date-fns/src/locale/en-NZ/snapshot.md
@@ -0,0 +1,304 @@
+# English (en-NZ) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987th | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987th | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4th | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11th | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28th | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365th | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1st | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55th | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1st | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55th | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb 1987, 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453, 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 February 1987 at 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 at 11:59:59 PM GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 at 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 at 11:59:59 PM GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | about 6 years | about 6 years | in about 6 years |
+| 2005-01-01T00:00:00.000Z | about 5 years | about 5 years | in about 5 years |
+| 2004-01-01T00:00:00.000Z | about 4 years | about 4 years | in about 4 years |
+| 2003-01-01T00:00:00.000Z | about 3 years | about 3 years | in about 3 years |
+| 2002-01-01T00:00:00.000Z | about 2 years | about 2 years | in about 2 years |
+| 2001-06-01T00:00:00.000Z | over 1 year | over 1 year | in over 1 year |
+| 2001-02-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2001-01-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2000-06-01T00:00:00.000Z | 5 months | 5 months | in 5 months |
+| 2000-03-01T00:00:00.000Z | 2 months | 2 months | in 2 months |
+| 2000-02-01T00:00:00.000Z | about 1 month | about 1 month | in about 1 month |
+| 2000-01-15T00:00:00.000Z | 14 days | 14 days | in 14 days |
+| 2000-01-02T00:00:00.000Z | 1 day | 1 day | in 1 day |
+| 2000-01-01T06:00:00.000Z | about 6 hours | about 6 hours | in about 6 hours |
+| 2000-01-01T01:00:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:45:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | in 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | in 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | in 1 minute |
+| 2000-01-01T00:00:25.000Z | less than a minute | half a minute | in less than a minute |
+| 2000-01-01T00:00:15.000Z | less than a minute | less than 20 seconds | in less than a minute |
+| 2000-01-01T00:00:05.000Z | less than a minute | less than 10 seconds | in less than a minute |
+| 2000-01-01T00:00:00.000Z | less than a minute | less than 5 seconds | less than a minute ago |
+| 1999-12-31T23:59:55.000Z | less than a minute | less than 10 seconds | less than a minute ago |
+| 1999-12-31T23:59:45.000Z | less than a minute | less than 20 seconds | less than a minute ago |
+| 1999-12-31T23:59:35.000Z | less than a minute | half a minute | less than a minute ago |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | 1 minute ago |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | 15 minutes ago |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | 30 minutes ago |
+| 1999-12-31T23:15:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T23:00:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T18:00:00.000Z | about 6 hours | about 6 hours | about 6 hours ago |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days | 2 days ago |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days | 17 days ago |
+| 1999-12-01T00:00:00.000Z | about 1 month | about 1 month | about 1 month ago |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months | 2 months ago |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months | 7 months ago |
+| 1999-01-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-12-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-06-01T00:00:00.000Z | over 1 year | over 1 year | over 1 year ago |
+| 1998-01-01T00:00:00.000Z | about 2 years | about 2 years | about 2 years ago |
+| 1997-01-01T00:00:00.000Z | about 3 years | about 3 years | about 3 years ago |
+| 1996-01-01T00:00:00.000Z | about 4 years | about 4 years | about 4 years ago |
+| 1995-01-01T00:00:00.000Z | about 5 years | about 5 years | about 5 years ago |
+| 1994-01-01T00:00:00.000Z | about 6 years | about 6 years | about 6 years ago |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 years | in 6 years | 52608 hours |
+| 2005-01-01T00:00:00.000Z | 5 years | in 5 years | 43848 hours |
+| 2004-01-01T00:00:00.000Z | 4 years | in 4 years | 35064 hours |
+| 2003-01-01T00:00:00.000Z | 3 years | in 3 years | 26304 hours |
+| 2002-01-01T00:00:00.000Z | 2 years | in 2 years | 17544 hours |
+| 2001-06-01T00:00:00.000Z | 1 year | in 1 year | 12408 hours |
+| 2001-02-01T00:00:00.000Z | 1 year | in 1 year | 9528 hours |
+| 2001-01-01T00:00:00.000Z | 1 year | in 1 year | 8784 hours |
+| 2000-06-01T00:00:00.000Z | 5 months | in 5 months | 3648 hours |
+| 2000-03-01T00:00:00.000Z | 2 months | in 2 months | 1440 hours |
+| 2000-02-01T00:00:00.000Z | 1 month | in 1 month | 744 hours |
+| 2000-01-15T00:00:00.000Z | 14 days | in 14 days | 336 hours |
+| 2000-01-02T00:00:00.000Z | 1 day | in 1 day | 24 hours |
+| 2000-01-01T06:00:00.000Z | 6 hours | in 6 hours | 6 hours |
+| 2000-01-01T01:00:00.000Z | 1 hour | in 1 hour | 1 hour |
+| 2000-01-01T00:45:00.000Z | 45 minutes | in 45 minutes | 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | in 30 minutes | 1 hour |
+| 2000-01-01T00:15:00.000Z | 15 minutes | in 15 minutes | 0 hours |
+| 2000-01-01T00:01:00.000Z | 1 minute | in 1 minute | 0 hours |
+| 2000-01-01T00:00:25.000Z | 25 seconds | in 25 seconds | 0 hours |
+| 2000-01-01T00:00:15.000Z | 15 seconds | in 15 seconds | 0 hours |
+| 2000-01-01T00:00:05.000Z | 5 seconds | in 5 seconds | 0 hours |
+| 2000-01-01T00:00:00.000Z | 0 seconds | 0 seconds ago | 0 hours |
+| 1999-12-31T23:59:55.000Z | 5 seconds | 5 seconds ago | 0 hours |
+| 1999-12-31T23:59:45.000Z | 15 seconds | 15 seconds ago | 0 hours |
+| 1999-12-31T23:59:35.000Z | 25 seconds | 25 seconds ago | 0 hours |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute ago | 0 hours |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes ago | 0 hours |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes ago | 1 hour |
+| 1999-12-31T23:15:00.000Z | 45 minutes | 45 minutes ago | 1 hour |
+| 1999-12-31T23:00:00.000Z | 1 hour | 1 hour ago | 1 hour |
+| 1999-12-31T18:00:00.000Z | 6 hours | 6 hours ago | 6 hours |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days ago | 48 hours |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days ago | 408 hours |
+| 1999-12-01T00:00:00.000Z | 1 month | 1 month ago | 744 hours |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months ago | 1464 hours |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months ago | 5136 hours |
+| 1999-01-01T00:00:00.000Z | 1 year | 1 year ago | 8760 hours |
+| 1998-12-01T00:00:00.000Z | 1 year | 1 year ago | 9504 hours |
+| 1998-06-01T00:00:00.000Z | 2 years | 2 years ago | 13896 hours |
+| 1998-01-01T00:00:00.000Z | 2 years | 2 years ago | 17520 hours |
+| 1997-01-01T00:00:00.000Z | 3 years | 3 years ago | 26280 hours |
+| 1996-01-01T00:00:00.000Z | 4 years | 4 years ago | 35064 hours |
+| 1995-01-01T00:00:00.000Z | 5 years | 5 years ago | 43824 hours |
+| 1994-01-01T00:00:00.000Z | 6 years | 6 years ago | 52584 hours |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | Wednesday at 12:00 AM |
+| 2000-01-02T00:00:00.000Z | tomorrow at 12:00 AM |
+| 2000-01-01T00:00:00.000Z | today at 12:00 AM |
+| 1999-12-31T00:00:00.000Z | yesterday at 12:00 AM |
+| 1999-12-27T00:00:00.000Z | last Monday at 12:00 AM |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/en-US/_lib/formatDistance/index.js b/date-fns/src/locale/en-US/_lib/formatDistance/index.js
new file mode 100644
index 0000000..ebcde65
--- /dev/null
+++ b/date-fns/src/locale/en-US/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'less than a second',
+ other: 'less than {{count}} seconds'
+ },
+
+ xSeconds: {
+ one: '1 second',
+ other: '{{count}} seconds'
+ },
+
+ halfAMinute: 'half a minute',
+
+ lessThanXMinutes: {
+ one: 'less than a minute',
+ other: 'less than {{count}} minutes'
+ },
+
+ xMinutes: {
+ one: '1 minute',
+ other: '{{count}} minutes'
+ },
+
+ aboutXHours: {
+ one: 'about 1 hour',
+ other: 'about {{count}} hours'
+ },
+
+ xHours: {
+ one: '1 hour',
+ other: '{{count}} hours'
+ },
+
+ xDays: {
+ one: '1 day',
+ other: '{{count}} days'
+ },
+
+ aboutXWeeks: {
+ one: 'about 1 week',
+ other: 'about {{count}} weeks'
+ },
+
+ xWeeks: {
+ one: '1 week',
+ other: '{{count}} weeks'
+ },
+
+ aboutXMonths: {
+ one: 'about 1 month',
+ other: 'about {{count}} months'
+ },
+
+ xMonths: {
+ one: '1 month',
+ other: '{{count}} months'
+ },
+
+ aboutXYears: {
+ one: 'about 1 year',
+ other: 'about {{count}} years'
+ },
+
+ xYears: {
+ one: '1 year',
+ other: '{{count}} years'
+ },
+
+ overXYears: {
+ one: 'over 1 year',
+ other: 'over {{count}} years'
+ },
+
+ almostXYears: {
+ one: 'almost 1 year',
+ other: 'almost {{count}} years'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'in ' + result
+ } else {
+ return result + ' ago'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/en-US/_lib/formatLong/index.js b/date-fns/src/locale/en-US/_lib/formatLong/index.js
new file mode 100644
index 0000000..212cf21
--- /dev/null
+++ b/date-fns/src/locale/en-US/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/en-US/_lib/formatRelative/index.js b/date-fns/src/locale/en-US/_lib/formatRelative/index.js
new file mode 100644
index 0000000..192af7d
--- /dev/null
+++ b/date-fns/src/locale/en-US/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'last' eeee 'at' p",
+ yesterday: "'yesterday at' p",
+ today: "'today at' p",
+ tomorrow: "'tomorrow at' p",
+ nextWeek: "eeee 'at' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/en-US/_lib/localize/index.js b/date-fns/src/locale/en-US/_lib/localize/index.js
new file mode 100644
index 0000000..1ffb8bf
--- /dev/null
+++ b/date-fns/src/locale/en-US/_lib/localize/index.js
@@ -0,0 +1,192 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['B', 'A'],
+ abbreviated: ['BC', 'AD'],
+ wide: ['Before Christ', 'Anno Domini']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Feb',
+ 'Mar',
+ 'Apr',
+ 'May',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Oct',
+ 'Nov',
+ 'Dec'
+ ],
+ wide: [
+ 'January',
+ 'February',
+ 'March',
+ 'April',
+ 'May',
+ 'June',
+ 'July',
+ 'August',
+ 'September',
+ 'October',
+ 'November',
+ 'December'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+ wide: [
+ 'Sunday',
+ 'Monday',
+ 'Tuesday',
+ 'Wednesday',
+ 'Thursday',
+ 'Friday',
+ 'Saturday'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mi',
+ noon: 'n',
+ morning: 'morning',
+ afternoon: 'afternoon',
+ evening: 'evening',
+ night: 'night'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'midnight',
+ noon: 'noon',
+ morning: 'morning',
+ afternoon: 'afternoon',
+ evening: 'evening',
+ night: 'night'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnight',
+ noon: 'noon',
+ morning: 'morning',
+ afternoon: 'afternoon',
+ evening: 'evening',
+ night: 'night'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mi',
+ noon: 'n',
+ morning: 'in the morning',
+ afternoon: 'in the afternoon',
+ evening: 'in the evening',
+ night: 'at night'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'midnight',
+ noon: 'noon',
+ morning: 'in the morning',
+ afternoon: 'in the afternoon',
+ evening: 'in the evening',
+ night: 'at night'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnight',
+ noon: 'noon',
+ morning: 'in the morning',
+ afternoon: 'in the afternoon',
+ evening: 'in the evening',
+ night: 'at night'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ var rem100 = number % 100
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ return number + 'st'
+ case 2:
+ return number + 'nd'
+ case 3:
+ return number + 'rd'
+ }
+ }
+ return number + 'th'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/en-US/_lib/match/index.js b/date-fns/src/locale/en-US/_lib/match/index.js
new file mode 100644
index 0000000..87acc8b
--- /dev/null
+++ b/date-fns/src/locale/en-US/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(b|a)/i,
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
+ wide: /^(before christ|before common era|anno domini|common era)/i
+}
+var parseEraPatterns = {
+ any: [/^b/i, /^(a|c)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](th|st|nd|rd)? quarter/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^may/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smtwf]/i,
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mi/i,
+ noon: /^no/i,
+ morning: /morning/i,
+ afternoon: /afternoon/i,
+ evening: /evening/i,
+ night: /night/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/en-US/index.d.ts b/date-fns/src/locale/en-US/index.d.ts
new file mode 100644
index 0000000..967f257
--- /dev/null
+++ b/date-fns/src/locale/en-US/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { enUS } from 'date-fns/locale'
+export default enUS
diff --git a/date-fns/src/locale/en-US/index.js b/date-fns/src/locale/en-US/index.js
new file mode 100644
index 0000000..944103c
--- /dev/null
+++ b/date-fns/src/locale/en-US/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary English locale (United States).
+ * @language English
+ * @iso-639-2 eng
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
+ */
+var locale = {
+ code: 'en-US',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/en-US/index.js.flow b/date-fns/src/locale/en-US/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/en-US/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/en-US/snapshot.md b/date-fns/src/locale/en-US/snapshot.md
new file mode 100644
index 0000000..19e6dcb
--- /dev/null
+++ b/date-fns/src/locale/en-US/snapshot.md
@@ -0,0 +1,304 @@
+# English (en-US) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987th | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987th | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1st | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49th | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11th | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28th | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365th | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6th | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6th | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1st | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55th | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1st | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55th | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | Feb 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | May 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | February 11th, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | May 29th, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Wednesday, February 11th, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sunday, May 29th, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | Feb 11, 1987, 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | May 29, 1453, 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | February 11th, 1987 at 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | May 29th, 1453 at 11:59:59 PM GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Wednesday, February 11th, 1987 at 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sunday, May 29th, 1453 at 11:59:59 PM GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | about 6 years | about 6 years | in about 6 years |
+| 2005-01-01T00:00:00.000Z | about 5 years | about 5 years | in about 5 years |
+| 2004-01-01T00:00:00.000Z | about 4 years | about 4 years | in about 4 years |
+| 2003-01-01T00:00:00.000Z | about 3 years | about 3 years | in about 3 years |
+| 2002-01-01T00:00:00.000Z | about 2 years | about 2 years | in about 2 years |
+| 2001-06-01T00:00:00.000Z | over 1 year | over 1 year | in over 1 year |
+| 2001-02-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2001-01-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2000-06-01T00:00:00.000Z | 5 months | 5 months | in 5 months |
+| 2000-03-01T00:00:00.000Z | 2 months | 2 months | in 2 months |
+| 2000-02-01T00:00:00.000Z | about 1 month | about 1 month | in about 1 month |
+| 2000-01-15T00:00:00.000Z | 14 days | 14 days | in 14 days |
+| 2000-01-02T00:00:00.000Z | 1 day | 1 day | in 1 day |
+| 2000-01-01T06:00:00.000Z | about 6 hours | about 6 hours | in about 6 hours |
+| 2000-01-01T01:00:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:45:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | in 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | in 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | in 1 minute |
+| 2000-01-01T00:00:25.000Z | less than a minute | half a minute | in less than a minute |
+| 2000-01-01T00:00:15.000Z | less than a minute | less than 20 seconds | in less than a minute |
+| 2000-01-01T00:00:05.000Z | less than a minute | less than 10 seconds | in less than a minute |
+| 2000-01-01T00:00:00.000Z | less than a minute | less than 5 seconds | less than a minute ago |
+| 1999-12-31T23:59:55.000Z | less than a minute | less than 10 seconds | less than a minute ago |
+| 1999-12-31T23:59:45.000Z | less than a minute | less than 20 seconds | less than a minute ago |
+| 1999-12-31T23:59:35.000Z | less than a minute | half a minute | less than a minute ago |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | 1 minute ago |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | 15 minutes ago |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | 30 minutes ago |
+| 1999-12-31T23:15:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T23:00:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T18:00:00.000Z | about 6 hours | about 6 hours | about 6 hours ago |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days | 2 days ago |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days | 17 days ago |
+| 1999-12-01T00:00:00.000Z | about 1 month | about 1 month | about 1 month ago |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months | 2 months ago |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months | 7 months ago |
+| 1999-01-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-12-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-06-01T00:00:00.000Z | over 1 year | over 1 year | over 1 year ago |
+| 1998-01-01T00:00:00.000Z | about 2 years | about 2 years | about 2 years ago |
+| 1997-01-01T00:00:00.000Z | about 3 years | about 3 years | about 3 years ago |
+| 1996-01-01T00:00:00.000Z | about 4 years | about 4 years | about 4 years ago |
+| 1995-01-01T00:00:00.000Z | about 5 years | about 5 years | about 5 years ago |
+| 1994-01-01T00:00:00.000Z | about 6 years | about 6 years | about 6 years ago |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 years | in 6 years | 52608 hours |
+| 2005-01-01T00:00:00.000Z | 5 years | in 5 years | 43848 hours |
+| 2004-01-01T00:00:00.000Z | 4 years | in 4 years | 35064 hours |
+| 2003-01-01T00:00:00.000Z | 3 years | in 3 years | 26304 hours |
+| 2002-01-01T00:00:00.000Z | 2 years | in 2 years | 17544 hours |
+| 2001-06-01T00:00:00.000Z | 1 year | in 1 year | 12408 hours |
+| 2001-02-01T00:00:00.000Z | 1 year | in 1 year | 9528 hours |
+| 2001-01-01T00:00:00.000Z | 1 year | in 1 year | 8784 hours |
+| 2000-06-01T00:00:00.000Z | 5 months | in 5 months | 3648 hours |
+| 2000-03-01T00:00:00.000Z | 2 months | in 2 months | 1440 hours |
+| 2000-02-01T00:00:00.000Z | 1 month | in 1 month | 744 hours |
+| 2000-01-15T00:00:00.000Z | 14 days | in 14 days | 336 hours |
+| 2000-01-02T00:00:00.000Z | 1 day | in 1 day | 24 hours |
+| 2000-01-01T06:00:00.000Z | 6 hours | in 6 hours | 6 hours |
+| 2000-01-01T01:00:00.000Z | 1 hour | in 1 hour | 1 hour |
+| 2000-01-01T00:45:00.000Z | 45 minutes | in 45 minutes | 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | in 30 minutes | 1 hour |
+| 2000-01-01T00:15:00.000Z | 15 minutes | in 15 minutes | 0 hours |
+| 2000-01-01T00:01:00.000Z | 1 minute | in 1 minute | 0 hours |
+| 2000-01-01T00:00:25.000Z | 25 seconds | in 25 seconds | 0 hours |
+| 2000-01-01T00:00:15.000Z | 15 seconds | in 15 seconds | 0 hours |
+| 2000-01-01T00:00:05.000Z | 5 seconds | in 5 seconds | 0 hours |
+| 2000-01-01T00:00:00.000Z | 0 seconds | 0 seconds ago | 0 hours |
+| 1999-12-31T23:59:55.000Z | 5 seconds | 5 seconds ago | 0 hours |
+| 1999-12-31T23:59:45.000Z | 15 seconds | 15 seconds ago | 0 hours |
+| 1999-12-31T23:59:35.000Z | 25 seconds | 25 seconds ago | 0 hours |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute ago | 0 hours |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes ago | 0 hours |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes ago | 1 hour |
+| 1999-12-31T23:15:00.000Z | 45 minutes | 45 minutes ago | 1 hour |
+| 1999-12-31T23:00:00.000Z | 1 hour | 1 hour ago | 1 hour |
+| 1999-12-31T18:00:00.000Z | 6 hours | 6 hours ago | 6 hours |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days ago | 48 hours |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days ago | 408 hours |
+| 1999-12-01T00:00:00.000Z | 1 month | 1 month ago | 744 hours |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months ago | 1464 hours |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months ago | 5136 hours |
+| 1999-01-01T00:00:00.000Z | 1 year | 1 year ago | 8760 hours |
+| 1998-12-01T00:00:00.000Z | 1 year | 1 year ago | 9504 hours |
+| 1998-06-01T00:00:00.000Z | 2 years | 2 years ago | 13896 hours |
+| 1998-01-01T00:00:00.000Z | 2 years | 2 years ago | 17520 hours |
+| 1997-01-01T00:00:00.000Z | 3 years | 3 years ago | 26280 hours |
+| 1996-01-01T00:00:00.000Z | 4 years | 4 years ago | 35064 hours |
+| 1995-01-01T00:00:00.000Z | 5 years | 5 years ago | 43824 hours |
+| 1994-01-01T00:00:00.000Z | 6 years | 6 years ago | 52584 hours |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | Wednesday at 12:00 AM |
+| 2000-01-02T00:00:00.000Z | tomorrow at 12:00 AM |
+| 2000-01-01T00:00:00.000Z | today at 12:00 AM |
+| 1999-12-31T00:00:00.000Z | yesterday at 12:00 AM |
+| 1999-12-27T00:00:00.000Z | last Monday at 12:00 AM |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/en-ZA/_lib/formatLong/index.js b/date-fns/src/locale/en-ZA/_lib/formatLong/index.js
new file mode 100644
index 0000000..8e674cd
--- /dev/null
+++ b/date-fns/src/locale/en-ZA/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'at' {{time}}",
+ long: "{{date}} 'at' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/en-ZA/index.d.ts b/date-fns/src/locale/en-ZA/index.d.ts
new file mode 100644
index 0000000..ebdd1c8
--- /dev/null
+++ b/date-fns/src/locale/en-ZA/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { enZA } from 'date-fns/locale'
+export default enZA
diff --git a/date-fns/src/locale/en-ZA/index.js b/date-fns/src/locale/en-ZA/index.js
new file mode 100644
index 0000000..4d4f300
--- /dev/null
+++ b/date-fns/src/locale/en-ZA/index.js
@@ -0,0 +1,28 @@
+import formatDistance from '../en-US/_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from '../en-US/_lib/formatRelative/index'
+import localize from '../en-US/_lib/localize/index'
+import match from '../en-US/_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary English locale (South Africa).
+ * @language English
+ * @iso-639-2 eng
+ * @author Shaila Kavrakova [@shaykav]{@link https://github.com/shaykav}
+ */
+var locale = {
+ code: 'en-ZA',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0, // Sunday is the first day of the week.
+ firstWeekContainsDate: 1 // The week that contains Jan 1st is the first week of the year.
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/en-ZA/index.js.flow b/date-fns/src/locale/en-ZA/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/en-ZA/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/en-ZA/snapshot.md b/date-fns/src/locale/en-ZA/snapshot.md
new file mode 100644
index 0000000..e4eace2
--- /dev/null
+++ b/date-fns/src/locale/en-ZA/snapshot.md
@@ -0,0 +1,304 @@
+# English (en-ZA) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987th | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987th | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5th | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1st | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1st quarter | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2nd quarter | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7th | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | February | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | July | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1st | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49th | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1st | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48th | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11th | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28th | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365th | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1st | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5th | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6th | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2nd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6th | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Monday | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Friday | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | in the morning | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | in the afternoon | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | in the evening | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | at night | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11th | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11th | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23rd | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1st | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55th | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1st | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55th | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb 1987, 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453, 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 February 1987 at 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 at 11:59:59 PM GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Wednesday, 11 February 1987 at 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sunday, 29 May 1453 at 11:59:59 PM GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | about 6 years | about 6 years | in about 6 years |
+| 2005-01-01T00:00:00.000Z | about 5 years | about 5 years | in about 5 years |
+| 2004-01-01T00:00:00.000Z | about 4 years | about 4 years | in about 4 years |
+| 2003-01-01T00:00:00.000Z | about 3 years | about 3 years | in about 3 years |
+| 2002-01-01T00:00:00.000Z | about 2 years | about 2 years | in about 2 years |
+| 2001-06-01T00:00:00.000Z | over 1 year | over 1 year | in over 1 year |
+| 2001-02-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2001-01-01T00:00:00.000Z | about 1 year | about 1 year | in about 1 year |
+| 2000-06-01T00:00:00.000Z | 5 months | 5 months | in 5 months |
+| 2000-03-01T00:00:00.000Z | 2 months | 2 months | in 2 months |
+| 2000-02-01T00:00:00.000Z | about 1 month | about 1 month | in about 1 month |
+| 2000-01-15T00:00:00.000Z | 14 days | 14 days | in 14 days |
+| 2000-01-02T00:00:00.000Z | 1 day | 1 day | in 1 day |
+| 2000-01-01T06:00:00.000Z | about 6 hours | about 6 hours | in about 6 hours |
+| 2000-01-01T01:00:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:45:00.000Z | about 1 hour | about 1 hour | in about 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | in 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | in 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | in 1 minute |
+| 2000-01-01T00:00:25.000Z | less than a minute | half a minute | in less than a minute |
+| 2000-01-01T00:00:15.000Z | less than a minute | less than 20 seconds | in less than a minute |
+| 2000-01-01T00:00:05.000Z | less than a minute | less than 10 seconds | in less than a minute |
+| 2000-01-01T00:00:00.000Z | less than a minute | less than 5 seconds | less than a minute ago |
+| 1999-12-31T23:59:55.000Z | less than a minute | less than 10 seconds | less than a minute ago |
+| 1999-12-31T23:59:45.000Z | less than a minute | less than 20 seconds | less than a minute ago |
+| 1999-12-31T23:59:35.000Z | less than a minute | half a minute | less than a minute ago |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | 1 minute ago |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | 15 minutes ago |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | 30 minutes ago |
+| 1999-12-31T23:15:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T23:00:00.000Z | about 1 hour | about 1 hour | about 1 hour ago |
+| 1999-12-31T18:00:00.000Z | about 6 hours | about 6 hours | about 6 hours ago |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days | 2 days ago |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days | 17 days ago |
+| 1999-12-01T00:00:00.000Z | about 1 month | about 1 month | about 1 month ago |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months | 2 months ago |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months | 7 months ago |
+| 1999-01-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-12-01T00:00:00.000Z | about 1 year | about 1 year | about 1 year ago |
+| 1998-06-01T00:00:00.000Z | over 1 year | over 1 year | over 1 year ago |
+| 1998-01-01T00:00:00.000Z | about 2 years | about 2 years | about 2 years ago |
+| 1997-01-01T00:00:00.000Z | about 3 years | about 3 years | about 3 years ago |
+| 1996-01-01T00:00:00.000Z | about 4 years | about 4 years | about 4 years ago |
+| 1995-01-01T00:00:00.000Z | about 5 years | about 5 years | about 5 years ago |
+| 1994-01-01T00:00:00.000Z | about 6 years | about 6 years | about 6 years ago |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 years | in 6 years | 52608 hours |
+| 2005-01-01T00:00:00.000Z | 5 years | in 5 years | 43848 hours |
+| 2004-01-01T00:00:00.000Z | 4 years | in 4 years | 35064 hours |
+| 2003-01-01T00:00:00.000Z | 3 years | in 3 years | 26304 hours |
+| 2002-01-01T00:00:00.000Z | 2 years | in 2 years | 17544 hours |
+| 2001-06-01T00:00:00.000Z | 1 year | in 1 year | 12408 hours |
+| 2001-02-01T00:00:00.000Z | 1 year | in 1 year | 9528 hours |
+| 2001-01-01T00:00:00.000Z | 1 year | in 1 year | 8784 hours |
+| 2000-06-01T00:00:00.000Z | 5 months | in 5 months | 3648 hours |
+| 2000-03-01T00:00:00.000Z | 2 months | in 2 months | 1440 hours |
+| 2000-02-01T00:00:00.000Z | 1 month | in 1 month | 744 hours |
+| 2000-01-15T00:00:00.000Z | 14 days | in 14 days | 336 hours |
+| 2000-01-02T00:00:00.000Z | 1 day | in 1 day | 24 hours |
+| 2000-01-01T06:00:00.000Z | 6 hours | in 6 hours | 6 hours |
+| 2000-01-01T01:00:00.000Z | 1 hour | in 1 hour | 1 hour |
+| 2000-01-01T00:45:00.000Z | 45 minutes | in 45 minutes | 1 hour |
+| 2000-01-01T00:30:00.000Z | 30 minutes | in 30 minutes | 1 hour |
+| 2000-01-01T00:15:00.000Z | 15 minutes | in 15 minutes | 0 hours |
+| 2000-01-01T00:01:00.000Z | 1 minute | in 1 minute | 0 hours |
+| 2000-01-01T00:00:25.000Z | 25 seconds | in 25 seconds | 0 hours |
+| 2000-01-01T00:00:15.000Z | 15 seconds | in 15 seconds | 0 hours |
+| 2000-01-01T00:00:05.000Z | 5 seconds | in 5 seconds | 0 hours |
+| 2000-01-01T00:00:00.000Z | 0 seconds | 0 seconds ago | 0 hours |
+| 1999-12-31T23:59:55.000Z | 5 seconds | 5 seconds ago | 0 hours |
+| 1999-12-31T23:59:45.000Z | 15 seconds | 15 seconds ago | 0 hours |
+| 1999-12-31T23:59:35.000Z | 25 seconds | 25 seconds ago | 0 hours |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute ago | 0 hours |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes ago | 0 hours |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes ago | 1 hour |
+| 1999-12-31T23:15:00.000Z | 45 minutes | 45 minutes ago | 1 hour |
+| 1999-12-31T23:00:00.000Z | 1 hour | 1 hour ago | 1 hour |
+| 1999-12-31T18:00:00.000Z | 6 hours | 6 hours ago | 6 hours |
+| 1999-12-30T00:00:00.000Z | 2 days | 2 days ago | 48 hours |
+| 1999-12-15T00:00:00.000Z | 17 days | 17 days ago | 408 hours |
+| 1999-12-01T00:00:00.000Z | 1 month | 1 month ago | 744 hours |
+| 1999-11-01T00:00:00.000Z | 2 months | 2 months ago | 1464 hours |
+| 1999-06-01T00:00:00.000Z | 7 months | 7 months ago | 5136 hours |
+| 1999-01-01T00:00:00.000Z | 1 year | 1 year ago | 8760 hours |
+| 1998-12-01T00:00:00.000Z | 1 year | 1 year ago | 9504 hours |
+| 1998-06-01T00:00:00.000Z | 2 years | 2 years ago | 13896 hours |
+| 1998-01-01T00:00:00.000Z | 2 years | 2 years ago | 17520 hours |
+| 1997-01-01T00:00:00.000Z | 3 years | 3 years ago | 26280 hours |
+| 1996-01-01T00:00:00.000Z | 4 years | 4 years ago | 35064 hours |
+| 1995-01-01T00:00:00.000Z | 5 years | 5 years ago | 43824 hours |
+| 1994-01-01T00:00:00.000Z | 6 years | 6 years ago | 52584 hours |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | Wednesday at 12:00 AM |
+| 2000-01-02T00:00:00.000Z | tomorrow at 12:00 AM |
+| 2000-01-01T00:00:00.000Z | today at 12:00 AM |
+| 1999-12-31T00:00:00.000Z | yesterday at 12:00 AM |
+| 1999-12-27T00:00:00.000Z | last Monday at 12:00 AM |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/eo/_lib/formatDistance/index.js b/date-fns/src/locale/eo/_lib/formatDistance/index.js
new file mode 100644
index 0000000..bfadf02
--- /dev/null
+++ b/date-fns/src/locale/eo/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'malpli ol sekundo',
+ other: 'malpli ol {{count}} sekundoj'
+ },
+
+ xSeconds: {
+ one: '1 sekundo',
+ other: '{{count}} sekundoj'
+ },
+
+ halfAMinute: 'duonminuto',
+
+ lessThanXMinutes: {
+ one: 'malpli ol minuto',
+ other: 'malpli ol {{count}} minutoj'
+ },
+
+ xMinutes: {
+ one: '1 minuto',
+ other: '{{count}} minutoj'
+ },
+
+ aboutXHours: {
+ one: 'proksimume 1 horo',
+ other: 'proksimume {{count}} horoj'
+ },
+
+ xHours: {
+ one: '1 horo',
+ other: '{{count}} horoj'
+ },
+
+ xDays: {
+ one: '1 tago',
+ other: '{{count}} tagoj'
+ },
+
+ aboutXMonths: {
+ one: 'proksimume 1 monato',
+ other: 'proksimume {{count}} monatoj'
+ },
+
+ xWeeks: {
+ one: '1 semajno',
+ other: '{{count}} semajnoj'
+ },
+
+ aboutXWeeks: {
+ one: 'proksimume 1 semajno',
+ other: 'proksimume {{count}} semajnoj'
+ },
+
+ xMonths: {
+ one: '1 monato',
+ other: '{{count}} monatoj'
+ },
+
+ aboutXYears: {
+ one: 'proksimume 1 jaro',
+ other: 'proksimume {{count}} jaroj'
+ },
+
+ xYears: {
+ one: '1 jaro',
+ other: '{{count}} jaroj'
+ },
+
+ overXYears: {
+ one: 'pli ol 1 jaro',
+ other: 'pli ol {{count}} jaroj'
+ },
+
+ almostXYears: {
+ one: 'preskaŭ 1 jaro',
+ other: 'preskaŭ {{count}} jaroj'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'post ' + result
+ } else {
+ return 'antaŭ ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/eo/_lib/formatLong/index.js b/date-fns/src/locale/eo/_lib/formatLong/index.js
new file mode 100644
index 0000000..67e73a7
--- /dev/null
+++ b/date-fns/src/locale/eo/_lib/formatLong/index.js
@@ -0,0 +1,38 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, do 'de' MMMM y",
+ long: 'y-MMMM-dd',
+ medium: 'y-MMM-dd',
+ short: 'yyyy-MM-dd'
+}
+
+var timeFormats = {
+ full: "Ho 'horo kaj' m:ss zzzz",
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ any: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'any'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/eo/_lib/formatRelative/index.js b/date-fns/src/locale/eo/_lib/formatRelative/index.js
new file mode 100644
index 0000000..f9389e4
--- /dev/null
+++ b/date-fns/src/locale/eo/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'pasinta' eeee 'je' p",
+ yesterday: "'hieraŭ je' p",
+ today: "'hodiaŭ je' p",
+ tomorrow: "'morgaŭ je' p",
+ nextWeek: "eeee 'je' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/eo/_lib/localize/index.js b/date-fns/src/locale/eo/_lib/localize/index.js
new file mode 100644
index 0000000..d046d81
--- /dev/null
+++ b/date-fns/src/locale/eo/_lib/localize/index.js
@@ -0,0 +1,124 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['aK', 'pK'],
+ abbreviated: ['a.K.E.', 'p.K.E.'],
+ wide: ['antaŭ Komuna Erao', 'Komuna Erao']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['1-a kvaronjaro', '2-a kvaronjaro', '3-a kvaronjaro', '4-a kvaronjaro']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'maj',
+ 'jun',
+ 'jul',
+ 'aŭg',
+ 'sep',
+ 'okt',
+ 'nov',
+ 'dec'
+ ],
+ wide: [
+ 'januaro',
+ 'februaro',
+ 'marto',
+ 'aprilo',
+ 'majo',
+ 'junio',
+ 'julio',
+ 'aŭgusto',
+ 'septembro',
+ 'oktobro',
+ 'novembro',
+ 'decembro'
+ ]
+}
+
+var dayValues = {
+ narrow: ['D', 'L', 'M', 'M', 'Ĵ', 'V', 'S'],
+ short: ['di', 'lu', 'ma', 'me', 'ĵa', 've', 'sa'],
+ abbreviated: ['dim', 'lun', 'mar', 'mer', 'ĵaŭ', 'ven', 'sab'],
+ wide: ['dimanĉo', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'noktomezo',
+ noon: 'tagmezo',
+ morning: 'matene',
+ afternoon: 'posttagmeze',
+ evening: 'vespere',
+ night: 'nokte'
+ },
+ abbreviated: {
+ am: 'a.t.m.',
+ pm: 'p.t.m.',
+ midnight: 'noktomezo',
+ noon: 'tagmezo',
+ morning: 'matene',
+ afternoon: 'posttagmeze',
+ evening: 'vespere',
+ night: 'nokte'
+ },
+ wide: {
+ am: 'antaŭtagmeze',
+ pm: 'posttagmeze',
+ midnight: 'noktomezo',
+ noon: 'tagmezo',
+ morning: 'matene',
+ afternoon: 'posttagmeze',
+ evening: 'vespere',
+ night: 'nokte'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '-a'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/eo/_lib/match/index.js b/date-fns/src/locale/eo/_lib/match/index.js
new file mode 100644
index 0000000..a194b0c
--- /dev/null
+++ b/date-fns/src/locale/eo/_lib/match/index.js
@@ -0,0 +1,138 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?a)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^([ap]k)/i,
+ abbreviated: /^([ap]\.?\s?k\.?\s?e\.?)/i,
+ wide: /^((antaǔ |post )?komuna erao)/i
+}
+var parseEraPatterns = {
+ any: [/^a/i, /^[kp]/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^k[1234]/i,
+ wide: /^[1234](-?a)? kvaronjaro/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|a(ŭ|ux|uh|u)g|sep|okt|nov|dec)/i,
+ wide: /^(januaro|februaro|marto|aprilo|majo|junio|julio|a(ŭ|ux|uh|u)gusto|septembro|oktobro|novembro|decembro)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^maj/i,
+ /^jun/i,
+ /^jul/i,
+ /^a(u|ŭ)/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dlmĵjvs]/i,
+ short: /^(di|lu|ma|me|(ĵ|jx|jh|j)a|ve|sa)/i,
+ abbreviated: /^(dim|lun|mar|mer|(ĵ|jx|jh|j)a(ŭ|ux|uh|u)|ven|sab)/i,
+ wide: /^(diman(ĉ|cx|ch|c)o|lundo|mardo|merkredo|(ĵ|jx|jh|j)a(ŭ|ux|uh|u)do|vendredo|sabato)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^(j|ĵ)/i, /^v/i, /^s/i],
+ any: [/^d/i, /^l/i, /^ma/i, /^me/i, /^(j|ĵ)/i, /^v/i, /^s/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^([ap]|(posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo])/i,
+ abbreviated: /^([ap][.\s]?t[.\s]?m[.\s]?|(posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo])/i,
+ wide: /^(anta(ŭ|ux)tagmez|posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo]/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^noktom/i,
+ noon: /^t/i,
+ morning: /^m/i,
+ afternoon: /^posttagmeze/i,
+ evening: /^v/i,
+ night: /^n/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/eo/index.d.ts b/date-fns/src/locale/eo/index.d.ts
new file mode 100644
index 0000000..40716b3
--- /dev/null
+++ b/date-fns/src/locale/eo/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eo } from 'date-fns/locale'
+export default eo
diff --git a/date-fns/src/locale/eo/index.js b/date-fns/src/locale/eo/index.js
new file mode 100644
index 0000000..04adee5
--- /dev/null
+++ b/date-fns/src/locale/eo/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Esperanto locale.
+ * @language Esperanto
+ * @iso-639-2 epo
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
+ */
+var locale = {
+ code: 'eo',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/eo/index.js.flow b/date-fns/src/locale/eo/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/eo/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/eo/snapshot.md b/date-fns/src/locale/eo/snapshot.md
new file mode 100644
index 0000000..0e3e722
--- /dev/null
+++ b/date-fns/src/locale/eo/snapshot.md
@@ -0,0 +1,304 @@
+# Esperanto (eo) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-a | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-a | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-a | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4-a | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-a | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-a | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-a kvaronjaro | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-a kvaronjaro | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-a | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-a | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-a kvaronjaro | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-a kvaronjaro | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-a | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-a | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februaro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julio | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-a | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-a | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februaro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julio | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-a | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-a | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-a | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-a | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-a | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-a | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-a | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | lundo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredo | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-a | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | lundo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredo | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-a | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | lundo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredo | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-a | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | lundo | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredo | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | antaŭtagmeze | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | antaŭtagmeze | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.t.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.t.m. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | antaŭtagmeze | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | antaŭtagmeze | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | matene | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vespere | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nokte | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | matene | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vespere | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nokte | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | matene | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vespere | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nokte | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | matene | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posttagmeze | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vespere | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nokte | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | matene | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posttagmeze | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | vespere | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nokte | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-a | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-a | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-a | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-a | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-a | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-a | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-a | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-a | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-a | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-a | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-a | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-a | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987-feb-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-maj-29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987-februaro-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-majo-29 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | merkredo, 11-a de februaro 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | dimanĉo, 29-a de majo 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12-a horo kaj 13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23-a horo kaj 59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987-02-11 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987-feb-11 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-maj-29 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987-februaro-11 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453-majo-29 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | merkredo, 11-a de februaro 1987 12-a horo kaj 13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | dimanĉo, 29-a de majo 1453 23-a horo kaj 59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------- | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | proksimume 6 jaroj | proksimume 6 jaroj | post proksimume 6 jaroj |
+| 2005-01-01T00:00:00.000Z | proksimume 5 jaroj | proksimume 5 jaroj | post proksimume 5 jaroj |
+| 2004-01-01T00:00:00.000Z | proksimume 4 jaroj | proksimume 4 jaroj | post proksimume 4 jaroj |
+| 2003-01-01T00:00:00.000Z | proksimume 3 jaroj | proksimume 3 jaroj | post proksimume 3 jaroj |
+| 2002-01-01T00:00:00.000Z | proksimume 2 jaroj | proksimume 2 jaroj | post proksimume 2 jaroj |
+| 2001-06-01T00:00:00.000Z | pli ol 1 jaro | pli ol 1 jaro | post pli ol 1 jaro |
+| 2001-02-01T00:00:00.000Z | proksimume 1 jaro | proksimume 1 jaro | post proksimume 1 jaro |
+| 2001-01-01T00:00:00.000Z | proksimume 1 jaro | proksimume 1 jaro | post proksimume 1 jaro |
+| 2000-06-01T00:00:00.000Z | 5 monatoj | 5 monatoj | post 5 monatoj |
+| 2000-03-01T00:00:00.000Z | 2 monatoj | 2 monatoj | post 2 monatoj |
+| 2000-02-01T00:00:00.000Z | proksimume 1 monato | proksimume 1 monato | post proksimume 1 monato |
+| 2000-01-15T00:00:00.000Z | 14 tagoj | 14 tagoj | post 14 tagoj |
+| 2000-01-02T00:00:00.000Z | 1 tago | 1 tago | post 1 tago |
+| 2000-01-01T06:00:00.000Z | proksimume 6 horoj | proksimume 6 horoj | post proksimume 6 horoj |
+| 2000-01-01T01:00:00.000Z | proksimume 1 horo | proksimume 1 horo | post proksimume 1 horo |
+| 2000-01-01T00:45:00.000Z | proksimume 1 horo | proksimume 1 horo | post proksimume 1 horo |
+| 2000-01-01T00:30:00.000Z | 30 minutoj | 30 minutoj | post 30 minutoj |
+| 2000-01-01T00:15:00.000Z | 15 minutoj | 15 minutoj | post 15 minutoj |
+| 2000-01-01T00:01:00.000Z | 1 minuto | 1 minuto | post 1 minuto |
+| 2000-01-01T00:00:25.000Z | malpli ol minuto | duonminuto | post malpli ol minuto |
+| 2000-01-01T00:00:15.000Z | malpli ol minuto | malpli ol 20 sekundoj | post malpli ol minuto |
+| 2000-01-01T00:00:05.000Z | malpli ol minuto | malpli ol 10 sekundoj | post malpli ol minuto |
+| 2000-01-01T00:00:00.000Z | malpli ol minuto | malpli ol 5 sekundoj | antaŭ malpli ol minuto |
+| 1999-12-31T23:59:55.000Z | malpli ol minuto | malpli ol 10 sekundoj | antaŭ malpli ol minuto |
+| 1999-12-31T23:59:45.000Z | malpli ol minuto | malpli ol 20 sekundoj | antaŭ malpli ol minuto |
+| 1999-12-31T23:59:35.000Z | malpli ol minuto | duonminuto | antaŭ malpli ol minuto |
+| 1999-12-31T23:59:00.000Z | 1 minuto | 1 minuto | antaŭ 1 minuto |
+| 1999-12-31T23:45:00.000Z | 15 minutoj | 15 minutoj | antaŭ 15 minutoj |
+| 1999-12-31T23:30:00.000Z | 30 minutoj | 30 minutoj | antaŭ 30 minutoj |
+| 1999-12-31T23:15:00.000Z | proksimume 1 horo | proksimume 1 horo | antaŭ proksimume 1 horo |
+| 1999-12-31T23:00:00.000Z | proksimume 1 horo | proksimume 1 horo | antaŭ proksimume 1 horo |
+| 1999-12-31T18:00:00.000Z | proksimume 6 horoj | proksimume 6 horoj | antaŭ proksimume 6 horoj |
+| 1999-12-30T00:00:00.000Z | 2 tagoj | 2 tagoj | antaŭ 2 tagoj |
+| 1999-12-15T00:00:00.000Z | 17 tagoj | 17 tagoj | antaŭ 17 tagoj |
+| 1999-12-01T00:00:00.000Z | proksimume 1 monato | proksimume 1 monato | antaŭ proksimume 1 monato |
+| 1999-11-01T00:00:00.000Z | 2 monatoj | 2 monatoj | antaŭ 2 monatoj |
+| 1999-06-01T00:00:00.000Z | 7 monatoj | 7 monatoj | antaŭ 7 monatoj |
+| 1999-01-01T00:00:00.000Z | proksimume 1 jaro | proksimume 1 jaro | antaŭ proksimume 1 jaro |
+| 1998-12-01T00:00:00.000Z | proksimume 1 jaro | proksimume 1 jaro | antaŭ proksimume 1 jaro |
+| 1998-06-01T00:00:00.000Z | pli ol 1 jaro | pli ol 1 jaro | antaŭ pli ol 1 jaro |
+| 1998-01-01T00:00:00.000Z | proksimume 2 jaroj | proksimume 2 jaroj | antaŭ proksimume 2 jaroj |
+| 1997-01-01T00:00:00.000Z | proksimume 3 jaroj | proksimume 3 jaroj | antaŭ proksimume 3 jaroj |
+| 1996-01-01T00:00:00.000Z | proksimume 4 jaroj | proksimume 4 jaroj | antaŭ proksimume 4 jaroj |
+| 1995-01-01T00:00:00.000Z | proksimume 5 jaroj | proksimume 5 jaroj | antaŭ proksimume 5 jaroj |
+| 1994-01-01T00:00:00.000Z | proksimume 6 jaroj | proksimume 6 jaroj | antaŭ proksimume 6 jaroj |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 jaroj | post 6 jaroj | 52608 horoj |
+| 2005-01-01T00:00:00.000Z | 5 jaroj | post 5 jaroj | 43848 horoj |
+| 2004-01-01T00:00:00.000Z | 4 jaroj | post 4 jaroj | 35064 horoj |
+| 2003-01-01T00:00:00.000Z | 3 jaroj | post 3 jaroj | 26304 horoj |
+| 2002-01-01T00:00:00.000Z | 2 jaroj | post 2 jaroj | 17544 horoj |
+| 2001-06-01T00:00:00.000Z | 1 jaro | post 1 jaro | 12408 horoj |
+| 2001-02-01T00:00:00.000Z | 1 jaro | post 1 jaro | 9528 horoj |
+| 2001-01-01T00:00:00.000Z | 1 jaro | post 1 jaro | 8784 horoj |
+| 2000-06-01T00:00:00.000Z | 5 monatoj | post 5 monatoj | 3648 horoj |
+| 2000-03-01T00:00:00.000Z | 2 monatoj | post 2 monatoj | 1440 horoj |
+| 2000-02-01T00:00:00.000Z | 1 monato | post 1 monato | 744 horoj |
+| 2000-01-15T00:00:00.000Z | 14 tagoj | post 14 tagoj | 336 horoj |
+| 2000-01-02T00:00:00.000Z | 1 tago | post 1 tago | 24 horoj |
+| 2000-01-01T06:00:00.000Z | 6 horoj | post 6 horoj | 6 horoj |
+| 2000-01-01T01:00:00.000Z | 1 horo | post 1 horo | 1 horo |
+| 2000-01-01T00:45:00.000Z | 45 minutoj | post 45 minutoj | 1 horo |
+| 2000-01-01T00:30:00.000Z | 30 minutoj | post 30 minutoj | 1 horo |
+| 2000-01-01T00:15:00.000Z | 15 minutoj | post 15 minutoj | 0 horoj |
+| 2000-01-01T00:01:00.000Z | 1 minuto | post 1 minuto | 0 horoj |
+| 2000-01-01T00:00:25.000Z | 25 sekundoj | post 25 sekundoj | 0 horoj |
+| 2000-01-01T00:00:15.000Z | 15 sekundoj | post 15 sekundoj | 0 horoj |
+| 2000-01-01T00:00:05.000Z | 5 sekundoj | post 5 sekundoj | 0 horoj |
+| 2000-01-01T00:00:00.000Z | 0 sekundoj | antaŭ 0 sekundoj | 0 horoj |
+| 1999-12-31T23:59:55.000Z | 5 sekundoj | antaŭ 5 sekundoj | 0 horoj |
+| 1999-12-31T23:59:45.000Z | 15 sekundoj | antaŭ 15 sekundoj | 0 horoj |
+| 1999-12-31T23:59:35.000Z | 25 sekundoj | antaŭ 25 sekundoj | 0 horoj |
+| 1999-12-31T23:59:00.000Z | 1 minuto | antaŭ 1 minuto | 0 horoj |
+| 1999-12-31T23:45:00.000Z | 15 minutoj | antaŭ 15 minutoj | 0 horoj |
+| 1999-12-31T23:30:00.000Z | 30 minutoj | antaŭ 30 minutoj | 1 horo |
+| 1999-12-31T23:15:00.000Z | 45 minutoj | antaŭ 45 minutoj | 1 horo |
+| 1999-12-31T23:00:00.000Z | 1 horo | antaŭ 1 horo | 1 horo |
+| 1999-12-31T18:00:00.000Z | 6 horoj | antaŭ 6 horoj | 6 horoj |
+| 1999-12-30T00:00:00.000Z | 2 tagoj | antaŭ 2 tagoj | 48 horoj |
+| 1999-12-15T00:00:00.000Z | 17 tagoj | antaŭ 17 tagoj | 408 horoj |
+| 1999-12-01T00:00:00.000Z | 1 monato | antaŭ 1 monato | 744 horoj |
+| 1999-11-01T00:00:00.000Z | 2 monatoj | antaŭ 2 monatoj | 1464 horoj |
+| 1999-06-01T00:00:00.000Z | 7 monatoj | antaŭ 7 monatoj | 5136 horoj |
+| 1999-01-01T00:00:00.000Z | 1 jaro | antaŭ 1 jaro | 8760 horoj |
+| 1998-12-01T00:00:00.000Z | 1 jaro | antaŭ 1 jaro | 9504 horoj |
+| 1998-06-01T00:00:00.000Z | 2 jaroj | antaŭ 2 jaroj | 13896 horoj |
+| 1998-01-01T00:00:00.000Z | 2 jaroj | antaŭ 2 jaroj | 17520 horoj |
+| 1997-01-01T00:00:00.000Z | 3 jaroj | antaŭ 3 jaroj | 26280 horoj |
+| 1996-01-01T00:00:00.000Z | 4 jaroj | antaŭ 4 jaroj | 35064 horoj |
+| 1995-01-01T00:00:00.000Z | 5 jaroj | antaŭ 5 jaroj | 43824 horoj |
+| 1994-01-01T00:00:00.000Z | 6 jaroj | antaŭ 6 jaroj | 52584 horoj |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------- |
+| 2000-01-10T00:00:00.000Z | 2000-01-10 |
+| 2000-01-05T00:00:00.000Z | merkredo je 00:00 |
+| 2000-01-02T00:00:00.000Z | morgaŭ je 00:00 |
+| 2000-01-01T00:00:00.000Z | hodiaŭ je 00:00 |
+| 1999-12-31T00:00:00.000Z | hieraŭ je 00:00 |
+| 1999-12-27T00:00:00.000Z | pasinta lundo je 00:00 |
+| 1999-12-21T00:00:00.000Z | 1999-12-21 |
diff --git a/date-fns/src/locale/es/_lib/formatDistance/index.js b/date-fns/src/locale/es/_lib/formatDistance/index.js
new file mode 100644
index 0000000..512e30e
--- /dev/null
+++ b/date-fns/src/locale/es/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'menos de un segundo',
+ other: 'menos de {{count}} segundos'
+ },
+
+ xSeconds: {
+ one: '1 segundo',
+ other: '{{count}} segundos'
+ },
+
+ halfAMinute: 'medio minuto',
+
+ lessThanXMinutes: {
+ one: 'menos de un minuto',
+ other: 'menos de {{count}} minutos'
+ },
+
+ xMinutes: {
+ one: '1 minuto',
+ other: '{{count}} minutos'
+ },
+
+ aboutXHours: {
+ one: 'alrededor de 1 hora',
+ other: 'alrededor de {{count}} horas'
+ },
+
+ xHours: {
+ one: '1 hora',
+ other: '{{count}} horas'
+ },
+
+ xDays: {
+ one: '1 día',
+ other: '{{count}} días'
+ },
+
+ aboutXWeeks: {
+ one: 'alrededor de 1 semana',
+ other: 'alrededor de {{count}} semanas'
+ },
+
+ xWeeks: {
+ one: '1 semana',
+ other: '{{count}} semanas'
+ },
+
+ aboutXMonths: {
+ one: 'alrededor de 1 mes',
+ other: 'alrededor de {{count}} meses'
+ },
+
+ xMonths: {
+ one: '1 mes',
+ other: '{{count}} meses'
+ },
+
+ aboutXYears: {
+ one: 'alrededor de 1 año',
+ other: 'alrededor de {{count}} años'
+ },
+
+ xYears: {
+ one: '1 año',
+ other: '{{count}} años'
+ },
+
+ overXYears: {
+ one: 'más de 1 año',
+ other: 'más de {{count}} años'
+ },
+
+ almostXYears: {
+ one: 'casi 1 año',
+ other: 'casi {{count}} años'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'en ' + result
+ } else {
+ return 'hace ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/es/_lib/formatLong/index.js b/date-fns/src/locale/es/_lib/formatLong/index.js
new file mode 100644
index 0000000..3edd81e
--- /dev/null
+++ b/date-fns/src/locale/es/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, d 'de' MMMM 'de' y",
+ long: "d 'de' MMMM 'de' y",
+ medium: 'd MMM y',
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'a las' {{time}}",
+ long: "{{date}} 'a las' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/es/_lib/formatRelative/index.js b/date-fns/src/locale/es/_lib/formatRelative/index.js
new file mode 100644
index 0000000..6323dc1
--- /dev/null
+++ b/date-fns/src/locale/es/_lib/formatRelative/index.js
@@ -0,0 +1,24 @@
+var formatRelativeLocale = {
+ lastWeek: "'el' eeee 'pasado a la' LT",
+ yesterday: "'ayer a la' p",
+ today: "'hoy a la' p",
+ tomorrow: "'mañana a la' p",
+ nextWeek: "eeee 'a la' p",
+ other: 'P'
+}
+
+var formatRelativeLocalePlural = {
+ lastWeek: "'el' eeee 'pasado a las' p",
+ yesterday: "'ayer a las' p",
+ today: "'hoy a las' p",
+ tomorrow: "'mañana a las' p",
+ nextWeek: "eeee 'a las' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ if (date.getUTCHours() !== 1) {
+ return formatRelativeLocalePlural[token]
+ }
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/es/_lib/localize/index.js b/date-fns/src/locale/es/_lib/localize/index.js
new file mode 100644
index 0000000..ffdd1a9
--- /dev/null
+++ b/date-fns/src/locale/es/_lib/localize/index.js
@@ -0,0 +1,166 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['AC', 'DC'],
+ abbreviated: ['AC', 'DC'],
+ wide: ['antes de cristo', 'después de cristo']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
+ wide: ['1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre']
+}
+
+var monthValues = {
+ narrow: ['e', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
+ abbreviated: [
+ 'ene',
+ 'feb',
+ 'mar',
+ 'abr',
+ 'may',
+ 'jun',
+ 'jul',
+ 'ago',
+ 'sep',
+ 'oct',
+ 'nov',
+ 'dic'
+ ],
+ wide: [
+ 'enero',
+ 'febrero',
+ 'marzo',
+ 'abril',
+ 'mayo',
+ 'junio',
+ 'julio',
+ 'agosto',
+ 'septiembre',
+ 'octubre',
+ 'noviembre',
+ 'diciembre'
+ ]
+}
+
+var dayValues = {
+ narrow: ['d', 'l', 'm', 'm', 'j', 'v', 's'],
+ short: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sa'],
+ abbreviated: ['dom', 'lun', 'mar', 'mié', 'jue', 'vie', 'sáb'],
+ wide: [
+ 'domingo',
+ 'lunes',
+ 'martes',
+ 'miércoles',
+ 'jueves',
+ 'viernes',
+ 'sábado'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'md',
+ morning: 'mañana',
+ afternoon: 'tarde',
+ evening: 'tarde',
+ night: 'noche'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'medianoche',
+ noon: 'mediodia',
+ morning: 'mañana',
+ afternoon: 'tarde',
+ evening: 'tarde',
+ night: 'noche'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'medianoche',
+ noon: 'mediodia',
+ morning: 'mañana',
+ afternoon: 'tarde',
+ evening: 'tarde',
+ night: 'noche'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'md',
+ morning: 'de la mañana',
+ afternoon: 'de la tarde',
+ evening: 'de la tarde',
+ night: 'de la noche'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'medianoche',
+ noon: 'mediodia',
+ morning: 'de la mañana',
+ afternoon: 'de la tarde',
+ evening: 'de la tarde',
+ night: 'de la noche'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'medianoche',
+ noon: 'mediodia',
+ morning: 'de la mañana',
+ afternoon: 'de la tarde',
+ evening: 'de la tarde',
+ night: 'de la noche'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + 'º'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/es/_lib/match/index.js b/date-fns/src/locale/es/_lib/match/index.js
new file mode 100644
index 0000000..3c9cf1a
--- /dev/null
+++ b/date-fns/src/locale/es/_lib/match/index.js
@@ -0,0 +1,141 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(º)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ac|dc|a|d)/i,
+ abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
+ wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i
+}
+var parseEraPatterns = {
+ any: [/^ac/i, /^dc/i],
+ wide: [
+ /^(antes de cristo|antes de la era com[uú]n)/i,
+ /^(despu[eé]s de cristo|era com[uú]n)/i
+ ]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^T[1234]/i,
+ wide: /^[1234](º)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[efmajsond]/i,
+ abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,
+ wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^e/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^en/i,
+ /^feb/i,
+ /^mar/i,
+ /^abr/i,
+ /^may/i,
+ /^jun/i,
+ /^jul/i,
+ /^ago/i,
+ /^sep/i,
+ /^oct/i,
+ /^nov/i,
+ /^dic/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dlmjvs]/i,
+ short: /^(do|lu|ma|mi|ju|vi|sa)/i,
+ abbreviated: /^(dom|lun|mar|mie|jue|vie|sab)/i,
+ wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
+ any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
+ any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mn/i,
+ noon: /^md/i,
+ morning: /mañana/i,
+ afternoon: /tarde/i,
+ evening: /tarde/i,
+ night: /noche/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/es/index.d.ts b/date-fns/src/locale/es/index.d.ts
new file mode 100644
index 0000000..8b0431e
--- /dev/null
+++ b/date-fns/src/locale/es/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { es } from 'date-fns/locale'
+export default es
diff --git a/date-fns/src/locale/es/index.js b/date-fns/src/locale/es/index.js
new file mode 100644
index 0000000..633fbe9
--- /dev/null
+++ b/date-fns/src/locale/es/index.js
@@ -0,0 +1,32 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Spanish locale.
+ * @language Spanish
+ * @iso-639-2 spa
+ * @author Juan Angosto [@juanangosto]{@link https://github.com/juanangosto}
+ * @author Guillermo Grau [@guigrpa]{@link https://github.com/guigrpa}
+ * @author Fernando Agüero [@fjaguero]{@link https://github.com/fjaguero}
+ * @author Gastón Haro [@harogaston]{@link https://github.com/harogaston}
+ * @author Yago Carballo [@YagoCarballo]{@link https://github.com/YagoCarballo}
+ */
+var locale = {
+ code: 'es',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/es/index.js.flow b/date-fns/src/locale/es/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/es/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/es/snapshot.md b/date-fns/src/locale/es/snapshot.md
new file mode 100644
index 0000000..7b92b7d
--- /dev/null
+++ b/date-fns/src/locale/es/snapshot.md
@@ -0,0 +1,304 @@
+# Spanish (es) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987º | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987º | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | febrero | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julio | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-06-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | febrero | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julio | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-06-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28º | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42º | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365º | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vie | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vie | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vie | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | lunes | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | viernes | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vi | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vie | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | lunes | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | viernes | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vi | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vie | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | lunes | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | viernes | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vi | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vie | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | lunes | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | viernes | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vi | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | de la mañana | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la noche | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | de la mañana | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la noche | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | de la mañana | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la noche | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | de la mañana | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la noche | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | de la mañana | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | de la tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de la noche | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1º | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55º | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1º | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55º | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 may 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 de febrero de 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 de mayo de 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | miércoles, 11 de febrero de 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de mayo de 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 feb 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 may 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 de febrero de 1987 a las 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 de mayo de 1453 a las 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | miércoles, 11 de febrero de 1987 a las 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de mayo de 1453 a las 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------------- | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | alrededor de 6 años | alrededor de 6 años | en alrededor de 6 años |
+| 2005-01-01T00:00:00.000Z | alrededor de 5 años | alrededor de 5 años | en alrededor de 5 años |
+| 2004-01-01T00:00:00.000Z | alrededor de 4 años | alrededor de 4 años | en alrededor de 4 años |
+| 2003-01-01T00:00:00.000Z | alrededor de 3 años | alrededor de 3 años | en alrededor de 3 años |
+| 2002-01-01T00:00:00.000Z | alrededor de 2 años | alrededor de 2 años | en alrededor de 2 años |
+| 2001-06-01T00:00:00.000Z | más de 1 año | más de 1 año | en más de 1 año |
+| 2001-02-01T00:00:00.000Z | alrededor de 1 año | alrededor de 1 año | en alrededor de 1 año |
+| 2001-01-01T00:00:00.000Z | alrededor de 1 año | alrededor de 1 año | en alrededor de 1 año |
+| 2000-06-01T00:00:00.000Z | 5 meses | 5 meses | en 5 meses |
+| 2000-03-01T00:00:00.000Z | 2 meses | 2 meses | en 2 meses |
+| 2000-02-01T00:00:00.000Z | alrededor de 1 mes | alrededor de 1 mes | en alrededor de 1 mes |
+| 2000-01-15T00:00:00.000Z | 14 días | 14 días | en 14 días |
+| 2000-01-02T00:00:00.000Z | 1 día | 1 día | en 1 día |
+| 2000-01-01T06:00:00.000Z | alrededor de 6 horas | alrededor de 6 horas | en alrededor de 6 horas |
+| 2000-01-01T01:00:00.000Z | alrededor de 1 hora | alrededor de 1 hora | en alrededor de 1 hora |
+| 2000-01-01T00:45:00.000Z | alrededor de 1 hora | alrededor de 1 hora | en alrededor de 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | 30 minutos | en 30 minutos |
+| 2000-01-01T00:15:00.000Z | 15 minutos | 15 minutos | en 15 minutos |
+| 2000-01-01T00:01:00.000Z | 1 minuto | 1 minuto | en 1 minuto |
+| 2000-01-01T00:00:25.000Z | menos de un minuto | medio minuto | en menos de un minuto |
+| 2000-01-01T00:00:15.000Z | menos de un minuto | menos de 20 segundos | en menos de un minuto |
+| 2000-01-01T00:00:05.000Z | menos de un minuto | menos de 10 segundos | en menos de un minuto |
+| 2000-01-01T00:00:00.000Z | menos de un minuto | menos de 5 segundos | hace menos de un minuto |
+| 1999-12-31T23:59:55.000Z | menos de un minuto | menos de 10 segundos | hace menos de un minuto |
+| 1999-12-31T23:59:45.000Z | menos de un minuto | menos de 20 segundos | hace menos de un minuto |
+| 1999-12-31T23:59:35.000Z | menos de un minuto | medio minuto | hace menos de un minuto |
+| 1999-12-31T23:59:00.000Z | 1 minuto | 1 minuto | hace 1 minuto |
+| 1999-12-31T23:45:00.000Z | 15 minutos | 15 minutos | hace 15 minutos |
+| 1999-12-31T23:30:00.000Z | 30 minutos | 30 minutos | hace 30 minutos |
+| 1999-12-31T23:15:00.000Z | alrededor de 1 hora | alrededor de 1 hora | hace alrededor de 1 hora |
+| 1999-12-31T23:00:00.000Z | alrededor de 1 hora | alrededor de 1 hora | hace alrededor de 1 hora |
+| 1999-12-31T18:00:00.000Z | alrededor de 6 horas | alrededor de 6 horas | hace alrededor de 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 días | 2 días | hace 2 días |
+| 1999-12-15T00:00:00.000Z | 17 días | 17 días | hace 17 días |
+| 1999-12-01T00:00:00.000Z | alrededor de 1 mes | alrededor de 1 mes | hace alrededor de 1 mes |
+| 1999-11-01T00:00:00.000Z | 2 meses | 2 meses | hace 2 meses |
+| 1999-06-01T00:00:00.000Z | 7 meses | 7 meses | hace 7 meses |
+| 1999-01-01T00:00:00.000Z | alrededor de 1 año | alrededor de 1 año | hace alrededor de 1 año |
+| 1998-12-01T00:00:00.000Z | alrededor de 1 año | alrededor de 1 año | hace alrededor de 1 año |
+| 1998-06-01T00:00:00.000Z | más de 1 año | más de 1 año | hace más de 1 año |
+| 1998-01-01T00:00:00.000Z | alrededor de 2 años | alrededor de 2 años | hace alrededor de 2 años |
+| 1997-01-01T00:00:00.000Z | alrededor de 3 años | alrededor de 3 años | hace alrededor de 3 años |
+| 1996-01-01T00:00:00.000Z | alrededor de 4 años | alrededor de 4 años | hace alrededor de 4 años |
+| 1995-01-01T00:00:00.000Z | alrededor de 5 años | alrededor de 5 años | hace alrededor de 5 años |
+| 1994-01-01T00:00:00.000Z | alrededor de 6 años | alrededor de 6 años | hace alrededor de 6 años |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 años | en 6 años | 52608 horas |
+| 2005-01-01T00:00:00.000Z | 5 años | en 5 años | 43848 horas |
+| 2004-01-01T00:00:00.000Z | 4 años | en 4 años | 35064 horas |
+| 2003-01-01T00:00:00.000Z | 3 años | en 3 años | 26304 horas |
+| 2002-01-01T00:00:00.000Z | 2 años | en 2 años | 17544 horas |
+| 2001-06-01T00:00:00.000Z | 1 año | en 1 año | 12408 horas |
+| 2001-02-01T00:00:00.000Z | 1 año | en 1 año | 9528 horas |
+| 2001-01-01T00:00:00.000Z | 1 año | en 1 año | 8784 horas |
+| 2000-06-01T00:00:00.000Z | 5 meses | en 5 meses | 3648 horas |
+| 2000-03-01T00:00:00.000Z | 2 meses | en 2 meses | 1440 horas |
+| 2000-02-01T00:00:00.000Z | 1 mes | en 1 mes | 744 horas |
+| 2000-01-15T00:00:00.000Z | 14 días | en 14 días | 336 horas |
+| 2000-01-02T00:00:00.000Z | 1 día | en 1 día | 24 horas |
+| 2000-01-01T06:00:00.000Z | 6 horas | en 6 horas | 6 horas |
+| 2000-01-01T01:00:00.000Z | 1 hora | en 1 hora | 1 hora |
+| 2000-01-01T00:45:00.000Z | 45 minutos | en 45 minutos | 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | en 30 minutos | 1 hora |
+| 2000-01-01T00:15:00.000Z | 15 minutos | en 15 minutos | 0 horas |
+| 2000-01-01T00:01:00.000Z | 1 minuto | en 1 minuto | 0 horas |
+| 2000-01-01T00:00:25.000Z | 25 segundos | en 25 segundos | 0 horas |
+| 2000-01-01T00:00:15.000Z | 15 segundos | en 15 segundos | 0 horas |
+| 2000-01-01T00:00:05.000Z | 5 segundos | en 5 segundos | 0 horas |
+| 2000-01-01T00:00:00.000Z | 0 segundos | hace 0 segundos | 0 horas |
+| 1999-12-31T23:59:55.000Z | 5 segundos | hace 5 segundos | 0 horas |
+| 1999-12-31T23:59:45.000Z | 15 segundos | hace 15 segundos | 0 horas |
+| 1999-12-31T23:59:35.000Z | 25 segundos | hace 25 segundos | 0 horas |
+| 1999-12-31T23:59:00.000Z | 1 minuto | hace 1 minuto | 0 horas |
+| 1999-12-31T23:45:00.000Z | 15 minutos | hace 15 minutos | 0 horas |
+| 1999-12-31T23:30:00.000Z | 30 minutos | hace 30 minutos | 1 hora |
+| 1999-12-31T23:15:00.000Z | 45 minutos | hace 45 minutos | 1 hora |
+| 1999-12-31T23:00:00.000Z | 1 hora | hace 1 hora | 1 hora |
+| 1999-12-31T18:00:00.000Z | 6 horas | hace 6 horas | 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 días | hace 2 días | 48 horas |
+| 1999-12-15T00:00:00.000Z | 17 días | hace 17 días | 408 horas |
+| 1999-12-01T00:00:00.000Z | 1 mes | hace 1 mes | 744 horas |
+| 1999-11-01T00:00:00.000Z | 2 meses | hace 2 meses | 1464 horas |
+| 1999-06-01T00:00:00.000Z | 7 meses | hace 7 meses | 5136 horas |
+| 1999-01-01T00:00:00.000Z | 1 año | hace 1 año | 8760 horas |
+| 1998-12-01T00:00:00.000Z | 1 año | hace 1 año | 9504 horas |
+| 1998-06-01T00:00:00.000Z | 2 años | hace 2 años | 13896 horas |
+| 1998-01-01T00:00:00.000Z | 2 años | hace 2 años | 17520 horas |
+| 1997-01-01T00:00:00.000Z | 3 años | hace 3 años | 26280 horas |
+| 1996-01-01T00:00:00.000Z | 4 años | hace 4 años | 35064 horas |
+| 1995-01-01T00:00:00.000Z | 5 años | hace 5 años | 43824 horas |
+| 1994-01-01T00:00:00.000Z | 6 años | hace 6 años | 52584 horas |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | miércoles a las 00:00 |
+| 2000-01-02T00:00:00.000Z | mañana a las 00:00 |
+| 2000-01-01T00:00:00.000Z | hoy a las 00:00 |
+| 1999-12-31T00:00:00.000Z | ayer a las 00:00 |
+| 1999-12-27T00:00:00.000Z | el lunes pasado a las 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/et/_lib/formatDistance/index.js b/date-fns/src/locale/et/_lib/formatDistance/index.js
new file mode 100644
index 0000000..1e4ed97
--- /dev/null
+++ b/date-fns/src/locale/et/_lib/formatDistance/index.js
@@ -0,0 +1,198 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ standalone: {
+ one: 'vähem kui üks sekund',
+ other: 'vähem kui {{count}} sekundit'
+ },
+ withPreposition: {
+ one: 'vähem kui ühe sekundi',
+ other: 'vähem kui {{count}} sekundi'
+ }
+ },
+
+ xSeconds: {
+ standalone: {
+ one: 'üks sekund',
+ other: '{{count}} sekundit'
+ },
+ withPreposition: {
+ one: 'ühe sekundi',
+ other: '{{count}} sekundi'
+ }
+ },
+
+ halfAMinute: {
+ standalone: 'pool minutit',
+ withPreposition: 'poole minuti'
+ },
+
+ lessThanXMinutes: {
+ standalone: {
+ one: 'vähem kui üks minut',
+ other: 'vähem kui {{count}} minutit'
+ },
+ withPreposition: {
+ one: 'vähem kui ühe minuti',
+ other: 'vähem kui {{count}} minuti'
+ }
+ },
+
+ xMinutes: {
+ standalone: {
+ one: 'üks minut',
+ other: '{{count}} minutit'
+ },
+ withPreposition: {
+ one: 'ühe minuti',
+ other: '{{count}} minuti'
+ }
+ },
+
+ aboutXHours: {
+ standalone: {
+ one: 'umbes üks tund',
+ other: 'umbes {{count}} tundi'
+ },
+ withPreposition: {
+ one: 'umbes ühe tunni',
+ other: 'umbes {{count}} tunni'
+ }
+ },
+
+ xHours: {
+ standalone: {
+ one: 'üks tund',
+ other: '{{count}} tundi'
+ },
+ withPreposition: {
+ one: 'ühe tunni',
+ other: '{{count}} tunni'
+ }
+ },
+
+ xDays: {
+ standalone: {
+ one: 'üks päev',
+ other: '{{count}} päeva'
+ },
+ withPreposition: {
+ one: 'ühe päeva',
+ other: '{{count}} päeva'
+ }
+ },
+
+ aboutXWeeks: {
+ standalone: {
+ one: 'umbes üks nädal',
+ other: 'umbes {{count}} nädalat'
+ },
+ withPreposition: {
+ one: 'umbes ühe nädala',
+ other: 'umbes {{count}} nädala'
+ }
+ },
+
+ xWeeks: {
+ standalone: {
+ one: 'üks nädal',
+ other: '{{count}} nädalat'
+ },
+ withPreposition: {
+ one: 'ühe nädala',
+ other: '{{count}} nädala'
+ }
+ },
+
+ aboutXMonths: {
+ standalone: {
+ one: 'umbes üks kuu',
+ other: 'umbes {{count}} kuud'
+ },
+ withPreposition: {
+ one: 'umbes ühe kuu',
+ other: 'umbes {{count}} kuu'
+ }
+ },
+
+ xMonths: {
+ standalone: {
+ one: 'üks kuu',
+ other: '{{count}} kuud'
+ },
+ withPreposition: {
+ one: 'ühe kuu',
+ other: '{{count}} kuu'
+ }
+ },
+
+ aboutXYears: {
+ standalone: {
+ one: 'umbes üks aasta',
+ other: 'umbes {{count}} aastat'
+ },
+ withPreposition: {
+ one: 'umbes ühe aasta',
+ other: 'umbes {{count}} aasta'
+ }
+ },
+
+ xYears: {
+ standalone: {
+ one: 'üks aasta',
+ other: '{{count}} aastat'
+ },
+ withPreposition: {
+ one: 'ühe aasta',
+ other: '{{count}} aasta'
+ }
+ },
+
+ overXYears: {
+ standalone: {
+ one: 'rohkem kui üks aasta',
+ other: 'rohkem kui {{count}} aastat'
+ },
+ withPreposition: {
+ one: 'rohkem kui ühe aasta',
+ other: 'rohkem kui {{count}} aasta'
+ }
+ },
+
+ almostXYears: {
+ standalone: {
+ one: 'peaaegu üks aasta',
+ other: 'peaaegu {{count}} aastat'
+ },
+ withPreposition: {
+ one: 'peaaegu ühe aasta',
+ other: 'peaaegu {{count}} aasta'
+ }
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var usageGroup = options.addSuffix
+ ? formatDistanceLocale[token].withPreposition
+ : formatDistanceLocale[token].standalone
+
+ var result
+ if (typeof usageGroup === 'string') {
+ result = usageGroup
+ } else if (count === 1) {
+ result = usageGroup.one
+ } else {
+ result = usageGroup.other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' pärast'
+ } else {
+ return result + ' eest'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/et/_lib/formatLong/index.js b/date-fns/src/locale/et/_lib/formatLong/index.js
new file mode 100644
index 0000000..c149b17
--- /dev/null
+++ b/date-fns/src/locale/et/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'eeee, d. MMMM y',
+ long: 'd. MMMM y',
+ medium: 'd. MMM y',
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'kell' {{time}}",
+ long: "{{date}} 'kell' {{time}}",
+ medium: '{{date}}. {{time}}',
+ short: '{{date}}. {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/et/_lib/formatRelative/index.js b/date-fns/src/locale/et/_lib/formatRelative/index.js
new file mode 100644
index 0000000..50132f3
--- /dev/null
+++ b/date-fns/src/locale/et/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'eelmine' eeee 'kell' p",
+ yesterday: "'eile kell' p",
+ today: "'täna kell' p",
+ tomorrow: "'homme kell' p",
+ nextWeek: "'järgmine' eeee 'kell' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/et/_lib/localize/index.js b/date-fns/src/locale/et/_lib/localize/index.js
new file mode 100644
index 0000000..fac828f
--- /dev/null
+++ b/date-fns/src/locale/et/_lib/localize/index.js
@@ -0,0 +1,176 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['e.m.a', 'm.a.j'],
+ abbreviated: ['e.m.a', 'm.a.j'],
+ wide: ['enne meie ajaarvamist', 'meie ajaarvamise järgi']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal']
+}
+
+var monthValues = {
+ narrow: ['J', 'V', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jaan',
+ 'veebr',
+ 'märts',
+ 'apr',
+ 'mai',
+ 'juuni',
+ 'juuli',
+ 'aug',
+ 'sept',
+ 'okt',
+ 'nov',
+ 'dets'
+ ],
+ wide: [
+ 'jaanuar',
+ 'veebruar',
+ 'märts',
+ 'aprill',
+ 'mai',
+ 'juuni',
+ 'juuli',
+ 'august',
+ 'september',
+ 'oktoober',
+ 'november',
+ 'detsember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['P', 'E', 'T', 'K', 'N', 'R', 'L'],
+ short: ['P', 'E', 'T', 'K', 'N', 'R', 'L'],
+ abbreviated: [
+ 'pühap.',
+ 'esmasp.',
+ 'teisip.',
+ 'kolmap.',
+ 'neljap.',
+ 'reede.',
+ 'laup.'
+ ],
+ wide: [
+ 'pühapäev',
+ 'esmaspäev',
+ 'teisipäev',
+ 'kolmapäev',
+ 'neljapäev',
+ 'reede',
+ 'laupäev'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'kesköö',
+ noon: 'keskpäev',
+ morning: 'hommik',
+ afternoon: 'pärastlõuna',
+ evening: 'õhtu',
+ night: 'öö'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'kesköö',
+ noon: 'keskpäev',
+ morning: 'hommik',
+ afternoon: 'pärastlõuna',
+ evening: 'õhtu',
+ night: 'öö'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'kesköö',
+ noon: 'keskpäev',
+ morning: 'hommik',
+ afternoon: 'pärastlõuna',
+ evening: 'õhtu',
+ night: 'öö'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'keskööl',
+ noon: 'keskpäeval',
+ morning: 'hommikul',
+ afternoon: 'pärastlõunal',
+ evening: 'õhtul',
+ night: 'öösel'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'keskööl',
+ noon: 'keskpäeval',
+ morning: 'hommikul',
+ afternoon: 'pärastlõunal',
+ evening: 'õhtul',
+ night: 'öösel'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'keskööl',
+ noon: 'keskpäeval',
+ morning: 'hommikul',
+ afternoon: 'pärastlõunal',
+ evening: 'õhtul',
+ night: 'öösel'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ formattingValues: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ formattingValues: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ formattingValues: formattingDayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/et/_lib/match/index.js b/date-fns/src/locale/et/_lib/match/index.js
new file mode 100644
index 0000000..7f0cc5c
--- /dev/null
+++ b/date-fns/src/locale/et/_lib/match/index.js
@@ -0,0 +1,139 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^\d+\./i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(e\.m\.a|m\.a\.j|eKr|pKr)/i,
+ abbreviated: /^(e\.m\.a|m\.a\.j|eKr|pKr)/i,
+ wide: /^(enne meie ajaarvamist|meie ajaarvamise järgi|enne Kristust|pärast Kristust)/i
+}
+
+var parseEraPatterns = {
+ any: [/^e/i, /^(m|p)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^K[1234]/i,
+ wide: /^[1234](\.)? kvartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jvmasond]/i,
+ abbreviated: /^('jaan|veebr|märts|apr|mai|juuni|juuli|aug|sept|okt|nov|dets')/i,
+ wide: /^('jaanuar|veebruar|märts|aprill|mai|juuni|juuli|august|september|oktoober|november|detsember')/i
+}
+
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^v/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^v/i,
+ /^mär/i,
+ /^ap/i,
+ /^mai/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[petknrl]/i,
+ short: /^[petknrl]/i,
+ abbreviated: /^(püh?|esm?|tei?|kolm?|nel?|ree?|laup?)\.?/i,
+ wide: /^('pühapäev|esmaspäev|teisipäev|kolmapäev|neljapäev|reede|laupäev')/i
+}
+
+var parseDayPatterns = {
+ any: [/^p/i, /^e/i, /^t/i, /^k/i, /^n/i, /^r/i, /^l/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(am|pm|kesköö|keskpäev|hommik|pärastlõuna|õhtu|öö)/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^keskö/i,
+ noon: /^keskp/i,
+ morning: /hommik/i,
+ afternoon: /pärastlõuna/i,
+ evening: /õhtu/i,
+ night: /öö/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/et/index.d.ts b/date-fns/src/locale/et/index.d.ts
new file mode 100644
index 0000000..debd0b9
--- /dev/null
+++ b/date-fns/src/locale/et/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { et } from 'date-fns/locale'
+export default et
diff --git a/date-fns/src/locale/et/index.js b/date-fns/src/locale/et/index.js
new file mode 100644
index 0000000..af163e0
--- /dev/null
+++ b/date-fns/src/locale/et/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Estonian locale.
+ * @language Estonian
+ * @iso-639-2 est
+ * @author Priit Hansen [@HansenPriit]{@link https://github.com/priithansen}
+ */
+var locale = {
+ code: 'et',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/et/index.js.flow b/date-fns/src/locale/et/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/et/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/et/snapshot.md b/date-fns/src/locale/et/snapshot.md
new file mode 100644
index 0000000..9e4100b
--- /dev/null
+++ b/date-fns/src/locale/et/snapshot.md
@@ -0,0 +1,304 @@
+# Estonian (et) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | veebr | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juuli | Invalid Date |
+| | MMMM | 2019-02-11T12:13:14.015Z | veebruar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juuli | Invalid Date |
+| | MMMMM | 2019-02-11T12:13:14.015Z | V | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | veebr | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juuli | Invalid Date |
+| | LLLL | 2019-02-11T12:13:14.015Z | veebruar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juuli | Invalid Date |
+| | LLLLL | 2019-02-11T12:13:14.015Z | V | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | esmasp. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | reede. | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | esmasp. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | reede. | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | esmasp. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | reede. | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | esmaspäev | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | reede | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | esmasp. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | reede. | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | esmaspäev | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | reede | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | esmasp. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | reede. | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | esmaspäev | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | reede | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | esmasp. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | reede. | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | esmaspäev | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | reede | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | E | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | R | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | hommikul | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pärastlõunal | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | õhtul | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | öösel | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | hommikul | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pärastlõunal | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | õhtul | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | öösel | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | hommikul | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pärastlõunal | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | õhtul | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | öösel | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | hommikul | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pärastlõunal | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | õhtul | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | öösel | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | hommikul | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pärastlõunal | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | õhtul | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | öösel | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. veebr 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. veebruar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | kolmapäev, 11. veebruar 1987 | Errored |
+| | | 1453-05-29T23:59:59.999Z | pühapäev, 29. mai 1453 | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987. 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453. 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. veebr 1987. 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453. 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. veebruar 1987 kell 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 kell 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | kolmapäev, 11. veebruar 1987 kell 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | pühapäev, 29. mai 1453 kell 23:59:59 GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------------- | ---------------------- | --------------------------- |
+| 2006-01-01T00:00:00.000Z | umbes 6 aastat | umbes 6 aastat | umbes 6 aasta pärast |
+| 2005-01-01T00:00:00.000Z | umbes 5 aastat | umbes 5 aastat | umbes 5 aasta pärast |
+| 2004-01-01T00:00:00.000Z | umbes 4 aastat | umbes 4 aastat | umbes 4 aasta pärast |
+| 2003-01-01T00:00:00.000Z | umbes 3 aastat | umbes 3 aastat | umbes 3 aasta pärast |
+| 2002-01-01T00:00:00.000Z | umbes 2 aastat | umbes 2 aastat | umbes 2 aasta pärast |
+| 2001-06-01T00:00:00.000Z | rohkem kui üks aasta | rohkem kui üks aasta | rohkem kui ühe aasta pärast |
+| 2001-02-01T00:00:00.000Z | umbes üks aasta | umbes üks aasta | umbes ühe aasta pärast |
+| 2001-01-01T00:00:00.000Z | umbes üks aasta | umbes üks aasta | umbes ühe aasta pärast |
+| 2000-06-01T00:00:00.000Z | 5 kuud | 5 kuud | 5 kuu pärast |
+| 2000-03-01T00:00:00.000Z | 2 kuud | 2 kuud | 2 kuu pärast |
+| 2000-02-01T00:00:00.000Z | umbes üks kuu | umbes üks kuu | umbes ühe kuu pärast |
+| 2000-01-15T00:00:00.000Z | 14 päeva | 14 päeva | 14 päeva pärast |
+| 2000-01-02T00:00:00.000Z | üks päev | üks päev | ühe päeva pärast |
+| 2000-01-01T06:00:00.000Z | umbes 6 tundi | umbes 6 tundi | umbes 6 tunni pärast |
+| 2000-01-01T01:00:00.000Z | umbes üks tund | umbes üks tund | umbes ühe tunni pärast |
+| 2000-01-01T00:45:00.000Z | umbes üks tund | umbes üks tund | umbes ühe tunni pärast |
+| 2000-01-01T00:30:00.000Z | 30 minutit | 30 minutit | 30 minuti pärast |
+| 2000-01-01T00:15:00.000Z | 15 minutit | 15 minutit | 15 minuti pärast |
+| 2000-01-01T00:01:00.000Z | üks minut | üks minut | ühe minuti pärast |
+| 2000-01-01T00:00:25.000Z | vähem kui üks minut | pool minutit | vähem kui ühe minuti pärast |
+| 2000-01-01T00:00:15.000Z | vähem kui üks minut | vähem kui 20 sekundit | vähem kui ühe minuti pärast |
+| 2000-01-01T00:00:05.000Z | vähem kui üks minut | vähem kui 10 sekundit | vähem kui ühe minuti pärast |
+| 2000-01-01T00:00:00.000Z | vähem kui üks minut | vähem kui 5 sekundit | vähem kui ühe minuti eest |
+| 1999-12-31T23:59:55.000Z | vähem kui üks minut | vähem kui 10 sekundit | vähem kui ühe minuti eest |
+| 1999-12-31T23:59:45.000Z | vähem kui üks minut | vähem kui 20 sekundit | vähem kui ühe minuti eest |
+| 1999-12-31T23:59:35.000Z | vähem kui üks minut | pool minutit | vähem kui ühe minuti eest |
+| 1999-12-31T23:59:00.000Z | üks minut | üks minut | ühe minuti eest |
+| 1999-12-31T23:45:00.000Z | 15 minutit | 15 minutit | 15 minuti eest |
+| 1999-12-31T23:30:00.000Z | 30 minutit | 30 minutit | 30 minuti eest |
+| 1999-12-31T23:15:00.000Z | umbes üks tund | umbes üks tund | umbes ühe tunni eest |
+| 1999-12-31T23:00:00.000Z | umbes üks tund | umbes üks tund | umbes ühe tunni eest |
+| 1999-12-31T18:00:00.000Z | umbes 6 tundi | umbes 6 tundi | umbes 6 tunni eest |
+| 1999-12-30T00:00:00.000Z | 2 päeva | 2 päeva | 2 päeva eest |
+| 1999-12-15T00:00:00.000Z | 17 päeva | 17 päeva | 17 päeva eest |
+| 1999-12-01T00:00:00.000Z | umbes üks kuu | umbes üks kuu | umbes ühe kuu eest |
+| 1999-11-01T00:00:00.000Z | 2 kuud | 2 kuud | 2 kuu eest |
+| 1999-06-01T00:00:00.000Z | 7 kuud | 7 kuud | 7 kuu eest |
+| 1999-01-01T00:00:00.000Z | umbes üks aasta | umbes üks aasta | umbes ühe aasta eest |
+| 1998-12-01T00:00:00.000Z | umbes üks aasta | umbes üks aasta | umbes ühe aasta eest |
+| 1998-06-01T00:00:00.000Z | rohkem kui üks aasta | rohkem kui üks aasta | rohkem kui ühe aasta eest |
+| 1998-01-01T00:00:00.000Z | umbes 2 aastat | umbes 2 aastat | umbes 2 aasta eest |
+| 1997-01-01T00:00:00.000Z | umbes 3 aastat | umbes 3 aastat | umbes 3 aasta eest |
+| 1996-01-01T00:00:00.000Z | umbes 4 aastat | umbes 4 aastat | umbes 4 aasta eest |
+| 1995-01-01T00:00:00.000Z | umbes 5 aastat | umbes 5 aastat | umbes 5 aasta eest |
+| 1994-01-01T00:00:00.000Z | umbes 6 aastat | umbes 6 aastat | umbes 6 aasta eest |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 aastat | 6 aasta pärast | 52608 tundi |
+| 2005-01-01T00:00:00.000Z | 5 aastat | 5 aasta pärast | 43848 tundi |
+| 2004-01-01T00:00:00.000Z | 4 aastat | 4 aasta pärast | 35064 tundi |
+| 2003-01-01T00:00:00.000Z | 3 aastat | 3 aasta pärast | 26304 tundi |
+| 2002-01-01T00:00:00.000Z | 2 aastat | 2 aasta pärast | 17544 tundi |
+| 2001-06-01T00:00:00.000Z | üks aasta | ühe aasta pärast | 12408 tundi |
+| 2001-02-01T00:00:00.000Z | üks aasta | ühe aasta pärast | 9528 tundi |
+| 2001-01-01T00:00:00.000Z | üks aasta | ühe aasta pärast | 8784 tundi |
+| 2000-06-01T00:00:00.000Z | 5 kuud | 5 kuu pärast | 3648 tundi |
+| 2000-03-01T00:00:00.000Z | 2 kuud | 2 kuu pärast | 1440 tundi |
+| 2000-02-01T00:00:00.000Z | üks kuu | ühe kuu pärast | 744 tundi |
+| 2000-01-15T00:00:00.000Z | 14 päeva | 14 päeva pärast | 336 tundi |
+| 2000-01-02T00:00:00.000Z | üks päev | ühe päeva pärast | 24 tundi |
+| 2000-01-01T06:00:00.000Z | 6 tundi | 6 tunni pärast | 6 tundi |
+| 2000-01-01T01:00:00.000Z | üks tund | ühe tunni pärast | üks tund |
+| 2000-01-01T00:45:00.000Z | 45 minutit | 45 minuti pärast | üks tund |
+| 2000-01-01T00:30:00.000Z | 30 minutit | 30 minuti pärast | üks tund |
+| 2000-01-01T00:15:00.000Z | 15 minutit | 15 minuti pärast | 0 tundi |
+| 2000-01-01T00:01:00.000Z | üks minut | ühe minuti pärast | 0 tundi |
+| 2000-01-01T00:00:25.000Z | 25 sekundit | 25 sekundi pärast | 0 tundi |
+| 2000-01-01T00:00:15.000Z | 15 sekundit | 15 sekundi pärast | 0 tundi |
+| 2000-01-01T00:00:05.000Z | 5 sekundit | 5 sekundi pärast | 0 tundi |
+| 2000-01-01T00:00:00.000Z | 0 sekundit | 0 sekundi eest | 0 tundi |
+| 1999-12-31T23:59:55.000Z | 5 sekundit | 5 sekundi eest | 0 tundi |
+| 1999-12-31T23:59:45.000Z | 15 sekundit | 15 sekundi eest | 0 tundi |
+| 1999-12-31T23:59:35.000Z | 25 sekundit | 25 sekundi eest | 0 tundi |
+| 1999-12-31T23:59:00.000Z | üks minut | ühe minuti eest | 0 tundi |
+| 1999-12-31T23:45:00.000Z | 15 minutit | 15 minuti eest | 0 tundi |
+| 1999-12-31T23:30:00.000Z | 30 minutit | 30 minuti eest | üks tund |
+| 1999-12-31T23:15:00.000Z | 45 minutit | 45 minuti eest | üks tund |
+| 1999-12-31T23:00:00.000Z | üks tund | ühe tunni eest | üks tund |
+| 1999-12-31T18:00:00.000Z | 6 tundi | 6 tunni eest | 6 tundi |
+| 1999-12-30T00:00:00.000Z | 2 päeva | 2 päeva eest | 48 tundi |
+| 1999-12-15T00:00:00.000Z | 17 päeva | 17 päeva eest | 408 tundi |
+| 1999-12-01T00:00:00.000Z | üks kuu | ühe kuu eest | 744 tundi |
+| 1999-11-01T00:00:00.000Z | 2 kuud | 2 kuu eest | 1464 tundi |
+| 1999-06-01T00:00:00.000Z | 7 kuud | 7 kuu eest | 5136 tundi |
+| 1999-01-01T00:00:00.000Z | üks aasta | ühe aasta eest | 8760 tundi |
+| 1998-12-01T00:00:00.000Z | üks aasta | ühe aasta eest | 9504 tundi |
+| 1998-06-01T00:00:00.000Z | 2 aastat | 2 aasta eest | 13896 tundi |
+| 1998-01-01T00:00:00.000Z | 2 aastat | 2 aasta eest | 17520 tundi |
+| 1997-01-01T00:00:00.000Z | 3 aastat | 3 aasta eest | 26280 tundi |
+| 1996-01-01T00:00:00.000Z | 4 aastat | 4 aasta eest | 35064 tundi |
+| 1995-01-01T00:00:00.000Z | 5 aastat | 5 aasta eest | 43824 tundi |
+| 1994-01-01T00:00:00.000Z | 6 aastat | 6 aasta eest | 52584 tundi |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | järgmine kolmapäev kell 00:00 |
+| 2000-01-02T00:00:00.000Z | homme kell 00:00 |
+| 2000-01-01T00:00:00.000Z | täna kell 00:00 |
+| 1999-12-31T00:00:00.000Z | eile kell 00:00 |
+| 1999-12-27T00:00:00.000Z | eelmine esmaspäev kell 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/eu/_lib/formatDistance/index.js b/date-fns/src/locale/eu/_lib/formatDistance/index.js
new file mode 100644
index 0000000..b36bef9
--- /dev/null
+++ b/date-fns/src/locale/eu/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'segundo bat baino gutxiago',
+ other: '{{count}} segundo baino gutxiago'
+ },
+
+ xSeconds: {
+ one: '1 segundo',
+ other: '{{count}} segundo'
+ },
+
+ halfAMinute: 'minutu erdi',
+
+ lessThanXMinutes: {
+ one: 'minutu bat baino gutxiago',
+ other: '{{count}} minutu baino gutxiago'
+ },
+
+ xMinutes: {
+ one: '1 minutu',
+ other: '{{count}} minutu'
+ },
+
+ aboutXHours: {
+ one: '1 ordu gutxi gorabehera',
+ other: '{{count}} ordu gutxi gorabehera'
+ },
+
+ xHours: {
+ one: '1 ordu',
+ other: '{{count}} ordu'
+ },
+
+ xDays: {
+ one: '1 egun',
+ other: '{{count}} egun'
+ },
+
+ aboutXWeeks: {
+ one: 'aste 1 inguru',
+ other: '{{count}} aste inguru'
+ },
+
+ xWeeks: {
+ one: '1 aste',
+ other: '{{count}} astean'
+ },
+
+ aboutXMonths: {
+ one: '1 hilabete gutxi gorabehera',
+ other: '{{count}} hilabete gutxi gorabehera'
+ },
+
+ xMonths: {
+ one: '1 hilabete',
+ other: '{{count}} hilabete'
+ },
+
+ aboutXYears: {
+ one: '1 urte gutxi gorabehera',
+ other: '{{count}} urte gutxi gorabehera'
+ },
+
+ xYears: {
+ one: '1 urte',
+ other: '{{count}} urte'
+ },
+
+ overXYears: {
+ one: '1 urte baino gehiago',
+ other: '{{count}} urte baino gehiago'
+ },
+
+ almostXYears: {
+ one: 'ia 1 urte',
+ other: 'ia {{count}} urte'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'en ' + result
+ } else {
+ return 'duela ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/eu/_lib/formatLong/index.js b/date-fns/src/locale/eu/_lib/formatLong/index.js
new file mode 100644
index 0000000..7551df6
--- /dev/null
+++ b/date-fns/src/locale/eu/_lib/formatLong/index.js
@@ -0,0 +1,40 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, y'ko' MMMM'ren' d'a' y'ren'",
+ long: "y'ko' MMMM'ren' d'a'",
+ medium: 'y MMM d',
+ short: 'yy/MM/dd',
+}
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'tan' {{time}}",
+ long: "{{date}} 'tan' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/eu/_lib/formatRelative/index.js b/date-fns/src/locale/eu/_lib/formatRelative/index.js
new file mode 100644
index 0000000..4cf3407
--- /dev/null
+++ b/date-fns/src/locale/eu/_lib/formatRelative/index.js
@@ -0,0 +1,24 @@
+var formatRelativeLocale = {
+ lastWeek: "'joan den' eeee, LT",
+ yesterday: "'atzo,' p",
+ today: "'gaur,' p",
+ tomorrow: "'bihar,' p",
+ nextWeek: 'eeee, p',
+ other: 'P'
+}
+
+var formatRelativeLocalePlural = {
+ lastWeek: "'joan den' eeee, p",
+ yesterday: "'atzo,' p",
+ today: "'gaur,' p",
+ tomorrow: "'bihar,' p",
+ nextWeek: 'eeee, p',
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ if (date.getUTCHours() !== 1) {
+ return formatRelativeLocalePlural[token]
+ }
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/eu/_lib/localize/index.js b/date-fns/src/locale/eu/_lib/localize/index.js
new file mode 100644
index 0000000..4244774
--- /dev/null
+++ b/date-fns/src/locale/eu/_lib/localize/index.js
@@ -0,0 +1,167 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['k.a.', 'k.o.'],
+ abbreviated: ['k.a.', 'k.o.'],
+ wide: ['kristo aurretik', 'kristo ondoren']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1H', '2H', '3H', '4H'],
+ wide: ['1. hiruhilekoa', '2. hiruhilekoa', '3. hiruhilekoa', '4. hiruhilekoa']
+}
+
+var monthValues = {
+ narrow: ['u', 'o', 'm', 'a', 'm', 'e', 'u', 'a', 'i', 'u', 'a', 'a'],
+ abbreviated: [
+ 'urt',
+ 'ots',
+ 'mar',
+ 'api',
+ 'mai',
+ 'eka',
+ 'uzt',
+ 'abu',
+ 'ira',
+ 'urr',
+ 'aza',
+ 'abe'
+ ],
+ wide: [
+ 'urtarrila',
+ 'otsaila',
+ 'martxoa',
+ 'apirila',
+ 'maiatza',
+ 'ekaina',
+ 'uztaila',
+ 'abuztua',
+ 'iraila',
+ 'urria',
+ 'azaroa',
+ 'abendua'
+ ]
+}
+
+var dayValues = {
+ narrow: ['i', 'a', 'a', 'a', 'o', 'o', 'l'],
+ short: ['ig', 'al', 'as', 'az', 'og', 'or', 'lr'],
+ abbreviated: ['iga', 'ast', 'ast', 'ast', 'ost', 'ost', 'lar'],
+ wide: [
+ 'igandea',
+ 'astelehena',
+ 'asteartea',
+ 'asteazkena',
+ 'osteguna',
+ 'ostirala',
+ 'larunbata'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'ge',
+ noon: 'eg',
+ morning: 'goiza',
+ afternoon: 'arratsaldea',
+ evening: 'arratsaldea',
+ night: 'gaua'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'gauerdia',
+ noon: 'eguerdia',
+ morning: 'goiza',
+ afternoon: 'arratsaldea',
+ evening: 'arratsaldea',
+ night: 'gaua'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'gauerdia',
+ noon: 'eguerdia',
+ morning: 'goiza',
+ afternoon: 'arratsaldea',
+ evening: 'arratsaldea',
+ night: 'gaua'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'ge',
+ noon: 'eg',
+ morning: 'goizean',
+ afternoon: 'arratsaldean',
+ evening: 'arratsaldean',
+ night: 'gauean'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'gauerdia',
+ noon: 'eguerdia',
+ morning: 'goizean',
+ afternoon: 'arratsaldean',
+ evening: 'arratsaldean',
+ night: 'gauean'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'gauerdia',
+ noon: 'eguerdia',
+ morning: 'goizean',
+ afternoon: 'arratsaldean',
+ evening: 'arratsaldean',
+ night: 'gauean'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/eu/_lib/match/index.js b/date-fns/src/locale/eu/_lib/match/index.js
new file mode 100644
index 0000000..049b51d
--- /dev/null
+++ b/date-fns/src/locale/eu/_lib/match/index.js
@@ -0,0 +1,159 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(.)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(k.a.|k.o.)/i,
+ abbreviated: /^(k.a.|k.o.)/i,
+ wide: /^(kristo aurretik|kristo ondoren)/i
+}
+var parseEraPatterns = {
+ narrow: [/^k.a./i, /^k.o./i],
+ abbreviated: [/^(k.a.)/i, /^(k.o.)/i],
+ wide: [/^(kristo aurretik)/i, /^(kristo ondoren)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]H/i,
+ wide: /^[1234](.)? hiruhilekoa/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[uomaei]/i,
+ abbreviated: /^(urt|ots|mar|api|mai|eka|uzt|abu|ira|urr|aza|abe)/i,
+ wide: /^(urtarrila|otsaila|martxoa|apirila|maiatza|ekaina|uztaila|abuztua|iraila|urria|azaroa|abendua)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^u/i,
+ /^o/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^e/i,
+ /^u/i,
+ /^a/i,
+ /^i/i,
+ /^u/i,
+ /^a/i,
+ /^a/i
+ ],
+ any: [
+ /^urt/i,
+ /^ots/i,
+ /^mar/i,
+ /^api/i,
+ /^mai/i,
+ /^eka/i,
+ /^uzt/i,
+ /^abu/i,
+ /^ira/i,
+ /^urr/i,
+ /^aza/i,
+ /^abe/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[iaol]/i,
+ short: /^(ig|al|as|az|og|or|lr)/i,
+ abbreviated: /^(iga|ast|ast|ast|ost|ost|lar)/i,
+ wide: /^(igandea|astelehena|asteartea|asteazkena|osteguna|ostirala|larunbata)/i
+}
+var parseDayPatterns = {
+ narrow: [/^i/i, /^a/i, /^a/i, /^a/i, /^o/i, /^o/i, /^l/i],
+ short: [/^ig/i, /^al/i, /^as/i, /^az/i, /^og/i, /^or/i, /^lr/i],
+ abbreviated: [/^iga/i, /^ast/i, /^ast/i, /^ast/i, /^ost/i, /^ost/i, /^lar/i],
+ wide: [
+ /^igandea/i,
+ /^astelehena/i,
+ /^asteartea/i,
+ /^asteazkena/i,
+ /^osteguna/i,
+ /^ostirala/i,
+ /^larunbata/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|ge|eg|((goiza|goizean)|arratsaldea|(gaua|gauean)))/i,
+ any: /^([ap]\.?\s?m\.?|gauerdia|eguerdia|((goiza|goizean)|arratsaldea|(gaua|gauean)))/i
+}
+var parseDayPeriodPatterns = {
+ narrow: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^ge/i,
+ noon: /^eg/i,
+ morning: /goiz/i,
+ afternoon: /arratsaldea/i,
+ evening: /arratsaldea/i,
+ night: /gau/i
+ },
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^gauerdia/i,
+ noon: /^eguerdia/i,
+ morning: /goiz/i,
+ afternoon: /arratsaldea/i,
+ evening: /arratsaldea/i,
+ night: /gau/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/eu/index.d.ts b/date-fns/src/locale/eu/index.d.ts
new file mode 100644
index 0000000..ec84189
--- /dev/null
+++ b/date-fns/src/locale/eu/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { eu } from 'date-fns/locale'
+export default eu
diff --git a/date-fns/src/locale/eu/index.js b/date-fns/src/locale/eu/index.js
new file mode 100644
index 0000000..51dd659
--- /dev/null
+++ b/date-fns/src/locale/eu/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Basque locale.
+ * @language Basque
+ * @iso-639-2 eus
+ * @author Jacob Söderblom [@JacobSoderblom]{@link https://github.com/JacobSoderblom}
+ */
+var locale = {
+ code: 'eu',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/eu/index.js.flow b/date-fns/src/locale/eu/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/eu/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/eu/snapshot.md b/date-fns/src/locale/eu/snapshot.md
new file mode 100644
index 0000000..13f3146
--- /dev/null
+++ b/date-fns/src/locale/eu/snapshot.md
@@ -0,0 +1,304 @@
+# Basque (eu) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1H | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2H | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. hiruhilekoa | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. hiruhilekoa | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1H | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2H | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. hiruhilekoa | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. hiruhilekoa | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | ots | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | uzt | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | otsaila | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | uztaila | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | o | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | u | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | ots | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | uzt | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | otsaila | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | uztaila | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | o | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | u | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | ast | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ost | 2019-02-14T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | ast | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ost | 2019-02-14T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | ast | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ost | 2019-02-14T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | astelehena | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ostirala | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | o | 2019-02-14T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | al | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | or | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | ast | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ost | 2019-02-14T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | astelehena | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ostirala | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | o | 2019-02-14T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | al | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | or | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | ast | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ost | 2019-02-14T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | astelehena | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ostirala | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | o | 2019-02-14T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | al | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | or | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | ast | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ost | 2019-02-14T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | astelehena | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ostirala | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | o | 2019-02-14T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | al | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | or | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | goizean | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | gauean | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | goizean | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | gauean | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | goizean | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | gauean | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | goizean | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | gauean | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | goizean | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | arratsaldean | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | gauean | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 87/02/11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53/05/29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987 ots 11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 mai 29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987ko otsailaren 11a | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453ko maiatzaren 29a | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | asteazkena, 1987ko otsailaren 11a 1987ren | Errored |
+| | | 1453-05-29T23:59:59.999Z | igandea, 1453ko maiatzaren 29a 1453ren | Errored |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 87/02/11, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53/05/29, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987 ots 11, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 mai 29, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987ko otsailaren 11a tan 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453ko maiatzaren 29a tan 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | asteazkena, 1987ko otsailaren 11a 1987ren tan 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | igandea, 1453ko maiatzaren 29a 1453ren tan 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------------- | --------------------------- | --------------------------------- |
+| 2006-01-01T00:00:00.000Z | 6 urte gutxi gorabehera | 6 urte gutxi gorabehera | en 6 urte gutxi gorabehera |
+| 2005-01-01T00:00:00.000Z | 5 urte gutxi gorabehera | 5 urte gutxi gorabehera | en 5 urte gutxi gorabehera |
+| 2004-01-01T00:00:00.000Z | 4 urte gutxi gorabehera | 4 urte gutxi gorabehera | en 4 urte gutxi gorabehera |
+| 2003-01-01T00:00:00.000Z | 3 urte gutxi gorabehera | 3 urte gutxi gorabehera | en 3 urte gutxi gorabehera |
+| 2002-01-01T00:00:00.000Z | 2 urte gutxi gorabehera | 2 urte gutxi gorabehera | en 2 urte gutxi gorabehera |
+| 2001-06-01T00:00:00.000Z | 1 urte baino gehiago | 1 urte baino gehiago | en 1 urte baino gehiago |
+| 2001-02-01T00:00:00.000Z | 1 urte gutxi gorabehera | 1 urte gutxi gorabehera | en 1 urte gutxi gorabehera |
+| 2001-01-01T00:00:00.000Z | 1 urte gutxi gorabehera | 1 urte gutxi gorabehera | en 1 urte gutxi gorabehera |
+| 2000-06-01T00:00:00.000Z | 5 hilabete | 5 hilabete | en 5 hilabete |
+| 2000-03-01T00:00:00.000Z | 2 hilabete | 2 hilabete | en 2 hilabete |
+| 2000-02-01T00:00:00.000Z | 1 hilabete gutxi gorabehera | 1 hilabete gutxi gorabehera | en 1 hilabete gutxi gorabehera |
+| 2000-01-15T00:00:00.000Z | 14 egun | 14 egun | en 14 egun |
+| 2000-01-02T00:00:00.000Z | 1 egun | 1 egun | en 1 egun |
+| 2000-01-01T06:00:00.000Z | 6 ordu gutxi gorabehera | 6 ordu gutxi gorabehera | en 6 ordu gutxi gorabehera |
+| 2000-01-01T01:00:00.000Z | 1 ordu gutxi gorabehera | 1 ordu gutxi gorabehera | en 1 ordu gutxi gorabehera |
+| 2000-01-01T00:45:00.000Z | 1 ordu gutxi gorabehera | 1 ordu gutxi gorabehera | en 1 ordu gutxi gorabehera |
+| 2000-01-01T00:30:00.000Z | 30 minutu | 30 minutu | en 30 minutu |
+| 2000-01-01T00:15:00.000Z | 15 minutu | 15 minutu | en 15 minutu |
+| 2000-01-01T00:01:00.000Z | 1 minutu | 1 minutu | en 1 minutu |
+| 2000-01-01T00:00:25.000Z | minutu bat baino gutxiago | minutu erdi | en minutu bat baino gutxiago |
+| 2000-01-01T00:00:15.000Z | minutu bat baino gutxiago | 20 segundo baino gutxiago | en minutu bat baino gutxiago |
+| 2000-01-01T00:00:05.000Z | minutu bat baino gutxiago | 10 segundo baino gutxiago | en minutu bat baino gutxiago |
+| 2000-01-01T00:00:00.000Z | minutu bat baino gutxiago | 5 segundo baino gutxiago | duela minutu bat baino gutxiago |
+| 1999-12-31T23:59:55.000Z | minutu bat baino gutxiago | 10 segundo baino gutxiago | duela minutu bat baino gutxiago |
+| 1999-12-31T23:59:45.000Z | minutu bat baino gutxiago | 20 segundo baino gutxiago | duela minutu bat baino gutxiago |
+| 1999-12-31T23:59:35.000Z | minutu bat baino gutxiago | minutu erdi | duela minutu bat baino gutxiago |
+| 1999-12-31T23:59:00.000Z | 1 minutu | 1 minutu | duela 1 minutu |
+| 1999-12-31T23:45:00.000Z | 15 minutu | 15 minutu | duela 15 minutu |
+| 1999-12-31T23:30:00.000Z | 30 minutu | 30 minutu | duela 30 minutu |
+| 1999-12-31T23:15:00.000Z | 1 ordu gutxi gorabehera | 1 ordu gutxi gorabehera | duela 1 ordu gutxi gorabehera |
+| 1999-12-31T23:00:00.000Z | 1 ordu gutxi gorabehera | 1 ordu gutxi gorabehera | duela 1 ordu gutxi gorabehera |
+| 1999-12-31T18:00:00.000Z | 6 ordu gutxi gorabehera | 6 ordu gutxi gorabehera | duela 6 ordu gutxi gorabehera |
+| 1999-12-30T00:00:00.000Z | 2 egun | 2 egun | duela 2 egun |
+| 1999-12-15T00:00:00.000Z | 17 egun | 17 egun | duela 17 egun |
+| 1999-12-01T00:00:00.000Z | 1 hilabete gutxi gorabehera | 1 hilabete gutxi gorabehera | duela 1 hilabete gutxi gorabehera |
+| 1999-11-01T00:00:00.000Z | 2 hilabete | 2 hilabete | duela 2 hilabete |
+| 1999-06-01T00:00:00.000Z | 7 hilabete | 7 hilabete | duela 7 hilabete |
+| 1999-01-01T00:00:00.000Z | 1 urte gutxi gorabehera | 1 urte gutxi gorabehera | duela 1 urte gutxi gorabehera |
+| 1998-12-01T00:00:00.000Z | 1 urte gutxi gorabehera | 1 urte gutxi gorabehera | duela 1 urte gutxi gorabehera |
+| 1998-06-01T00:00:00.000Z | 1 urte baino gehiago | 1 urte baino gehiago | duela 1 urte baino gehiago |
+| 1998-01-01T00:00:00.000Z | 2 urte gutxi gorabehera | 2 urte gutxi gorabehera | duela 2 urte gutxi gorabehera |
+| 1997-01-01T00:00:00.000Z | 3 urte gutxi gorabehera | 3 urte gutxi gorabehera | duela 3 urte gutxi gorabehera |
+| 1996-01-01T00:00:00.000Z | 4 urte gutxi gorabehera | 4 urte gutxi gorabehera | duela 4 urte gutxi gorabehera |
+| 1995-01-01T00:00:00.000Z | 5 urte gutxi gorabehera | 5 urte gutxi gorabehera | duela 5 urte gutxi gorabehera |
+| 1994-01-01T00:00:00.000Z | 6 urte gutxi gorabehera | 6 urte gutxi gorabehera | duela 6 urte gutxi gorabehera |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 urte | en 6 urte | 52608 ordu |
+| 2005-01-01T00:00:00.000Z | 5 urte | en 5 urte | 43848 ordu |
+| 2004-01-01T00:00:00.000Z | 4 urte | en 4 urte | 35064 ordu |
+| 2003-01-01T00:00:00.000Z | 3 urte | en 3 urte | 26304 ordu |
+| 2002-01-01T00:00:00.000Z | 2 urte | en 2 urte | 17544 ordu |
+| 2001-06-01T00:00:00.000Z | 1 urte | en 1 urte | 12408 ordu |
+| 2001-02-01T00:00:00.000Z | 1 urte | en 1 urte | 9528 ordu |
+| 2001-01-01T00:00:00.000Z | 1 urte | en 1 urte | 8784 ordu |
+| 2000-06-01T00:00:00.000Z | 5 hilabete | en 5 hilabete | 3648 ordu |
+| 2000-03-01T00:00:00.000Z | 2 hilabete | en 2 hilabete | 1440 ordu |
+| 2000-02-01T00:00:00.000Z | 1 hilabete | en 1 hilabete | 744 ordu |
+| 2000-01-15T00:00:00.000Z | 14 egun | en 14 egun | 336 ordu |
+| 2000-01-02T00:00:00.000Z | 1 egun | en 1 egun | 24 ordu |
+| 2000-01-01T06:00:00.000Z | 6 ordu | en 6 ordu | 6 ordu |
+| 2000-01-01T01:00:00.000Z | 1 ordu | en 1 ordu | 1 ordu |
+| 2000-01-01T00:45:00.000Z | 45 minutu | en 45 minutu | 1 ordu |
+| 2000-01-01T00:30:00.000Z | 30 minutu | en 30 minutu | 1 ordu |
+| 2000-01-01T00:15:00.000Z | 15 minutu | en 15 minutu | 0 ordu |
+| 2000-01-01T00:01:00.000Z | 1 minutu | en 1 minutu | 0 ordu |
+| 2000-01-01T00:00:25.000Z | 25 segundo | en 25 segundo | 0 ordu |
+| 2000-01-01T00:00:15.000Z | 15 segundo | en 15 segundo | 0 ordu |
+| 2000-01-01T00:00:05.000Z | 5 segundo | en 5 segundo | 0 ordu |
+| 2000-01-01T00:00:00.000Z | 0 segundo | duela 0 segundo | 0 ordu |
+| 1999-12-31T23:59:55.000Z | 5 segundo | duela 5 segundo | 0 ordu |
+| 1999-12-31T23:59:45.000Z | 15 segundo | duela 15 segundo | 0 ordu |
+| 1999-12-31T23:59:35.000Z | 25 segundo | duela 25 segundo | 0 ordu |
+| 1999-12-31T23:59:00.000Z | 1 minutu | duela 1 minutu | 0 ordu |
+| 1999-12-31T23:45:00.000Z | 15 minutu | duela 15 minutu | 0 ordu |
+| 1999-12-31T23:30:00.000Z | 30 minutu | duela 30 minutu | 1 ordu |
+| 1999-12-31T23:15:00.000Z | 45 minutu | duela 45 minutu | 1 ordu |
+| 1999-12-31T23:00:00.000Z | 1 ordu | duela 1 ordu | 1 ordu |
+| 1999-12-31T18:00:00.000Z | 6 ordu | duela 6 ordu | 6 ordu |
+| 1999-12-30T00:00:00.000Z | 2 egun | duela 2 egun | 48 ordu |
+| 1999-12-15T00:00:00.000Z | 17 egun | duela 17 egun | 408 ordu |
+| 1999-12-01T00:00:00.000Z | 1 hilabete | duela 1 hilabete | 744 ordu |
+| 1999-11-01T00:00:00.000Z | 2 hilabete | duela 2 hilabete | 1464 ordu |
+| 1999-06-01T00:00:00.000Z | 7 hilabete | duela 7 hilabete | 5136 ordu |
+| 1999-01-01T00:00:00.000Z | 1 urte | duela 1 urte | 8760 ordu |
+| 1998-12-01T00:00:00.000Z | 1 urte | duela 1 urte | 9504 ordu |
+| 1998-06-01T00:00:00.000Z | 2 urte | duela 2 urte | 13896 ordu |
+| 1998-01-01T00:00:00.000Z | 2 urte | duela 2 urte | 17520 ordu |
+| 1997-01-01T00:00:00.000Z | 3 urte | duela 3 urte | 26280 ordu |
+| 1996-01-01T00:00:00.000Z | 4 urte | duela 4 urte | 35064 ordu |
+| 1995-01-01T00:00:00.000Z | 5 urte | duela 5 urte | 43824 ordu |
+| 1994-01-01T00:00:00.000Z | 6 urte | duela 6 urte | 52584 ordu |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------- |
+| 2000-01-10T00:00:00.000Z | 00/01/10 |
+| 2000-01-05T00:00:00.000Z | asteazkena, 00:00 |
+| 2000-01-02T00:00:00.000Z | bihar, 00:00 |
+| 2000-01-01T00:00:00.000Z | gaur, 00:00 |
+| 1999-12-31T00:00:00.000Z | atzo, 00:00 |
+| 1999-12-27T00:00:00.000Z | joan den astelehena, 00:00 |
+| 1999-12-21T00:00:00.000Z | 99/12/21 |
diff --git a/date-fns/src/locale/fa-IR/_lib/formatDistance/index.js b/date-fns/src/locale/fa-IR/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e9ba208
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'کمتر از یک ثانیه',
+ other: 'کمتر از {{count}} ثانیه'
+ },
+
+ xSeconds: {
+ one: '1 ثانیه',
+ other: '{{count}} ثانیه'
+ },
+
+ halfAMinute: 'نیم دقیقه',
+
+ lessThanXMinutes: {
+ one: 'کمتر از یک دقیقه',
+ other: 'کمتر از {{count}} دقیقه'
+ },
+
+ xMinutes: {
+ one: '1 دقیقه',
+ other: '{{count}} دقیقه'
+ },
+
+ aboutXHours: {
+ one: 'حدود 1 ساعت',
+ other: 'حدود {{count}} ساعت'
+ },
+
+ xHours: {
+ one: '1 ساعت',
+ other: '{{count}} ساعت'
+ },
+
+ xDays: {
+ one: '1 روز',
+ other: '{{count}} روز'
+ },
+
+ aboutXWeeks: {
+ one: 'حدود 1 هفته',
+ other: 'حدود {{count}} هفته'
+ },
+
+ xWeeks: {
+ one: '1 هفته',
+ other: '{{count}} هفته'
+ },
+
+ aboutXMonths: {
+ one: 'حدود 1 ماه',
+ other: 'حدود {{count}} ماه'
+ },
+
+ xMonths: {
+ one: '1 ماه',
+ other: '{{count}} ماه'
+ },
+
+ aboutXYears: {
+ one: 'حدود 1 سال',
+ other: 'حدود {{count}} سال'
+ },
+
+ xYears: {
+ one: '1 سال',
+ other: '{{count}} سال'
+ },
+
+ overXYears: {
+ one: 'بیشتر از 1 سال',
+ other: 'بیشتر از {{count}} سال'
+ },
+
+ almostXYears: {
+ one: 'نزدیک 1 سال',
+ other: 'نزدیک {{count}} سال'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'در ' + result
+ } else {
+ return result + ' قبل'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/fa-IR/_lib/formatLong/index.js b/date-fns/src/locale/fa-IR/_lib/formatLong/index.js
new file mode 100644
index 0000000..9fc97e4
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE do MMMM y',
+ long: 'do MMMM y',
+ medium: 'd MMM y',
+ short: 'yyyy/MM/dd'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'در' {{time}}",
+ long: "{{date}} 'در' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/fa-IR/_lib/formatRelative/index.js b/date-fns/src/locale/fa-IR/_lib/formatRelative/index.js
new file mode 100644
index 0000000..34244e1
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'گذشته در' p",
+ yesterday: "'دیروز در' p",
+ today: "'امروز در' p",
+ tomorrow: "'فردا در' p",
+ nextWeek: "eeee 'در' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/fa-IR/_lib/localize/index.js b/date-fns/src/locale/fa-IR/_lib/localize/index.js
new file mode 100644
index 0000000..e8f5de2
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/_lib/localize/index.js
@@ -0,0 +1,169 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ق', 'ب'],
+ abbreviated: ['ق.م.', 'ب.م.'],
+ wide: ['قبل از میلاد', 'بعد از میلاد']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['س‌م1', 'س‌م2', 'س‌م3', 'س‌م4'],
+ wide: ['سه‌ماهه 1', 'سه‌ماهه 2', 'سه‌ماهه 3', 'سه‌ماهه 4']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['ژ', 'ف', 'م', 'آ', 'م', 'ج', 'ج', 'آ', 'س', 'ا', 'ن', 'د'],
+ abbreviated: [
+ 'ژانـ',
+ 'فور',
+ 'مارس',
+ 'آپر',
+ 'می',
+ 'جون',
+ 'جولـ',
+ 'آگو',
+ 'سپتـ',
+ 'اکتـ',
+ 'نوامـ',
+ 'دسامـ'
+ ],
+ wide: [
+ 'ژانویه',
+ 'فوریه',
+ 'مارس',
+ 'آپریل',
+ 'می',
+ 'جون',
+ 'جولای',
+ 'آگوست',
+ 'سپتامبر',
+ 'اکتبر',
+ 'نوامبر',
+ 'دسامبر'
+ ]
+}
+
+var dayValues = {
+ narrow: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
+ short: ['1ش', '2ش', '3ش', '4ش', '5ش', 'ج', 'ش'],
+ abbreviated: [
+ 'یکشنبه',
+ 'دوشنبه',
+ 'سه‌شنبه',
+ 'چهارشنبه',
+ 'پنجشنبه',
+ 'جمعه',
+ 'شنبه'
+ ],
+ wide: ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ق',
+ pm: 'ب',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'ص',
+ afternoon: 'ب.ظ.',
+ evening: 'ع',
+ night: 'ش'
+ },
+ abbreviated: {
+ am: 'ق.ظ.',
+ pm: 'ب.ظ.',
+ midnight: 'نیمه‌شب',
+ noon: 'ظهر',
+ morning: 'صبح',
+ afternoon: 'بعدازظهر',
+ evening: 'عصر',
+ night: 'شب'
+ },
+ wide: {
+ am: 'قبل‌ازظهر',
+ pm: 'بعدازظهر',
+ midnight: 'نیمه‌شب',
+ noon: 'ظهر',
+ morning: 'صبح',
+ afternoon: 'بعدازظهر',
+ evening: 'عصر',
+ night: 'شب'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ق',
+ pm: 'ب',
+ midnight: 'ن',
+ noon: 'ظ',
+ morning: 'ص',
+ afternoon: 'ب.ظ.',
+ evening: 'ع',
+ night: 'ش'
+ },
+ abbreviated: {
+ am: 'ق.ظ.',
+ pm: 'ب.ظ.',
+ midnight: 'نیمه‌شب',
+ noon: 'ظهر',
+ morning: 'صبح',
+ afternoon: 'بعدازظهر',
+ evening: 'عصر',
+ night: 'شب'
+ },
+ wide: {
+ am: 'قبل‌ازظهر',
+ pm: 'بعدازظهر',
+ midnight: 'نیمه‌شب',
+ noon: 'ظهر',
+ morning: 'صبح',
+ afternoon: 'بعدازظهر',
+ evening: 'عصر',
+ night: 'شب'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ return String(dirtyNumber)
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/fa-IR/_lib/match/index.js b/date-fns/src/locale/fa-IR/_lib/match/index.js
new file mode 100644
index 0000000..e7ebd3f
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/_lib/match/index.js
@@ -0,0 +1,146 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ق|ب)/i,
+ abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?د\.?\s?م\.?|م\.?\s?|د\.?\s?م\.?)/i,
+ wide: /^(قبل از میلاد|قبل از دوران مشترک|میلادی|دوران مشترک|بعد از میلاد)/i
+}
+var parseEraPatterns = {
+ any: [/^قبل/i, /^بعد/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^س‌م[1234]/i,
+ wide: /^سه‌ماهه [1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[جژفمآاماسند]/i,
+ abbreviated: /^(جنو|ژانـ|ژانویه|فوریه|فور|مارس|آوریل|آپر|مه|می|ژوئن|جون|جول|جولـ|ژوئیه|اوت|آگو|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نوامـ|دسامبر|دسامـ|دسم)/i,
+ wide: /^(ژانویه|جنوری|فبروری|فوریه|مارچ|مارس|آپریل|اپریل|ایپریل|آوریل|مه|می|ژوئن|جون|جولای|ژوئیه|آگست|اگست|آگوست|اوت|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نومبر|دسامبر|دسمبر)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^(ژ|ج)/i,
+ /^ف/i,
+ /^م/i,
+ /^(آ|ا)/i,
+ /^م/i,
+ /^(ژ|ج)/i,
+ /^(ج|ژ)/i,
+ /^(آ|ا)/i,
+ /^س/i,
+ /^ا/i,
+ /^ن/i,
+ /^د/i
+ ],
+ any: [
+ /^ژا/i,
+ /^ف/i,
+ /^ما/i,
+ /^آپ/i,
+ /^(می|مه)/i,
+ /^(ژوئن|جون)/i,
+ /^(ژوئی|جول)/i,
+ /^(اوت|آگ)/i,
+ /^س/i,
+ /^(اوک|اک)/i,
+ /^ن/i,
+ /^د/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[شیدسچپج]/i,
+ short: /^(ش|ج|1ش|2ش|3ش|4ش|5ش)/i,
+ abbreviated: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,
+ wide: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ی/i, /^دو/i, /^س/i, /^چ/i, /^پ/i, /^ج/i, /^ش/i],
+ any: [
+ /^(ی|1ش|یکشنبه)/i,
+ /^(د|2ش|دوشنبه)/i,
+ /^(س|3ش|سه‌شنبه)/i,
+ /^(چ|4ش|چهارشنبه)/i,
+ /^(پ|5ش|پنجشنبه)/i,
+ /^(ج|جمعه)/i,
+ /^(ش|شنبه)/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(ب|ق|ن|ظ|ص|ب.ظ.|ع|ش)/i,
+ abbreviated: /^(ق.ظ.|ب.ظ.|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i,
+ wide: /^(قبل‌ازظهر|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^(ق|ق.ظ.|قبل‌ازظهر)/i,
+ pm: /^(ب|ب.ظ.|بعدازظهر)/i,
+ midnight: /^(‌نیمه‌شب|ن)/i,
+ noon: /^(ظ|ظهر)/i,
+ morning: /(ص|صبح)/i,
+ afternoon: /(ب|ب.ظ.|بعدازظهر)/i,
+ evening: /(ع|عصر)/i,
+ night: /(ش|شب)/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/fa-IR/index.d.ts b/date-fns/src/locale/fa-IR/index.d.ts
new file mode 100644
index 0000000..2e6e4bb
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { faIR } from 'date-fns/locale'
+export default faIR
diff --git a/date-fns/src/locale/fa-IR/index.js b/date-fns/src/locale/fa-IR/index.js
new file mode 100644
index 0000000..a09d202
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Persian/Farsi locale (Iran).
+ * @language Persian
+ * @iso-639-2 ira
+ * @author Morteza Ziyae [@mort3za]{@link https://github.com/mort3za}
+ */
+var locale = {
+ code: 'fa-IR',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 6 /* Saturday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/fa-IR/index.js.flow b/date-fns/src/locale/fa-IR/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/fa-IR/snapshot.md b/date-fns/src/locale/fa-IR/snapshot.md
new file mode 100644
index 0000000..b4fbfcb
--- /dev/null
+++ b/date-fns/src/locale/fa-IR/snapshot.md
@@ -0,0 +1,304 @@
+# Persian (fa-IR) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-27T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | س‌م1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | س‌م2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | سه‌ماهه 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | سه‌ماهه 2 | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | س‌م1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | س‌م2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | سه‌ماهه 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | سه‌ماهه 2 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | فور | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | جولـ | Invalid Date |
+| | MMMM | 2019-02-11T12:13:14.015Z | فوریه | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | جولای | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ج | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | فور | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | جولـ | Invalid Date |
+| | LLLL | 2019-02-11T12:13:14.015Z | فوریه | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | جولای | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ج | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-29T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49 | 2019-11-30T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | د | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-22T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | 2ش | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-22T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | د | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | 2ش | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 3 | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 7 | 2019-02-22T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | د | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-22T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | 2ش | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-22T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 3 | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 7 | 2019-02-22T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | دوشنبه | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جمعه | 2019-02-22T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | د | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-22T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | 2ش | 2019-02-18T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-22T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | قبل‌ازظهر | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | قبل‌ازظهر | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ق | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب.ظ. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق.ظ. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | قبل‌ازظهر | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | قبل‌ازظهر | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ق | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ب | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ق | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | صبح | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | عصر | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | شب | 2019-02-11T12:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | صبح | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | عصر | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | شب | 2019-02-11T12:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | صبح | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | عصر | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | شب | 2019-02-11T12:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | صبح | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | بعدازظهر | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | عصر | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | شب | 2019-02-11T12:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ص | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ب.ظ. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ع | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ش | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987/02/11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 فور 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 می 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 فوریه 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 می 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | چهارشنبه 11 فوریه 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | یکشنبه 29 می 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 ب.ظ. | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 ب.ظ. | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 ب.ظ. | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 ب.ظ. | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 ب.ظ. GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 ب.ظ. GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 ب.ظ. GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 ب.ظ. GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987/02/11, 12:13 ب.ظ. | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29, 11:59 ب.ظ. | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 فور 1987, 12:13:14 ب.ظ. | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 می 1453, 11:59:59 ب.ظ. | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 فوریه 1987 در 12:13:14 ب.ظ. GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 می 1453 در 11:59:59 ب.ظ. GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | چهارشنبه 11 فوریه 1987 در 12:13:14 ب.ظ. GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | یکشنبه 29 می 1453 در 11:59:59 ب.ظ. GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | -------------------- |
+| 2006-01-01T00:00:00.000Z | حدود 6 سال | حدود 6 سال | در حدود 6 سال |
+| 2005-01-01T00:00:00.000Z | حدود 5 سال | حدود 5 سال | در حدود 5 سال |
+| 2004-01-01T00:00:00.000Z | حدود 4 سال | حدود 4 سال | در حدود 4 سال |
+| 2003-01-01T00:00:00.000Z | حدود 3 سال | حدود 3 سال | در حدود 3 سال |
+| 2002-01-01T00:00:00.000Z | حدود 2 سال | حدود 2 سال | در حدود 2 سال |
+| 2001-06-01T00:00:00.000Z | بیشتر از 1 سال | بیشتر از 1 سال | در بیشتر از 1 سال |
+| 2001-02-01T00:00:00.000Z | حدود 1 سال | حدود 1 سال | در حدود 1 سال |
+| 2001-01-01T00:00:00.000Z | حدود 1 سال | حدود 1 سال | در حدود 1 سال |
+| 2000-06-01T00:00:00.000Z | 5 ماه | 5 ماه | در 5 ماه |
+| 2000-03-01T00:00:00.000Z | 2 ماه | 2 ماه | در 2 ماه |
+| 2000-02-01T00:00:00.000Z | حدود 1 ماه | حدود 1 ماه | در حدود 1 ماه |
+| 2000-01-15T00:00:00.000Z | 14 روز | 14 روز | در 14 روز |
+| 2000-01-02T00:00:00.000Z | 1 روز | 1 روز | در 1 روز |
+| 2000-01-01T06:00:00.000Z | حدود 6 ساعت | حدود 6 ساعت | در حدود 6 ساعت |
+| 2000-01-01T01:00:00.000Z | حدود 1 ساعت | حدود 1 ساعت | در حدود 1 ساعت |
+| 2000-01-01T00:45:00.000Z | حدود 1 ساعت | حدود 1 ساعت | در حدود 1 ساعت |
+| 2000-01-01T00:30:00.000Z | 30 دقیقه | 30 دقیقه | در 30 دقیقه |
+| 2000-01-01T00:15:00.000Z | 15 دقیقه | 15 دقیقه | در 15 دقیقه |
+| 2000-01-01T00:01:00.000Z | 1 دقیقه | 1 دقیقه | در 1 دقیقه |
+| 2000-01-01T00:00:25.000Z | کمتر از یک دقیقه | نیم دقیقه | در کمتر از یک دقیقه |
+| 2000-01-01T00:00:15.000Z | کمتر از یک دقیقه | کمتر از 20 ثانیه | در کمتر از یک دقیقه |
+| 2000-01-01T00:00:05.000Z | کمتر از یک دقیقه | کمتر از 10 ثانیه | در کمتر از یک دقیقه |
+| 2000-01-01T00:00:00.000Z | کمتر از یک دقیقه | کمتر از 5 ثانیه | کمتر از یک دقیقه قبل |
+| 1999-12-31T23:59:55.000Z | کمتر از یک دقیقه | کمتر از 10 ثانیه | کمتر از یک دقیقه قبل |
+| 1999-12-31T23:59:45.000Z | کمتر از یک دقیقه | کمتر از 20 ثانیه | کمتر از یک دقیقه قبل |
+| 1999-12-31T23:59:35.000Z | کمتر از یک دقیقه | نیم دقیقه | کمتر از یک دقیقه قبل |
+| 1999-12-31T23:59:00.000Z | 1 دقیقه | 1 دقیقه | 1 دقیقه قبل |
+| 1999-12-31T23:45:00.000Z | 15 دقیقه | 15 دقیقه | 15 دقیقه قبل |
+| 1999-12-31T23:30:00.000Z | 30 دقیقه | 30 دقیقه | 30 دقیقه قبل |
+| 1999-12-31T23:15:00.000Z | حدود 1 ساعت | حدود 1 ساعت | حدود 1 ساعت قبل |
+| 1999-12-31T23:00:00.000Z | حدود 1 ساعت | حدود 1 ساعت | حدود 1 ساعت قبل |
+| 1999-12-31T18:00:00.000Z | حدود 6 ساعت | حدود 6 ساعت | حدود 6 ساعت قبل |
+| 1999-12-30T00:00:00.000Z | 2 روز | 2 روز | 2 روز قبل |
+| 1999-12-15T00:00:00.000Z | 17 روز | 17 روز | 17 روز قبل |
+| 1999-12-01T00:00:00.000Z | حدود 1 ماه | حدود 1 ماه | حدود 1 ماه قبل |
+| 1999-11-01T00:00:00.000Z | 2 ماه | 2 ماه | 2 ماه قبل |
+| 1999-06-01T00:00:00.000Z | 7 ماه | 7 ماه | 7 ماه قبل |
+| 1999-01-01T00:00:00.000Z | حدود 1 سال | حدود 1 سال | حدود 1 سال قبل |
+| 1998-12-01T00:00:00.000Z | حدود 1 سال | حدود 1 سال | حدود 1 سال قبل |
+| 1998-06-01T00:00:00.000Z | بیشتر از 1 سال | بیشتر از 1 سال | بیشتر از 1 سال قبل |
+| 1998-01-01T00:00:00.000Z | حدود 2 سال | حدود 2 سال | حدود 2 سال قبل |
+| 1997-01-01T00:00:00.000Z | حدود 3 سال | حدود 3 سال | حدود 3 سال قبل |
+| 1996-01-01T00:00:00.000Z | حدود 4 سال | حدود 4 سال | حدود 4 سال قبل |
+| 1995-01-01T00:00:00.000Z | حدود 5 سال | حدود 5 سال | حدود 5 سال قبل |
+| 1994-01-01T00:00:00.000Z | حدود 6 سال | حدود 6 سال | حدود 6 سال قبل |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | -------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 سال | در 6 سال | 52608 ساعت |
+| 2005-01-01T00:00:00.000Z | 5 سال | در 5 سال | 43848 ساعت |
+| 2004-01-01T00:00:00.000Z | 4 سال | در 4 سال | 35064 ساعت |
+| 2003-01-01T00:00:00.000Z | 3 سال | در 3 سال | 26304 ساعت |
+| 2002-01-01T00:00:00.000Z | 2 سال | در 2 سال | 17544 ساعت |
+| 2001-06-01T00:00:00.000Z | 1 سال | در 1 سال | 12408 ساعت |
+| 2001-02-01T00:00:00.000Z | 1 سال | در 1 سال | 9528 ساعت |
+| 2001-01-01T00:00:00.000Z | 1 سال | در 1 سال | 8784 ساعت |
+| 2000-06-01T00:00:00.000Z | 5 ماه | در 5 ماه | 3648 ساعت |
+| 2000-03-01T00:00:00.000Z | 2 ماه | در 2 ماه | 1440 ساعت |
+| 2000-02-01T00:00:00.000Z | 1 ماه | در 1 ماه | 744 ساعت |
+| 2000-01-15T00:00:00.000Z | 14 روز | در 14 روز | 336 ساعت |
+| 2000-01-02T00:00:00.000Z | 1 روز | در 1 روز | 24 ساعت |
+| 2000-01-01T06:00:00.000Z | 6 ساعت | در 6 ساعت | 6 ساعت |
+| 2000-01-01T01:00:00.000Z | 1 ساعت | در 1 ساعت | 1 ساعت |
+| 2000-01-01T00:45:00.000Z | 45 دقیقه | در 45 دقیقه | 1 ساعت |
+| 2000-01-01T00:30:00.000Z | 30 دقیقه | در 30 دقیقه | 1 ساعت |
+| 2000-01-01T00:15:00.000Z | 15 دقیقه | در 15 دقیقه | 0 ساعت |
+| 2000-01-01T00:01:00.000Z | 1 دقیقه | در 1 دقیقه | 0 ساعت |
+| 2000-01-01T00:00:25.000Z | 25 ثانیه | در 25 ثانیه | 0 ساعت |
+| 2000-01-01T00:00:15.000Z | 15 ثانیه | در 15 ثانیه | 0 ساعت |
+| 2000-01-01T00:00:05.000Z | 5 ثانیه | در 5 ثانیه | 0 ساعت |
+| 2000-01-01T00:00:00.000Z | 0 ثانیه | 0 ثانیه قبل | 0 ساعت |
+| 1999-12-31T23:59:55.000Z | 5 ثانیه | 5 ثانیه قبل | 0 ساعت |
+| 1999-12-31T23:59:45.000Z | 15 ثانیه | 15 ثانیه قبل | 0 ساعت |
+| 1999-12-31T23:59:35.000Z | 25 ثانیه | 25 ثانیه قبل | 0 ساعت |
+| 1999-12-31T23:59:00.000Z | 1 دقیقه | 1 دقیقه قبل | 0 ساعت |
+| 1999-12-31T23:45:00.000Z | 15 دقیقه | 15 دقیقه قبل | 0 ساعت |
+| 1999-12-31T23:30:00.000Z | 30 دقیقه | 30 دقیقه قبل | 1 ساعت |
+| 1999-12-31T23:15:00.000Z | 45 دقیقه | 45 دقیقه قبل | 1 ساعت |
+| 1999-12-31T23:00:00.000Z | 1 ساعت | 1 ساعت قبل | 1 ساعت |
+| 1999-12-31T18:00:00.000Z | 6 ساعت | 6 ساعت قبل | 6 ساعت |
+| 1999-12-30T00:00:00.000Z | 2 روز | 2 روز قبل | 48 ساعت |
+| 1999-12-15T00:00:00.000Z | 17 روز | 17 روز قبل | 408 ساعت |
+| 1999-12-01T00:00:00.000Z | 1 ماه | 1 ماه قبل | 744 ساعت |
+| 1999-11-01T00:00:00.000Z | 2 ماه | 2 ماه قبل | 1464 ساعت |
+| 1999-06-01T00:00:00.000Z | 7 ماه | 7 ماه قبل | 5136 ساعت |
+| 1999-01-01T00:00:00.000Z | 1 سال | 1 سال قبل | 8760 ساعت |
+| 1998-12-01T00:00:00.000Z | 1 سال | 1 سال قبل | 9504 ساعت |
+| 1998-06-01T00:00:00.000Z | 2 سال | 2 سال قبل | 13896 ساعت |
+| 1998-01-01T00:00:00.000Z | 2 سال | 2 سال قبل | 17520 ساعت |
+| 1997-01-01T00:00:00.000Z | 3 سال | 3 سال قبل | 26280 ساعت |
+| 1996-01-01T00:00:00.000Z | 4 سال | 4 سال قبل | 35064 ساعت |
+| 1995-01-01T00:00:00.000Z | 5 سال | 5 سال قبل | 43824 ساعت |
+| 1994-01-01T00:00:00.000Z | 6 سال | 6 سال قبل | 52584 ساعت |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------- |
+| 2000-01-10T00:00:00.000Z | 2000/01/10 |
+| 2000-01-05T00:00:00.000Z | چهارشنبه در 12:00 ق.ظ. |
+| 2000-01-02T00:00:00.000Z | فردا در 12:00 ق.ظ. |
+| 2000-01-01T00:00:00.000Z | امروز در 12:00 ق.ظ. |
+| 1999-12-31T00:00:00.000Z | دیروز در 12:00 ق.ظ. |
+| 1999-12-27T00:00:00.000Z | دوشنبه گذشته در 12:00 ق.ظ. |
+| 1999-12-21T00:00:00.000Z | 1999/12/21 |
diff --git a/date-fns/src/locale/fi/_lib/formatDistance/index.js b/date-fns/src/locale/fi/_lib/formatDistance/index.js
new file mode 100644
index 0000000..5ff6a48
--- /dev/null
+++ b/date-fns/src/locale/fi/_lib/formatDistance/index.js
@@ -0,0 +1,145 @@
+function futureSeconds(text) {
+ return text.replace(/sekuntia?/, 'sekunnin')
+}
+
+function futureMinutes(text) {
+ return text.replace(/minuuttia?/, 'minuutin')
+}
+
+function futureHours(text) {
+ return text.replace(/tuntia?/, 'tunnin')
+}
+
+function futureDays(text) {
+ return text.replace(/päivää?/, 'päivän')
+}
+
+function futureWeeks(text) {
+ return text.replace(/(viikko|viikkoa)/, 'viikon')
+}
+
+function futureMonths(text) {
+ return text.replace(/(kuukausi|kuukautta)/, 'kuukauden')
+}
+
+function futureYears(text) {
+ return text.replace(/(vuosi|vuotta)/, 'vuoden')
+}
+
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'alle sekunti',
+ other: 'alle {{count}} sekuntia',
+ futureTense: futureSeconds
+ },
+
+ xSeconds: {
+ one: 'sekunti',
+ other: '{{count}} sekuntia',
+ futureTense: futureSeconds
+ },
+
+ halfAMinute: {
+ one: 'puoli minuuttia',
+ other: 'puoli minuuttia',
+ futureTense: function(_text) {
+ return 'puolen minuutin'
+ }
+ },
+
+ lessThanXMinutes: {
+ one: 'alle minuutti',
+ other: 'alle {{count}} minuuttia',
+ futureTense: futureMinutes
+ },
+
+ xMinutes: {
+ one: 'minuutti',
+ other: '{{count}} minuuttia',
+ futureTense: futureMinutes
+ },
+
+ aboutXHours: {
+ one: 'noin tunti',
+ other: 'noin {{count}} tuntia',
+ futureTense: futureHours
+ },
+
+ xHours: {
+ one: 'tunti',
+ other: '{{count}} tuntia',
+ futureTense: futureHours
+ },
+
+ xDays: {
+ one: 'päivä',
+ other: '{{count}} päivää',
+ futureTense: futureDays
+ },
+
+ aboutXWeeks: {
+ one: 'noin viikko',
+ other: 'noin {{count}} viikkoa',
+ futureTense: futureWeeks
+ },
+
+ xWeeks: {
+ one: 'viikko',
+ other: '{{count}} viikkoa',
+ futureTense: futureWeeks
+ },
+
+ aboutXMonths: {
+ one: 'noin kuukausi',
+ other: 'noin {{count}} kuukautta',
+ futureTense: futureMonths
+ },
+
+ xMonths: {
+ one: 'kuukausi',
+ other: '{{count}} kuukautta',
+ futureTense: futureMonths
+ },
+
+ aboutXYears: {
+ one: 'noin vuosi',
+ other: 'noin {{count}} vuotta',
+ futureTense: futureYears
+ },
+
+ xYears: {
+ one: 'vuosi',
+ other: '{{count}} vuotta',
+ futureTense: futureYears
+ },
+
+ overXYears: {
+ one: 'yli vuosi',
+ other: 'yli {{count}} vuotta',
+ futureTense: futureYears
+ },
+
+ almostXYears: {
+ one: 'lähes vuosi',
+ other: 'lähes {{count}} vuotta',
+ futureTense: futureYears
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var distance = formatDistanceLocale[token]
+ var result =
+ count === 1 ? distance.one : distance.other.replace('{{count}}', count)
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return distance.futureTense(result) + ' kuluttua'
+ } else {
+ return result + ' sitten'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/fi/_lib/formatLong/index.js b/date-fns/src/locale/fi/_lib/formatLong/index.js
new file mode 100644
index 0000000..670ac7b
--- /dev/null
+++ b/date-fns/src/locale/fi/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'eeee d. MMMM y',
+ long: 'd. MMMM y',
+ medium: 'd. MMM y',
+ short: 'd.M.y'
+}
+
+var timeFormats = {
+ full: 'HH.mm.ss zzzz',
+ long: 'HH.mm.ss z',
+ medium: 'HH.mm.ss',
+ short: 'HH.mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'klo' {{time}}",
+ long: "{{date}} 'klo' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/fi/_lib/formatRelative/index.js b/date-fns/src/locale/fi/_lib/formatRelative/index.js
new file mode 100644
index 0000000..1b0cbe8
--- /dev/null
+++ b/date-fns/src/locale/fi/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'viime' eeee 'klo' p",
+ yesterday: "'eilen klo' p",
+ today: "'tänään klo' p",
+ tomorrow: "'huomenna klo' p",
+ nextWeek: "'ensi' eeee 'klo' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/fi/_lib/localize/index.js b/date-fns/src/locale/fi/_lib/localize/index.js
new file mode 100644
index 0000000..02f94c2
--- /dev/null
+++ b/date-fns/src/locale/fi/_lib/localize/index.js
@@ -0,0 +1,147 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['eaa.', 'jaa.'],
+ abbreviated: ['eaa.', 'jaa.'],
+ wide: ['ennen ajanlaskun alkua', 'jälkeen ajanlaskun alun']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1. kvartaali', '2. kvartaali', '3. kvartaali', '4. kvartaali']
+}
+
+var monthValues = {
+ narrow: ['T', 'H', 'M', 'H', 'T', 'K', 'H', 'E', 'S', 'L', 'M', 'J'],
+ abbreviated: [
+ 'tammi',
+ 'helmi',
+ 'maalis',
+ 'huhti',
+ 'touko',
+ 'kesä',
+ 'heinä',
+ 'elo',
+ 'syys',
+ 'loka',
+ 'marras',
+ 'joulu'
+ ],
+ wide: [
+ 'tammikuu',
+ 'helmikuu',
+ 'maaliskuu',
+ 'huhtikuu',
+ 'toukokuu',
+ 'kesäkuu',
+ 'heinäkuu',
+ 'elokuu',
+ 'syyskuu',
+ 'lokakuu',
+ 'marraskuu',
+ 'joulukuu'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: monthValues.narrow,
+ abbreviated: monthValues.abbreviated,
+ wide: monthValues.wide.map(name => name + 'ta')
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'T', 'K', 'T', 'P', 'L'],
+ short: ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'],
+ abbreviated: ['sunn.', 'maan.', 'tiis.', 'kesk.', 'torst.', 'perj.', 'la'],
+ wide: [
+ 'sunnuntai',
+ 'maanantai',
+ 'tiistai',
+ 'keskiviikko',
+ 'torstai',
+ 'perjantai',
+ 'lauantai'
+ ]
+}
+
+var formattingDayValues = {
+ narrow: dayValues.narrow,
+ short: dayValues.short,
+ abbreviated: dayValues.abbreviated,
+ wide: dayValues.wide.map(name => name + 'na')
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ap',
+ pm: 'ip',
+ midnight: 'keskiyö',
+ noon: 'keskipäivä',
+ morning: 'ap',
+ afternoon: 'ip',
+ evening: 'illalla',
+ night: 'yöllä'
+ },
+ abbreviated: {
+ am: 'ap',
+ pm: 'ip',
+ midnight: 'keskiyö',
+ noon: 'keskipäivä',
+ morning: 'ap',
+ afternoon: 'ip',
+ evening: 'illalla',
+ night: 'yöllä'
+ },
+ wide: {
+ am: 'ap',
+ pm: 'ip',
+ midnight: 'keskiyöllä',
+ noon: 'keskipäivällä',
+ morning: 'aamupäivällä',
+ afternoon: 'iltapäivällä',
+ evening: 'illalla',
+ night: 'yöllä'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ formattingValues: formattingMonthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ formattingValues: formattingDayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/fi/_lib/match/index.js b/date-fns/src/locale/fi/_lib/match/index.js
new file mode 100644
index 0000000..0717d41
--- /dev/null
+++ b/date-fns/src/locale/fi/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(\.)/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(e|j)/i,
+ abbreviated: /^(eaa.|jaa.)/i,
+ wide: /^(ennen ajanlaskun alkua|jälkeen ajanlaskun alun)/i
+}
+var parseEraPatterns = {
+ any: [/^e/i, /^j/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234]\.? kvartaali/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[thmkeslj]/i,
+ abbreviated: /^(tammi|helmi|maalis|huhti|touko|kesä|heinä|elo|syys|loka|marras|joulu)/i,
+ wide: /^(tammikuu|helmikuu|maaliskuu|huhtikuu|toukokuu|kesäkuu|heinäkuu|elokuu|syyskuu|lokakuu|marraskuu|joulukuu)(ta)?/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^t/i,
+ /^h/i,
+ /^m/i,
+ /^h/i,
+ /^t/i,
+ /^k/i,
+ /^h/i,
+ /^e/i,
+ /^s/i,
+ /^l/i,
+ /^m/i,
+ /^j/i
+ ],
+ any: [
+ /^ta/i,
+ /^hel/i,
+ /^maa/i,
+ /^hu/i,
+ /^to/i,
+ /^k/i,
+ /^hei/i,
+ /^e/i,
+ /^s/i,
+ /^l/i,
+ /^mar/i,
+ /^j/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smtkpl]/i,
+ short: /^(su|ma|ti|ke|to|pe|la)/i,
+ abbreviated: /^(sunn.|maan.|tiis.|kesk.|torst.|perj.|la)/i,
+ wide: /^(sunnuntai|maanantai|tiistai|keskiviikko|torstai|perjantai|lauantai)(na)?/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^t/i, /^k/i, /^t/i, /^p/i, /^l/i],
+ any: [/^s/i, /^m/i, /^ti/i, /^k/i, /^to/i, /^p/i, /^l/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(ap|ip|keskiyö|keskipäivä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,
+ any: /^(ap|ip|keskiyöllä|keskipäivällä|aamupäivällä|iltapäivällä|illalla|yöllä)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^ap/i,
+ pm: /^ip/i,
+ midnight: /^keskiyö/i,
+ noon: /^keskipäivä/i,
+ morning: /aamupäivällä/i,
+ afternoon: /iltapäivällä/i,
+ evening: /illalla/i,
+ night: /yöllä/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/fi/index.d.ts b/date-fns/src/locale/fi/index.d.ts
new file mode 100644
index 0000000..e400702
--- /dev/null
+++ b/date-fns/src/locale/fi/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { fi } from 'date-fns/locale'
+export default fi
diff --git a/date-fns/src/locale/fi/index.js b/date-fns/src/locale/fi/index.js
new file mode 100644
index 0000000..35e9287
--- /dev/null
+++ b/date-fns/src/locale/fi/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Finnish locale.
+ * @language Finnish
+ * @iso-639-2 fin
+ * @author Pyry-Samuli Lahti [@Pyppe]{@link https://github.com/Pyppe}
+ * @author Edo Rivai [@mikolajgrzyb]{@link https://github.com/mikolajgrzyb}
+ * @author Samu Juvonen [@sjuvonen]{@link https://github.com/sjuvonen}
+ */
+var locale = {
+ code: 'fi',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/fi/index.js.flow b/date-fns/src/locale/fi/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/fi/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/fi/snapshot.md b/date-fns/src/locale/fi/snapshot.md
new file mode 100644
index 0000000..29e621f
--- /dev/null
+++ b/date-fns/src/locale/fi/snapshot.md
@@ -0,0 +1,304 @@
+# Finnish (fi) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kvartaali | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartaali | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kvartaali | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartaali | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | helmi | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | heinä | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | helmikuuta | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | heinäkuuta | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | H | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | H | 2019-02-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | helmi | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | heinä | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | helmikuu | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | heinäkuu | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | H | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | H | 2019-02-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | maan. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perj. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | maan. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perj. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | maan. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perj. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | maanantaina | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perjantaina | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pe | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | maan. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perj. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | maanantaina | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perjantaina | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pe | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | maan. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perj. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | maanantaina | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perjantaina | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pe | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | maan. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perj. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | maanantai | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | perjantai | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pe | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | illalla | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yöllä | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | illalla | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yöllä | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | illalla | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yöllä | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | aamupäivällä | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | iltapäivällä | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | illalla | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yöllä | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ap | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ip | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | illalla | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | yöllä | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.2.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.5.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. helmi 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. touko 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. helmikuuta 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. toukokuuta 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | keskiviikkona 11. helmikuuta 1987 | Errored |
+| | | 1453-05-29T23:59:59.999Z | sunnuntaina 29. toukokuuta 1453 | Errored |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59.59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12.13.14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23.59.59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12.13.14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23.59.59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.2.1987 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.5.1453 23.59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. helmi 1987 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. touko 1453 23.59.59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. helmikuuta 1987 klo 12.13.14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. toukokuuta 1453 klo 23.59.59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | keskiviikkona 11. helmikuuta 1987 klo 12.13.14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | sunnuntaina 29. toukokuuta 1453 klo 23.59.59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------- | ---------------------- | ----------------------- |
+| 2006-01-01T00:00:00.000Z | noin 6 vuotta | noin 6 vuotta | noin 6 vuoden kuluttua |
+| 2005-01-01T00:00:00.000Z | noin 5 vuotta | noin 5 vuotta | noin 5 vuoden kuluttua |
+| 2004-01-01T00:00:00.000Z | noin 4 vuotta | noin 4 vuotta | noin 4 vuoden kuluttua |
+| 2003-01-01T00:00:00.000Z | noin 3 vuotta | noin 3 vuotta | noin 3 vuoden kuluttua |
+| 2002-01-01T00:00:00.000Z | noin 2 vuotta | noin 2 vuotta | noin 2 vuoden kuluttua |
+| 2001-06-01T00:00:00.000Z | yli vuosi | yli vuosi | yli vuoden kuluttua |
+| 2001-02-01T00:00:00.000Z | noin vuosi | noin vuosi | noin vuoden kuluttua |
+| 2001-01-01T00:00:00.000Z | noin vuosi | noin vuosi | noin vuoden kuluttua |
+| 2000-06-01T00:00:00.000Z | 5 kuukautta | 5 kuukautta | 5 kuukauden kuluttua |
+| 2000-03-01T00:00:00.000Z | 2 kuukautta | 2 kuukautta | 2 kuukauden kuluttua |
+| 2000-02-01T00:00:00.000Z | noin kuukausi | noin kuukausi | noin kuukauden kuluttua |
+| 2000-01-15T00:00:00.000Z | 14 päivää | 14 päivää | 14 päivän kuluttua |
+| 2000-01-02T00:00:00.000Z | päivä | päivä | päivän kuluttua |
+| 2000-01-01T06:00:00.000Z | noin 6 tuntia | noin 6 tuntia | noin 6 tunnin kuluttua |
+| 2000-01-01T01:00:00.000Z | noin tunti | noin tunti | noin tunnin kuluttua |
+| 2000-01-01T00:45:00.000Z | noin tunti | noin tunti | noin tunnin kuluttua |
+| 2000-01-01T00:30:00.000Z | 30 minuuttia | 30 minuuttia | 30 minuutin kuluttua |
+| 2000-01-01T00:15:00.000Z | 15 minuuttia | 15 minuuttia | 15 minuutin kuluttua |
+| 2000-01-01T00:01:00.000Z | minuutti | minuutti | minuutin kuluttua |
+| 2000-01-01T00:00:25.000Z | alle minuutti | puoli minuuttia | alle minuutin kuluttua |
+| 2000-01-01T00:00:15.000Z | alle minuutti | alle 20 sekuntia | alle minuutin kuluttua |
+| 2000-01-01T00:00:05.000Z | alle minuutti | alle 10 sekuntia | alle minuutin kuluttua |
+| 2000-01-01T00:00:00.000Z | alle minuutti | alle 5 sekuntia | alle minuutti sitten |
+| 1999-12-31T23:59:55.000Z | alle minuutti | alle 10 sekuntia | alle minuutti sitten |
+| 1999-12-31T23:59:45.000Z | alle minuutti | alle 20 sekuntia | alle minuutti sitten |
+| 1999-12-31T23:59:35.000Z | alle minuutti | puoli minuuttia | alle minuutti sitten |
+| 1999-12-31T23:59:00.000Z | minuutti | minuutti | minuutti sitten |
+| 1999-12-31T23:45:00.000Z | 15 minuuttia | 15 minuuttia | 15 minuuttia sitten |
+| 1999-12-31T23:30:00.000Z | 30 minuuttia | 30 minuuttia | 30 minuuttia sitten |
+| 1999-12-31T23:15:00.000Z | noin tunti | noin tunti | noin tunti sitten |
+| 1999-12-31T23:00:00.000Z | noin tunti | noin tunti | noin tunti sitten |
+| 1999-12-31T18:00:00.000Z | noin 6 tuntia | noin 6 tuntia | noin 6 tuntia sitten |
+| 1999-12-30T00:00:00.000Z | 2 päivää | 2 päivää | 2 päivää sitten |
+| 1999-12-15T00:00:00.000Z | 17 päivää | 17 päivää | 17 päivää sitten |
+| 1999-12-01T00:00:00.000Z | noin kuukausi | noin kuukausi | noin kuukausi sitten |
+| 1999-11-01T00:00:00.000Z | 2 kuukautta | 2 kuukautta | 2 kuukautta sitten |
+| 1999-06-01T00:00:00.000Z | 7 kuukautta | 7 kuukautta | 7 kuukautta sitten |
+| 1999-01-01T00:00:00.000Z | noin vuosi | noin vuosi | noin vuosi sitten |
+| 1998-12-01T00:00:00.000Z | noin vuosi | noin vuosi | noin vuosi sitten |
+| 1998-06-01T00:00:00.000Z | yli vuosi | yli vuosi | yli vuosi sitten |
+| 1998-01-01T00:00:00.000Z | noin 2 vuotta | noin 2 vuotta | noin 2 vuotta sitten |
+| 1997-01-01T00:00:00.000Z | noin 3 vuotta | noin 3 vuotta | noin 3 vuotta sitten |
+| 1996-01-01T00:00:00.000Z | noin 4 vuotta | noin 4 vuotta | noin 4 vuotta sitten |
+| 1995-01-01T00:00:00.000Z | noin 5 vuotta | noin 5 vuotta | noin 5 vuotta sitten |
+| 1994-01-01T00:00:00.000Z | noin 6 vuotta | noin 6 vuotta | noin 6 vuotta sitten |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------ | -------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 vuotta | 6 vuoden kuluttua | 52608 tuntia |
+| 2005-01-01T00:00:00.000Z | 5 vuotta | 5 vuoden kuluttua | 43848 tuntia |
+| 2004-01-01T00:00:00.000Z | 4 vuotta | 4 vuoden kuluttua | 35064 tuntia |
+| 2003-01-01T00:00:00.000Z | 3 vuotta | 3 vuoden kuluttua | 26304 tuntia |
+| 2002-01-01T00:00:00.000Z | 2 vuotta | 2 vuoden kuluttua | 17544 tuntia |
+| 2001-06-01T00:00:00.000Z | vuosi | vuoden kuluttua | 12408 tuntia |
+| 2001-02-01T00:00:00.000Z | vuosi | vuoden kuluttua | 9528 tuntia |
+| 2001-01-01T00:00:00.000Z | vuosi | vuoden kuluttua | 8784 tuntia |
+| 2000-06-01T00:00:00.000Z | 5 kuukautta | 5 kuukauden kuluttua | 3648 tuntia |
+| 2000-03-01T00:00:00.000Z | 2 kuukautta | 2 kuukauden kuluttua | 1440 tuntia |
+| 2000-02-01T00:00:00.000Z | kuukausi | kuukauden kuluttua | 744 tuntia |
+| 2000-01-15T00:00:00.000Z | 14 päivää | 14 päivän kuluttua | 336 tuntia |
+| 2000-01-02T00:00:00.000Z | päivä | päivän kuluttua | 24 tuntia |
+| 2000-01-01T06:00:00.000Z | 6 tuntia | 6 tunnin kuluttua | 6 tuntia |
+| 2000-01-01T01:00:00.000Z | tunti | tunnin kuluttua | tunti |
+| 2000-01-01T00:45:00.000Z | 45 minuuttia | 45 minuutin kuluttua | tunti |
+| 2000-01-01T00:30:00.000Z | 30 minuuttia | 30 minuutin kuluttua | tunti |
+| 2000-01-01T00:15:00.000Z | 15 minuuttia | 15 minuutin kuluttua | 0 tuntia |
+| 2000-01-01T00:01:00.000Z | minuutti | minuutin kuluttua | 0 tuntia |
+| 2000-01-01T00:00:25.000Z | 25 sekuntia | 25 sekunnin kuluttua | 0 tuntia |
+| 2000-01-01T00:00:15.000Z | 15 sekuntia | 15 sekunnin kuluttua | 0 tuntia |
+| 2000-01-01T00:00:05.000Z | 5 sekuntia | 5 sekunnin kuluttua | 0 tuntia |
+| 2000-01-01T00:00:00.000Z | 0 sekuntia | 0 sekuntia sitten | 0 tuntia |
+| 1999-12-31T23:59:55.000Z | 5 sekuntia | 5 sekuntia sitten | 0 tuntia |
+| 1999-12-31T23:59:45.000Z | 15 sekuntia | 15 sekuntia sitten | 0 tuntia |
+| 1999-12-31T23:59:35.000Z | 25 sekuntia | 25 sekuntia sitten | 0 tuntia |
+| 1999-12-31T23:59:00.000Z | minuutti | minuutti sitten | 0 tuntia |
+| 1999-12-31T23:45:00.000Z | 15 minuuttia | 15 minuuttia sitten | 0 tuntia |
+| 1999-12-31T23:30:00.000Z | 30 minuuttia | 30 minuuttia sitten | tunti |
+| 1999-12-31T23:15:00.000Z | 45 minuuttia | 45 minuuttia sitten | tunti |
+| 1999-12-31T23:00:00.000Z | tunti | tunti sitten | tunti |
+| 1999-12-31T18:00:00.000Z | 6 tuntia | 6 tuntia sitten | 6 tuntia |
+| 1999-12-30T00:00:00.000Z | 2 päivää | 2 päivää sitten | 48 tuntia |
+| 1999-12-15T00:00:00.000Z | 17 päivää | 17 päivää sitten | 408 tuntia |
+| 1999-12-01T00:00:00.000Z | kuukausi | kuukausi sitten | 744 tuntia |
+| 1999-11-01T00:00:00.000Z | 2 kuukautta | 2 kuukautta sitten | 1464 tuntia |
+| 1999-06-01T00:00:00.000Z | 7 kuukautta | 7 kuukautta sitten | 5136 tuntia |
+| 1999-01-01T00:00:00.000Z | vuosi | vuosi sitten | 8760 tuntia |
+| 1998-12-01T00:00:00.000Z | vuosi | vuosi sitten | 9504 tuntia |
+| 1998-06-01T00:00:00.000Z | 2 vuotta | 2 vuotta sitten | 13896 tuntia |
+| 1998-01-01T00:00:00.000Z | 2 vuotta | 2 vuotta sitten | 17520 tuntia |
+| 1997-01-01T00:00:00.000Z | 3 vuotta | 3 vuotta sitten | 26280 tuntia |
+| 1996-01-01T00:00:00.000Z | 4 vuotta | 4 vuotta sitten | 35064 tuntia |
+| 1995-01-01T00:00:00.000Z | 5 vuotta | 5 vuotta sitten | 43824 tuntia |
+| 1994-01-01T00:00:00.000Z | 6 vuotta | 6 vuotta sitten | 52584 tuntia |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.1.2000 |
+| 2000-01-05T00:00:00.000Z | ensi keskiviikkona klo 00.00 |
+| 2000-01-02T00:00:00.000Z | huomenna klo 00.00 |
+| 2000-01-01T00:00:00.000Z | tänään klo 00.00 |
+| 1999-12-31T00:00:00.000Z | eilen klo 00.00 |
+| 1999-12-27T00:00:00.000Z | viime maanantaina klo 00.00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/fil/_lib/formatDistance/index.js b/date-fns/src/locale/fil/_lib/formatDistance/index.js
new file mode 100644
index 0000000..4da5dfa
--- /dev/null
+++ b/date-fns/src/locale/fil/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'mas maliit sa isang segundo',
+ other: 'mas maliit sa {{count}} segundo'
+ },
+
+ xSeconds: {
+ one: '1 segundo',
+ other: '{{count}} segundo'
+ },
+
+ halfAMinute: 'kalahating minuto',
+
+ lessThanXMinutes: {
+ one: 'mas maliit sa isang minuto',
+ other: 'mas maliit sa {{count}} minuto'
+ },
+
+ xMinutes: {
+ one: '1 minuto',
+ other: '{{count}} minuto'
+ },
+
+ aboutXHours: {
+ one: 'mga 1 oras',
+ other: 'mga {{count}} oras'
+ },
+
+ xHours: {
+ one: '1 oras',
+ other: '{{count}} oras'
+ },
+
+ xDays: {
+ one: '1 araw',
+ other: '{{count}} araw'
+ },
+
+ aboutXWeeks: {
+ one: 'mga 1 buwan', // TODO
+ other: 'mga {{count}} buwan' // TODO
+ },
+
+ xWeeks: {
+ one: '1 buwan', // TODO
+ other: '{{count}} buwan' // TODO
+ },
+
+ aboutXMonths: {
+ one: 'mga 1 buwan',
+ other: 'mga {{count}} buwan'
+ },
+
+ xMonths: {
+ one: '1 buwan',
+ other: '{{count}} buwan'
+ },
+
+ aboutXYears: {
+ one: 'mga 1 taon',
+ other: 'mga {{count}} taon'
+ },
+
+ xYears: {
+ one: '1 taon',
+ other: '{{count}} taon'
+ },
+
+ overXYears: {
+ one: 'higit sa 1 taon',
+ other: 'higit sa {{count}} taon'
+ },
+
+ almostXYears: {
+ one: 'halos 1 taon',
+ other: 'halos {{count}} taon'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'sa loob ng ' + result
+ } else {
+ return result + ' ang nakalipas'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/fil/_lib/formatLong/index.js b/date-fns/src/locale/fil/_lib/formatLong/index.js
new file mode 100644
index 0000000..2cf1867
--- /dev/null
+++ b/date-fns/src/locale/fil/_lib/formatLong/index.js
@@ -0,0 +1,12 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var formatLong = buildFormatLongFn({
+ LT: 'h:mm aa',
+ LTS: 'h:mm:ss aa',
+ L: 'MM/DD/YYYY',
+ LL: 'MMMM D YYYY',
+ LLL: 'MMMM D YYYY h:mm aa',
+ LLLL: 'dddd, MMMM D YYYY h:mm aa'
+})
+
+export default formatLong
diff --git a/date-fns/src/locale/fil/_lib/formatRelative/index.js b/date-fns/src/locale/fil/_lib/formatRelative/index.js
new file mode 100644
index 0000000..52ebbf1
--- /dev/null
+++ b/date-fns/src/locale/fil/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: '[last] dddd [at] LT',
+ yesterday: '[yesterday at] LT',
+ today: '[today at] LT',
+ tomorrow: '[tomorrow at] LT',
+ nextWeek: 'dddd [at] LT',
+ other: 'L'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/fil/_lib/localize/index.js b/date-fns/src/locale/fil/_lib/localize/index.js
new file mode 100644
index 0000000..6be8e61
--- /dev/null
+++ b/date-fns/src/locale/fil/_lib/localize/index.js
@@ -0,0 +1,83 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+import buildLocalizeArrayFn from '../../../_lib/buildLocalizeArrayFn/index'
+
+var weekdayValues = {
+ narrow: ['Li', 'Lu', 'Ma', 'Mi', 'Hu', 'Bi', 'Sa'],
+ short: ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'],
+ long: [
+ 'Linggo',
+ 'Lunes',
+ 'Martes',
+ 'Miyerkules',
+ 'Huwebes',
+ 'Biyernes',
+ 'Sabado'
+ ]
+}
+
+var monthValues = {
+ short: [
+ 'Ene',
+ 'Peb',
+ 'Mar',
+ 'Abr',
+ 'May',
+ 'Hun',
+ 'Hul',
+ 'Ago',
+ 'Set',
+ 'Okt',
+ 'Nob',
+ 'Dis'
+ ],
+ long: [
+ 'Enero',
+ 'Pebrero',
+ 'Marso',
+ 'Abril',
+ 'Mayo',
+ 'Hunyo',
+ 'Hulyo',
+ 'Agosto',
+ 'Setyembre',
+ 'Oktubre',
+ 'Nobyembre',
+ 'Disyembre'
+ ]
+}
+
+var timeOfDayValues = {
+ uppercase: ['NU', 'NT', 'NH', 'NG'],
+ lowercase: ['nu', 'nt', 'nh', 'ng'],
+ long: ['ng umaga', 'ng tanghali', 'ng hapon', 'ng gabi']
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return 'ika-' + number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ weekday: buildLocalizeFn(weekdayValues, 'long'),
+ weekdays: buildLocalizeArrayFn(weekdayValues, 'long'),
+ month: buildLocalizeFn(monthValues, 'long'),
+ months: buildLocalizeArrayFn(monthValues, 'long'),
+ timeOfDay: buildLocalizeFn(timeOfDayValues, 'long', function(hours) {
+ if (hours > 12) {
+ var modulo = hours % 12
+ if (modulo < 6) {
+ return 2
+ } else {
+ return 3
+ }
+ } else if (hours < 12) {
+ return 0
+ } else {
+ return 1
+ }
+ }),
+ timesOfDay: buildLocalizeArrayFn(timeOfDayValues, 'long')
+}
+
+export default localize
diff --git a/date-fns/src/locale/fil/_lib/match/index.js b/date-fns/src/locale/fil/_lib/match/index.js
new file mode 100644
index 0000000..5a3f4c5
--- /dev/null
+++ b/date-fns/src/locale/fil/_lib/match/index.js
@@ -0,0 +1,60 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildParseFn from '../../../_lib/buildParseFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import parseDecimal from '../../../_lib/parseDecimal/index'
+
+var matchOrdinalNumbersPattern = /^(\d+)(th|st|nd|rd)?/i
+
+var matchWeekdaysPatterns = {
+ narrow: /^(su|mo|tu|we|th|fr|sa)/i,
+ short: /^(sun|mon|tue|wed|thu|fri|sat)/i,
+ long: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
+}
+
+var parseWeekdayPatterns = {
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
+}
+
+var matchMonthsPatterns = {
+ short: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
+ long: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
+}
+
+var parseMonthPatterns = {
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^may/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchTimesOfDayPatterns = {
+ short: /^(am|pm)/i,
+ long: /^([ap]\.?\s?m\.?)/i
+}
+
+var parseTimeOfDayPatterns = {
+ any: [/^a/i, /^p/i]
+}
+
+var match = {
+ ordinalNumbers: buildMatchPatternFn(matchOrdinalNumbersPattern),
+ ordinalNumber: parseDecimal,
+ weekdays: buildMatchFn(matchWeekdaysPatterns, 'long'),
+ weekday: buildParseFn(parseWeekdayPatterns, 'any'),
+ months: buildMatchFn(matchMonthsPatterns, 'long'),
+ month: buildParseFn(parseMonthPatterns, 'any'),
+ timesOfDay: buildMatchFn(matchTimesOfDayPatterns, 'long'),
+ timeOfDay: buildParseFn(parseTimeOfDayPatterns, 'any')
+}
+
+export default match
diff --git a/date-fns/src/locale/fil/index.d.ts b/date-fns/src/locale/fil/index.d.ts
new file mode 100644
index 0000000..edd13d6
--- /dev/null
+++ b/date-fns/src/locale/fil/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { fil } from 'date-fns/locale'
+export default fil
diff --git a/date-fns/src/locale/fil/index.js b/date-fns/src/locale/fil/index.js
new file mode 100644
index 0000000..63c9477
--- /dev/null
+++ b/date-fns/src/locale/fil/index.js
@@ -0,0 +1,32 @@
+// import formatDistance from './_lib/formatDistance/index'
+// import formatLong from './_lib/formatLong/index'
+// import formatRelative from './_lib/formatRelative/index'
+// import localize from './_lib/localize/index'
+// import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Filipino locale.
+ * @language Filipino
+ * @iso-639-2 fil
+ * @author Ian De La Cruz [@RIanDeLaCruz]{@link https://github.com/RIanDeLaCruz}
+ */
+// var locale = {
+// code: 'fil',
+// formatDistance: formatDistance,
+// formatLong: formatLong,
+// formatRelative: formatRelative,
+// localize: localize,
+// match: match,
+// options: {
+// weekStartsOn: 0 /* Sunday */,
+// firstWeekContainsDate: 1
+// }
+// }
+
+// export default locale
+
+throw new Error(
+ 'fil locale is currently unavailable. Please check the progress of converting this locale to v2.0.0 in this issue on Github: TBA'
+)
diff --git a/date-fns/src/locale/fil/index.js.flow b/date-fns/src/locale/fil/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/fil/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/fr-CA/_lib/formatLong/index.js b/date-fns/src/locale/fr-CA/_lib/formatLong/index.js
new file mode 100644
index 0000000..3810ebe
--- /dev/null
+++ b/date-fns/src/locale/fr-CA/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'yy-MM-dd'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'à' {{time}}",
+ long: "{{date}} 'à' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/fr-CA/index.d.ts b/date-fns/src/locale/fr-CA/index.d.ts
new file mode 100644
index 0000000..533b466
--- /dev/null
+++ b/date-fns/src/locale/fr-CA/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { frCA } from 'date-fns/locale'
+export default frCA
diff --git a/date-fns/src/locale/fr-CA/index.js b/date-fns/src/locale/fr-CA/index.js
new file mode 100644
index 0000000..1986220
--- /dev/null
+++ b/date-fns/src/locale/fr-CA/index.js
@@ -0,0 +1,35 @@
+// Same as fr
+import formatDistance from '../fr/_lib/formatDistance/index'
+import formatRelative from '../fr/_lib/formatRelative/index'
+import localize from '../fr/_lib/localize/index'
+import match from '../fr/_lib/match/index'
+
+// Unique for fr-CA
+import formatLong from './_lib/formatLong/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary French locale (Canada).
+ * @language French
+ * @iso-639-2 fra
+ * @author Jean Dupouy [@izeau]{@link https://github.com/izeau}
+ * @author François B [@fbonzon]{@link https://github.com/fbonzon}
+ * @author Gabriele Petrioli [@gpetrioli]{@link https://github.com/gpetrioli}
+ */
+var locale = {
+ code: 'fr-CA',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+
+ // Unique for fr-CA
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/fr-CA/index.js.flow b/date-fns/src/locale/fr-CA/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/fr-CA/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/fr-CA/snapshot.md b/date-fns/src/locale/fr-CA/snapshot.md
new file mode 100644
index 0000000..4c471e8
--- /dev/null
+++ b/date-fns/src/locale/fr-CA/snapshot.md
@@ -0,0 +1,304 @@
+# French (fr-CA) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987ème | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ème | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987ème | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ème | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1er | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1er trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2ème trim. | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1er trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | T1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | T2 | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1er | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1er trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2ème trim. | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1er trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ème | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | févr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juil. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | février | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juillet | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ème | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | févr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juil. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | février | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juillet | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1ère | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49ème | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1ère | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ème | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28ème | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365ème | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1er | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ème | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6ème | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6ème | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | du matin | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de l’après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | du soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | du matin | 2019-02-11T04:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ap.m. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ème | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ème | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ème | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ème | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1er | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55ème | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1er | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55ème | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 87-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53-05-29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 févr. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 février 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | mercredi 11 février 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | dimanche 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 87-02-11, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53-05-29, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 févr. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 février 1987 à 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 à 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | mercredi 11 février 1987 à 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | dimanche 29 mai 1453 à 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | environ 6 ans | environ 6 ans | dans environ 6 ans |
+| 2005-01-01T00:00:00.000Z | environ 5 ans | environ 5 ans | dans environ 5 ans |
+| 2004-01-01T00:00:00.000Z | environ 4 ans | environ 4 ans | dans environ 4 ans |
+| 2003-01-01T00:00:00.000Z | environ 3 ans | environ 3 ans | dans environ 3 ans |
+| 2002-01-01T00:00:00.000Z | environ 2 ans | environ 2 ans | dans environ 2 ans |
+| 2001-06-01T00:00:00.000Z | plus d’un an | plus d’un an | dans plus d’un an |
+| 2001-02-01T00:00:00.000Z | environ 1 an | environ 1 an | dans environ 1 an |
+| 2001-01-01T00:00:00.000Z | environ 1 an | environ 1 an | dans environ 1 an |
+| 2000-06-01T00:00:00.000Z | 5 mois | 5 mois | dans 5 mois |
+| 2000-03-01T00:00:00.000Z | 2 mois | 2 mois | dans 2 mois |
+| 2000-02-01T00:00:00.000Z | environ 1 mois | environ 1 mois | dans environ 1 mois |
+| 2000-01-15T00:00:00.000Z | 14 jours | 14 jours | dans 14 jours |
+| 2000-01-02T00:00:00.000Z | 1 jour | 1 jour | dans 1 jour |
+| 2000-01-01T06:00:00.000Z | environ 6 heures | environ 6 heures | dans environ 6 heures |
+| 2000-01-01T01:00:00.000Z | environ 1 heure | environ 1 heure | dans environ 1 heure |
+| 2000-01-01T00:45:00.000Z | environ 1 heure | environ 1 heure | dans environ 1 heure |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | dans 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | dans 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | dans 1 minute |
+| 2000-01-01T00:00:25.000Z | moins d’une minute | 30 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:15.000Z | moins d’une minute | moins de 20 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:05.000Z | moins d’une minute | moins de 10 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:00.000Z | moins d’une minute | moins de 5 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:55.000Z | moins d’une minute | moins de 10 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:45.000Z | moins d’une minute | moins de 20 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:35.000Z | moins d’une minute | 30 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | il y a 1 minute |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | il y a 15 minutes |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | il y a 30 minutes |
+| 1999-12-31T23:15:00.000Z | environ 1 heure | environ 1 heure | il y a environ 1 heure |
+| 1999-12-31T23:00:00.000Z | environ 1 heure | environ 1 heure | il y a environ 1 heure |
+| 1999-12-31T18:00:00.000Z | environ 6 heures | environ 6 heures | il y a environ 6 heures |
+| 1999-12-30T00:00:00.000Z | 2 jours | 2 jours | il y a 2 jours |
+| 1999-12-15T00:00:00.000Z | 17 jours | 17 jours | il y a 17 jours |
+| 1999-12-01T00:00:00.000Z | environ 1 mois | environ 1 mois | il y a environ 1 mois |
+| 1999-11-01T00:00:00.000Z | 2 mois | 2 mois | il y a 2 mois |
+| 1999-06-01T00:00:00.000Z | 7 mois | 7 mois | il y a 7 mois |
+| 1999-01-01T00:00:00.000Z | environ 1 an | environ 1 an | il y a environ 1 an |
+| 1998-12-01T00:00:00.000Z | environ 1 an | environ 1 an | il y a environ 1 an |
+| 1998-06-01T00:00:00.000Z | plus d’un an | plus d’un an | il y a plus d’un an |
+| 1998-01-01T00:00:00.000Z | environ 2 ans | environ 2 ans | il y a environ 2 ans |
+| 1997-01-01T00:00:00.000Z | environ 3 ans | environ 3 ans | il y a environ 3 ans |
+| 1996-01-01T00:00:00.000Z | environ 4 ans | environ 4 ans | il y a environ 4 ans |
+| 1995-01-01T00:00:00.000Z | environ 5 ans | environ 5 ans | il y a environ 5 ans |
+| 1994-01-01T00:00:00.000Z | environ 6 ans | environ 6 ans | il y a environ 6 ans |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ans | dans 6 ans | 52608 heures |
+| 2005-01-01T00:00:00.000Z | 5 ans | dans 5 ans | 43848 heures |
+| 2004-01-01T00:00:00.000Z | 4 ans | dans 4 ans | 35064 heures |
+| 2003-01-01T00:00:00.000Z | 3 ans | dans 3 ans | 26304 heures |
+| 2002-01-01T00:00:00.000Z | 2 ans | dans 2 ans | 17544 heures |
+| 2001-06-01T00:00:00.000Z | 1 an | dans 1 an | 12408 heures |
+| 2001-02-01T00:00:00.000Z | 1 an | dans 1 an | 9528 heures |
+| 2001-01-01T00:00:00.000Z | 1 an | dans 1 an | 8784 heures |
+| 2000-06-01T00:00:00.000Z | 5 mois | dans 5 mois | 3648 heures |
+| 2000-03-01T00:00:00.000Z | 2 mois | dans 2 mois | 1440 heures |
+| 2000-02-01T00:00:00.000Z | 1 mois | dans 1 mois | 744 heures |
+| 2000-01-15T00:00:00.000Z | 14 jours | dans 14 jours | 336 heures |
+| 2000-01-02T00:00:00.000Z | 1 jour | dans 1 jour | 24 heures |
+| 2000-01-01T06:00:00.000Z | 6 heures | dans 6 heures | 6 heures |
+| 2000-01-01T01:00:00.000Z | 1 heure | dans 1 heure | 1 heure |
+| 2000-01-01T00:45:00.000Z | 45 minutes | dans 45 minutes | 1 heure |
+| 2000-01-01T00:30:00.000Z | 30 minutes | dans 30 minutes | 1 heure |
+| 2000-01-01T00:15:00.000Z | 15 minutes | dans 15 minutes | 0 heures |
+| 2000-01-01T00:01:00.000Z | 1 minute | dans 1 minute | 0 heures |
+| 2000-01-01T00:00:25.000Z | 25 secondes | dans 25 secondes | 0 heures |
+| 2000-01-01T00:00:15.000Z | 15 secondes | dans 15 secondes | 0 heures |
+| 2000-01-01T00:00:05.000Z | 5 secondes | dans 5 secondes | 0 heures |
+| 2000-01-01T00:00:00.000Z | 0 secondes | il y a 0 secondes | 0 heures |
+| 1999-12-31T23:59:55.000Z | 5 secondes | il y a 5 secondes | 0 heures |
+| 1999-12-31T23:59:45.000Z | 15 secondes | il y a 15 secondes | 0 heures |
+| 1999-12-31T23:59:35.000Z | 25 secondes | il y a 25 secondes | 0 heures |
+| 1999-12-31T23:59:00.000Z | 1 minute | il y a 1 minute | 0 heures |
+| 1999-12-31T23:45:00.000Z | 15 minutes | il y a 15 minutes | 0 heures |
+| 1999-12-31T23:30:00.000Z | 30 minutes | il y a 30 minutes | 1 heure |
+| 1999-12-31T23:15:00.000Z | 45 minutes | il y a 45 minutes | 1 heure |
+| 1999-12-31T23:00:00.000Z | 1 heure | il y a 1 heure | 1 heure |
+| 1999-12-31T18:00:00.000Z | 6 heures | il y a 6 heures | 6 heures |
+| 1999-12-30T00:00:00.000Z | 2 jours | il y a 2 jours | 48 heures |
+| 1999-12-15T00:00:00.000Z | 17 jours | il y a 17 jours | 408 heures |
+| 1999-12-01T00:00:00.000Z | 1 mois | il y a 1 mois | 744 heures |
+| 1999-11-01T00:00:00.000Z | 2 mois | il y a 2 mois | 1464 heures |
+| 1999-06-01T00:00:00.000Z | 7 mois | il y a 7 mois | 5136 heures |
+| 1999-01-01T00:00:00.000Z | 1 an | il y a 1 an | 8760 heures |
+| 1998-12-01T00:00:00.000Z | 1 an | il y a 1 an | 9504 heures |
+| 1998-06-01T00:00:00.000Z | 2 ans | il y a 2 ans | 13896 heures |
+| 1998-01-01T00:00:00.000Z | 2 ans | il y a 2 ans | 17520 heures |
+| 1997-01-01T00:00:00.000Z | 3 ans | il y a 3 ans | 26280 heures |
+| 1996-01-01T00:00:00.000Z | 4 ans | il y a 4 ans | 35064 heures |
+| 1995-01-01T00:00:00.000Z | 5 ans | il y a 5 ans | 43824 heures |
+| 1994-01-01T00:00:00.000Z | 6 ans | il y a 6 ans | 52584 heures |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------- |
+| 2000-01-10T00:00:00.000Z | 00-01-10 |
+| 2000-01-05T00:00:00.000Z | mercredi prochain à 00:00 |
+| 2000-01-02T00:00:00.000Z | demain à 00:00 |
+| 2000-01-01T00:00:00.000Z | aujourd’hui à 00:00 |
+| 1999-12-31T00:00:00.000Z | hier à 00:00 |
+| 1999-12-27T00:00:00.000Z | lundi dernier à 00:00 |
+| 1999-12-21T00:00:00.000Z | 99-12-21 |
diff --git a/date-fns/src/locale/fr-CH/_lib/formatDistance/index.js b/date-fns/src/locale/fr-CH/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e5bbf4f
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'moins d’une seconde',
+ other: 'moins de {{count}} secondes'
+ },
+
+ xSeconds: {
+ one: '1 seconde',
+ other: '{{count}} secondes'
+ },
+
+ halfAMinute: '30 secondes',
+
+ lessThanXMinutes: {
+ one: 'moins d’une minute',
+ other: 'moins de {{count}} minutes'
+ },
+
+ xMinutes: {
+ one: '1 minute',
+ other: '{{count}} minutes'
+ },
+
+ aboutXHours: {
+ one: 'environ 1 heure',
+ other: 'environ {{count}} heures'
+ },
+
+ xHours: {
+ one: '1 heure',
+ other: '{{count}} heures'
+ },
+
+ xDays: {
+ one: '1 jour',
+ other: '{{count}} jours'
+ },
+
+ aboutXWeeks: {
+ one: 'environ 1 semaine',
+ other: 'environ {{count}} semaines'
+ },
+
+ xWeeks: {
+ one: '1 semaine',
+ other: '{{count}} semaines'
+ },
+
+ aboutXMonths: {
+ one: 'environ 1 mois',
+ other: 'environ {{count}} mois'
+ },
+
+ xMonths: {
+ one: '1 mois',
+ other: '{{count}} mois'
+ },
+
+ aboutXYears: {
+ one: 'environ 1 an',
+ other: 'environ {{count}} ans'
+ },
+
+ xYears: {
+ one: '1 an',
+ other: '{{count}} ans'
+ },
+
+ overXYears: {
+ one: 'plus d’un an',
+ other: 'plus de {{count}} ans'
+ },
+
+ almostXYears: {
+ one: 'presqu’un an',
+ other: 'presque {{count}} ans'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'dans ' + result
+ } else {
+ return 'il y a ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/fr-CH/_lib/formatLong/index.js b/date-fns/src/locale/fr-CH/_lib/formatLong/index.js
new file mode 100644
index 0000000..16cdba1
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'à' {{time}}",
+ long: "{{date}} 'à' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/fr-CH/_lib/formatRelative/index.js b/date-fns/src/locale/fr-CH/_lib/formatRelative/index.js
new file mode 100644
index 0000000..fff22de
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'la semaine dernière à' p",
+ yesterday: "'hier à' p",
+ today: "'aujourd’hui à' p",
+ tomorrow: "'demain à' p'",
+ nextWeek: "eeee 'la semaine prochaine à' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/fr-CH/_lib/formatters/index.js b/date-fns/src/locale/fr-CH/_lib/formatters/index.js
new file mode 100644
index 0000000..b270774
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/_lib/formatters/index.js
@@ -0,0 +1,17 @@
+var formatters = {}
+
+// Special case for day of month ordinals in long date format context:
+// 1er mars, 2 mars, 3 mars, …
+// See https://github.com/date-fns/date-fns/issues/437
+var monthsTokens = ['MMM', 'MMMM']
+monthsTokens.forEach(function (monthToken) {
+ formatters['Do ' + monthToken] = function (date, options) {
+ var commonFormatters = options.formatters
+ var dayOfMonthToken = date.getUTCDate() === 1 ? 'Do' : 'D'
+ var dayOfMonthFormatter = commonFormatters[dayOfMonthToken]
+ var monthFormatter = commonFormatters[monthToken]
+ return dayOfMonthFormatter(date, options) + ' ' + monthFormatter(date, options)
+ }
+})
+
+export default formatters
diff --git a/date-fns/src/locale/fr-CH/_lib/localize/index.js b/date-fns/src/locale/fr-CH/_lib/localize/index.js
new file mode 100644
index 0000000..01d52b3
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/_lib/localize/index.js
@@ -0,0 +1,155 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['av. J.-C', 'ap. J.-C'],
+ abbreviated: ['av. J.-C', 'ap. J.-C'],
+ wide: ['avant Jésus-Christ', 'après Jésus-Christ']
+}
+
+var quarterValues = {
+ narrow: ['T1', 'T2', 'T3', 'T4'],
+ abbreviated: ['1er trim.', '2ème trim.', '3ème trim.', '4ème trim.'],
+ wide: ['1er trimestre', '2ème trimestre', '3ème trimestre', '4ème trimestre']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'janv.',
+ 'févr.',
+ 'mars',
+ 'avr.',
+ 'mai',
+ 'juin',
+ 'juil.',
+ 'août',
+ 'sept.',
+ 'oct.',
+ 'nov.',
+ 'déc.'
+ ],
+ wide: [
+ 'janvier',
+ 'février',
+ 'mars',
+ 'avril',
+ 'mai',
+ 'juin',
+ 'juillet',
+ 'août',
+ 'septembre',
+ 'octobre',
+ 'novembre',
+ 'décembre'
+ ]
+}
+
+var dayValues = {
+ narrow: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
+ short: ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'],
+ abbreviated: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
+ wide: [
+ 'dimanche',
+ 'lundi',
+ 'mardi',
+ 'mercredi',
+ 'jeudi',
+ 'vendredi',
+ 'samedi'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minuit',
+ noon: 'midi',
+ morning: 'mat.',
+ afternoon: 'ap.m.',
+ evening: 'soir',
+ night: 'mat.'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minuit',
+ noon: 'midi',
+ morning: 'matin',
+ afternoon: 'après-midi',
+ evening: 'soir',
+ night: 'matin'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minuit',
+ noon: 'midi',
+ morning: 'du matin',
+ afternoon: 'de l’après-midi',
+ evening: 'du soir',
+ night: 'du matin'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var suffix
+
+ if (number === 0) {
+ return number
+ }
+
+ if (unit === 'year' || unit === 'hour' || unit === 'week') {
+ if (number === 1) {
+ suffix = 'ère'
+ } else {
+ suffix = 'ème'
+ }
+ } else {
+ if (number === 1) {
+ suffix = 'er'
+ } else {
+ suffix = 'ème'
+ }
+ }
+
+ return number + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/fr-CH/_lib/match/index.js b/date-fns/src/locale/fr-CH/_lib/match/index.js
new file mode 100644
index 0000000..e5c36f8
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(ième|ère|ème|er|e)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
+ abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
+ wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
+}
+var parseEraPatterns = {
+ any: [/^av/i, /^ap/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^t[1234]/i,
+ wide: /^[1234](er|ème|e)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
+ wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^av/i,
+ /^ma/i,
+ /^juin/i,
+ /^juil/i,
+ /^ao/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[lmjvsd]/i,
+ short: /^(di|lu|ma|me|je|ve|sa)/i,
+ abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
+ wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
+ any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
+ any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^min/i,
+ noon: /^mid/i,
+ morning: /mat/i,
+ afternoon: /ap/i,
+ evening: /soir/i,
+ night: /nuit/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/fr-CH/index.d.ts b/date-fns/src/locale/fr-CH/index.d.ts
new file mode 100644
index 0000000..5fdd3c5
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { frCH } from 'date-fns/locale'
+export default frCH
diff --git a/date-fns/src/locale/fr-CH/index.js b/date-fns/src/locale/fr-CH/index.js
new file mode 100644
index 0000000..d153f05
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/index.js
@@ -0,0 +1,32 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary French locale.
+ * @language French
+ * @iso-639-2 fra
+ * @author Jean Dupouy [@izeau]{@link https://github.com/izeau}
+ * @author François B [@fbonzon]{@link https://github.com/fbonzon}
+ * @author Van Vuong Ngo [@vanvuongngo]{@link https://github.com/vanvuongngo}
+ * @author Alex Hoeing [@dcbn]{@link https://github.com/dcbn}
+ */
+
+var locale = {
+ code: 'fr-CH',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/fr-CH/index.js.flow b/date-fns/src/locale/fr-CH/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/fr-CH/snapshot.md b/date-fns/src/locale/fr-CH/snapshot.md
new file mode 100644
index 0000000..f92944e
--- /dev/null
+++ b/date-fns/src/locale/fr-CH/snapshot.md
@@ -0,0 +1,304 @@
+# French (fr-CH) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987ème | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ème | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987ème | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4ème | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1er | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1er trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2ème trim. | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1er trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | T1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | T2 | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1er | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1er trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2ème trim. | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1er trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ème | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | févr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juil. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | février | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juillet | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ème | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | févr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juil. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | février | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juillet | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1ère | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ème | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1ère | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ème | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28ème | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365ème | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1er | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ème | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1er | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ème | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1er | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ème | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | du matin | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de l’après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | du soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | du matin | 2019-02-11T04:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ap.m. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ème | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ème | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ème | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ème | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1er | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55ème | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1er | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55ème | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 févr. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 février 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | mercredi 11 février 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | dimanche 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 févr. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 février 1987 à 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 à 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | mercredi 11 février 1987 à 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | dimanche 29 mai 1453 à 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | environ 6 ans | environ 6 ans | dans environ 6 ans |
+| 2005-01-01T00:00:00.000Z | environ 5 ans | environ 5 ans | dans environ 5 ans |
+| 2004-01-01T00:00:00.000Z | environ 4 ans | environ 4 ans | dans environ 4 ans |
+| 2003-01-01T00:00:00.000Z | environ 3 ans | environ 3 ans | dans environ 3 ans |
+| 2002-01-01T00:00:00.000Z | environ 2 ans | environ 2 ans | dans environ 2 ans |
+| 2001-06-01T00:00:00.000Z | plus d’un an | plus d’un an | dans plus d’un an |
+| 2001-02-01T00:00:00.000Z | environ 1 an | environ 1 an | dans environ 1 an |
+| 2001-01-01T00:00:00.000Z | environ 1 an | environ 1 an | dans environ 1 an |
+| 2000-06-01T00:00:00.000Z | 5 mois | 5 mois | dans 5 mois |
+| 2000-03-01T00:00:00.000Z | 2 mois | 2 mois | dans 2 mois |
+| 2000-02-01T00:00:00.000Z | environ 1 mois | environ 1 mois | dans environ 1 mois |
+| 2000-01-15T00:00:00.000Z | 14 jours | 14 jours | dans 14 jours |
+| 2000-01-02T00:00:00.000Z | 1 jour | 1 jour | dans 1 jour |
+| 2000-01-01T06:00:00.000Z | environ 6 heures | environ 6 heures | dans environ 6 heures |
+| 2000-01-01T01:00:00.000Z | environ 1 heure | environ 1 heure | dans environ 1 heure |
+| 2000-01-01T00:45:00.000Z | environ 1 heure | environ 1 heure | dans environ 1 heure |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | dans 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | dans 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | dans 1 minute |
+| 2000-01-01T00:00:25.000Z | moins d’une minute | 30 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:15.000Z | moins d’une minute | moins de 20 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:05.000Z | moins d’une minute | moins de 10 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:00.000Z | moins d’une minute | moins de 5 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:55.000Z | moins d’une minute | moins de 10 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:45.000Z | moins d’une minute | moins de 20 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:35.000Z | moins d’une minute | 30 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | il y a 1 minute |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | il y a 15 minutes |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | il y a 30 minutes |
+| 1999-12-31T23:15:00.000Z | environ 1 heure | environ 1 heure | il y a environ 1 heure |
+| 1999-12-31T23:00:00.000Z | environ 1 heure | environ 1 heure | il y a environ 1 heure |
+| 1999-12-31T18:00:00.000Z | environ 6 heures | environ 6 heures | il y a environ 6 heures |
+| 1999-12-30T00:00:00.000Z | 2 jours | 2 jours | il y a 2 jours |
+| 1999-12-15T00:00:00.000Z | 17 jours | 17 jours | il y a 17 jours |
+| 1999-12-01T00:00:00.000Z | environ 1 mois | environ 1 mois | il y a environ 1 mois |
+| 1999-11-01T00:00:00.000Z | 2 mois | 2 mois | il y a 2 mois |
+| 1999-06-01T00:00:00.000Z | 7 mois | 7 mois | il y a 7 mois |
+| 1999-01-01T00:00:00.000Z | environ 1 an | environ 1 an | il y a environ 1 an |
+| 1998-12-01T00:00:00.000Z | environ 1 an | environ 1 an | il y a environ 1 an |
+| 1998-06-01T00:00:00.000Z | plus d’un an | plus d’un an | il y a plus d’un an |
+| 1998-01-01T00:00:00.000Z | environ 2 ans | environ 2 ans | il y a environ 2 ans |
+| 1997-01-01T00:00:00.000Z | environ 3 ans | environ 3 ans | il y a environ 3 ans |
+| 1996-01-01T00:00:00.000Z | environ 4 ans | environ 4 ans | il y a environ 4 ans |
+| 1995-01-01T00:00:00.000Z | environ 5 ans | environ 5 ans | il y a environ 5 ans |
+| 1994-01-01T00:00:00.000Z | environ 6 ans | environ 6 ans | il y a environ 6 ans |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ans | dans 6 ans | 52608 heures |
+| 2005-01-01T00:00:00.000Z | 5 ans | dans 5 ans | 43848 heures |
+| 2004-01-01T00:00:00.000Z | 4 ans | dans 4 ans | 35064 heures |
+| 2003-01-01T00:00:00.000Z | 3 ans | dans 3 ans | 26304 heures |
+| 2002-01-01T00:00:00.000Z | 2 ans | dans 2 ans | 17544 heures |
+| 2001-06-01T00:00:00.000Z | 1 an | dans 1 an | 12408 heures |
+| 2001-02-01T00:00:00.000Z | 1 an | dans 1 an | 9528 heures |
+| 2001-01-01T00:00:00.000Z | 1 an | dans 1 an | 8784 heures |
+| 2000-06-01T00:00:00.000Z | 5 mois | dans 5 mois | 3648 heures |
+| 2000-03-01T00:00:00.000Z | 2 mois | dans 2 mois | 1440 heures |
+| 2000-02-01T00:00:00.000Z | 1 mois | dans 1 mois | 744 heures |
+| 2000-01-15T00:00:00.000Z | 14 jours | dans 14 jours | 336 heures |
+| 2000-01-02T00:00:00.000Z | 1 jour | dans 1 jour | 24 heures |
+| 2000-01-01T06:00:00.000Z | 6 heures | dans 6 heures | 6 heures |
+| 2000-01-01T01:00:00.000Z | 1 heure | dans 1 heure | 1 heure |
+| 2000-01-01T00:45:00.000Z | 45 minutes | dans 45 minutes | 1 heure |
+| 2000-01-01T00:30:00.000Z | 30 minutes | dans 30 minutes | 1 heure |
+| 2000-01-01T00:15:00.000Z | 15 minutes | dans 15 minutes | 0 heures |
+| 2000-01-01T00:01:00.000Z | 1 minute | dans 1 minute | 0 heures |
+| 2000-01-01T00:00:25.000Z | 25 secondes | dans 25 secondes | 0 heures |
+| 2000-01-01T00:00:15.000Z | 15 secondes | dans 15 secondes | 0 heures |
+| 2000-01-01T00:00:05.000Z | 5 secondes | dans 5 secondes | 0 heures |
+| 2000-01-01T00:00:00.000Z | 0 secondes | il y a 0 secondes | 0 heures |
+| 1999-12-31T23:59:55.000Z | 5 secondes | il y a 5 secondes | 0 heures |
+| 1999-12-31T23:59:45.000Z | 15 secondes | il y a 15 secondes | 0 heures |
+| 1999-12-31T23:59:35.000Z | 25 secondes | il y a 25 secondes | 0 heures |
+| 1999-12-31T23:59:00.000Z | 1 minute | il y a 1 minute | 0 heures |
+| 1999-12-31T23:45:00.000Z | 15 minutes | il y a 15 minutes | 0 heures |
+| 1999-12-31T23:30:00.000Z | 30 minutes | il y a 30 minutes | 1 heure |
+| 1999-12-31T23:15:00.000Z | 45 minutes | il y a 45 minutes | 1 heure |
+| 1999-12-31T23:00:00.000Z | 1 heure | il y a 1 heure | 1 heure |
+| 1999-12-31T18:00:00.000Z | 6 heures | il y a 6 heures | 6 heures |
+| 1999-12-30T00:00:00.000Z | 2 jours | il y a 2 jours | 48 heures |
+| 1999-12-15T00:00:00.000Z | 17 jours | il y a 17 jours | 408 heures |
+| 1999-12-01T00:00:00.000Z | 1 mois | il y a 1 mois | 744 heures |
+| 1999-11-01T00:00:00.000Z | 2 mois | il y a 2 mois | 1464 heures |
+| 1999-06-01T00:00:00.000Z | 7 mois | il y a 7 mois | 5136 heures |
+| 1999-01-01T00:00:00.000Z | 1 an | il y a 1 an | 8760 heures |
+| 1998-12-01T00:00:00.000Z | 1 an | il y a 1 an | 9504 heures |
+| 1998-06-01T00:00:00.000Z | 2 ans | il y a 2 ans | 13896 heures |
+| 1998-01-01T00:00:00.000Z | 2 ans | il y a 2 ans | 17520 heures |
+| 1997-01-01T00:00:00.000Z | 3 ans | il y a 3 ans | 26280 heures |
+| 1996-01-01T00:00:00.000Z | 4 ans | il y a 4 ans | 35064 heures |
+| 1995-01-01T00:00:00.000Z | 5 ans | il y a 5 ans | 43824 heures |
+| 1994-01-01T00:00:00.000Z | 6 ans | il y a 6 ans | 52584 heures |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | mercredi la semaine prochaine à 00:00 |
+| 2000-01-02T00:00:00.000Z | demain à 00:00 |
+| 2000-01-01T00:00:00.000Z | aujourd’hui à 00:00 |
+| 1999-12-31T00:00:00.000Z | hier à 00:00 |
+| 1999-12-27T00:00:00.000Z | lundi la semaine dernière à 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/fr/_lib/formatDistance/index.js b/date-fns/src/locale/fr/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e5bbf4f
--- /dev/null
+++ b/date-fns/src/locale/fr/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'moins d’une seconde',
+ other: 'moins de {{count}} secondes'
+ },
+
+ xSeconds: {
+ one: '1 seconde',
+ other: '{{count}} secondes'
+ },
+
+ halfAMinute: '30 secondes',
+
+ lessThanXMinutes: {
+ one: 'moins d’une minute',
+ other: 'moins de {{count}} minutes'
+ },
+
+ xMinutes: {
+ one: '1 minute',
+ other: '{{count}} minutes'
+ },
+
+ aboutXHours: {
+ one: 'environ 1 heure',
+ other: 'environ {{count}} heures'
+ },
+
+ xHours: {
+ one: '1 heure',
+ other: '{{count}} heures'
+ },
+
+ xDays: {
+ one: '1 jour',
+ other: '{{count}} jours'
+ },
+
+ aboutXWeeks: {
+ one: 'environ 1 semaine',
+ other: 'environ {{count}} semaines'
+ },
+
+ xWeeks: {
+ one: '1 semaine',
+ other: '{{count}} semaines'
+ },
+
+ aboutXMonths: {
+ one: 'environ 1 mois',
+ other: 'environ {{count}} mois'
+ },
+
+ xMonths: {
+ one: '1 mois',
+ other: '{{count}} mois'
+ },
+
+ aboutXYears: {
+ one: 'environ 1 an',
+ other: 'environ {{count}} ans'
+ },
+
+ xYears: {
+ one: '1 an',
+ other: '{{count}} ans'
+ },
+
+ overXYears: {
+ one: 'plus d’un an',
+ other: 'plus de {{count}} ans'
+ },
+
+ almostXYears: {
+ one: 'presqu’un an',
+ other: 'presque {{count}} ans'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'dans ' + result
+ } else {
+ return 'il y a ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/fr/_lib/formatLong/index.js b/date-fns/src/locale/fr/_lib/formatLong/index.js
new file mode 100644
index 0000000..509d10a
--- /dev/null
+++ b/date-fns/src/locale/fr/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'à' {{time}}",
+ long: "{{date}} 'à' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/fr/_lib/formatRelative/index.js b/date-fns/src/locale/fr/_lib/formatRelative/index.js
new file mode 100644
index 0000000..c4905f3
--- /dev/null
+++ b/date-fns/src/locale/fr/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'dernier à' p",
+ yesterday: "'hier à' p",
+ today: "'aujourd’hui à' p",
+ tomorrow: "'demain à' p'",
+ nextWeek: "eeee 'prochain à' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/fr/_lib/formatters/index.js b/date-fns/src/locale/fr/_lib/formatters/index.js
new file mode 100644
index 0000000..b270774
--- /dev/null
+++ b/date-fns/src/locale/fr/_lib/formatters/index.js
@@ -0,0 +1,17 @@
+var formatters = {}
+
+// Special case for day of month ordinals in long date format context:
+// 1er mars, 2 mars, 3 mars, …
+// See https://github.com/date-fns/date-fns/issues/437
+var monthsTokens = ['MMM', 'MMMM']
+monthsTokens.forEach(function (monthToken) {
+ formatters['Do ' + monthToken] = function (date, options) {
+ var commonFormatters = options.formatters
+ var dayOfMonthToken = date.getUTCDate() === 1 ? 'Do' : 'D'
+ var dayOfMonthFormatter = commonFormatters[dayOfMonthToken]
+ var monthFormatter = commonFormatters[monthToken]
+ return dayOfMonthFormatter(date, options) + ' ' + monthFormatter(date, options)
+ }
+})
+
+export default formatters
diff --git a/date-fns/src/locale/fr/_lib/localize/index.js b/date-fns/src/locale/fr/_lib/localize/index.js
new file mode 100644
index 0000000..01d52b3
--- /dev/null
+++ b/date-fns/src/locale/fr/_lib/localize/index.js
@@ -0,0 +1,155 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['av. J.-C', 'ap. J.-C'],
+ abbreviated: ['av. J.-C', 'ap. J.-C'],
+ wide: ['avant Jésus-Christ', 'après Jésus-Christ']
+}
+
+var quarterValues = {
+ narrow: ['T1', 'T2', 'T3', 'T4'],
+ abbreviated: ['1er trim.', '2ème trim.', '3ème trim.', '4ème trim.'],
+ wide: ['1er trimestre', '2ème trimestre', '3ème trimestre', '4ème trimestre']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'janv.',
+ 'févr.',
+ 'mars',
+ 'avr.',
+ 'mai',
+ 'juin',
+ 'juil.',
+ 'août',
+ 'sept.',
+ 'oct.',
+ 'nov.',
+ 'déc.'
+ ],
+ wide: [
+ 'janvier',
+ 'février',
+ 'mars',
+ 'avril',
+ 'mai',
+ 'juin',
+ 'juillet',
+ 'août',
+ 'septembre',
+ 'octobre',
+ 'novembre',
+ 'décembre'
+ ]
+}
+
+var dayValues = {
+ narrow: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
+ short: ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'],
+ abbreviated: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
+ wide: [
+ 'dimanche',
+ 'lundi',
+ 'mardi',
+ 'mercredi',
+ 'jeudi',
+ 'vendredi',
+ 'samedi'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minuit',
+ noon: 'midi',
+ morning: 'mat.',
+ afternoon: 'ap.m.',
+ evening: 'soir',
+ night: 'mat.'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minuit',
+ noon: 'midi',
+ morning: 'matin',
+ afternoon: 'après-midi',
+ evening: 'soir',
+ night: 'matin'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minuit',
+ noon: 'midi',
+ morning: 'du matin',
+ afternoon: 'de l’après-midi',
+ evening: 'du soir',
+ night: 'du matin'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var suffix
+
+ if (number === 0) {
+ return number
+ }
+
+ if (unit === 'year' || unit === 'hour' || unit === 'week') {
+ if (number === 1) {
+ suffix = 'ère'
+ } else {
+ suffix = 'ème'
+ }
+ } else {
+ if (number === 1) {
+ suffix = 'er'
+ } else {
+ suffix = 'ème'
+ }
+ }
+
+ return number + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/fr/_lib/match/index.js b/date-fns/src/locale/fr/_lib/match/index.js
new file mode 100644
index 0000000..e5c36f8
--- /dev/null
+++ b/date-fns/src/locale/fr/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(ième|ère|ème|er|e)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
+ abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
+ wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
+}
+var parseEraPatterns = {
+ any: [/^av/i, /^ap/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^t[1234]/i,
+ wide: /^[1234](er|ème|e)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
+ wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^av/i,
+ /^ma/i,
+ /^juin/i,
+ /^juil/i,
+ /^ao/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[lmjvsd]/i,
+ short: /^(di|lu|ma|me|je|ve|sa)/i,
+ abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
+ wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
+ any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
+ any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^min/i,
+ noon: /^mid/i,
+ morning: /mat/i,
+ afternoon: /ap/i,
+ evening: /soir/i,
+ night: /nuit/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/fr/index.d.ts b/date-fns/src/locale/fr/index.d.ts
new file mode 100644
index 0000000..5dc7fe0
--- /dev/null
+++ b/date-fns/src/locale/fr/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { fr } from 'date-fns/locale'
+export default fr
diff --git a/date-fns/src/locale/fr/index.js b/date-fns/src/locale/fr/index.js
new file mode 100644
index 0000000..34f9438
--- /dev/null
+++ b/date-fns/src/locale/fr/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary French locale.
+ * @language French
+ * @iso-639-2 fra
+ * @author Jean Dupouy [@izeau]{@link https://github.com/izeau}
+ * @author François B [@fbonzon]{@link https://github.com/fbonzon}
+ */
+
+var locale = {
+ code: 'fr',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4,
+ },
+}
+
+export default locale
diff --git a/date-fns/src/locale/fr/index.js.flow b/date-fns/src/locale/fr/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/fr/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/fr/snapshot.md b/date-fns/src/locale/fr/snapshot.md
new file mode 100644
index 0000000..1edb19f
--- /dev/null
+++ b/date-fns/src/locale/fr/snapshot.md
@@ -0,0 +1,304 @@
+# French (fr) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987ème | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ème | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987ème | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4ème | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1er | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1er trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2ème trim. | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1er trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | T1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | T2 | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1er | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1er trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2ème trim. | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1er trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ème trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ème | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | févr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juil. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | février | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juillet | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2ème | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ème | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | févr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juil. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | février | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juillet | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1ère | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ème | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1ère | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ème | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28ème | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42ème | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365ème | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1er | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ème | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1er | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ème | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1er | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ème | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | lundi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vendredi | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | matin | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | matin | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | du matin | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | de l’après-midi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | du soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | du matin | 2019-02-11T04:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ap.m. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | soir | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ème | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ème | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ème | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11ème | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ème | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1er | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55ème | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1er | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55ème | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 févr. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 février 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | mercredi 11 février 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | dimanche 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 févr. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 février 1987 à 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 à 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | mercredi 11 février 1987 à 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | dimanche 29 mai 1453 à 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | environ 6 ans | environ 6 ans | dans environ 6 ans |
+| 2005-01-01T00:00:00.000Z | environ 5 ans | environ 5 ans | dans environ 5 ans |
+| 2004-01-01T00:00:00.000Z | environ 4 ans | environ 4 ans | dans environ 4 ans |
+| 2003-01-01T00:00:00.000Z | environ 3 ans | environ 3 ans | dans environ 3 ans |
+| 2002-01-01T00:00:00.000Z | environ 2 ans | environ 2 ans | dans environ 2 ans |
+| 2001-06-01T00:00:00.000Z | plus d’un an | plus d’un an | dans plus d’un an |
+| 2001-02-01T00:00:00.000Z | environ 1 an | environ 1 an | dans environ 1 an |
+| 2001-01-01T00:00:00.000Z | environ 1 an | environ 1 an | dans environ 1 an |
+| 2000-06-01T00:00:00.000Z | 5 mois | 5 mois | dans 5 mois |
+| 2000-03-01T00:00:00.000Z | 2 mois | 2 mois | dans 2 mois |
+| 2000-02-01T00:00:00.000Z | environ 1 mois | environ 1 mois | dans environ 1 mois |
+| 2000-01-15T00:00:00.000Z | 14 jours | 14 jours | dans 14 jours |
+| 2000-01-02T00:00:00.000Z | 1 jour | 1 jour | dans 1 jour |
+| 2000-01-01T06:00:00.000Z | environ 6 heures | environ 6 heures | dans environ 6 heures |
+| 2000-01-01T01:00:00.000Z | environ 1 heure | environ 1 heure | dans environ 1 heure |
+| 2000-01-01T00:45:00.000Z | environ 1 heure | environ 1 heure | dans environ 1 heure |
+| 2000-01-01T00:30:00.000Z | 30 minutes | 30 minutes | dans 30 minutes |
+| 2000-01-01T00:15:00.000Z | 15 minutes | 15 minutes | dans 15 minutes |
+| 2000-01-01T00:01:00.000Z | 1 minute | 1 minute | dans 1 minute |
+| 2000-01-01T00:00:25.000Z | moins d’une minute | 30 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:15.000Z | moins d’une minute | moins de 20 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:05.000Z | moins d’une minute | moins de 10 secondes | dans moins d’une minute |
+| 2000-01-01T00:00:00.000Z | moins d’une minute | moins de 5 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:55.000Z | moins d’une minute | moins de 10 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:45.000Z | moins d’une minute | moins de 20 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:35.000Z | moins d’une minute | 30 secondes | il y a moins d’une minute |
+| 1999-12-31T23:59:00.000Z | 1 minute | 1 minute | il y a 1 minute |
+| 1999-12-31T23:45:00.000Z | 15 minutes | 15 minutes | il y a 15 minutes |
+| 1999-12-31T23:30:00.000Z | 30 minutes | 30 minutes | il y a 30 minutes |
+| 1999-12-31T23:15:00.000Z | environ 1 heure | environ 1 heure | il y a environ 1 heure |
+| 1999-12-31T23:00:00.000Z | environ 1 heure | environ 1 heure | il y a environ 1 heure |
+| 1999-12-31T18:00:00.000Z | environ 6 heures | environ 6 heures | il y a environ 6 heures |
+| 1999-12-30T00:00:00.000Z | 2 jours | 2 jours | il y a 2 jours |
+| 1999-12-15T00:00:00.000Z | 17 jours | 17 jours | il y a 17 jours |
+| 1999-12-01T00:00:00.000Z | environ 1 mois | environ 1 mois | il y a environ 1 mois |
+| 1999-11-01T00:00:00.000Z | 2 mois | 2 mois | il y a 2 mois |
+| 1999-06-01T00:00:00.000Z | 7 mois | 7 mois | il y a 7 mois |
+| 1999-01-01T00:00:00.000Z | environ 1 an | environ 1 an | il y a environ 1 an |
+| 1998-12-01T00:00:00.000Z | environ 1 an | environ 1 an | il y a environ 1 an |
+| 1998-06-01T00:00:00.000Z | plus d’un an | plus d’un an | il y a plus d’un an |
+| 1998-01-01T00:00:00.000Z | environ 2 ans | environ 2 ans | il y a environ 2 ans |
+| 1997-01-01T00:00:00.000Z | environ 3 ans | environ 3 ans | il y a environ 3 ans |
+| 1996-01-01T00:00:00.000Z | environ 4 ans | environ 4 ans | il y a environ 4 ans |
+| 1995-01-01T00:00:00.000Z | environ 5 ans | environ 5 ans | il y a environ 5 ans |
+| 1994-01-01T00:00:00.000Z | environ 6 ans | environ 6 ans | il y a environ 6 ans |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ans | dans 6 ans | 52608 heures |
+| 2005-01-01T00:00:00.000Z | 5 ans | dans 5 ans | 43848 heures |
+| 2004-01-01T00:00:00.000Z | 4 ans | dans 4 ans | 35064 heures |
+| 2003-01-01T00:00:00.000Z | 3 ans | dans 3 ans | 26304 heures |
+| 2002-01-01T00:00:00.000Z | 2 ans | dans 2 ans | 17544 heures |
+| 2001-06-01T00:00:00.000Z | 1 an | dans 1 an | 12408 heures |
+| 2001-02-01T00:00:00.000Z | 1 an | dans 1 an | 9528 heures |
+| 2001-01-01T00:00:00.000Z | 1 an | dans 1 an | 8784 heures |
+| 2000-06-01T00:00:00.000Z | 5 mois | dans 5 mois | 3648 heures |
+| 2000-03-01T00:00:00.000Z | 2 mois | dans 2 mois | 1440 heures |
+| 2000-02-01T00:00:00.000Z | 1 mois | dans 1 mois | 744 heures |
+| 2000-01-15T00:00:00.000Z | 14 jours | dans 14 jours | 336 heures |
+| 2000-01-02T00:00:00.000Z | 1 jour | dans 1 jour | 24 heures |
+| 2000-01-01T06:00:00.000Z | 6 heures | dans 6 heures | 6 heures |
+| 2000-01-01T01:00:00.000Z | 1 heure | dans 1 heure | 1 heure |
+| 2000-01-01T00:45:00.000Z | 45 minutes | dans 45 minutes | 1 heure |
+| 2000-01-01T00:30:00.000Z | 30 minutes | dans 30 minutes | 1 heure |
+| 2000-01-01T00:15:00.000Z | 15 minutes | dans 15 minutes | 0 heures |
+| 2000-01-01T00:01:00.000Z | 1 minute | dans 1 minute | 0 heures |
+| 2000-01-01T00:00:25.000Z | 25 secondes | dans 25 secondes | 0 heures |
+| 2000-01-01T00:00:15.000Z | 15 secondes | dans 15 secondes | 0 heures |
+| 2000-01-01T00:00:05.000Z | 5 secondes | dans 5 secondes | 0 heures |
+| 2000-01-01T00:00:00.000Z | 0 secondes | il y a 0 secondes | 0 heures |
+| 1999-12-31T23:59:55.000Z | 5 secondes | il y a 5 secondes | 0 heures |
+| 1999-12-31T23:59:45.000Z | 15 secondes | il y a 15 secondes | 0 heures |
+| 1999-12-31T23:59:35.000Z | 25 secondes | il y a 25 secondes | 0 heures |
+| 1999-12-31T23:59:00.000Z | 1 minute | il y a 1 minute | 0 heures |
+| 1999-12-31T23:45:00.000Z | 15 minutes | il y a 15 minutes | 0 heures |
+| 1999-12-31T23:30:00.000Z | 30 minutes | il y a 30 minutes | 1 heure |
+| 1999-12-31T23:15:00.000Z | 45 minutes | il y a 45 minutes | 1 heure |
+| 1999-12-31T23:00:00.000Z | 1 heure | il y a 1 heure | 1 heure |
+| 1999-12-31T18:00:00.000Z | 6 heures | il y a 6 heures | 6 heures |
+| 1999-12-30T00:00:00.000Z | 2 jours | il y a 2 jours | 48 heures |
+| 1999-12-15T00:00:00.000Z | 17 jours | il y a 17 jours | 408 heures |
+| 1999-12-01T00:00:00.000Z | 1 mois | il y a 1 mois | 744 heures |
+| 1999-11-01T00:00:00.000Z | 2 mois | il y a 2 mois | 1464 heures |
+| 1999-06-01T00:00:00.000Z | 7 mois | il y a 7 mois | 5136 heures |
+| 1999-01-01T00:00:00.000Z | 1 an | il y a 1 an | 8760 heures |
+| 1998-12-01T00:00:00.000Z | 1 an | il y a 1 an | 9504 heures |
+| 1998-06-01T00:00:00.000Z | 2 ans | il y a 2 ans | 13896 heures |
+| 1998-01-01T00:00:00.000Z | 2 ans | il y a 2 ans | 17520 heures |
+| 1997-01-01T00:00:00.000Z | 3 ans | il y a 3 ans | 26280 heures |
+| 1996-01-01T00:00:00.000Z | 4 ans | il y a 4 ans | 35064 heures |
+| 1995-01-01T00:00:00.000Z | 5 ans | il y a 5 ans | 43824 heures |
+| 1994-01-01T00:00:00.000Z | 6 ans | il y a 6 ans | 52584 heures |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | mercredi prochain à 00:00 |
+| 2000-01-02T00:00:00.000Z | demain à 00:00 |
+| 2000-01-01T00:00:00.000Z | aujourd’hui à 00:00 |
+| 1999-12-31T00:00:00.000Z | hier à 00:00 |
+| 1999-12-27T00:00:00.000Z | lundi dernier à 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/gd/_lib/formatDistance/index.js b/date-fns/src/locale/gd/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e24c2be
--- /dev/null
+++ b/date-fns/src/locale/gd/_lib/formatDistance/index.js
@@ -0,0 +1,115 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'nas lugha na diog',
+ other: 'nas lugha na {{count}} diogan'
+ },
+
+ xSeconds: {
+ one: '1 diog',
+ two: '2 dhiog',
+ twenty: '20 diog',
+ other: '{{count}} diogan'
+ },
+
+ halfAMinute: 'leth mhionaid',
+
+ lessThanXMinutes: {
+ one: 'nas lugha na mionaid',
+ other: 'nas lugha na {{count}} mionaidean'
+ },
+
+ xMinutes: {
+ one: '1 mionaid',
+ two: '2 mhionaid',
+ twenty: '20 mionaid',
+ other: '{{count}} mionaidean'
+ },
+
+ aboutXHours: {
+ one: 'mu uair de thìde',
+ other: 'mu {{count}} uairean de thìde'
+ },
+
+ xHours: {
+ one: '1 uair de thìde',
+ two: '2 uair de thìde',
+ twenty: '20 uair de thìde',
+ other: '{{count}} uairean de thìde'
+ },
+
+ xDays: {
+ one: '1 là',
+ other: '{{count}} là'
+ },
+
+ aboutXWeeks: {
+ one: 'mu 1 seachdain',
+ other: 'mu {{count}} seachdainean'
+ },
+
+ xWeeks: {
+ one: '1 seachdain',
+ other: '{{count}} seachdainean'
+ },
+
+ aboutXMonths: {
+ one: 'mu mhìos',
+ other: 'mu {{count}} mìosan'
+ },
+
+ xMonths: {
+ one: '1 mìos',
+ other: '{{count}} mìosan'
+ },
+
+ aboutXYears: {
+ one: 'mu bhliadhna',
+ other: 'mu {{count}} bliadhnaichean'
+ },
+
+ xYears: {
+ one: '1 bhliadhna',
+ other: '{{count}} bliadhna'
+ },
+
+ overXYears: {
+ one: 'còrr is bliadhna',
+ other: 'còrr is {{count}} bliadhnaichean'
+ },
+
+ almostXYears: {
+ one: 'cha mhòr bliadhna',
+ other: 'cha mhòr {{count}} bliadhnaichean'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 2 && !!formatDistanceLocale[token].two) {
+ result = formatDistanceLocale[token].two
+ } else if (count === 9 && !!formatDistanceLocale[token].nine) {
+ result = formatDistanceLocale[token].nine
+ } else if (count === 20 && !!formatDistanceLocale[token].twenty) {
+ result = formatDistanceLocale[token].twenty
+ } else if (count === 30 && !!formatDistanceLocale[token].thirty) {
+ result = formatDistanceLocale[token].thirty
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'ann an ' + result
+ } else {
+ return 'o chionn ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/gd/_lib/formatLong/index.js b/date-fns/src/locale/gd/_lib/formatLong/index.js
new file mode 100644
index 0000000..24513da
--- /dev/null
+++ b/date-fns/src/locale/gd/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'aig' {{time}}",
+ long: "{{date}} 'aig' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/gd/_lib/formatRelative/index.js b/date-fns/src/locale/gd/_lib/formatRelative/index.js
new file mode 100644
index 0000000..ea9d357
--- /dev/null
+++ b/date-fns/src/locale/gd/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'mu dheireadh' eeee 'aig' p", //FIX
+ yesterday: "'an-dè aig' p",
+ today: "'an-diugh aig' p",
+ tomorrow: "'a-màireach aig' p",
+ nextWeek: "eeee 'aig' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/gd/_lib/localize/index.js b/date-fns/src/locale/gd/_lib/localize/index.js
new file mode 100644
index 0000000..6c29358
--- /dev/null
+++ b/date-fns/src/locale/gd/_lib/localize/index.js
@@ -0,0 +1,200 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['R', 'A'],
+ abbreviated: ['RC', 'AD'],
+ wide: ['ro Chrìosta', 'anno domini']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['C1', 'C2', 'C3', 'C4'],
+ wide: [
+ "a' chiad chairteal",
+ 'an dàrna cairteal',
+ 'an treas cairteal',
+ 'an ceathramh cairteal'
+ ]
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['F', 'G', 'M', 'G', 'C', 'Ò', 'I', 'L', 'S', 'D', 'S', 'D'],
+ abbreviated: [
+ 'Faoi',
+ 'Gear',
+ 'Màrt',
+ 'Gibl',
+ 'Cèit',
+ 'Ògmh',
+ 'Iuch',
+ 'Lùn',
+ 'Sult',
+ 'Dàmh',
+ 'Samh',
+ 'Dùbh'
+ ],
+ wide: [
+ 'Am Faoilleach',
+ 'An Gearran',
+ 'Am Màrt',
+ 'An Giblean',
+ 'An Cèitean',
+ 'An t-Ògmhios',
+ 'An t-Iuchar',
+ 'An Lùnastal',
+ 'An t-Sultain',
+ 'An Dàmhair',
+ 'An t-Samhain',
+ 'An Dùbhlachd'
+ ]
+}
+
+var dayValues = {
+ narrow: ['D', 'L', 'M', 'C', 'A', 'H', 'S'],
+ short: ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'],
+ abbreviated: ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],
+ wide: [
+ 'Didòmhnaich',
+ 'Diluain',
+ 'Dimàirt',
+ 'Diciadain',
+ 'Diardaoin',
+ 'Dihaoine',
+ 'Disathairne'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'm',
+ pm: 'f',
+ midnight: 'm.o.',
+ noon: 'm.l.',
+ morning: 'madainn',
+ afternoon: 'feasgar',
+ evening: 'feasgar',
+ night: 'oidhche'
+ },
+ abbreviated: {
+ am: 'M.',
+ pm: 'F.',
+ midnight: 'meadhan oidhche',
+ noon: 'meadhan là',
+ morning: 'madainn',
+ afternoon: 'feasgar',
+ evening: 'feasgar',
+ night: 'oidhche'
+ },
+ wide: {
+ am: 'm.',
+ pm: 'f.',
+ midnight: 'meadhan oidhche',
+ noon: 'meadhan là',
+ morning: 'madainn',
+ afternoon: 'feasgar',
+ evening: 'feasgar',
+ night: 'oidhche'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'm',
+ pm: 'f',
+ midnight: 'm.o.',
+ noon: 'm.l.',
+ morning: 'sa mhadainn',
+ afternoon: 'feasgar',
+ evening: 'feasgar',
+ night: 'air an oidhche'
+ },
+ abbreviated: {
+ am: 'M.',
+ pm: 'F.',
+ midnight: 'meadhan oidhche',
+ noon: 'meadhan là',
+ morning: 'sa mhadainn',
+ afternoon: 'feasgar',
+ evening: 'feasgar',
+ night: 'air an oidhche'
+ },
+ wide: {
+ am: 'm.',
+ pm: 'f.',
+ midnight: 'meadhan oidhche',
+ noon: 'meadhan là',
+ morning: 'sa mhadainn',
+ afternoon: 'feasgar',
+ evening: 'feasgar',
+ night: 'air an oidhche'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ var rem100 = number % 100
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ return number + 'd'
+ case 2:
+ return number + 'na'
+ }
+ }
+
+ if (rem100 === 12) {
+ return number + 'na'
+ }
+
+ return number + 'mh'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/gd/_lib/match/index.js b/date-fns/src/locale/gd/_lib/match/index.js
new file mode 100644
index 0000000..bb23794
--- /dev/null
+++ b/date-fns/src/locale/gd/_lib/match/index.js
@@ -0,0 +1,138 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(d|na|tr|mh)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(r|a)/i,
+ abbreviated: /^(r\.?\s?c\.?|r\.?\s?a\.?\s?c\.?|a\.?\s?d\.?|a\.?\s?c\.?)/i,
+ wide: /^(ro Chrìosta|ron aois choitchinn|anno domini|aois choitcheann)/i
+}
+var parseEraPatterns = {
+ any: [/^b/i, /^(a|c)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^c[1234]/i,
+ wide: /^[1234](cd|na|tr|mh)? cairteal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[fgmcòilsd]/i,
+ abbreviated: /^(faoi|gear|màrt|gibl|cèit|ògmh|iuch|lùn|sult|dàmh|samh|dùbh)/i,
+ wide: /^(am faoilleach|an gearran|am màrt|an giblean|an cèitean|an t-Ògmhios|an t-Iuchar|an lùnastal|an t-Sultain|an dàmhair|an t-Samhain|an dùbhlachd)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^f/i,
+ /^g/i,
+ /^m/i,
+ /^g/i,
+ /^c/i,
+ /^ò/i,
+ /^i/i,
+ /^l/i,
+ /^s/i,
+ /^d/i,
+ /^s/i,
+ /^d/i
+ ],
+ any: [
+ /^fa/i,
+ /^ge/i,
+ /^mà/i,
+ /^gi/i,
+ /^c/i,
+ /^ò/i,
+ /^i/i,
+ /^l/i,
+ /^su/i,
+ /^d/i,
+ /^sa/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dlmcahs]/i,
+ short: /^(dò|lu|mà|ci|ar|ha|sa)/i,
+ abbreviated: /^(did|dil|dim|dic|dia|dih|dis)/i,
+ wide: /^(didòmhnaich|diluain|dimàirt|diciadain|diardaoin|dihaoine|disathairne)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^c/i, /^a/i, /^h/i, /^s/i],
+ any: [/^d/i, /^l/i, /^m/i, /^c/i, /^a/i, /^h/i, /^s/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mi|n|(san|aig) (madainn|feasgar|feasgar|oidhche))/i,
+ any: /^([ap]\.?\s?m\.?|meadhan oidhche|meadhan là|(san|aig) (madainn|feasgar|feasgar|oidhche))/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^m/i,
+ pm: /^f/i,
+ midnight: /^meadhan oidhche/i,
+ noon: /^meadhan là/i,
+ morning: /sa mhadainn/i,
+ afternoon: /feasgar/i,
+ evening: /feasgar/i,
+ night: /air an oidhche/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/gd/index.d.ts b/date-fns/src/locale/gd/index.d.ts
new file mode 100644
index 0000000..2b24744
--- /dev/null
+++ b/date-fns/src/locale/gd/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { gd } from 'date-fns/locale'
+export default gd
diff --git a/date-fns/src/locale/gd/index.js b/date-fns/src/locale/gd/index.js
new file mode 100644
index 0000000..05e8cd4
--- /dev/null
+++ b/date-fns/src/locale/gd/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Scottish Gaelic.
+ * @language Scottish Gaelic
+ * @iso-639-2 gla
+ * @author Lee Driscoll [@leedriscoll]{@link https://github.com/leedriscoll}
+ */
+var locale = {
+ code: 'gd',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/gd/index.js.flow b/date-fns/src/locale/gd/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/gd/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/gd/snapshot.md b/date-fns/src/locale/gd/snapshot.md
new file mode 100644
index 0000000..0378d1b
--- /dev/null
+++ b/date-fns/src/locale/gd/snapshot.md
@@ -0,0 +1,304 @@
+# Scottish Gaelic (gd) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987mh | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5mh | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987mh | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5mh | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1d | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2na | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | C1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | C2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | a' chiad chairteal | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | an dàrna cairteal | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1d | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2na | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | C1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | C2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | a' chiad chairteal | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | an dàrna cairteal | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2na | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7mh | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Gear | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Iuch | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | An Gearran | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | An t-Iuchar | Invalid Date |
+| | MMMMM | 2019-02-11T12:13:14.015Z | G | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2na | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7mh | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Gear | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Iuch | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | An Gearran | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | An t-Iuchar | Invalid Date |
+| | LLLLL | 2019-02-11T12:13:14.015Z | G | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1d | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49mh | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1d | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48mh | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11mh | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28mh | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42na | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365mh | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Dil | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dih | 2019-02-10T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Dil | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dih | 2019-02-10T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Dil | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dih | 2019-02-10T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Diluain | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dihaoine | 2019-02-10T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | H | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ha | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1d | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5mh | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Dil | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dih | 2019-02-17T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Diluain | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dihaoine | 2019-02-17T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | H | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ha | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2na | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6mh | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Dil | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dih | 2019-02-10T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Diluain | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dihaoine | 2019-02-10T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | H | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ha | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2na | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6mh | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Dil | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dih | 2019-02-10T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Diluain | 2019-02-10T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Dihaoine | 2019-02-10T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | H | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ha | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | M. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | M. | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | M. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | M. | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | m. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m. | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | m. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m. | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | m | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | f | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | f | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | M. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | M. | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | M. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | F. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | M. | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | m. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m. | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | m. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | f. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m. | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | m | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | f | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | f | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | sa mhadainn | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | air an oidhche | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | sa mhadainn | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | air an oidhche | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | sa mhadainn | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | air an oidhche | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | sa mhadainn | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | air an oidhche | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | sa mhadainn | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | feasgar | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | air an oidhche | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11mh | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11mh | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11mh | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23mh | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11mh | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11mh | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11mh | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23mh | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1d | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55mh | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1d | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55mh | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | Gear 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Cèit 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | An Gearran 11mh, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | An Cèitean 29mh, 1453 | Invalid Date |
+| | PPPP | 1987-02-11T12:13:14.015Z | Diciadain, An Gearran 11mh, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | Didòmhnaich, An Cèitean 29mh, 1453 | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 F. | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59 F. | Invalid Date |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 F. | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 F. | Invalid Date |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 F. GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 F. GMT+0 | Invalid Date |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 F. GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 F. GMT+00:00 | Invalid Date |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 F. | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 F. | Invalid Date |
+| | PPpp | 1987-02-11T12:13:14.015Z | Gear 11, 1987, 12:13:14 F. | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | Cèit 29, 1453, 11:59:59 F. | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | An Gearran 11mh, 1987 aig 12:13:14 F. GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | An Cèitean 29mh, 1453 aig 11:59:59 F. GMT+0 | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Diciadain, An Gearran 11mh, 1987 aig 12:13:14 F. GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | Didòmhnaich, An Cèitean 29mh, 1453 aig 11:59:59 F. GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------- | ---------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | mu 6 bliadhnaichean | mu 6 bliadhnaichean | ann an mu 6 bliadhnaichean |
+| 2005-01-01T00:00:00.000Z | mu 5 bliadhnaichean | mu 5 bliadhnaichean | ann an mu 5 bliadhnaichean |
+| 2004-01-01T00:00:00.000Z | mu 4 bliadhnaichean | mu 4 bliadhnaichean | ann an mu 4 bliadhnaichean |
+| 2003-01-01T00:00:00.000Z | mu 3 bliadhnaichean | mu 3 bliadhnaichean | ann an mu 3 bliadhnaichean |
+| 2002-01-01T00:00:00.000Z | mu 2 bliadhnaichean | mu 2 bliadhnaichean | ann an mu 2 bliadhnaichean |
+| 2001-06-01T00:00:00.000Z | còrr is bliadhna | còrr is bliadhna | ann an còrr is bliadhna |
+| 2001-02-01T00:00:00.000Z | mu bhliadhna | mu bhliadhna | ann an mu bhliadhna |
+| 2001-01-01T00:00:00.000Z | mu bhliadhna | mu bhliadhna | ann an mu bhliadhna |
+| 2000-06-01T00:00:00.000Z | 5 mìosan | 5 mìosan | ann an 5 mìosan |
+| 2000-03-01T00:00:00.000Z | 2 mìosan | 2 mìosan | ann an 2 mìosan |
+| 2000-02-01T00:00:00.000Z | mu mhìos | mu mhìos | ann an mu mhìos |
+| 2000-01-15T00:00:00.000Z | 14 là | 14 là | ann an 14 là |
+| 2000-01-02T00:00:00.000Z | 1 là | 1 là | ann an 1 là |
+| 2000-01-01T06:00:00.000Z | mu 6 uairean de thìde | mu 6 uairean de thìde | ann an mu 6 uairean de thìde |
+| 2000-01-01T01:00:00.000Z | mu uair de thìde | mu uair de thìde | ann an mu uair de thìde |
+| 2000-01-01T00:45:00.000Z | mu uair de thìde | mu uair de thìde | ann an mu uair de thìde |
+| 2000-01-01T00:30:00.000Z | 30 mionaidean | 30 mionaidean | ann an 30 mionaidean |
+| 2000-01-01T00:15:00.000Z | 15 mionaidean | 15 mionaidean | ann an 15 mionaidean |
+| 2000-01-01T00:01:00.000Z | 1 mionaid | 1 mionaid | ann an 1 mionaid |
+| 2000-01-01T00:00:25.000Z | nas lugha na mionaid | leth mhionaid | ann an nas lugha na mionaid |
+| 2000-01-01T00:00:15.000Z | nas lugha na mionaid | nas lugha na 20 diogan | ann an nas lugha na mionaid |
+| 2000-01-01T00:00:05.000Z | nas lugha na mionaid | nas lugha na 10 diogan | ann an nas lugha na mionaid |
+| 2000-01-01T00:00:00.000Z | nas lugha na mionaid | nas lugha na 5 diogan | o chionn nas lugha na mionaid |
+| 1999-12-31T23:59:55.000Z | nas lugha na mionaid | nas lugha na 10 diogan | o chionn nas lugha na mionaid |
+| 1999-12-31T23:59:45.000Z | nas lugha na mionaid | nas lugha na 20 diogan | o chionn nas lugha na mionaid |
+| 1999-12-31T23:59:35.000Z | nas lugha na mionaid | leth mhionaid | o chionn nas lugha na mionaid |
+| 1999-12-31T23:59:00.000Z | 1 mionaid | 1 mionaid | o chionn 1 mionaid |
+| 1999-12-31T23:45:00.000Z | 15 mionaidean | 15 mionaidean | o chionn 15 mionaidean |
+| 1999-12-31T23:30:00.000Z | 30 mionaidean | 30 mionaidean | o chionn 30 mionaidean |
+| 1999-12-31T23:15:00.000Z | mu uair de thìde | mu uair de thìde | o chionn mu uair de thìde |
+| 1999-12-31T23:00:00.000Z | mu uair de thìde | mu uair de thìde | o chionn mu uair de thìde |
+| 1999-12-31T18:00:00.000Z | mu 6 uairean de thìde | mu 6 uairean de thìde | o chionn mu 6 uairean de thìde |
+| 1999-12-30T00:00:00.000Z | 2 là | 2 là | o chionn 2 là |
+| 1999-12-15T00:00:00.000Z | 17 là | 17 là | o chionn 17 là |
+| 1999-12-01T00:00:00.000Z | mu mhìos | mu mhìos | o chionn mu mhìos |
+| 1999-11-01T00:00:00.000Z | 2 mìosan | 2 mìosan | o chionn 2 mìosan |
+| 1999-06-01T00:00:00.000Z | 7 mìosan | 7 mìosan | o chionn 7 mìosan |
+| 1999-01-01T00:00:00.000Z | mu bhliadhna | mu bhliadhna | o chionn mu bhliadhna |
+| 1998-12-01T00:00:00.000Z | mu bhliadhna | mu bhliadhna | o chionn mu bhliadhna |
+| 1998-06-01T00:00:00.000Z | còrr is bliadhna | còrr is bliadhna | o chionn còrr is bliadhna |
+| 1998-01-01T00:00:00.000Z | mu 2 bliadhnaichean | mu 2 bliadhnaichean | o chionn mu 2 bliadhnaichean |
+| 1997-01-01T00:00:00.000Z | mu 3 bliadhnaichean | mu 3 bliadhnaichean | o chionn mu 3 bliadhnaichean |
+| 1996-01-01T00:00:00.000Z | mu 4 bliadhnaichean | mu 4 bliadhnaichean | o chionn mu 4 bliadhnaichean |
+| 1995-01-01T00:00:00.000Z | mu 5 bliadhnaichean | mu 5 bliadhnaichean | o chionn mu 5 bliadhnaichean |
+| 1994-01-01T00:00:00.000Z | mu 6 bliadhnaichean | mu 6 bliadhnaichean | o chionn mu 6 bliadhnaichean |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------------ | --------------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 bliadhna | ann an 6 bliadhna | 52608 uairean de thìde |
+| 2005-01-01T00:00:00.000Z | 5 bliadhna | ann an 5 bliadhna | 43848 uairean de thìde |
+| 2004-01-01T00:00:00.000Z | 4 bliadhna | ann an 4 bliadhna | 35064 uairean de thìde |
+| 2003-01-01T00:00:00.000Z | 3 bliadhna | ann an 3 bliadhna | 26304 uairean de thìde |
+| 2002-01-01T00:00:00.000Z | 2 bliadhna | ann an 2 bliadhna | 17544 uairean de thìde |
+| 2001-06-01T00:00:00.000Z | 1 bhliadhna | ann an 1 bhliadhna | 12408 uairean de thìde |
+| 2001-02-01T00:00:00.000Z | 1 bhliadhna | ann an 1 bhliadhna | 9528 uairean de thìde |
+| 2001-01-01T00:00:00.000Z | 1 bhliadhna | ann an 1 bhliadhna | 8784 uairean de thìde |
+| 2000-06-01T00:00:00.000Z | 5 mìosan | ann an 5 mìosan | 3648 uairean de thìde |
+| 2000-03-01T00:00:00.000Z | 2 mìosan | ann an 2 mìosan | 1440 uairean de thìde |
+| 2000-02-01T00:00:00.000Z | 1 mìos | ann an 1 mìos | 744 uairean de thìde |
+| 2000-01-15T00:00:00.000Z | 14 là | ann an 14 là | 336 uairean de thìde |
+| 2000-01-02T00:00:00.000Z | 1 là | ann an 1 là | 24 uairean de thìde |
+| 2000-01-01T06:00:00.000Z | 6 uairean de thìde | ann an 6 uairean de thìde | 6 uairean de thìde |
+| 2000-01-01T01:00:00.000Z | 1 uair de thìde | ann an 1 uair de thìde | 1 uair de thìde |
+| 2000-01-01T00:45:00.000Z | 45 mionaidean | ann an 45 mionaidean | 1 uair de thìde |
+| 2000-01-01T00:30:00.000Z | 30 mionaidean | ann an 30 mionaidean | 1 uair de thìde |
+| 2000-01-01T00:15:00.000Z | 15 mionaidean | ann an 15 mionaidean | 0 uairean de thìde |
+| 2000-01-01T00:01:00.000Z | 1 mionaid | ann an 1 mionaid | 0 uairean de thìde |
+| 2000-01-01T00:00:25.000Z | 25 diogan | ann an 25 diogan | 0 uairean de thìde |
+| 2000-01-01T00:00:15.000Z | 15 diogan | ann an 15 diogan | 0 uairean de thìde |
+| 2000-01-01T00:00:05.000Z | 5 diogan | ann an 5 diogan | 0 uairean de thìde |
+| 2000-01-01T00:00:00.000Z | 0 diogan | o chionn 0 diogan | 0 uairean de thìde |
+| 1999-12-31T23:59:55.000Z | 5 diogan | o chionn 5 diogan | 0 uairean de thìde |
+| 1999-12-31T23:59:45.000Z | 15 diogan | o chionn 15 diogan | 0 uairean de thìde |
+| 1999-12-31T23:59:35.000Z | 25 diogan | o chionn 25 diogan | 0 uairean de thìde |
+| 1999-12-31T23:59:00.000Z | 1 mionaid | o chionn 1 mionaid | 0 uairean de thìde |
+| 1999-12-31T23:45:00.000Z | 15 mionaidean | o chionn 15 mionaidean | 0 uairean de thìde |
+| 1999-12-31T23:30:00.000Z | 30 mionaidean | o chionn 30 mionaidean | 1 uair de thìde |
+| 1999-12-31T23:15:00.000Z | 45 mionaidean | o chionn 45 mionaidean | 1 uair de thìde |
+| 1999-12-31T23:00:00.000Z | 1 uair de thìde | o chionn 1 uair de thìde | 1 uair de thìde |
+| 1999-12-31T18:00:00.000Z | 6 uairean de thìde | o chionn 6 uairean de thìde | 6 uairean de thìde |
+| 1999-12-30T00:00:00.000Z | 2 là | o chionn 2 là | 48 uairean de thìde |
+| 1999-12-15T00:00:00.000Z | 17 là | o chionn 17 là | 408 uairean de thìde |
+| 1999-12-01T00:00:00.000Z | 1 mìos | o chionn 1 mìos | 744 uairean de thìde |
+| 1999-11-01T00:00:00.000Z | 2 mìosan | o chionn 2 mìosan | 1464 uairean de thìde |
+| 1999-06-01T00:00:00.000Z | 7 mìosan | o chionn 7 mìosan | 5136 uairean de thìde |
+| 1999-01-01T00:00:00.000Z | 1 bhliadhna | o chionn 1 bhliadhna | 8760 uairean de thìde |
+| 1998-12-01T00:00:00.000Z | 1 bhliadhna | o chionn 1 bhliadhna | 9504 uairean de thìde |
+| 1998-06-01T00:00:00.000Z | 2 bliadhna | o chionn 2 bliadhna | 13896 uairean de thìde |
+| 1998-01-01T00:00:00.000Z | 2 bliadhna | o chionn 2 bliadhna | 17520 uairean de thìde |
+| 1997-01-01T00:00:00.000Z | 3 bliadhna | o chionn 3 bliadhna | 26280 uairean de thìde |
+| 1996-01-01T00:00:00.000Z | 4 bliadhna | o chionn 4 bliadhna | 35064 uairean de thìde |
+| 1995-01-01T00:00:00.000Z | 5 bliadhna | o chionn 5 bliadhna | 43824 uairean de thìde |
+| 1994-01-01T00:00:00.000Z | 6 bliadhna | o chionn 6 bliadhna | 52584 uairean de thìde |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | Diciadain aig 12:00 M. |
+| 2000-01-02T00:00:00.000Z | a-màireach aig 12:00 M. |
+| 2000-01-01T00:00:00.000Z | an-diugh aig 12:00 M. |
+| 1999-12-31T00:00:00.000Z | an-dè aig 12:00 M. |
+| 1999-12-27T00:00:00.000Z | mu dheireadh Diluain aig 12:00 M. |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/gl/_lib/formatDistance/index.js b/date-fns/src/locale/gl/_lib/formatDistance/index.js
new file mode 100644
index 0000000..dbb841f
--- /dev/null
+++ b/date-fns/src/locale/gl/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'menos dun segundo',
+ other: 'menos de {{count}} segundos'
+ },
+
+ xSeconds: {
+ one: '1 segundo',
+ other: '{{count}} segundos'
+ },
+
+ halfAMinute: 'medio minuto',
+
+ lessThanXMinutes: {
+ one: 'menos dun minuto',
+ other: 'menos de {{count}} minutos'
+ },
+
+ xMinutes: {
+ one: '1 minuto',
+ other: '{{count}} minutos'
+ },
+
+ aboutXHours: {
+ one: 'arredor dunha hora',
+ other: 'arredor de {{count}} horas'
+ },
+
+ xHours: {
+ one: '1 hora',
+ other: '{{count}} horas'
+ },
+
+ xDays: {
+ one: '1 día',
+ other: '{{count}} días'
+ },
+
+ aboutXWeeks: {
+ one: 'arredor dunha semana',
+ other: 'arredor de {{count}} semanas'
+ },
+
+ xWeeks: {
+ one: '1 semana',
+ other: '{{count}} semanas'
+ },
+
+ aboutXMonths: {
+ one: 'arredor de 1 mes',
+ other: 'arredor de {{count}} meses'
+ },
+
+ xMonths: {
+ one: '1 mes',
+ other: '{{count}} meses'
+ },
+
+ aboutXYears: {
+ one: 'arredor dun ano',
+ other: 'arredor de {{count}} anos'
+ },
+
+ xYears: {
+ one: '1 ano',
+ other: '{{count}} anos'
+ },
+
+ overXYears: {
+ one: 'máis dun ano',
+ other: 'máis de {{count}} anos'
+ },
+
+ almostXYears: {
+ one: 'case un ano',
+ other: 'case {{count}} anos'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'en ' + result
+ } else {
+ return 'hai ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/gl/_lib/formatLong/index.js b/date-fns/src/locale/gl/_lib/formatLong/index.js
new file mode 100644
index 0000000..e95cb7f
--- /dev/null
+++ b/date-fns/src/locale/gl/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, d 'de' MMMM y",
+ long: "d 'de' MMMM y",
+ medium: 'd MMM y',
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'ás' {{time}}",
+ long: "{{date}} 'ás' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/gl/_lib/formatRelative/index.js b/date-fns/src/locale/gl/_lib/formatRelative/index.js
new file mode 100644
index 0000000..36f217f
--- /dev/null
+++ b/date-fns/src/locale/gl/_lib/formatRelative/index.js
@@ -0,0 +1,24 @@
+var formatRelativeLocale = {
+ lastWeek: "'o' eeee 'pasado á' LT",
+ yesterday: "'onte á' p",
+ today: "'hoxe á' p",
+ tomorrow: "'mañá á' p",
+ nextWeek: "eeee 'á' p",
+ other: 'P'
+}
+
+var formatRelativeLocalePlural = {
+ lastWeek: "'o' eeee 'pasado ás' p",
+ yesterday: "'onte ás' p",
+ today: "'hoxe ás' p",
+ tomorrow: "'mañá ás' p",
+ nextWeek: "eeee 'ás' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ if (date.getUTCHours() !== 1) {
+ return formatRelativeLocalePlural[token]
+ }
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/gl/_lib/localize/index.js b/date-fns/src/locale/gl/_lib/localize/index.js
new file mode 100644
index 0000000..aea5255
--- /dev/null
+++ b/date-fns/src/locale/gl/_lib/localize/index.js
@@ -0,0 +1,158 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['AC', 'DC'],
+ abbreviated: ['AC', 'DC'],
+ wide: ['antes de cristo', 'despois de cristo']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
+ wide: ['1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre']
+}
+
+var monthValues = {
+ narrow: ['e', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
+ abbreviated: [
+ 'xan',
+ 'feb',
+ 'mar',
+ 'abr',
+ 'mai',
+ 'xun',
+ 'xul',
+ 'ago',
+ 'set',
+ 'out',
+ 'nov',
+ 'dec'
+ ],
+ wide: [
+ 'xaneiro',
+ 'febreiro',
+ 'marzo',
+ 'abril',
+ 'maio',
+ 'xuño',
+ 'xullo',
+ 'agosto',
+ 'setembro',
+ 'outubro',
+ 'novembro',
+ 'decembro'
+ ]
+}
+
+var dayValues = {
+ narrow: ['d', 'l', 'm', 'm', 'j', 'v', 's'],
+ short: ['do', 'lu', 'ma', 'me', 'xo', 've', 'sa'],
+ abbreviated: ['dom', 'lun', 'mar', 'mer', 'xov', 'ven', 'sab'],
+ wide: ['domingo', 'luns', 'martes', 'mércores', 'xoves', 'venres', 'sábado']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'md',
+ morning: 'mañá',
+ afternoon: 'tarde',
+ evening: 'tarde',
+ night: 'noite'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'medianoite',
+ noon: 'mediodía',
+ morning: 'mañá',
+ afternoon: 'tarde',
+ evening: 'tardiña',
+ night: 'noite'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'medianoite',
+ noon: 'mediodía',
+ morning: 'mañá',
+ afternoon: 'tarde',
+ evening: 'tardiña',
+ night: 'noite'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'md',
+ morning: 'da mañá',
+ afternoon: 'da tarde',
+ evening: 'da tardiña',
+ night: 'da noite'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'medianoite',
+ noon: 'mediodía',
+ morning: 'da mañá',
+ afternoon: 'da tarde',
+ evening: 'da tardiña',
+ night: 'da noite'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'medianoite',
+ noon: 'mediodía',
+ morning: 'da mañá',
+ afternoon: 'da tarde',
+ evening: 'da tardiña',
+ night: 'da noite'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + 'º'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/gl/_lib/match/index.js b/date-fns/src/locale/gl/_lib/match/index.js
new file mode 100644
index 0000000..08a957c
--- /dev/null
+++ b/date-fns/src/locale/gl/_lib/match/index.js
@@ -0,0 +1,141 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(º)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ac|dc|a|d)/i,
+ abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
+ wide: /^(antes de cristo|antes da era com[uú]n|despois de cristo|era com[uú]n)/i
+}
+var parseEraPatterns = {
+ any: [/^ac/i, /^dc/i],
+ wide: [
+ /^(antes de cristo|antes da era com[uú]n)/i,
+ /^(despois de cristo|era com[uú]n)/i
+ ]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^T[1234]/i,
+ wide: /^[1234](º)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[xfmasond]/i,
+ abbreviated: /^(xan|feb|mar|abr|mai|xun|xul|ago|set|out|nov|dec)/i,
+ wide: /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^x/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^x/i,
+ /^x/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^xan/i,
+ /^feb/i,
+ /^mar/i,
+ /^abr/i,
+ /^mai/i,
+ /^xun/i,
+ /^xul/i,
+ /^ago/i,
+ /^set/i,
+ /^out/i,
+ /^nov/i,
+ /^dec/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dlmxvs]/i,
+ short: /^(do|lu|ma|me|xo|ve|sa)/i,
+ abbreviated: /^(dom|lun|mar|mer|xov|ven|sab)/i,
+ wide: /^(domingo|luns|martes|m[eé]rcores|xoves|venres|s[áa]bado)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^x/i, /^v/i, /^s/i],
+ any: [/^do/i, /^lu/i, /^ma/i, /^me/i, /^xo/i, /^ve/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mn|md|(da|[aá]s) (mañ[aá]|tarde|noite))/i,
+ any: /^([ap]\.?\s?m\.?|medianoite|mediod[ií]a|(da|[aá]s) (mañ[aá]|tarde|noite))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mn/i,
+ noon: /^md/i,
+ morning: /mañ[aá]/i,
+ afternoon: /tarde/i,
+ evening: /tardiña/i,
+ night: /noite/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/gl/index.d.ts b/date-fns/src/locale/gl/index.d.ts
new file mode 100644
index 0000000..67954c6
--- /dev/null
+++ b/date-fns/src/locale/gl/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { gl } from 'date-fns/locale'
+export default gl
diff --git a/date-fns/src/locale/gl/index.js b/date-fns/src/locale/gl/index.js
new file mode 100644
index 0000000..67561fe
--- /dev/null
+++ b/date-fns/src/locale/gl/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Galician locale.
+ * @language Galician
+ * @iso-639-2 glg
+ * @author Alberto Doval - Cocodin Technology[@cocodinTech]{@link https://github.com/cocodinTech}
+ * @author Fidel Pita [@fidelpita]{@link https://github.com/fidelpita}
+ */
+var locale = {
+ code: 'gl',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/gl/index.js.flow b/date-fns/src/locale/gl/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/gl/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/gl/snapshot.md b/date-fns/src/locale/gl/snapshot.md
new file mode 100644
index 0000000..46fa888
--- /dev/null
+++ b/date-fns/src/locale/gl/snapshot.md
@@ -0,0 +1,304 @@
+# Galician (gl) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987º | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987º | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | xul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | febreiro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | xullo | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | Invalid Date |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | xul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | febreiro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | xullo | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | Invalid Date |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28º | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42º | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365º | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | luns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venres | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | luns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venres | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | luns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venres | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | luns | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venres | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lu | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ve | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | da mañá | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tardiña | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | da mañá | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tardiña | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | da mañá | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tardiña | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | da mañá | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tardiña | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | da mañá | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tardiña | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1º | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55º | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1º | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55º | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 de febreiro 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 de maio 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | mércores, 11 de febreiro 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de maio 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 feb 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 de febreiro 1987 ás 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 de maio 1453 ás 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | mércores, 11 de febreiro 1987 ás 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de maio 1453 ás 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | arredor de 6 anos | arredor de 6 anos | en arredor de 6 anos |
+| 2005-01-01T00:00:00.000Z | arredor de 5 anos | arredor de 5 anos | en arredor de 5 anos |
+| 2004-01-01T00:00:00.000Z | arredor de 4 anos | arredor de 4 anos | en arredor de 4 anos |
+| 2003-01-01T00:00:00.000Z | arredor de 3 anos | arredor de 3 anos | en arredor de 3 anos |
+| 2002-01-01T00:00:00.000Z | arredor de 2 anos | arredor de 2 anos | en arredor de 2 anos |
+| 2001-06-01T00:00:00.000Z | máis dun ano | máis dun ano | en máis dun ano |
+| 2001-02-01T00:00:00.000Z | arredor dun ano | arredor dun ano | en arredor dun ano |
+| 2001-01-01T00:00:00.000Z | arredor dun ano | arredor dun ano | en arredor dun ano |
+| 2000-06-01T00:00:00.000Z | 5 meses | 5 meses | en 5 meses |
+| 2000-03-01T00:00:00.000Z | 2 meses | 2 meses | en 2 meses |
+| 2000-02-01T00:00:00.000Z | arredor de 1 mes | arredor de 1 mes | en arredor de 1 mes |
+| 2000-01-15T00:00:00.000Z | 14 días | 14 días | en 14 días |
+| 2000-01-02T00:00:00.000Z | 1 día | 1 día | en 1 día |
+| 2000-01-01T06:00:00.000Z | arredor de 6 horas | arredor de 6 horas | en arredor de 6 horas |
+| 2000-01-01T01:00:00.000Z | arredor dunha hora | arredor dunha hora | en arredor dunha hora |
+| 2000-01-01T00:45:00.000Z | arredor dunha hora | arredor dunha hora | en arredor dunha hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | 30 minutos | en 30 minutos |
+| 2000-01-01T00:15:00.000Z | 15 minutos | 15 minutos | en 15 minutos |
+| 2000-01-01T00:01:00.000Z | 1 minuto | 1 minuto | en 1 minuto |
+| 2000-01-01T00:00:25.000Z | menos dun minuto | medio minuto | en menos dun minuto |
+| 2000-01-01T00:00:15.000Z | menos dun minuto | menos de 20 segundos | en menos dun minuto |
+| 2000-01-01T00:00:05.000Z | menos dun minuto | menos de 10 segundos | en menos dun minuto |
+| 2000-01-01T00:00:00.000Z | menos dun minuto | menos de 5 segundos | hai menos dun minuto |
+| 1999-12-31T23:59:55.000Z | menos dun minuto | menos de 10 segundos | hai menos dun minuto |
+| 1999-12-31T23:59:45.000Z | menos dun minuto | menos de 20 segundos | hai menos dun minuto |
+| 1999-12-31T23:59:35.000Z | menos dun minuto | medio minuto | hai menos dun minuto |
+| 1999-12-31T23:59:00.000Z | 1 minuto | 1 minuto | hai 1 minuto |
+| 1999-12-31T23:45:00.000Z | 15 minutos | 15 minutos | hai 15 minutos |
+| 1999-12-31T23:30:00.000Z | 30 minutos | 30 minutos | hai 30 minutos |
+| 1999-12-31T23:15:00.000Z | arredor dunha hora | arredor dunha hora | hai arredor dunha hora |
+| 1999-12-31T23:00:00.000Z | arredor dunha hora | arredor dunha hora | hai arredor dunha hora |
+| 1999-12-31T18:00:00.000Z | arredor de 6 horas | arredor de 6 horas | hai arredor de 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 días | 2 días | hai 2 días |
+| 1999-12-15T00:00:00.000Z | 17 días | 17 días | hai 17 días |
+| 1999-12-01T00:00:00.000Z | arredor de 1 mes | arredor de 1 mes | hai arredor de 1 mes |
+| 1999-11-01T00:00:00.000Z | 2 meses | 2 meses | hai 2 meses |
+| 1999-06-01T00:00:00.000Z | 7 meses | 7 meses | hai 7 meses |
+| 1999-01-01T00:00:00.000Z | arredor dun ano | arredor dun ano | hai arredor dun ano |
+| 1998-12-01T00:00:00.000Z | arredor dun ano | arredor dun ano | hai arredor dun ano |
+| 1998-06-01T00:00:00.000Z | máis dun ano | máis dun ano | hai máis dun ano |
+| 1998-01-01T00:00:00.000Z | arredor de 2 anos | arredor de 2 anos | hai arredor de 2 anos |
+| 1997-01-01T00:00:00.000Z | arredor de 3 anos | arredor de 3 anos | hai arredor de 3 anos |
+| 1996-01-01T00:00:00.000Z | arredor de 4 anos | arredor de 4 anos | hai arredor de 4 anos |
+| 1995-01-01T00:00:00.000Z | arredor de 5 anos | arredor de 5 anos | hai arredor de 5 anos |
+| 1994-01-01T00:00:00.000Z | arredor de 6 anos | arredor de 6 anos | hai arredor de 6 anos |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 anos | en 6 anos | 52608 horas |
+| 2005-01-01T00:00:00.000Z | 5 anos | en 5 anos | 43848 horas |
+| 2004-01-01T00:00:00.000Z | 4 anos | en 4 anos | 35064 horas |
+| 2003-01-01T00:00:00.000Z | 3 anos | en 3 anos | 26304 horas |
+| 2002-01-01T00:00:00.000Z | 2 anos | en 2 anos | 17544 horas |
+| 2001-06-01T00:00:00.000Z | 1 ano | en 1 ano | 12408 horas |
+| 2001-02-01T00:00:00.000Z | 1 ano | en 1 ano | 9528 horas |
+| 2001-01-01T00:00:00.000Z | 1 ano | en 1 ano | 8784 horas |
+| 2000-06-01T00:00:00.000Z | 5 meses | en 5 meses | 3648 horas |
+| 2000-03-01T00:00:00.000Z | 2 meses | en 2 meses | 1440 horas |
+| 2000-02-01T00:00:00.000Z | 1 mes | en 1 mes | 744 horas |
+| 2000-01-15T00:00:00.000Z | 14 días | en 14 días | 336 horas |
+| 2000-01-02T00:00:00.000Z | 1 día | en 1 día | 24 horas |
+| 2000-01-01T06:00:00.000Z | 6 horas | en 6 horas | 6 horas |
+| 2000-01-01T01:00:00.000Z | 1 hora | en 1 hora | 1 hora |
+| 2000-01-01T00:45:00.000Z | 45 minutos | en 45 minutos | 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | en 30 minutos | 1 hora |
+| 2000-01-01T00:15:00.000Z | 15 minutos | en 15 minutos | 0 horas |
+| 2000-01-01T00:01:00.000Z | 1 minuto | en 1 minuto | 0 horas |
+| 2000-01-01T00:00:25.000Z | 25 segundos | en 25 segundos | 0 horas |
+| 2000-01-01T00:00:15.000Z | 15 segundos | en 15 segundos | 0 horas |
+| 2000-01-01T00:00:05.000Z | 5 segundos | en 5 segundos | 0 horas |
+| 2000-01-01T00:00:00.000Z | 0 segundos | hai 0 segundos | 0 horas |
+| 1999-12-31T23:59:55.000Z | 5 segundos | hai 5 segundos | 0 horas |
+| 1999-12-31T23:59:45.000Z | 15 segundos | hai 15 segundos | 0 horas |
+| 1999-12-31T23:59:35.000Z | 25 segundos | hai 25 segundos | 0 horas |
+| 1999-12-31T23:59:00.000Z | 1 minuto | hai 1 minuto | 0 horas |
+| 1999-12-31T23:45:00.000Z | 15 minutos | hai 15 minutos | 0 horas |
+| 1999-12-31T23:30:00.000Z | 30 minutos | hai 30 minutos | 1 hora |
+| 1999-12-31T23:15:00.000Z | 45 minutos | hai 45 minutos | 1 hora |
+| 1999-12-31T23:00:00.000Z | 1 hora | hai 1 hora | 1 hora |
+| 1999-12-31T18:00:00.000Z | 6 horas | hai 6 horas | 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 días | hai 2 días | 48 horas |
+| 1999-12-15T00:00:00.000Z | 17 días | hai 17 días | 408 horas |
+| 1999-12-01T00:00:00.000Z | 1 mes | hai 1 mes | 744 horas |
+| 1999-11-01T00:00:00.000Z | 2 meses | hai 2 meses | 1464 horas |
+| 1999-06-01T00:00:00.000Z | 7 meses | hai 7 meses | 5136 horas |
+| 1999-01-01T00:00:00.000Z | 1 ano | hai 1 ano | 8760 horas |
+| 1998-12-01T00:00:00.000Z | 1 ano | hai 1 ano | 9504 horas |
+| 1998-06-01T00:00:00.000Z | 2 anos | hai 2 anos | 13896 horas |
+| 1998-01-01T00:00:00.000Z | 2 anos | hai 2 anos | 17520 horas |
+| 1997-01-01T00:00:00.000Z | 3 anos | hai 3 anos | 26280 horas |
+| 1996-01-01T00:00:00.000Z | 4 anos | hai 4 anos | 35064 horas |
+| 1995-01-01T00:00:00.000Z | 5 anos | hai 5 anos | 43824 horas |
+| 1994-01-01T00:00:00.000Z | 6 anos | hai 6 anos | 52584 horas |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | mércores ás 00:00 |
+| 2000-01-02T00:00:00.000Z | mañá ás 00:00 |
+| 2000-01-01T00:00:00.000Z | hoxe ás 00:00 |
+| 1999-12-31T00:00:00.000Z | onte ás 00:00 |
+| 1999-12-27T00:00:00.000Z | o luns pasado ás 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/gu/_lib/formatDistance/index.js b/date-fns/src/locale/gu/_lib/formatDistance/index.js
new file mode 100644
index 0000000..1502cc3
--- /dev/null
+++ b/date-fns/src/locale/gu/_lib/formatDistance/index.js
@@ -0,0 +1,102 @@
+// Source: https://www.unicode.org/cldr/charts/32/summary/gu.html
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'હમણાં', // CLDR #1461
+ other: '​આશરે {{count}} સેકંડ'
+ },
+
+ xSeconds: {
+ one: '1 સેકંડ',
+ other: '{{count}} સેકંડ'
+ },
+
+ halfAMinute: 'અડધી મિનિટ',
+
+ lessThanXMinutes: {
+ one: 'આ મિનિટ', // CLDR #1448
+ other: '​આશરે {{count}} મિનિટ'
+ },
+
+ xMinutes: {
+ one: '1 મિનિટ',
+ other: '{{count}} મિનિટ'
+ },
+
+ aboutXHours: {
+ one: '​આશરે 1 કલાક',
+ other: '​આશરે {{count}} કલાક'
+ },
+
+ xHours: {
+ one: '1 કલાક',
+ other: '{{count}} કલાક'
+ },
+
+ xDays: {
+ one: '1 દિવસ',
+ other: '{{count}} દિવસ'
+ },
+
+ aboutXWeeks: {
+ one: 'આશરે 1 અઠવાડિયું',
+ other: 'આશરે {{count}} અઠવાડિયા'
+ },
+
+ xWeeks: {
+ one: '1 અઠવાડિયું',
+ other: '{{count}} અઠવાડિયા'
+ },
+
+ aboutXMonths: {
+ one: 'આશરે 1 મહિનો',
+ other: 'આશરે {{count}} મહિના'
+ },
+
+ xMonths: {
+ one: '1 મહિનો',
+ other: '{{count}} મહિના'
+ },
+
+ aboutXYears: {
+ one: 'આશરે 1 વર્ષ',
+ other: 'આશરે {{count}} વર્ષ'
+ },
+
+ xYears: {
+ one: '1 વર્ષ',
+ other: '{{count}} વર્ષ'
+ },
+
+ overXYears: {
+ one: '1 વર્ષથી વધુ',
+ other: '{{count}} વર્ષથી વધુ'
+ },
+
+ almostXYears: {
+ one: 'લગભગ 1 વર્ષ',
+ other: 'લગભગ {{count}} વર્ષ'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + 'માં'
+ } else {
+ return result + ' પહેલાં'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/gu/_lib/formatLong/index.js b/date-fns/src/locale/gu/_lib/formatLong/index.js
new file mode 100644
index 0000000..064953b
--- /dev/null
+++ b/date-fns/src/locale/gu/_lib/formatLong/index.js
@@ -0,0 +1,42 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+//Source: https://www.unicode.org/cldr/charts/32/summary/gu.html
+var dateFormats = {
+ full: 'EEEE, d MMMM, y', // CLDR #1825
+ long: 'd MMMM, y', // CLDR #1826
+ medium: 'd MMM, y', // CLDR #1827
+ short: 'd/M/yy' // CLDR #1828
+}
+
+var timeFormats = {
+ full: 'hh:mm:ss a zzzz', // CLDR #1829
+ long: 'hh:mm:ss a z', // CLDR #1830
+ medium: 'hh:mm:ss a', // CLDR #1831
+ short: 'hh:mm a' // CLDR #1832
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}', // CLDR #1833
+ long: '{{date}} {{time}}', // CLDR #1834
+ medium: '{{date}} {{time}}', // CLDR #1835
+ short: '{{date}} {{time}}' // CLDR #1836
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/gu/_lib/formatRelative/index.js b/date-fns/src/locale/gu/_lib/formatRelative/index.js
new file mode 100644
index 0000000..367399b
--- /dev/null
+++ b/date-fns/src/locale/gu/_lib/formatRelative/index.js
@@ -0,0 +1,14 @@
+// Source: https://www.unicode.org/cldr/charts/32/summary/gu.html
+
+var formatRelativeLocale = {
+ lastWeek: "'પાછલા' eeee p", // CLDR #1384
+ yesterday: "'ગઈકાલે' p", // CLDR #1409
+ today: "'આજે' p", // CLDR #1410
+ tomorrow: "'આવતીકાલે' p", // CLDR #1411
+ nextWeek: 'eeee p', // CLDR #1386
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/gu/_lib/localize/index.js b/date-fns/src/locale/gu/_lib/localize/index.js
new file mode 100644
index 0000000..690beaf
--- /dev/null
+++ b/date-fns/src/locale/gu/_lib/localize/index.js
@@ -0,0 +1,181 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+// https://www.unicode.org/cldr/charts/32/summary/gu.html
+// #1621 - #1630
+var eraValues = {
+ narrow: ['ઈસપૂ', 'ઈસ'],
+ abbreviated: ['ઈ.સ.પૂર્વે', 'ઈ.સ.'],
+ wide: ['ઈસવીસન પૂર્વે', 'ઈસવીસન']
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/gu.html
+// #1631 - #1654
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1લો ત્રિમાસ', '2જો ત્રિમાસ', '3જો ત્રિમાસ', '4થો ત્રિમાસ']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+
+// https://www.unicode.org/cldr/charts/32/summary/gu.html
+// #1655 - #1726
+var monthValues = {
+ narrow: ['જા', 'ફે', 'મા', 'એ', 'મે', 'જૂ', 'જુ', 'ઓ', 'સ', 'ઓ', 'ન', 'ડિ'],
+ abbreviated: [
+ 'જાન્યુ',
+ 'ફેબ્રુ',
+ 'માર્ચ',
+ 'એપ્રિલ',
+ 'મે',
+ 'જૂન',
+ 'જુલાઈ',
+ 'ઑગસ્ટ',
+ 'સપ્ટે',
+ 'ઓક્ટો',
+ 'નવે',
+ 'ડિસે'
+ ],
+ wide: [
+ 'જાન્યુઆરી',
+ 'ફેબ્રુઆરી',
+ 'માર્ચ',
+ 'એપ્રિલ',
+ 'મે',
+ 'જૂન',
+ 'જુલાઇ',
+ 'ઓગસ્ટ',
+ 'સપ્ટેમ્બર',
+ 'ઓક્ટોબર',
+ 'નવેમ્બર',
+ 'ડિસેમ્બર'
+ ]
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/gu.html
+// #1727 - #1768
+var dayValues = {
+ narrow: ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'],
+ short: ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'],
+ abbreviated: ['રવિ', 'સોમ', 'મંગળ', 'બુધ', 'ગુરુ', 'શુક્ર', 'શનિ'],
+ wide: [
+ 'રવિવાર' /* Sunday */,
+ 'સોમવાર' /* Monday */,
+ 'મંગળવાર' /* Tuesday */,
+ 'બુધવાર' /* Wednesday */,
+ 'ગુરુવાર' /* Thursday */,
+ 'શુક્રવાર' /* Friday */,
+ 'શનિવાર' /* Saturday */
+ ]
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/gu.html
+// #1783 - #1824
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'મ.રાત્રિ',
+ noon: 'બ.',
+ morning: 'સવારે',
+ afternoon: 'બપોરે',
+ evening: 'સાંજે',
+ night: 'રાત્રે'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: '​મધ્યરાત્રિ',
+ noon: 'બપોરે',
+ morning: 'સવારે',
+ afternoon: 'બપોરે',
+ evening: 'સાંજે',
+ night: 'રાત્રે'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: '​મધ્યરાત્રિ',
+ noon: 'બપોરે',
+ morning: 'સવારે',
+ afternoon: 'બપોરે',
+ evening: 'સાંજે',
+ night: 'રાત્રે'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'મ.રાત્રિ',
+ noon: 'બપોરે',
+ morning: 'સવારે',
+ afternoon: 'બપોરે',
+ evening: 'સાંજે',
+ night: 'રાત્રે'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'મધ્યરાત્રિ',
+ noon: 'બપોરે',
+ morning: 'સવારે',
+ afternoon: 'બપોરે',
+ evening: 'સાંજે',
+ night: 'રાત્રે'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: '​મધ્યરાત્રિ',
+ noon: 'બપોરે',
+ morning: 'સવારે',
+ afternoon: 'બપોરે',
+ evening: 'સાંજે',
+ night: 'રાત્રે'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ return number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/gu/_lib/match/index.js b/date-fns/src/locale/gu/_lib/match/index.js
new file mode 100644
index 0000000..5386ce3
--- /dev/null
+++ b/date-fns/src/locale/gu/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(લ|જ|થ|ઠ્ઠ|મ)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ઈસપૂ|ઈસ)/i,
+ abbreviated: /^(ઈ\.સ\.પૂર્વે|ઈ\.સ\.)/i,
+ wide: /^(ઈસવીસન\sપૂર્વે|ઈસવીસન)/i
+}
+var parseEraPatterns = {
+ any: [/^(ઈસપૂ|ઈસ)/i, /^(ઈ\.સ\.પૂર્વે|ઈ\.સ\.)/i, /^(ઈસવીસન\sપૂર્વે|ઈસવીસન)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](લો|જો|થો)? ત્રિમાસ/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[જાફેમાએમેજૂજુઓસઓનડિ]/i,
+ abbreviated: /^(જાન્યુ|ફેબ્રુ|માર્ચ|એપ્રિલ|મે|જૂન|જુલાઈ|ઑગસ્ટ|સપ્ટે|ઓક્ટો|નવે|ડિસે)/i,
+ wide: /^(જાન્યુઆરી|ફેબ્રુઆરી|માર્ચ|એપ્રિલ|મે|જૂન|જુલાઇ|ઓગસ્ટ|સપ્ટેમ્બર|ઓક્ટોબર|નવેમ્બર|ડિસેમ્બર)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^જા/i,
+ /^ફે/i,
+ /^મા/i,
+ /^એ/i,
+ /^મે/i,
+ /^જૂ/i,
+ /^જુ/i,
+ /^ઑગ/i,
+ /^સ/i,
+ /^ઓક્ટો/i,
+ /^ન/i,
+ /^ડિ/i
+ ],
+ any: [
+ /^જા/i,
+ /^ફે/i,
+ /^મા/i,
+ /^એ/i,
+ /^મે/i,
+ /^જૂ/i,
+ /^જુ/i,
+ /^ઑગ/i,
+ /^સ/i,
+ /^ઓક્ટો/i,
+ /^ન/i,
+ /^ડિ/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(ર|સો|મં|બુ|ગુ|શુ|શ)/i,
+ short: /^(ર|સો|મં|બુ|ગુ|શુ|શ)/i,
+ abbreviated: /^(રવિ|સોમ|મંગળ|બુધ|ગુરુ|શુક્ર|શનિ)/i,
+ wide: /^(રવિવાર|સોમવાર|મંગળવાર|બુધવાર|ગુરુવાર|શુક્રવાર|શનિવાર)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ર/i, /^સો/i, /^મં/i, /^બુ/i, /^ગુ/i, /^શુ/i, /^શ/i],
+ any: [/^ર/i, /^સો/i, /^મં/i, /^બુ/i, /^ગુ/i, /^શુ/i, /^શ/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|મ\.?|સ|બ|સાં|રા)/i,
+ any: /^(a|p|મ\.?|સ|બ|સાં|રા)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^મ\.?/i,
+ noon: /^બ/i,
+ morning: /સ/i,
+ afternoon: /બ/i,
+ evening: /સાં/i,
+ night: /રા/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/gu/index.d.ts b/date-fns/src/locale/gu/index.d.ts
new file mode 100644
index 0000000..42642b6
--- /dev/null
+++ b/date-fns/src/locale/gu/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { gu } from 'date-fns/locale'
+export default gu
diff --git a/date-fns/src/locale/gu/index.js b/date-fns/src/locale/gu/index.js
new file mode 100644
index 0000000..69026da
--- /dev/null
+++ b/date-fns/src/locale/gu/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Gujarati locale (India).
+ * @language Gujarati
+ * @iso-639-2 guj
+ * @author Manaday Mavani [@ManadayM]{@link https://github.com/manadaym}
+ */
+var locale = {
+ code: 'gu',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/gu/index.js.flow b/date-fns/src/locale/gu/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/gu/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/gu/snapshot.md b/date-fns/src/locale/gu/snapshot.md
new file mode 100644
index 0000000..21353dd
--- /dev/null
+++ b/date-fns/src/locale/gu/snapshot.md
@@ -0,0 +1,304 @@
+# Gujarati (gu) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4 | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1લો ત્રિમાસ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2જો ત્રિમાસ | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1લો ત્રિમાસ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2જો ત્રિમાસ | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | ફેબ્રુ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | જુલાઈ | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | ફેબ્રુઆરી | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | જુલાઇ | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ફે | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | જુ | Invalid Date |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | ફેબ્રુ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | જુલાઈ | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | ફેબ્રુઆરી | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | જુલાઇ | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ફે | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | જુ | Invalid Date |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | સોમ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્ર | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | સોમ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્ર | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | સોમ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્ર | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | સોમવાર | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્રવાર | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | સોમ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્ર | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | સોમવાર | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્રવાર | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | સોમ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્ર | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | સોમવાર | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્રવાર | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | સોમ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્ર | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | સોમવાર | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુક્રવાર | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | સો | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | શુ | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | am | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | am | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | am | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | am | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | સવારે | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | બપોરે | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | સાંજે | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | રાત્રે | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | સવારે | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | બપોરે | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | સાંજે | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | રાત્રે | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | સવારે | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | બપોરે | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | સાંજે | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | રાત્રે | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | સવારે | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | બપોરે | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | સાંજે | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | રાત્રે | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | સવારે | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | બપોરે | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | સાંજે | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | રાત્રે | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/2/87 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 ફેબ્રુ, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 મે, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 ફેબ્રુઆરી, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 મે, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | બુધવાર, 11 ફેબ્રુઆરી, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | રવિવાર, 29 મે, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | Invalid Date |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | Invalid Date |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Invalid Date |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Invalid Date |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/2/87 12:13 PM | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53 11:59 PM | Invalid Date |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 ફેબ્રુ, 1987 12:13:14 PM | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29 મે, 1453 11:59:59 PM | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 ફેબ્રુઆરી, 1987 12:13:14 PM GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29 મે, 1453 11:59:59 PM GMT+0 | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | બુધવાર, 11 ફેબ્રુઆરી, 1987 12:13:14 PM GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | રવિવાર, 29 મે, 1453 11:59:59 PM GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------ | ---------------------- | ------------------- |
+| 2006-01-01T00:00:00.000Z | આશરે 6 વર્ષ | આશરે 6 વર્ષ | આશરે 6 વર્ષમાં |
+| 2005-01-01T00:00:00.000Z | આશરે 5 વર્ષ | આશરે 5 વર્ષ | આશરે 5 વર્ષમાં |
+| 2004-01-01T00:00:00.000Z | આશરે 4 વર્ષ | આશરે 4 વર્ષ | આશરે 4 વર્ષમાં |
+| 2003-01-01T00:00:00.000Z | આશરે 3 વર્ષ | આશરે 3 વર્ષ | આશરે 3 વર્ષમાં |
+| 2002-01-01T00:00:00.000Z | આશરે 2 વર્ષ | આશરે 2 વર્ષ | આશરે 2 વર્ષમાં |
+| 2001-06-01T00:00:00.000Z | 1 વર્ષથી વધુ | 1 વર્ષથી વધુ | 1 વર્ષથી વધુમાં |
+| 2001-02-01T00:00:00.000Z | આશરે 1 વર્ષ | આશરે 1 વર્ષ | આશરે 1 વર્ષમાં |
+| 2001-01-01T00:00:00.000Z | આશરે 1 વર્ષ | આશરે 1 વર્ષ | આશરે 1 વર્ષમાં |
+| 2000-06-01T00:00:00.000Z | 5 મહિના | 5 મહિના | 5 મહિનામાં |
+| 2000-03-01T00:00:00.000Z | 2 મહિના | 2 મહિના | 2 મહિનામાં |
+| 2000-02-01T00:00:00.000Z | આશરે 1 મહિનો | આશરે 1 મહિનો | આશરે 1 મહિનોમાં |
+| 2000-01-15T00:00:00.000Z | 14 દિવસ | 14 દિવસ | 14 દિવસમાં |
+| 2000-01-02T00:00:00.000Z | 1 દિવસ | 1 દિવસ | 1 દિવસમાં |
+| 2000-01-01T06:00:00.000Z | ​આશરે 6 કલાક | ​આશરે 6 કલાક | ​આશરે 6 કલાકમાં |
+| 2000-01-01T01:00:00.000Z | ​આશરે 1 કલાક | ​આશરે 1 કલાક | ​આશરે 1 કલાકમાં |
+| 2000-01-01T00:45:00.000Z | ​આશરે 1 કલાક | ​આશરે 1 કલાક | ​આશરે 1 કલાકમાં |
+| 2000-01-01T00:30:00.000Z | 30 મિનિટ | 30 મિનિટ | 30 મિનિટમાં |
+| 2000-01-01T00:15:00.000Z | 15 મિનિટ | 15 મિનિટ | 15 મિનિટમાં |
+| 2000-01-01T00:01:00.000Z | 1 મિનિટ | 1 મિનિટ | 1 મિનિટમાં |
+| 2000-01-01T00:00:25.000Z | આ મિનિટ | અડધી મિનિટ | આ મિનિટમાં |
+| 2000-01-01T00:00:15.000Z | આ મિનિટ | ​આશરે 20 સેકંડ | આ મિનિટમાં |
+| 2000-01-01T00:00:05.000Z | આ મિનિટ | ​આશરે 10 સેકંડ | આ મિનિટમાં |
+| 2000-01-01T00:00:00.000Z | આ મિનિટ | ​આશરે 5 સેકંડ | આ મિનિટ પહેલાં |
+| 1999-12-31T23:59:55.000Z | આ મિનિટ | ​આશરે 10 સેકંડ | આ મિનિટ પહેલાં |
+| 1999-12-31T23:59:45.000Z | આ મિનિટ | ​આશરે 20 સેકંડ | આ મિનિટ પહેલાં |
+| 1999-12-31T23:59:35.000Z | આ મિનિટ | અડધી મિનિટ | આ મિનિટ પહેલાં |
+| 1999-12-31T23:59:00.000Z | 1 મિનિટ | 1 મિનિટ | 1 મિનિટ પહેલાં |
+| 1999-12-31T23:45:00.000Z | 15 મિનિટ | 15 મિનિટ | 15 મિનિટ પહેલાં |
+| 1999-12-31T23:30:00.000Z | 30 મિનિટ | 30 મિનિટ | 30 મિનિટ પહેલાં |
+| 1999-12-31T23:15:00.000Z | ​આશરે 1 કલાક | ​આશરે 1 કલાક | ​આશરે 1 કલાક પહેલાં |
+| 1999-12-31T23:00:00.000Z | ​આશરે 1 કલાક | ​આશરે 1 કલાક | ​આશરે 1 કલાક પહેલાં |
+| 1999-12-31T18:00:00.000Z | ​આશરે 6 કલાક | ​આશરે 6 કલાક | ​આશરે 6 કલાક પહેલાં |
+| 1999-12-30T00:00:00.000Z | 2 દિવસ | 2 દિવસ | 2 દિવસ પહેલાં |
+| 1999-12-15T00:00:00.000Z | 17 દિવસ | 17 દિવસ | 17 દિવસ પહેલાં |
+| 1999-12-01T00:00:00.000Z | આશરે 1 મહિનો | આશરે 1 મહિનો | આશરે 1 મહિનો પહેલાં |
+| 1999-11-01T00:00:00.000Z | 2 મહિના | 2 મહિના | 2 મહિના પહેલાં |
+| 1999-06-01T00:00:00.000Z | 7 મહિના | 7 મહિના | 7 મહિના પહેલાં |
+| 1999-01-01T00:00:00.000Z | આશરે 1 વર્ષ | આશરે 1 વર્ષ | આશરે 1 વર્ષ પહેલાં |
+| 1998-12-01T00:00:00.000Z | આશરે 1 વર્ષ | આશરે 1 વર્ષ | આશરે 1 વર્ષ પહેલાં |
+| 1998-06-01T00:00:00.000Z | 1 વર્ષથી વધુ | 1 વર્ષથી વધુ | 1 વર્ષથી વધુ પહેલાં |
+| 1998-01-01T00:00:00.000Z | આશરે 2 વર્ષ | આશરે 2 વર્ષ | આશરે 2 વર્ષ પહેલાં |
+| 1997-01-01T00:00:00.000Z | આશરે 3 વર્ષ | આશરે 3 વર્ષ | આશરે 3 વર્ષ પહેલાં |
+| 1996-01-01T00:00:00.000Z | આશરે 4 વર્ષ | આશરે 4 વર્ષ | આશરે 4 વર્ષ પહેલાં |
+| 1995-01-01T00:00:00.000Z | આશરે 5 વર્ષ | આશરે 5 વર્ષ | આશરે 5 વર્ષ પહેલાં |
+| 1994-01-01T00:00:00.000Z | આશરે 6 વર્ષ | આશરે 6 વર્ષ | આશરે 6 વર્ષ પહેલાં |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | -------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 વર્ષ | 6 વર્ષમાં | 52608 કલાક |
+| 2005-01-01T00:00:00.000Z | 5 વર્ષ | 5 વર્ષમાં | 43848 કલાક |
+| 2004-01-01T00:00:00.000Z | 4 વર્ષ | 4 વર્ષમાં | 35064 કલાક |
+| 2003-01-01T00:00:00.000Z | 3 વર્ષ | 3 વર્ષમાં | 26304 કલાક |
+| 2002-01-01T00:00:00.000Z | 2 વર્ષ | 2 વર્ષમાં | 17544 કલાક |
+| 2001-06-01T00:00:00.000Z | 1 વર્ષ | 1 વર્ષમાં | 12408 કલાક |
+| 2001-02-01T00:00:00.000Z | 1 વર્ષ | 1 વર્ષમાં | 9528 કલાક |
+| 2001-01-01T00:00:00.000Z | 1 વર્ષ | 1 વર્ષમાં | 8784 કલાક |
+| 2000-06-01T00:00:00.000Z | 5 મહિના | 5 મહિનામાં | 3648 કલાક |
+| 2000-03-01T00:00:00.000Z | 2 મહિના | 2 મહિનામાં | 1440 કલાક |
+| 2000-02-01T00:00:00.000Z | 1 મહિનો | 1 મહિનોમાં | 744 કલાક |
+| 2000-01-15T00:00:00.000Z | 14 દિવસ | 14 દિવસમાં | 336 કલાક |
+| 2000-01-02T00:00:00.000Z | 1 દિવસ | 1 દિવસમાં | 24 કલાક |
+| 2000-01-01T06:00:00.000Z | 6 કલાક | 6 કલાકમાં | 6 કલાક |
+| 2000-01-01T01:00:00.000Z | 1 કલાક | 1 કલાકમાં | 1 કલાક |
+| 2000-01-01T00:45:00.000Z | 45 મિનિટ | 45 મિનિટમાં | 1 કલાક |
+| 2000-01-01T00:30:00.000Z | 30 મિનિટ | 30 મિનિટમાં | 1 કલાક |
+| 2000-01-01T00:15:00.000Z | 15 મિનિટ | 15 મિનિટમાં | 0 કલાક |
+| 2000-01-01T00:01:00.000Z | 1 મિનિટ | 1 મિનિટમાં | 0 કલાક |
+| 2000-01-01T00:00:25.000Z | 25 સેકંડ | 25 સેકંડમાં | 0 કલાક |
+| 2000-01-01T00:00:15.000Z | 15 સેકંડ | 15 સેકંડમાં | 0 કલાક |
+| 2000-01-01T00:00:05.000Z | 5 સેકંડ | 5 સેકંડમાં | 0 કલાક |
+| 2000-01-01T00:00:00.000Z | 0 સેકંડ | 0 સેકંડ પહેલાં | 0 કલાક |
+| 1999-12-31T23:59:55.000Z | 5 સેકંડ | 5 સેકંડ પહેલાં | 0 કલાક |
+| 1999-12-31T23:59:45.000Z | 15 સેકંડ | 15 સેકંડ પહેલાં | 0 કલાક |
+| 1999-12-31T23:59:35.000Z | 25 સેકંડ | 25 સેકંડ પહેલાં | 0 કલાક |
+| 1999-12-31T23:59:00.000Z | 1 મિનિટ | 1 મિનિટ પહેલાં | 0 કલાક |
+| 1999-12-31T23:45:00.000Z | 15 મિનિટ | 15 મિનિટ પહેલાં | 0 કલાક |
+| 1999-12-31T23:30:00.000Z | 30 મિનિટ | 30 મિનિટ પહેલાં | 1 કલાક |
+| 1999-12-31T23:15:00.000Z | 45 મિનિટ | 45 મિનિટ પહેલાં | 1 કલાક |
+| 1999-12-31T23:00:00.000Z | 1 કલાક | 1 કલાક પહેલાં | 1 કલાક |
+| 1999-12-31T18:00:00.000Z | 6 કલાક | 6 કલાક પહેલાં | 6 કલાક |
+| 1999-12-30T00:00:00.000Z | 2 દિવસ | 2 દિવસ પહેલાં | 48 કલાક |
+| 1999-12-15T00:00:00.000Z | 17 દિવસ | 17 દિવસ પહેલાં | 408 કલાક |
+| 1999-12-01T00:00:00.000Z | 1 મહિનો | 1 મહિનો પહેલાં | 744 કલાક |
+| 1999-11-01T00:00:00.000Z | 2 મહિના | 2 મહિના પહેલાં | 1464 કલાક |
+| 1999-06-01T00:00:00.000Z | 7 મહિના | 7 મહિના પહેલાં | 5136 કલાક |
+| 1999-01-01T00:00:00.000Z | 1 વર્ષ | 1 વર્ષ પહેલાં | 8760 કલાક |
+| 1998-12-01T00:00:00.000Z | 1 વર્ષ | 1 વર્ષ પહેલાં | 9504 કલાક |
+| 1998-06-01T00:00:00.000Z | 2 વર્ષ | 2 વર્ષ પહેલાં | 13896 કલાક |
+| 1998-01-01T00:00:00.000Z | 2 વર્ષ | 2 વર્ષ પહેલાં | 17520 કલાક |
+| 1997-01-01T00:00:00.000Z | 3 વર્ષ | 3 વર્ષ પહેલાં | 26280 કલાક |
+| 1996-01-01T00:00:00.000Z | 4 વર્ષ | 4 વર્ષ પહેલાં | 35064 કલાક |
+| 1995-01-01T00:00:00.000Z | 5 વર્ષ | 5 વર્ષ પહેલાં | 43824 કલાક |
+| 1994-01-01T00:00:00.000Z | 6 વર્ષ | 6 વર્ષ પહેલાં | 52584 કલાક |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------- |
+| 2000-01-10T00:00:00.000Z | 10/1/00 |
+| 2000-01-05T00:00:00.000Z | બુધવાર 12:00 AM |
+| 2000-01-02T00:00:00.000Z | આવતીકાલે 12:00 AM |
+| 2000-01-01T00:00:00.000Z | આજે 12:00 AM |
+| 1999-12-31T00:00:00.000Z | ગઈકાલે 12:00 AM |
+| 1999-12-27T00:00:00.000Z | પાછલા સોમવાર 12:00 AM |
+| 1999-12-21T00:00:00.000Z | 21/12/99 |
diff --git a/date-fns/src/locale/he/_lib/formatDistance/index.js b/date-fns/src/locale/he/_lib/formatDistance/index.js
new file mode 100644
index 0000000..a900cb0
--- /dev/null
+++ b/date-fns/src/locale/he/_lib/formatDistance/index.js
@@ -0,0 +1,131 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'פחות משנייה',
+ two: 'פחות משתי שניות',
+ other: 'פחות מ־{{count}} שניות'
+ },
+
+ xSeconds: {
+ one: 'שנייה',
+ two: 'שתי שניות',
+ other: '{{count}} שניות'
+ },
+
+ halfAMinute: 'חצי דקה',
+
+ lessThanXMinutes: {
+ one: 'פחות מדקה',
+ two: 'פחות משתי דקות',
+ other: 'פחות מ־{{count}} דקות'
+ },
+
+ xMinutes: {
+ one: 'דקה',
+ two: 'שתי דקות',
+ other: '{{count}} דקות'
+ },
+
+ aboutXHours: {
+ one: 'כשעה',
+ two: 'כשעתיים',
+ other: 'כ־{{count}} שעות'
+ },
+
+ xHours: {
+ one: 'שעה',
+ two: 'שעתיים',
+ other: '{{count}} שעות'
+ },
+
+ xDays: {
+ one: 'יום',
+ two: 'יומיים',
+ other: '{{count}} ימים'
+ },
+
+ aboutXWeeks: {
+ one: 'כשבוע',
+ two: 'כשבועיים',
+ other: 'כ־{{count}} שבועות'
+ },
+
+ xWeeks: {
+ one: 'שבוע',
+ two: 'שבועיים',
+ other: '{{count}} שבועות'
+ },
+
+ aboutXMonths: {
+ one: 'כחודש',
+ two: 'כחודשיים',
+ other: 'כ־{{count}} חודשים'
+ },
+
+ xMonths: {
+ one: 'חודש',
+ two: 'חודשיים',
+ other: '{{count}} חודשים'
+ },
+
+ aboutXYears: {
+ one: 'כשנה',
+ two: 'כשנתיים',
+ other: 'כ־{{count}} שנים'
+ },
+
+ xYears: {
+ one: 'שנה',
+ two: 'שנתיים',
+ other: '{{count}} שנים'
+ },
+
+ overXYears: {
+ one: 'יותר משנה',
+ two: 'יותר משנתיים',
+ other: 'יותר מ־{{count}} שנים'
+ },
+
+ almostXYears: {
+ one: 'כמעט שנה',
+ two: 'כמעט שנתיים',
+ other: 'כמעט {{count}} שנים'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ // Return word instead of `in one day` or `one day ago`
+ if (token === 'xDays' && options.addSuffix && count <= 2) {
+ var past = {
+ 1: 'אתמול',
+ 2: 'שלשום'
+ }
+ var future = {
+ 1: 'מחר',
+ 2: 'מחרתיים'
+ }
+ return options.comparison > 0 ? future[count] : past[count]
+ }
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 2) {
+ result = formatDistanceLocale[token].two
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'בעוד ' + result
+ } else {
+ return 'לפני ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/he/_lib/formatLong/index.js b/date-fns/src/locale/he/_lib/formatLong/index.js
new file mode 100644
index 0000000..74ebc14
--- /dev/null
+++ b/date-fns/src/locale/he/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d בMMMM y',
+ long: 'd בMMMM y',
+ medium: 'd בMMM y',
+ short: 'd.M.y'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'בשעה' {{time}}",
+ long: "{{date}} 'בשעה' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/he/_lib/formatRelative/index.js b/date-fns/src/locale/he/_lib/formatRelative/index.js
new file mode 100644
index 0000000..3589cc3
--- /dev/null
+++ b/date-fns/src/locale/he/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'שעבר בשעה' p",
+ yesterday: "'אתמול בשעה' p",
+ today: "'היום בשעה' p",
+ tomorrow: "'מחר בשעה' p",
+ nextWeek: "eeee 'בשעה' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/he/_lib/localize/index.js b/date-fns/src/locale/he/_lib/localize/index.js
new file mode 100644
index 0000000..c06ba32
--- /dev/null
+++ b/date-fns/src/locale/he/_lib/localize/index.js
@@ -0,0 +1,209 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['לפנה״ס', 'לספירה'],
+ abbreviated: ['לפנה״ס', 'לספירה'],
+ wide: ['לפני הספירה', 'לספירה']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['רבעון 1', 'רבעון 2', 'רבעון 3', 'רבעון 4']
+}
+
+var monthValues = {
+ narrow: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+ abbreviated: [
+ 'ינו׳',
+ 'פבר׳',
+ 'מרץ',
+ 'אפר׳',
+ 'מאי',
+ 'יוני',
+ 'יולי',
+ 'אוג׳',
+ 'ספט׳',
+ 'אוק׳',
+ 'נוב׳',
+ 'דצמ׳'
+ ],
+ wide: [
+ 'ינואר',
+ 'פברואר',
+ 'מרץ',
+ 'אפריל',
+ 'מאי',
+ 'יוני',
+ 'יולי',
+ 'אוגוסט',
+ 'ספטמבר',
+ 'אוקטובר',
+ 'נובמבר',
+ 'דצמבר'
+ ]
+}
+
+var dayValues = {
+ narrow: ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'],
+ short: ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'],
+ abbreviated: [
+ 'יום א׳',
+ 'יום ב׳',
+ 'יום ג׳',
+ 'יום ד׳',
+ 'יום ה׳',
+ 'יום ו׳',
+ 'שבת'
+ ],
+ wide: [
+ 'יום ראשון',
+ 'יום שני',
+ 'יום שלישי',
+ 'יום רביעי',
+ 'יום חמישי',
+ 'יום שישי',
+ 'יום שבת'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'לפנה״צ',
+ pm: 'אחה״צ',
+ midnight: 'חצות',
+ noon: 'צהריים',
+ morning: 'בוקר',
+ afternoon: 'אחר הצהריים',
+ evening: 'ערב',
+ night: 'לילה'
+ },
+ abbreviated: {
+ am: 'לפנה״צ',
+ pm: 'אחה״צ',
+ midnight: 'חצות',
+ noon: 'צהריים',
+ morning: 'בוקר',
+ afternoon: 'אחר הצהריים',
+ evening: 'ערב',
+ night: 'לילה'
+ },
+ wide: {
+ am: 'לפנה״צ',
+ pm: 'אחה״צ',
+ midnight: 'חצות',
+ noon: 'צהריים',
+ morning: 'בוקר',
+ afternoon: 'אחר הצהריים',
+ evening: 'ערב',
+ night: 'לילה'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'לפנה״צ',
+ pm: 'אחה״צ',
+ midnight: 'חצות',
+ noon: 'צהריים',
+ morning: 'בבוקר',
+ afternoon: 'בצהריים',
+ evening: 'בערב',
+ night: 'בלילה'
+ },
+ abbreviated: {
+ am: 'לפנה״צ',
+ pm: 'אחה״צ',
+ midnight: 'חצות',
+ noon: 'צהריים',
+ morning: 'בבוקר',
+ afternoon: 'אחר הצהריים',
+ evening: 'בערב',
+ night: 'בלילה'
+ },
+ wide: {
+ am: 'לפנה״צ',
+ pm: 'אחה״צ',
+ midnight: 'חצות',
+ noon: 'צהריים',
+ morning: 'בבוקר',
+ afternoon: 'אחר הצהריים',
+ evening: 'בערב',
+ night: 'בלילה'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // We only show words till 10
+ if (number <= 0 || number > 10) return number
+
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+
+ var isFemale = ['year', 'hour', 'minute', 'second'].indexOf(unit) >= 0
+
+ var male = [
+ 'ראשון',
+ 'שני',
+ 'שלישי',
+ 'רביעי',
+ 'חמישי',
+ 'שישי',
+ 'שביעי',
+ 'שמיני',
+ 'תשיעי',
+ 'עשירי'
+ ]
+ var female = [
+ 'ראשונה',
+ 'שנייה',
+ 'שלישית',
+ 'רביעית',
+ 'חמישית',
+ 'שישית',
+ 'שביעית',
+ 'שמינית',
+ 'תשיעית',
+ 'עשירית'
+ ]
+
+ var index = number - 1
+ return isFemale ? female[index] : male[index]
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/he/_lib/match/index.js b/date-fns/src/locale/he/_lib/match/index.js
new file mode 100644
index 0000000..fa4dbb5
--- /dev/null
+++ b/date-fns/src/locale/he/_lib/match/index.js
@@ -0,0 +1,140 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+|(ראשון|שני|שלישי|רביעי|חמישי|שישי|שביעי|שמיני|תשיעי|עשירי|ראשונה|שנייה|שלישית|רביעית|חמישית|שישית|שביעית|שמינית|תשיעית|עשירית))/i
+var parseOrdinalNumberPattern = /^(\d+|רא|שנ|של|רב|ח|שי|שב|שמ|ת|ע)/i
+
+var matchEraPatterns = {
+ narrow: /^ל(ספירה|פנה״ס)/i,
+ abbreviated: /^ל(ספירה|פנה״ס)/i,
+ wide: /^ל(פני ה)?ספירה/i
+}
+var parseEraPatterns = {
+ any: [/^לפ/i, /^לס/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^רבעון [1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^\d+/i,
+ abbreviated: /^(ינו|פבר|מרץ|אפר|מאי|יוני|יולי|אוג|ספט|אוק|נוב|דצמ)׳?/i,
+ wide: /^(ינואר|פברואר|מרץ|אפריל|מאי|יוני|יולי|אוגוסט|ספטמבר|אוקטובר|נובמבר|דצמבר)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^1$/i,
+ /^2/i,
+ /^3/i,
+ /^4/i,
+ /^5/i,
+ /^6/i,
+ /^7/i,
+ /^8/i,
+ /^9/i,
+ /^10/i,
+ /^11/i,
+ /^12/i
+ ],
+ any: [
+ /^ינ/i,
+ /^פ/i,
+ /^מר/i,
+ /^אפ/i,
+ /^מא/i,
+ /^יונ/i,
+ /^יול/i,
+ /^אוג/i,
+ /^ס/i,
+ /^אוק/i,
+ /^נ/i,
+ /^ד/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[אבגדהוש]׳/i,
+ short: /^[אבגדהוש]׳/i,
+ abbreviated: /^(שבת|יום (א|ב|ג|ד|ה|ו)׳)/i,
+ wide: /^יום (ראשון|שני|שלישי|רביעי|חמישי|שישי|שבת)/i
+}
+var parseDayPatterns = {
+ abbreviated: [/א׳$/i, /ב׳$/i, /ג׳$/i, /ד׳$/i, /ה׳$/i, /ו׳$/i, /^ש/i],
+ wide: [/ן$/i, /ני$/i, /לישי$/i, /עי$/i, /מישי$/i, /שישי$/i, /ת$/i],
+ any: [/^א/i, /^ב/i, /^ג/i, /^ד/i, /^ה/i, /^ו/i, /^ש/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(אחר ה|ב)?(חצות|צהריים|בוקר|ערב|לילה|אחה״צ|לפנה״צ)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^לפ/i,
+ pm: /^אחה/i,
+ midnight: /^ח/i,
+ noon: /^צ/i,
+ morning: /בוקר/i,
+ afternoon: /בצ|אחר/i,
+ evening: /ערב/i,
+ night: /לילה/i
+ }
+}
+
+var ordinalName = ['רא', 'שנ', 'של', 'רב', 'ח', 'שי', 'שב', 'שמ', 'ת', 'ע']
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ var number = parseInt(value, 10)
+ return isNaN(number) ? ordinalName.indexOf(value) + 1 : number
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/he/index.d.ts b/date-fns/src/locale/he/index.d.ts
new file mode 100644
index 0000000..33d6042
--- /dev/null
+++ b/date-fns/src/locale/he/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { he } from 'date-fns/locale'
+export default he
diff --git a/date-fns/src/locale/he/index.js b/date-fns/src/locale/he/index.js
new file mode 100644
index 0000000..3194b14
--- /dev/null
+++ b/date-fns/src/locale/he/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Hebrew locale.
+ * @language Hebrew
+ * @iso-639-2 heb
+ * @author Nir Lahad [@nirlah]{@link https://github.com/nirlah}
+ */
+var locale = {
+ code: 'he',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/he/index.js.flow b/date-fns/src/locale/he/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/he/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/he/snapshot.md b/date-fns/src/locale/he/snapshot.md
new file mode 100644
index 0000000..9ca3f24
--- /dev/null
+++ b/date-fns/src/locale/he/snapshot.md
@@ -0,0 +1,304 @@
+# Hebrew (he) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | חמישית | Invalid Date |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | חמישית | Invalid Date |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | ראשון | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | שני | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | רבעון 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | רבעון 2 | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | ראשון | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | שני | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | רבעון 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | רבעון 2 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | שני | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | שביעי | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | פבר׳ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | יולי | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | פברואר | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | יולי | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | שני | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | שביעי | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | פבר׳ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | יולי | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | פברואר | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | יולי | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | ראשון | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49 | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | ראשון | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | יום ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום ו׳ | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | יום ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום ו׳ | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | יום ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום ו׳ | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | יום שני | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום שישי | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | ראשון | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | חמישי | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | יום ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום ו׳ | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | יום שני | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום שישי | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | שני | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | שישי | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | יום ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום ו׳ | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | יום שני | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום שישי | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | שני | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | שישי | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | יום ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום ו׳ | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | יום שני | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | יום שישי | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ב׳ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ו׳ | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | אחה״צ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | לפנה״צ | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | בבוקר | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחר הצהריים | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | בערב | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | בלילה | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | בבוקר | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחר הצהריים | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | בערב | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | בלילה | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | בבוקר | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחר הצהריים | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | בערב | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | בלילה | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | בבוקר | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | אחר הצהריים | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | בערב | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | בלילה | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | בבוקר | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | בצהריים | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | בערב | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | בלילה | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | ראשונה | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | ראשונה | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.2.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.5.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 בפבר׳ 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 במאי 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 בפברואר 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 במאי 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | יום רביעי, 11 בפברואר 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | יום ראשון, 29 במאי 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.2.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.5.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 בפבר׳ 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 במאי 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 בפברואר 1987 בשעה 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 במאי 1453 בשעה 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | יום רביעי, 11 בפברואר 1987 בשעה 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | יום ראשון, 29 במאי 1453 בשעה 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------- | ---------------------- | ----------------- |
+| 2006-01-01T00:00:00.000Z | כ־6 שנים | כ־6 שנים | בעוד כ־6 שנים |
+| 2005-01-01T00:00:00.000Z | כ־5 שנים | כ־5 שנים | בעוד כ־5 שנים |
+| 2004-01-01T00:00:00.000Z | כ־4 שנים | כ־4 שנים | בעוד כ־4 שנים |
+| 2003-01-01T00:00:00.000Z | כ־3 שנים | כ־3 שנים | בעוד כ־3 שנים |
+| 2002-01-01T00:00:00.000Z | כשנתיים | כשנתיים | בעוד כשנתיים |
+| 2001-06-01T00:00:00.000Z | יותר משנה | יותר משנה | בעוד יותר משנה |
+| 2001-02-01T00:00:00.000Z | כשנה | כשנה | בעוד כשנה |
+| 2001-01-01T00:00:00.000Z | כשנה | כשנה | בעוד כשנה |
+| 2000-06-01T00:00:00.000Z | 5 חודשים | 5 חודשים | בעוד 5 חודשים |
+| 2000-03-01T00:00:00.000Z | חודשיים | חודשיים | בעוד חודשיים |
+| 2000-02-01T00:00:00.000Z | כחודש | כחודש | בעוד כחודש |
+| 2000-01-15T00:00:00.000Z | 14 ימים | 14 ימים | בעוד 14 ימים |
+| 2000-01-02T00:00:00.000Z | יום | יום | מחר |
+| 2000-01-01T06:00:00.000Z | כ־6 שעות | כ־6 שעות | בעוד כ־6 שעות |
+| 2000-01-01T01:00:00.000Z | כשעה | כשעה | בעוד כשעה |
+| 2000-01-01T00:45:00.000Z | כשעה | כשעה | בעוד כשעה |
+| 2000-01-01T00:30:00.000Z | 30 דקות | 30 דקות | בעוד 30 דקות |
+| 2000-01-01T00:15:00.000Z | 15 דקות | 15 דקות | בעוד 15 דקות |
+| 2000-01-01T00:01:00.000Z | דקה | דקה | בעוד דקה |
+| 2000-01-01T00:00:25.000Z | פחות מדקה | חצי דקה | בעוד פחות מדקה |
+| 2000-01-01T00:00:15.000Z | פחות מדקה | פחות מ־20 שניות | בעוד פחות מדקה |
+| 2000-01-01T00:00:05.000Z | פחות מדקה | פחות מ־10 שניות | בעוד פחות מדקה |
+| 2000-01-01T00:00:00.000Z | פחות מדקה | פחות מ־5 שניות | לפני פחות מדקה |
+| 1999-12-31T23:59:55.000Z | פחות מדקה | פחות מ־10 שניות | לפני פחות מדקה |
+| 1999-12-31T23:59:45.000Z | פחות מדקה | פחות מ־20 שניות | לפני פחות מדקה |
+| 1999-12-31T23:59:35.000Z | פחות מדקה | חצי דקה | לפני פחות מדקה |
+| 1999-12-31T23:59:00.000Z | דקה | דקה | לפני דקה |
+| 1999-12-31T23:45:00.000Z | 15 דקות | 15 דקות | לפני 15 דקות |
+| 1999-12-31T23:30:00.000Z | 30 דקות | 30 דקות | לפני 30 דקות |
+| 1999-12-31T23:15:00.000Z | כשעה | כשעה | לפני כשעה |
+| 1999-12-31T23:00:00.000Z | כשעה | כשעה | לפני כשעה |
+| 1999-12-31T18:00:00.000Z | כ־6 שעות | כ־6 שעות | לפני כ־6 שעות |
+| 1999-12-30T00:00:00.000Z | יומיים | יומיים | שלשום |
+| 1999-12-15T00:00:00.000Z | 17 ימים | 17 ימים | לפני 17 ימים |
+| 1999-12-01T00:00:00.000Z | כחודש | כחודש | לפני כחודש |
+| 1999-11-01T00:00:00.000Z | חודשיים | חודשיים | לפני חודשיים |
+| 1999-06-01T00:00:00.000Z | 7 חודשים | 7 חודשים | לפני 7 חודשים |
+| 1999-01-01T00:00:00.000Z | כשנה | כשנה | לפני כשנה |
+| 1998-12-01T00:00:00.000Z | כשנה | כשנה | לפני כשנה |
+| 1998-06-01T00:00:00.000Z | יותר משנה | יותר משנה | לפני יותר משנה |
+| 1998-01-01T00:00:00.000Z | כשנתיים | כשנתיים | לפני כשנתיים |
+| 1997-01-01T00:00:00.000Z | כ־3 שנים | כ־3 שנים | לפני כ־3 שנים |
+| 1996-01-01T00:00:00.000Z | כ־4 שנים | כ־4 שנים | לפני כ־4 שנים |
+| 1995-01-01T00:00:00.000Z | כ־5 שנים | כ־5 שנים | לפני כ־5 שנים |
+| 1994-01-01T00:00:00.000Z | כ־6 שנים | כ־6 שנים | לפני כ־6 שנים |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | -------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 שנים | בעוד 6 שנים | 52608 שעות |
+| 2005-01-01T00:00:00.000Z | 5 שנים | בעוד 5 שנים | 43848 שעות |
+| 2004-01-01T00:00:00.000Z | 4 שנים | בעוד 4 שנים | 35064 שעות |
+| 2003-01-01T00:00:00.000Z | 3 שנים | בעוד 3 שנים | 26304 שעות |
+| 2002-01-01T00:00:00.000Z | שנתיים | בעוד שנתיים | 17544 שעות |
+| 2001-06-01T00:00:00.000Z | שנה | בעוד שנה | 12408 שעות |
+| 2001-02-01T00:00:00.000Z | שנה | בעוד שנה | 9528 שעות |
+| 2001-01-01T00:00:00.000Z | שנה | בעוד שנה | 8784 שעות |
+| 2000-06-01T00:00:00.000Z | 5 חודשים | בעוד 5 חודשים | 3648 שעות |
+| 2000-03-01T00:00:00.000Z | חודשיים | בעוד חודשיים | 1440 שעות |
+| 2000-02-01T00:00:00.000Z | חודש | בעוד חודש | 744 שעות |
+| 2000-01-15T00:00:00.000Z | 14 ימים | בעוד 14 ימים | 336 שעות |
+| 2000-01-02T00:00:00.000Z | יום | מחר | 24 שעות |
+| 2000-01-01T06:00:00.000Z | 6 שעות | בעוד 6 שעות | 6 שעות |
+| 2000-01-01T01:00:00.000Z | שעה | בעוד שעה | שעה |
+| 2000-01-01T00:45:00.000Z | 45 דקות | בעוד 45 דקות | שעה |
+| 2000-01-01T00:30:00.000Z | 30 דקות | בעוד 30 דקות | שעה |
+| 2000-01-01T00:15:00.000Z | 15 דקות | בעוד 15 דקות | 0 שעות |
+| 2000-01-01T00:01:00.000Z | דקה | בעוד דקה | 0 שעות |
+| 2000-01-01T00:00:25.000Z | 25 שניות | בעוד 25 שניות | 0 שעות |
+| 2000-01-01T00:00:15.000Z | 15 שניות | בעוד 15 שניות | 0 שעות |
+| 2000-01-01T00:00:05.000Z | 5 שניות | בעוד 5 שניות | 0 שעות |
+| 2000-01-01T00:00:00.000Z | 0 שניות | לפני 0 שניות | 0 שעות |
+| 1999-12-31T23:59:55.000Z | 5 שניות | לפני 5 שניות | 0 שעות |
+| 1999-12-31T23:59:45.000Z | 15 שניות | לפני 15 שניות | 0 שעות |
+| 1999-12-31T23:59:35.000Z | 25 שניות | לפני 25 שניות | 0 שעות |
+| 1999-12-31T23:59:00.000Z | דקה | לפני דקה | 0 שעות |
+| 1999-12-31T23:45:00.000Z | 15 דקות | לפני 15 דקות | 0 שעות |
+| 1999-12-31T23:30:00.000Z | 30 דקות | לפני 30 דקות | שעה |
+| 1999-12-31T23:15:00.000Z | 45 דקות | לפני 45 דקות | שעה |
+| 1999-12-31T23:00:00.000Z | שעה | לפני שעה | שעה |
+| 1999-12-31T18:00:00.000Z | 6 שעות | לפני 6 שעות | 6 שעות |
+| 1999-12-30T00:00:00.000Z | יומיים | שלשום | 48 שעות |
+| 1999-12-15T00:00:00.000Z | 17 ימים | לפני 17 ימים | 408 שעות |
+| 1999-12-01T00:00:00.000Z | חודש | לפני חודש | 744 שעות |
+| 1999-11-01T00:00:00.000Z | חודשיים | לפני חודשיים | 1464 שעות |
+| 1999-06-01T00:00:00.000Z | 7 חודשים | לפני 7 חודשים | 5136 שעות |
+| 1999-01-01T00:00:00.000Z | שנה | לפני שנה | 8760 שעות |
+| 1998-12-01T00:00:00.000Z | שנה | לפני שנה | 9504 שעות |
+| 1998-06-01T00:00:00.000Z | שנתיים | לפני שנתיים | 13896 שעות |
+| 1998-01-01T00:00:00.000Z | שנתיים | לפני שנתיים | 17520 שעות |
+| 1997-01-01T00:00:00.000Z | 3 שנים | לפני 3 שנים | 26280 שעות |
+| 1996-01-01T00:00:00.000Z | 4 שנים | לפני 4 שנים | 35064 שעות |
+| 1995-01-01T00:00:00.000Z | 5 שנים | לפני 5 שנים | 43824 שעות |
+| 1994-01-01T00:00:00.000Z | 6 שנים | לפני 6 שנים | 52584 שעות |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------- |
+| 2000-01-10T00:00:00.000Z | 10.1.2000 |
+| 2000-01-05T00:00:00.000Z | יום רביעי בשעה 0:00 |
+| 2000-01-02T00:00:00.000Z | מחר בשעה 0:00 |
+| 2000-01-01T00:00:00.000Z | היום בשעה 0:00 |
+| 1999-12-31T00:00:00.000Z | אתמול בשעה 0:00 |
+| 1999-12-27T00:00:00.000Z | יום שני שעבר בשעה 0:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/hi/_lib/formatDistance/index.js b/date-fns/src/locale/hi/_lib/formatDistance/index.js
new file mode 100644
index 0000000..8cdad47
--- /dev/null
+++ b/date-fns/src/locale/hi/_lib/formatDistance/index.js
@@ -0,0 +1,106 @@
+import localize from '../localize/index'
+// Source: https://www.unicode.org/cldr/charts/32/summary/hi.html
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: '१ सेकंड से कम', // CLDR #1310
+ other: '{{count}} सेकंड से कम'
+ },
+
+ xSeconds: {
+ one: '१ सेकंड',
+ other: '{{count}} सेकंड'
+ },
+
+ halfAMinute: 'आधा मिनट',
+
+ lessThanXMinutes: {
+ one: '१ मिनट से कम',
+ other: '{{count}} मिनट से कम'
+ },
+
+ xMinutes: {
+ one: '१ मिनट', // CLDR #1307
+ other: '{{count}} मिनट'
+ },
+
+ aboutXHours: {
+ one: 'लगभग १ घंटा',
+ other: 'लगभग {{count}} घंटे'
+ },
+
+ xHours: {
+ one: '१ घंटा', // CLDR #1304
+ other: '{{count}} घंटे' // CLDR #4467
+ },
+
+ xDays: {
+ one: '१ दिन', // CLDR #1286
+ other: '{{count}} दिन'
+ },
+
+ aboutXWeeks: {
+ one: 'लगभग १ सप्ताह',
+ other: 'लगभग {{count}} सप्ताह'
+ },
+
+ xWeeks: {
+ one: '१ सप्ताह',
+ other: '{{count}} सप्ताह'
+ },
+
+ aboutXMonths: {
+ one: 'लगभग १ महीना',
+ other: 'लगभग {{count}} महीने'
+ },
+
+ xMonths: {
+ one: '१ महीना',
+ other: '{{count}} महीने'
+ },
+
+ aboutXYears: {
+ one: 'लगभग १ वर्ष',
+ other: 'लगभग {{count}} वर्ष' // CLDR #4823
+ },
+
+ xYears: {
+ one: '१ वर्ष',
+ other: '{{count}} वर्ष'
+ },
+
+ overXYears: {
+ one: '१ वर्ष से अधिक',
+ other: '{{count}} वर्ष से अधिक'
+ },
+
+ almostXYears: {
+ one: 'लगभग १ वर्ष',
+ other: 'लगभग {{count}} वर्ष'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace(
+ '{{count}}',
+ localize.numberToLocale(count)
+ )
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + 'मे '
+ } else {
+ return result + ' पहले'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/hi/_lib/formatLong/index.js b/date-fns/src/locale/hi/_lib/formatLong/index.js
new file mode 100644
index 0000000..91a7b41
--- /dev/null
+++ b/date-fns/src/locale/hi/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, do MMMM, y', // CLDR #1787
+ long: 'do MMMM, y', // CLDR #1788
+ medium: 'd MMM, y', // CLDR #1789
+ short: 'dd/MM/yyyy' // CLDR #1790
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz', // CLDR #1791
+ long: 'h:mm:ss a z', // CLDR #1792
+ medium: 'h:mm:ss a', // CLDR #1793
+ short: 'h:mm a' // CLDR #1794
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'को' {{time}}", // CLDR #1795
+ long: "{{date}} 'को' {{time}}", // CLDR #1796
+ medium: '{{date}}, {{time}}', // CLDR #1797
+ short: '{{date}}, {{time}}' // CLDR #1798
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/hi/_lib/formatRelative/index.js b/date-fns/src/locale/hi/_lib/formatRelative/index.js
new file mode 100644
index 0000000..6098a56
--- /dev/null
+++ b/date-fns/src/locale/hi/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'पिछले' eeee p",
+ yesterday: "'कल' p",
+ today: "'आज' p",
+ tomorrow: "'कल' p",
+ nextWeek: "eeee 'को' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/hi/_lib/localize/index.js b/date-fns/src/locale/hi/_lib/localize/index.js
new file mode 100644
index 0000000..5d0b90c
--- /dev/null
+++ b/date-fns/src/locale/hi/_lib/localize/index.js
@@ -0,0 +1,244 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var numberValues = {
+ locale: {
+ '1': '१',
+ '2': '२',
+ '3': '३',
+ '4': '४',
+ '5': '५',
+ '6': '६',
+ '7': '७',
+ '8': '८',
+ '9': '९',
+ '0': '०'
+ },
+ number: {
+ '१': '1',
+ '२': '2',
+ '३': '3',
+ '४': '4',
+ '५': '5',
+ '६': '6',
+ '७': '7',
+ '८': '8',
+ '९': '9',
+ '०': '0'
+ }
+}
+
+// CLDR #1585 - #1592
+var eraValues = {
+ narrow: ['ईसा-पूर्व', 'ईस्वी'],
+ abbreviated: ['ईसा-पूर्व', 'ईस्वी'],
+ wide: ['ईसा-पूर्व', 'ईसवी सन']
+}
+// CLDR #1593 - #1616
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['ति1', 'ति2', 'ति3', 'ति4'],
+ wide: ['पहली तिमाही', 'दूसरी तिमाही', 'तीसरी तिमाही', 'चौथी तिमाही']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+// https://www.unicode.org/cldr/charts/32/summary/hi.html
+// CLDR #1617 - #1688
+var monthValues = {
+ narrow: [
+ 'ज',
+ 'फ़',
+ 'मा',
+ 'अ',
+ 'मई',
+ 'जू',
+ 'जु',
+ 'अग',
+ 'सि',
+ 'अक्तू',
+ 'न',
+ 'दि'
+ ],
+ abbreviated: [
+ 'जन',
+ 'फ़र',
+ 'मार्च',
+ 'अप्रैल',
+ 'मई',
+ 'जून',
+ 'जुल',
+ 'अग',
+ 'सित',
+ 'अक्तू',
+ 'नव',
+ 'दिस'
+ ],
+ wide: [
+ 'जनवरी',
+ 'फ़रवरी',
+ 'मार्च',
+ 'अप्रैल',
+ 'मई',
+ 'जून',
+ 'जुलाई',
+ 'अगस्त',
+ 'सितंबर',
+ 'अक्तूबर',
+ 'नवंबर',
+ 'दिसंबर'
+ ]
+}
+
+// CLDR #1689 - #1744
+var dayValues = {
+ narrow: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'],
+ short: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'],
+ abbreviated: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'],
+ wide: [
+ 'रविवार',
+ 'सोमवार',
+ 'मंगलवार',
+ 'बुधवार',
+ 'गुरुवार',
+ 'शुक्रवार',
+ 'शनिवार'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'पूर्वाह्न',
+ pm: 'अपराह्न',
+ midnight: 'मध्यरात्रि',
+ noon: 'दोपहर',
+ morning: 'सुबह',
+ afternoon: 'दोपहर',
+ evening: 'शाम',
+ night: 'रात'
+ },
+ abbreviated: {
+ am: 'पूर्वाह्न',
+ pm: 'अपराह्न',
+ midnight: 'मध्यरात्रि',
+ noon: 'दोपहर',
+ morning: 'सुबह',
+ afternoon: 'दोपहर',
+ evening: 'शाम',
+ night: 'रात'
+ },
+ wide: {
+ am: 'पूर्वाह्न',
+ pm: 'अपराह्न',
+ midnight: 'मध्यरात्रि',
+ noon: 'दोपहर',
+ morning: 'सुबह',
+ afternoon: 'दोपहर',
+ evening: 'शाम',
+ night: 'रात'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'पूर्वाह्न',
+ pm: 'अपराह्न',
+ midnight: 'मध्यरात्रि',
+ noon: 'दोपहर',
+ morning: 'सुबह',
+ afternoon: 'दोपहर',
+ evening: 'शाम',
+ night: 'रात'
+ },
+ abbreviated: {
+ am: 'पूर्वाह्न',
+ pm: 'अपराह्न',
+ midnight: 'मध्यरात्रि',
+ noon: 'दोपहर',
+ morning: 'सुबह',
+ afternoon: 'दोपहर',
+ evening: 'शाम',
+ night: 'रात'
+ },
+ wide: {
+ am: 'पूर्वाह्न',
+ pm: 'अपराह्न',
+ midnight: 'मध्यरात्रि',
+ noon: 'दोपहर',
+ morning: 'सुबह',
+ afternoon: 'दोपहर',
+ evening: 'शाम',
+ night: 'रात'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = localize.localeToNumber(dirtyNumber)
+ var localeNumber = localize.numberToLocale(number)
+
+ var rem10 = number % 10
+ switch (rem10) {
+ case 2:
+ case 3:
+ case 4:
+ case 6:
+ case 1:
+ case 5:
+ case 7:
+ case 8:
+ case 9:
+ case 0:
+ return localeNumber
+ }
+}
+
+function localeToNumber(locale) {
+ var number = locale.toString().replace(/[१२३४५६७८९०]/g, function(match) {
+ return numberValues.number[match]
+ })
+ return Number(number)
+}
+
+function numberToLocale(number) {
+ return number.toString().replace(/\d/g, function(match) {
+ return numberValues.locale[match]
+ })
+}
+
+var localize = {
+ localeToNumber: localeToNumber,
+ numberToLocale: numberToLocale,
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/hi/_lib/match/index.js b/date-fns/src/locale/hi/_lib/match/index.js
new file mode 100644
index 0000000..9ec15da
--- /dev/null
+++ b/date-fns/src/locale/hi/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import localize from '../localize/index'
+
+var matchOrdinalNumberPattern = /^[०१२३४५६७८९]+/i
+var parseOrdinalNumberPattern = /^[०१२३४५६७८९]+/i
+
+var matchEraPatterns = {
+ narrow: /^(ईसा-पूर्व|ईस्वी)/i,
+ abbreviated: /^(ईसा\.?\s?पूर्व\.?|ईसा\.?)/i,
+ wide: /^(ईसा-पूर्व|ईसवी पूर्व|ईसवी सन|ईसवी)/i
+}
+var parseEraPatterns = {
+ any: [/^b/i, /^(a|c)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^ति[1234]/i,
+ wide: /^[1234](पहली|दूसरी|तीसरी|चौथी)? तिमाही/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[जफ़माअप्मईजूनजुअगसिअक्तनदि]/i,
+ abbreviated: /^(जन|फ़र|मार्च|अप्|मई|जून|जुल|अग|सित|अक्तू|नव|दिस)/i,
+ wide: /^(जनवरी|फ़रवरी|मार्च|अप्रैल|मई|जून|जुलाई|अगस्त|सितंबर|अक्तूबर|नवंबर|दिसंबर)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^ज/i,
+ /^फ़/i,
+ /^मा/i,
+ /^अप्/i,
+ /^मई/i,
+ /^जू/i,
+ /^जु/i,
+ /^अग/i,
+ /^सि/i,
+ /^अक्तू/i,
+ /^न/i,
+ /^दि/i
+ ],
+ any: [
+ /^जन/i,
+ /^फ़/i,
+ /^मा/i,
+ /^अप्/i,
+ /^मई/i,
+ /^जू/i,
+ /^जु/i,
+ /^अग/i,
+ /^सि/i,
+ /^अक्तू/i,
+ /^नव/i,
+ /^दिस/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[रविसोममंगलबुधगुरुशुक्रशनि]/i,
+ short: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
+ abbreviated: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
+ wide: /^(रविवार|सोमवार|मंगलवार|बुधवार|गुरुवार|शुक्रवार|शनिवार)/i
+}
+var parseDayPatterns = {
+ narrow: [/^रवि/i, /^सोम/i, /^मंगल/i, /^बुध/i, /^गुरु/i, /^शुक्र/i, /^शनि/i],
+ any: [/^रवि/i, /^सोम/i, /^मंगल/i, /^बुध/i, /^गुरु/i, /^शुक्र/i, /^शनि/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(पू|अ|म|द.\?|सु|दो|शा|रा)/i,
+ any: /^(पूर्वाह्न|अपराह्न|म|द.\?|सु|दो|शा|रा)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^पूर्वाह्न/i,
+ pm: /^अपराह्न/i,
+ midnight: /^मध्य/i,
+ noon: /^दो/i,
+ morning: /सु/i,
+ afternoon: /दो/i,
+ evening: /शा/i,
+ night: /रा/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: localize.localeToNumber
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/hi/index.d.ts b/date-fns/src/locale/hi/index.d.ts
new file mode 100644
index 0000000..089bdd9
--- /dev/null
+++ b/date-fns/src/locale/hi/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hi } from 'date-fns/locale'
+export default hi
diff --git a/date-fns/src/locale/hi/index.js b/date-fns/src/locale/hi/index.js
new file mode 100644
index 0000000..bec68d1
--- /dev/null
+++ b/date-fns/src/locale/hi/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Hindi locale (India).
+ * @language Hindi
+ * @iso-639-2 hin
+ * @author Mukesh Mandiwal [@mukeshmandiwal]{@link https://github.com/mukeshmandiwal}
+ */
+var locale = {
+ code: 'hi',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/hi/index.js.flow b/date-fns/src/locale/hi/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/hi/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/hi/snapshot.md b/date-fns/src/locale/hi/snapshot.md
new file mode 100644
index 0000000..172a55f
--- /dev/null
+++ b/date-fns/src/locale/hi/snapshot.md
@@ -0,0 +1,304 @@
+# Hindi (hi) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | १९८७ | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | ५ | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | १९८७ | 1987-01-04T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | ४ | 0004-01-04T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | १ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | २ | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | ति1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ति2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | पहली तिमाही | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | दूसरी तिमाही | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | १ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | २ | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | ति1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ति2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | पहली तिमाही | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | दूसरी तिमाही | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | २ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ७ | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | फ़र | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | जुल | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | फ़रवरी | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | जुलाई | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | फ़ | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | जु | Invalid Date |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | २ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ७ | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | फ़र | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | जुल | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | फ़रवरी | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | जुलाई | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | फ़ | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | जु | Invalid Date |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | १ | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | ४९ | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | १ | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | ४८ | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | ११ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | २८ | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | ४२ | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | ३६५ | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | सोम | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्र | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | सोम | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्र | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | सोम | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्र | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | सोमवार | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्रवार | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | १ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ५ | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | सोम | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्र | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | सोमवार | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्रवार | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| | iiiiii | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | २ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ६ | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | सोम | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्र | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | सोमवार | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्रवार | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| | eeeeee | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | २ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ६ | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | सोम | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्र | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | सोमवार | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | शुक्रवार | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| | cccccc | 2019-02-11T12:13:14.015Z | सो | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | शु | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | पूर्वाह्न | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | पूर्वाह्न | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | अपराह्न | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | अपराह्न | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | पूर्वाह्न | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | सुबह | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | दोपहर | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | शाम | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | रात | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | सुबह | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | दोपहर | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | शाम | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | रात | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | सुबह | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | दोपहर | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | शाम | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | रात | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | सुबह | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | दोपहर | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | शाम | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | रात | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | सुबह | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | दोपहर | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | शाम | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | रात | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | ११ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ११ | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | ११ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | २३ | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | ११ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ११ | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | ११ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | २३ | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | १ | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | ५५ | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | १ | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | ५५ | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 फ़र, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 मई, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | ११ फ़रवरी, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | २९ मई, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | बुधवार, ११ फ़रवरी, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | रविवार, २९ मई, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 अपराह्न | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 अपराह्न | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 अपराह्न | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 अपराह्न | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 अपराह्न GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 अपराह्न GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 अपराह्न GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 अपराह्न GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 अपराह्न | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 अपराह्न | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 फ़र, 1987, 12:13:14 अपराह्न | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 मई, 1453, 11:59:59 अपराह्न | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | ११ फ़रवरी, 1987 को 12:13:14 अपराह्न GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | २९ मई, 1453 को 11:59:59 अपराह्न GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | बुधवार, ११ फ़रवरी, 1987 को 12:13:14 अपराह्न GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | रविवार, २९ मई, 1453 को 11:59:59 अपराह्न GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------- | ---------------------- | ------------------- |
+| 2006-01-01T00:00:00.000Z | लगभग ६ वर्ष | लगभग ६ वर्ष | लगभग ६ वर्षमे |
+| 2005-01-01T00:00:00.000Z | लगभग ५ वर्ष | लगभग ५ वर्ष | लगभग ५ वर्षमे |
+| 2004-01-01T00:00:00.000Z | लगभग ४ वर्ष | लगभग ४ वर्ष | लगभग ४ वर्षमे |
+| 2003-01-01T00:00:00.000Z | लगभग ३ वर्ष | लगभग ३ वर्ष | लगभग ३ वर्षमे |
+| 2002-01-01T00:00:00.000Z | लगभग २ वर्ष | लगभग २ वर्ष | लगभग २ वर्षमे |
+| 2001-06-01T00:00:00.000Z | १ वर्ष से अधिक | १ वर्ष से अधिक | १ वर्ष से अधिकमे |
+| 2001-02-01T00:00:00.000Z | लगभग १ वर्ष | लगभग १ वर्ष | लगभग १ वर्षमे |
+| 2001-01-01T00:00:00.000Z | लगभग १ वर्ष | लगभग १ वर्ष | लगभग १ वर्षमे |
+| 2000-06-01T00:00:00.000Z | ५ महीने | ५ महीने | ५ महीनेमे |
+| 2000-03-01T00:00:00.000Z | २ महीने | २ महीने | २ महीनेमे |
+| 2000-02-01T00:00:00.000Z | लगभग १ महीना | लगभग १ महीना | लगभग १ महीनामे |
+| 2000-01-15T00:00:00.000Z | १४ दिन | १४ दिन | १४ दिनमे |
+| 2000-01-02T00:00:00.000Z | १ दिन | १ दिन | १ दिनमे |
+| 2000-01-01T06:00:00.000Z | लगभग ६ घंटे | लगभग ६ घंटे | लगभग ६ घंटेमे |
+| 2000-01-01T01:00:00.000Z | लगभग १ घंटा | लगभग १ घंटा | लगभग १ घंटामे |
+| 2000-01-01T00:45:00.000Z | लगभग १ घंटा | लगभग १ घंटा | लगभग १ घंटामे |
+| 2000-01-01T00:30:00.000Z | ३० मिनट | ३० मिनट | ३० मिनटमे |
+| 2000-01-01T00:15:00.000Z | १५ मिनट | १५ मिनट | १५ मिनटमे |
+| 2000-01-01T00:01:00.000Z | १ मिनट | १ मिनट | १ मिनटमे |
+| 2000-01-01T00:00:25.000Z | १ मिनट से कम | आधा मिनट | १ मिनट से कममे |
+| 2000-01-01T00:00:15.000Z | १ मिनट से कम | २० सेकंड से कम | १ मिनट से कममे |
+| 2000-01-01T00:00:05.000Z | १ मिनट से कम | १० सेकंड से कम | १ मिनट से कममे |
+| 2000-01-01T00:00:00.000Z | १ मिनट से कम | ५ सेकंड से कम | १ मिनट से कम पहले |
+| 1999-12-31T23:59:55.000Z | १ मिनट से कम | १० सेकंड से कम | १ मिनट से कम पहले |
+| 1999-12-31T23:59:45.000Z | १ मिनट से कम | २० सेकंड से कम | १ मिनट से कम पहले |
+| 1999-12-31T23:59:35.000Z | १ मिनट से कम | आधा मिनट | १ मिनट से कम पहले |
+| 1999-12-31T23:59:00.000Z | १ मिनट | १ मिनट | १ मिनट पहले |
+| 1999-12-31T23:45:00.000Z | १५ मिनट | १५ मिनट | १५ मिनट पहले |
+| 1999-12-31T23:30:00.000Z | ३० मिनट | ३० मिनट | ३० मिनट पहले |
+| 1999-12-31T23:15:00.000Z | लगभग १ घंटा | लगभग १ घंटा | लगभग १ घंटा पहले |
+| 1999-12-31T23:00:00.000Z | लगभग १ घंटा | लगभग १ घंटा | लगभग १ घंटा पहले |
+| 1999-12-31T18:00:00.000Z | लगभग ६ घंटे | लगभग ६ घंटे | लगभग ६ घंटे पहले |
+| 1999-12-30T00:00:00.000Z | २ दिन | २ दिन | २ दिन पहले |
+| 1999-12-15T00:00:00.000Z | १७ दिन | १७ दिन | १७ दिन पहले |
+| 1999-12-01T00:00:00.000Z | लगभग १ महीना | लगभग १ महीना | लगभग १ महीना पहले |
+| 1999-11-01T00:00:00.000Z | २ महीने | २ महीने | २ महीने पहले |
+| 1999-06-01T00:00:00.000Z | ७ महीने | ७ महीने | ७ महीने पहले |
+| 1999-01-01T00:00:00.000Z | लगभग १ वर्ष | लगभग १ वर्ष | लगभग १ वर्ष पहले |
+| 1998-12-01T00:00:00.000Z | लगभग १ वर्ष | लगभग १ वर्ष | लगभग १ वर्ष पहले |
+| 1998-06-01T00:00:00.000Z | १ वर्ष से अधिक | १ वर्ष से अधिक | १ वर्ष से अधिक पहले |
+| 1998-01-01T00:00:00.000Z | लगभग २ वर्ष | लगभग २ वर्ष | लगभग २ वर्ष पहले |
+| 1997-01-01T00:00:00.000Z | लगभग ३ वर्ष | लगभग ३ वर्ष | लगभग ३ वर्ष पहले |
+| 1996-01-01T00:00:00.000Z | लगभग ४ वर्ष | लगभग ४ वर्ष | लगभग ४ वर्ष पहले |
+| 1995-01-01T00:00:00.000Z | लगभग ५ वर्ष | लगभग ५ वर्ष | लगभग ५ वर्ष पहले |
+| 1994-01-01T00:00:00.000Z | लगभग ६ वर्ष | लगभग ६ वर्ष | लगभग ६ वर्ष पहले |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | -------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | ६ वर्ष | ६ वर्षमे | ५२६०८ घंटे |
+| 2005-01-01T00:00:00.000Z | ५ वर्ष | ५ वर्षमे | ४३८४८ घंटे |
+| 2004-01-01T00:00:00.000Z | ४ वर्ष | ४ वर्षमे | ३५०६४ घंटे |
+| 2003-01-01T00:00:00.000Z | ३ वर्ष | ३ वर्षमे | २६३०४ घंटे |
+| 2002-01-01T00:00:00.000Z | २ वर्ष | २ वर्षमे | १७५४४ घंटे |
+| 2001-06-01T00:00:00.000Z | १ वर्ष | १ वर्षमे | १२४०८ घंटे |
+| 2001-02-01T00:00:00.000Z | १ वर्ष | १ वर्षमे | ९५२८ घंटे |
+| 2001-01-01T00:00:00.000Z | १ वर्ष | १ वर्षमे | ८७८४ घंटे |
+| 2000-06-01T00:00:00.000Z | ५ महीने | ५ महीनेमे | ३६४८ घंटे |
+| 2000-03-01T00:00:00.000Z | २ महीने | २ महीनेमे | १४४० घंटे |
+| 2000-02-01T00:00:00.000Z | १ महीना | १ महीनामे | ७४४ घंटे |
+| 2000-01-15T00:00:00.000Z | १४ दिन | १४ दिनमे | ३३६ घंटे |
+| 2000-01-02T00:00:00.000Z | १ दिन | १ दिनमे | २४ घंटे |
+| 2000-01-01T06:00:00.000Z | ६ घंटे | ६ घंटेमे | ६ घंटे |
+| 2000-01-01T01:00:00.000Z | १ घंटा | १ घंटामे | १ घंटा |
+| 2000-01-01T00:45:00.000Z | ४५ मिनट | ४५ मिनटमे | १ घंटा |
+| 2000-01-01T00:30:00.000Z | ३० मिनट | ३० मिनटमे | १ घंटा |
+| 2000-01-01T00:15:00.000Z | १५ मिनट | १५ मिनटमे | ० घंटे |
+| 2000-01-01T00:01:00.000Z | १ मिनट | १ मिनटमे | ० घंटे |
+| 2000-01-01T00:00:25.000Z | २५ सेकंड | २५ सेकंडमे | ० घंटे |
+| 2000-01-01T00:00:15.000Z | १५ सेकंड | १५ सेकंडमे | ० घंटे |
+| 2000-01-01T00:00:05.000Z | ५ सेकंड | ५ सेकंडमे | ० घंटे |
+| 2000-01-01T00:00:00.000Z | ० सेकंड | ० सेकंड पहले | ० घंटे |
+| 1999-12-31T23:59:55.000Z | ५ सेकंड | ५ सेकंड पहले | ० घंटे |
+| 1999-12-31T23:59:45.000Z | १५ सेकंड | १५ सेकंड पहले | ० घंटे |
+| 1999-12-31T23:59:35.000Z | २५ सेकंड | २५ सेकंड पहले | ० घंटे |
+| 1999-12-31T23:59:00.000Z | १ मिनट | १ मिनट पहले | ० घंटे |
+| 1999-12-31T23:45:00.000Z | १५ मिनट | १५ मिनट पहले | ० घंटे |
+| 1999-12-31T23:30:00.000Z | ३० मिनट | ३० मिनट पहले | १ घंटा |
+| 1999-12-31T23:15:00.000Z | ४५ मिनट | ४५ मिनट पहले | १ घंटा |
+| 1999-12-31T23:00:00.000Z | १ घंटा | १ घंटा पहले | १ घंटा |
+| 1999-12-31T18:00:00.000Z | ६ घंटे | ६ घंटे पहले | ६ घंटे |
+| 1999-12-30T00:00:00.000Z | २ दिन | २ दिन पहले | ४८ घंटे |
+| 1999-12-15T00:00:00.000Z | १७ दिन | १७ दिन पहले | ४०८ घंटे |
+| 1999-12-01T00:00:00.000Z | १ महीना | १ महीना पहले | ७४४ घंटे |
+| 1999-11-01T00:00:00.000Z | २ महीने | २ महीने पहले | १४६४ घंटे |
+| 1999-06-01T00:00:00.000Z | ७ महीने | ७ महीने पहले | ५१३६ घंटे |
+| 1999-01-01T00:00:00.000Z | १ वर्ष | १ वर्ष पहले | ८७६० घंटे |
+| 1998-12-01T00:00:00.000Z | १ वर्ष | १ वर्ष पहले | ९५०४ घंटे |
+| 1998-06-01T00:00:00.000Z | २ वर्ष | २ वर्ष पहले | १३८९६ घंटे |
+| 1998-01-01T00:00:00.000Z | २ वर्ष | २ वर्ष पहले | १७५२० घंटे |
+| 1997-01-01T00:00:00.000Z | ३ वर्ष | ३ वर्ष पहले | २६२८० घंटे |
+| 1996-01-01T00:00:00.000Z | ४ वर्ष | ४ वर्ष पहले | ३५०६४ घंटे |
+| 1995-01-01T00:00:00.000Z | ५ वर्ष | ५ वर्ष पहले | ४३८२४ घंटे |
+| 1994-01-01T00:00:00.000Z | ६ वर्ष | ६ वर्ष पहले | ५२५८४ घंटे |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | बुधवार को 12:00 पूर्वाह्न |
+| 2000-01-02T00:00:00.000Z | कल 12:00 पूर्वाह्न |
+| 2000-01-01T00:00:00.000Z | आज 12:00 पूर्वाह्न |
+| 1999-12-31T00:00:00.000Z | कल 12:00 पूर्वाह्न |
+| 1999-12-27T00:00:00.000Z | पिछले सोमवार 12:00 पूर्वाह्न |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/hr/_lib/formatDistance/index.js b/date-fns/src/locale/hr/_lib/formatDistance/index.js
new file mode 100644
index 0000000..0076d08
--- /dev/null
+++ b/date-fns/src/locale/hr/_lib/formatDistance/index.js
@@ -0,0 +1,191 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: {
+ standalone: 'manje od 1 sekunde',
+ withPrepositionAgo: 'manje od 1 sekunde',
+ withPrepositionIn: 'manje od 1 sekundu'
+ },
+ dual: 'manje od {{count}} sekunde',
+ other: 'manje od {{count}} sekundi'
+ },
+
+ xSeconds: {
+ one: {
+ standalone: '1 sekunda',
+ withPrepositionAgo: '1 sekunde',
+ withPrepositionIn: '1 sekundu'
+ },
+ dual: '{{count}} sekunde',
+ other: '{{count}} sekundi'
+ },
+
+ halfAMinute: 'pola minute',
+
+ lessThanXMinutes: {
+ one: {
+ standalone: 'manje od 1 minute',
+ withPrepositionAgo: 'manje od 1 minute',
+ withPrepositionIn: 'manje od 1 minutu'
+ },
+ dual: 'manje od {{count}} minute',
+ other: 'manje od {{count}} minuta'
+ },
+
+ xMinutes: {
+ one: {
+ standalone: '1 minuta',
+ withPrepositionAgo: '1 minute',
+ withPrepositionIn: '1 minutu'
+ },
+ dual: '{{count}} minute',
+ other: '{{count}} minuta'
+ },
+
+ aboutXHours: {
+ one: {
+ standalone: 'oko 1 sat',
+ withPrepositionAgo: 'oko 1 sat',
+ withPrepositionIn: 'oko 1 sat'
+ },
+ dual: 'oko {{count}} sata',
+ other: 'oko {{count}} sati'
+ },
+
+ xHours: {
+ one: {
+ standalone: '1 sat',
+ withPrepositionAgo: '1 sat',
+ withPrepositionIn: '1 sat'
+ },
+ dual: '{{count}} sata',
+ other: '{{count}} sati'
+ },
+
+ xDays: {
+ one: {
+ standalone: '1 dan',
+ withPrepositionAgo: '1 dan',
+ withPrepositionIn: '1 dan'
+ },
+ dual: '{{count}} dana',
+ other: '{{count}} dana'
+ },
+
+ aboutXWeeks: {
+ one: {
+ standalone: 'oko 1 tjedan',
+ withPrepositionAgo: 'oko 1 tjedan',
+ withPrepositionIn: 'oko 1 tjedan'
+ },
+ dual: 'oko {{count}} tjedna',
+ other: 'oko {{count}} tjedana'
+ },
+
+ xWeeks: {
+ one: {
+ standalone: '1 tjedan',
+ withPrepositionAgo: '1 tjedan',
+ withPrepositionIn: '1 tjedan'
+ },
+ dual: '{{count}} tjedna',
+ other: '{{count}} tjedana'
+ },
+
+ aboutXMonths: {
+ one: {
+ standalone: 'oko 1 mjesec',
+ withPrepositionAgo: 'oko 1 mjesec',
+ withPrepositionIn: 'oko 1 mjesec'
+ },
+ dual: 'oko {{count}} mjeseca',
+ other: 'oko {{count}} mjeseci'
+ },
+
+ xMonths: {
+ one: {
+ standalone: '1 mjesec',
+ withPrepositionAgo: '1 mjesec',
+ withPrepositionIn: '1 mjesec'
+ },
+ dual: '{{count}} mjeseca',
+ other: '{{count}} mjeseci'
+ },
+
+ aboutXYears: {
+ one: {
+ standalone: 'oko 1 godinu',
+ withPrepositionAgo: 'oko 1 godinu',
+ withPrepositionIn: 'oko 1 godinu'
+ },
+ dual: 'oko {{count}} godine',
+ other: 'oko {{count}} godina'
+ },
+
+ xYears: {
+ one: {
+ standalone: '1 godina',
+ withPrepositionAgo: '1 godine',
+ withPrepositionIn: '1 godinu'
+ },
+ dual: '{{count}} godine',
+ other: '{{count}} godina'
+ },
+
+ overXYears: {
+ one: {
+ standalone: 'preko 1 godinu',
+ withPrepositionAgo: 'preko 1 godinu',
+ withPrepositionIn: 'preko 1 godinu'
+ },
+ dual: 'preko {{count}} godine',
+ other: 'preko {{count}} godina'
+ },
+
+ almostXYears: {
+ one: {
+ standalone: 'gotovo 1 godinu',
+ withPrepositionAgo: 'gotovo 1 godinu',
+ withPrepositionIn: 'gotovo 1 godinu'
+ },
+ dual: 'gotovo {{count}} godine',
+ other: 'gotovo {{count}} godina'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ result = formatDistanceLocale[token].one.withPrepositionIn
+ } else {
+ result = formatDistanceLocale[token].one.withPrepositionAgo
+ }
+ } else {
+ result = formatDistanceLocale[token].one.standalone
+ }
+ } else if (
+ count % 10 > 1 &&
+ count % 10 < 5 && // if last digit is between 2 and 4
+ String(count).substr(-2, 1) !== '1' // unless the 2nd to last digit is "1"
+ ) {
+ result = formatDistanceLocale[token].dual.replace('{{count}}', count)
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'za ' + result
+ } else {
+ return 'prije ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/hr/_lib/formatLong/index.js b/date-fns/src/locale/hr/_lib/formatLong/index.js
new file mode 100644
index 0000000..0d8e62f
--- /dev/null
+++ b/date-fns/src/locale/hr/_lib/formatLong/index.js
@@ -0,0 +1,39 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d. MMMM y.',
+ long: 'd. MMMM y.',
+ medium: 'd. MMM y.',
+ short: 'dd. MM. y.'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss (zzzz)',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'u' {{time}}",
+ long: "{{date}} 'u' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/hr/_lib/formatRelative/index.js b/date-fns/src/locale/hr/_lib/formatRelative/index.js
new file mode 100644
index 0000000..6f4ff43
--- /dev/null
+++ b/date-fns/src/locale/hr/_lib/formatRelative/index.js
@@ -0,0 +1,44 @@
+var formatRelativeLocale = {
+ lastWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'prošlu nedjelju u' p"
+ case 3:
+ return "'prošlu srijedu u' p"
+ case 6:
+ return "'prošlu subotu u' p"
+ default:
+ return "'prošli' EEEE 'u' p"
+ }
+ },
+ yesterday: "'jučer u' p",
+ today: "'danas u' p",
+ tomorrow: "'sutra u' p",
+ nextWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'iduću nedjelju u' p"
+ case 3:
+ return "'iduću srijedu u' p"
+ case 6:
+ return "'iduću subotu u' p"
+ default:
+ return "'prošli' EEEE 'u' p"
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/hr/_lib/localize/index.js b/date-fns/src/locale/hr/_lib/localize/index.js
new file mode 100644
index 0000000..76b64be
--- /dev/null
+++ b/date-fns/src/locale/hr/_lib/localize/index.js
@@ -0,0 +1,222 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return String(number).concat('.')
+}
+
+var eraValues = {
+ narrow: ['pr.n.e.', 'AD'],
+ abbreviated: ['pr. Kr.', 'po. Kr.'],
+ wide: ['Prije Krista', 'Poslije Krista']
+}
+
+var monthValues = {
+ narrow: [
+ '1.',
+ '2.',
+ '3.',
+ '4.',
+ '5.',
+ '6.',
+ '7.',
+ '8.',
+ '9.',
+ '10.',
+ '11.',
+ '12.'
+ ],
+ abbreviated: [
+ 'sij',
+ 'velj',
+ 'ožu',
+ 'tra',
+ 'svi',
+ 'lip',
+ 'srp',
+ 'kol',
+ 'ruj',
+ 'lis',
+ 'stu',
+ 'pro'
+ ],
+ wide: [
+ 'siječanj',
+ 'veljača',
+ 'ožujak',
+ 'travanj',
+ 'svibanj',
+ 'lipanj',
+ 'srpanj',
+ 'kolovoz',
+ 'rujan',
+ 'listopad',
+ 'studeni',
+ 'prosinac'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: [
+ '1.',
+ '2.',
+ '3.',
+ '4.',
+ '5.',
+ '6.',
+ '7.',
+ '8.',
+ '9.',
+ '10.',
+ '11.',
+ '12.'
+ ],
+ abbreviated: [
+ 'sij',
+ 'velj',
+ 'ožu',
+ 'tra',
+ 'svi',
+ 'lip',
+ 'srp',
+ 'kol',
+ 'ruj',
+ 'lis',
+ 'stu',
+ 'pro'
+ ],
+ wide: [
+ 'siječnja',
+ 'veljače',
+ 'ožujka',
+ 'travnja',
+ 'svibnja',
+ 'lipnja',
+ 'srpnja',
+ 'kolovoza',
+ 'rujna',
+ 'listopada',
+ 'studenog',
+ 'prosinca'
+ ]
+}
+
+var quarterValues = {
+ narrow: ['1.', '2.', '3.', '4.'],
+ abbreviated: ['1. kv.', '2. kv.', '3. kv.', '4. kv.'],
+ wide: ['1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal']
+}
+
+var dayValues = {
+ narrow: ['N', 'P', 'U', 'S', 'Č', 'P', 'S'],
+ short: ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'],
+ abbreviated: ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'],
+ wide: [
+ 'nedjelja',
+ 'ponedjeljak',
+ 'utorak',
+ 'srijeda',
+ 'četvrtak',
+ 'petak',
+ 'subota'
+ ]
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutro',
+ afternoon: 'popodne',
+ evening: 'navečer',
+ night: 'noću'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutro',
+ afternoon: 'popodne',
+ evening: 'navečer',
+ night: 'noću'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutro',
+ afternoon: 'poslije podne',
+ evening: 'navečer',
+ night: 'noću'
+ }
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutro',
+ afternoon: 'popodne',
+ evening: 'navečer',
+ night: 'noću'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutro',
+ afternoon: 'popodne',
+ evening: 'navečer',
+ night: 'noću'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutro',
+ afternoon: 'poslije podne',
+ evening: 'navečer',
+ night: 'noću'
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/hr/_lib/match/index.js b/date-fns/src/locale/hr/_lib/match/index.js
new file mode 100644
index 0000000..78cb630
--- /dev/null
+++ b/date-fns/src/locale/hr/_lib/match/index.js
@@ -0,0 +1,132 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\./i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(pr\.n\.e\.|AD)/i,
+ abbreviated: /^(pr\.\s?Kr\.|po\.\s?Kr\.)/i,
+ wide: /^(Prije Krista|prije nove ere|Poslije Krista|nova era)/i
+}
+var parseEraPatterns = {
+ any: [/^pr/i, /^(po|nova)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]\.\s?kv\.?/i,
+ wide: /^[1234]\. kvartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(10|11|12|[123456789])\./i,
+ abbreviated: /^(sij|velj|(ožu|ozu)|tra|svi|lip|srp|kol|ruj|lis|stu|pro)/i,
+ wide: /^((siječanj|siječnja|sijecanj|sijecnja)|(veljača|veljače|veljaca|veljace)|(ožujak|ožujka|ozujak|ozujka)|(travanj|travnja)|(svibanj|svibnja)|(lipanj|lipnja)|(srpanj|srpnja)|(kolovoz|kolovoza)|(rujan|rujna)|(listopad|listopada)|(studeni|studenog)|(prosinac|prosinca))/i
+}
+var parseMonthPatterns = {
+ narrow: [/(10|11|12|[123456789])/i],
+ abbreviated: [
+ /^sij/i,
+ /^velj/i,
+ /^(ožu|ozu)/i,
+ /^tra/i,
+ /^svi/i,
+ /^lip/i,
+ /^srp/i,
+ /^kol/i,
+ /^ruj/i,
+ /^lis/i,
+ /^stu/i,
+ /^pro/i
+ ],
+ wide: [
+ /^sij/i,
+ /^velj/i,
+ /^(ožu|ozu)/i,
+ /^tra/i,
+ /^svi/i,
+ /^lip/i,
+ /^srp/i,
+ /^kol/i,
+ /^ruj/i,
+ /^lis/i,
+ /^stu/i,
+ /^pro/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[npusčc]/i,
+ short: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
+ abbreviated: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
+ wide: /^(nedjelja|ponedjeljak|utorak|srijeda|(četvrtak|cetvrtak)|petak|subota)/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(am|pm|ponoc|ponoć|(po)?podne|navecer|navečer|noću|poslije podne|ujutro)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^pono/i,
+ noon: /^pod/i,
+ morning: /jutro/i,
+ afternoon: /(poslije\s|po)+podne/i,
+ evening: /(navece|naveče)/i,
+ night: /(nocu|noću)/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'wide'
+ }),
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/hr/index.d.ts b/date-fns/src/locale/hr/index.d.ts
new file mode 100644
index 0000000..025baa3
--- /dev/null
+++ b/date-fns/src/locale/hr/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hr } from 'date-fns/locale'
+export default hr
diff --git a/date-fns/src/locale/hr/index.js b/date-fns/src/locale/hr/index.js
new file mode 100644
index 0000000..e48232d
--- /dev/null
+++ b/date-fns/src/locale/hr/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Croatian locale.
+ * @language Croatian
+ * @iso-639-2 hrv
+ * @author Matija Marohnić [@silvenon]{@link https://github.com/silvenon}
+ * @author Manico [@manico]{@link https://github.com/manico}
+ * @author Ivan Jeržabek [@jerzabek]{@link https://github.com/jerzabek}
+ */
+var locale = {
+ code: 'hr',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/hr/index.js.flow b/date-fns/src/locale/hr/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/hr/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/hr/snapshot.md b/date-fns/src/locale/hr/snapshot.md
new file mode 100644
index 0000000..95bcd16
--- /dev/null
+++ b/date-fns/src/locale/hr/snapshot.md
@@ -0,0 +1,304 @@
+# Croatian (hr) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1. kv. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kv. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2. | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. kv. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kv. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | velj | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | srp | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | veljače | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | srpnja | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 2. | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | velj | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | srp | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | veljača | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | srpanj | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 2. | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | ponedjeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | EEEEE | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | ponedjeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | iiiii | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | iiiiii | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | ponedjeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | eeeee | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | eeeeee | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | ponedjeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | ccccc | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | cccccc | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ujutro | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | navečer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ujutro | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | navečer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ujutro | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | navečer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ujutro | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | poslije podne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | navečer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ujutro | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | navečer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11. 02. 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 1453. | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. velj 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. svi 1453. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. veljače 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. svibnja 1453. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | srijeda, 11. veljače 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | nedjelja, 29. svibnja 1453. | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 (GMT+00:00) | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 (GMT+00:00) | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11. 02. 1987. 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 1453. 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. velj 1987. 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. svi 1453. 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. veljače 1987. u 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. svibnja 1453. u 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | srijeda, 11. veljače 1987. u 12:13:14 (GMT+00:00) | Errored |
+| | | 1453-05-29T23:59:59.999Z | nedjelja, 29. svibnja 1453. u 23:59:59 (GMT+00:00) | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | ----------------------- |
+| 2006-01-01T00:00:00.000Z | oko 6 godina | oko 6 godina | za oko 6 godina |
+| 2005-01-01T00:00:00.000Z | oko 5 godina | oko 5 godina | za oko 5 godina |
+| 2004-01-01T00:00:00.000Z | oko 4 godine | oko 4 godine | za oko 4 godine |
+| 2003-01-01T00:00:00.000Z | oko 3 godine | oko 3 godine | za oko 3 godine |
+| 2002-01-01T00:00:00.000Z | oko 2 godine | oko 2 godine | za oko 2 godine |
+| 2001-06-01T00:00:00.000Z | preko 1 godinu | preko 1 godinu | za preko 1 godinu |
+| 2001-02-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | za oko 1 godinu |
+| 2001-01-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | za oko 1 godinu |
+| 2000-06-01T00:00:00.000Z | 5 mjeseci | 5 mjeseci | za 5 mjeseci |
+| 2000-03-01T00:00:00.000Z | 2 mjeseca | 2 mjeseca | za 2 mjeseca |
+| 2000-02-01T00:00:00.000Z | oko 1 mjesec | oko 1 mjesec | za oko 1 mjesec |
+| 2000-01-15T00:00:00.000Z | 14 dana | 14 dana | za 14 dana |
+| 2000-01-02T00:00:00.000Z | 1 dan | 1 dan | za 1 dan |
+| 2000-01-01T06:00:00.000Z | oko 6 sati | oko 6 sati | za oko 6 sati |
+| 2000-01-01T01:00:00.000Z | oko 1 sat | oko 1 sat | za oko 1 sat |
+| 2000-01-01T00:45:00.000Z | oko 1 sat | oko 1 sat | za oko 1 sat |
+| 2000-01-01T00:30:00.000Z | 30 minuta | 30 minuta | za 30 minuta |
+| 2000-01-01T00:15:00.000Z | 15 minuta | 15 minuta | za 15 minuta |
+| 2000-01-01T00:01:00.000Z | 1 minuta | 1 minuta | za 1 minutu |
+| 2000-01-01T00:00:25.000Z | manje od 1 minute | pola minute | za manje od 1 minutu |
+| 2000-01-01T00:00:15.000Z | manje od 1 minute | manje od 20 sekundi | za manje od 1 minutu |
+| 2000-01-01T00:00:05.000Z | manje od 1 minute | manje od 10 sekundi | za manje od 1 minutu |
+| 2000-01-01T00:00:00.000Z | manje od 1 minute | manje od 5 sekundi | prije manje od 1 minute |
+| 1999-12-31T23:59:55.000Z | manje od 1 minute | manje od 10 sekundi | prije manje od 1 minute |
+| 1999-12-31T23:59:45.000Z | manje od 1 minute | manje od 20 sekundi | prije manje od 1 minute |
+| 1999-12-31T23:59:35.000Z | manje od 1 minute | pola minute | prije manje od 1 minute |
+| 1999-12-31T23:59:00.000Z | 1 minuta | 1 minuta | prije 1 minute |
+| 1999-12-31T23:45:00.000Z | 15 minuta | 15 minuta | prije 15 minuta |
+| 1999-12-31T23:30:00.000Z | 30 minuta | 30 minuta | prije 30 minuta |
+| 1999-12-31T23:15:00.000Z | oko 1 sat | oko 1 sat | prije oko 1 sat |
+| 1999-12-31T23:00:00.000Z | oko 1 sat | oko 1 sat | prije oko 1 sat |
+| 1999-12-31T18:00:00.000Z | oko 6 sati | oko 6 sati | prije oko 6 sati |
+| 1999-12-30T00:00:00.000Z | 2 dana | 2 dana | prije 2 dana |
+| 1999-12-15T00:00:00.000Z | 17 dana | 17 dana | prije 17 dana |
+| 1999-12-01T00:00:00.000Z | oko 1 mjesec | oko 1 mjesec | prije oko 1 mjesec |
+| 1999-11-01T00:00:00.000Z | 2 mjeseca | 2 mjeseca | prije 2 mjeseca |
+| 1999-06-01T00:00:00.000Z | 7 mjeseci | 7 mjeseci | prije 7 mjeseci |
+| 1999-01-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | prije oko 1 godinu |
+| 1998-12-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | prije oko 1 godinu |
+| 1998-06-01T00:00:00.000Z | preko 1 godinu | preko 1 godinu | prije preko 1 godinu |
+| 1998-01-01T00:00:00.000Z | oko 2 godine | oko 2 godine | prije oko 2 godine |
+| 1997-01-01T00:00:00.000Z | oko 3 godine | oko 3 godine | prije oko 3 godine |
+| 1996-01-01T00:00:00.000Z | oko 4 godine | oko 4 godine | prije oko 4 godine |
+| 1995-01-01T00:00:00.000Z | oko 5 godina | oko 5 godina | prije oko 5 godina |
+| 1994-01-01T00:00:00.000Z | oko 6 godina | oko 6 godina | prije oko 6 godina |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 godina | za 6 godina | 52608 sati |
+| 2005-01-01T00:00:00.000Z | 5 godina | za 5 godina | 43848 sati |
+| 2004-01-01T00:00:00.000Z | 4 godine | za 4 godine | 35064 sata |
+| 2003-01-01T00:00:00.000Z | 3 godine | za 3 godine | 26304 sata |
+| 2002-01-01T00:00:00.000Z | 2 godine | za 2 godine | 17544 sata |
+| 2001-06-01T00:00:00.000Z | 1 godina | za 1 godinu | 12408 sati |
+| 2001-02-01T00:00:00.000Z | 1 godina | za 1 godinu | 9528 sati |
+| 2001-01-01T00:00:00.000Z | 1 godina | za 1 godinu | 8784 sata |
+| 2000-06-01T00:00:00.000Z | 5 mjeseci | za 5 mjeseci | 3648 sati |
+| 2000-03-01T00:00:00.000Z | 2 mjeseca | za 2 mjeseca | 1440 sati |
+| 2000-02-01T00:00:00.000Z | 1 mjesec | za 1 mjesec | 744 sata |
+| 2000-01-15T00:00:00.000Z | 14 dana | za 14 dana | 336 sati |
+| 2000-01-02T00:00:00.000Z | 1 dan | za 1 dan | 24 sata |
+| 2000-01-01T06:00:00.000Z | 6 sati | za 6 sati | 6 sati |
+| 2000-01-01T01:00:00.000Z | 1 sat | za 1 sat | 1 sat |
+| 2000-01-01T00:45:00.000Z | 45 minuta | za 45 minuta | 1 sat |
+| 2000-01-01T00:30:00.000Z | 30 minuta | za 30 minuta | 1 sat |
+| 2000-01-01T00:15:00.000Z | 15 minuta | za 15 minuta | 0 sati |
+| 2000-01-01T00:01:00.000Z | 1 minuta | za 1 minutu | 0 sati |
+| 2000-01-01T00:00:25.000Z | 25 sekundi | za 25 sekundi | 0 sati |
+| 2000-01-01T00:00:15.000Z | 15 sekundi | za 15 sekundi | 0 sati |
+| 2000-01-01T00:00:05.000Z | 5 sekundi | za 5 sekundi | 0 sati |
+| 2000-01-01T00:00:00.000Z | 0 sekundi | prije 0 sekundi | 0 sati |
+| 1999-12-31T23:59:55.000Z | 5 sekundi | prije 5 sekundi | 0 sati |
+| 1999-12-31T23:59:45.000Z | 15 sekundi | prije 15 sekundi | 0 sati |
+| 1999-12-31T23:59:35.000Z | 25 sekundi | prije 25 sekundi | 0 sati |
+| 1999-12-31T23:59:00.000Z | 1 minuta | prije 1 minute | 0 sati |
+| 1999-12-31T23:45:00.000Z | 15 minuta | prije 15 minuta | 0 sati |
+| 1999-12-31T23:30:00.000Z | 30 minuta | prije 30 minuta | 1 sat |
+| 1999-12-31T23:15:00.000Z | 45 minuta | prije 45 minuta | 1 sat |
+| 1999-12-31T23:00:00.000Z | 1 sat | prije 1 sat | 1 sat |
+| 1999-12-31T18:00:00.000Z | 6 sati | prije 6 sati | 6 sati |
+| 1999-12-30T00:00:00.000Z | 2 dana | prije 2 dana | 48 sati |
+| 1999-12-15T00:00:00.000Z | 17 dana | prije 17 dana | 408 sati |
+| 1999-12-01T00:00:00.000Z | 1 mjesec | prije 1 mjesec | 744 sata |
+| 1999-11-01T00:00:00.000Z | 2 mjeseca | prije 2 mjeseca | 1464 sata |
+| 1999-06-01T00:00:00.000Z | 7 mjeseci | prije 7 mjeseci | 5136 sati |
+| 1999-01-01T00:00:00.000Z | 1 godina | prije 1 godine | 8760 sati |
+| 1998-12-01T00:00:00.000Z | 1 godina | prije 1 godine | 9504 sata |
+| 1998-06-01T00:00:00.000Z | 2 godine | prije 2 godine | 13896 sati |
+| 1998-01-01T00:00:00.000Z | 2 godine | prije 2 godine | 17520 sati |
+| 1997-01-01T00:00:00.000Z | 3 godine | prije 3 godine | 26280 sati |
+| 1996-01-01T00:00:00.000Z | 4 godine | prije 4 godine | 35064 sata |
+| 1995-01-01T00:00:00.000Z | 5 godina | prije 5 godina | 43824 sata |
+| 1994-01-01T00:00:00.000Z | 6 godina | prije 6 godina | 52584 sata |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------- |
+| 2000-01-10T00:00:00.000Z | 10. 01. 2000. |
+| 2000-01-05T00:00:00.000Z | iduću srijedu u 00:00 |
+| 2000-01-02T00:00:00.000Z | sutra u 00:00 |
+| 2000-01-01T00:00:00.000Z | danas u 00:00 |
+| 1999-12-31T00:00:00.000Z | jučer u 00:00 |
+| 1999-12-27T00:00:00.000Z | prošli ponedjeljak u 00:00 |
+| 1999-12-21T00:00:00.000Z | 21. 12. 1999. |
diff --git a/date-fns/src/locale/ht/_lib/formatDistance/index.js b/date-fns/src/locale/ht/_lib/formatDistance/index.js
new file mode 100644
index 0000000..47fd416
--- /dev/null
+++ b/date-fns/src/locale/ht/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'mwens pase yon segond',
+ other: 'mwens pase {{count}} segond',
+ },
+
+ xSeconds: {
+ one: '1 segond',
+ other: '{{count}} segond',
+ },
+
+ halfAMinute: '30 segond',
+
+ lessThanXMinutes: {
+ one: 'mwens pase yon minit',
+ other: 'mwens pase {{count}} minit',
+ },
+
+ xMinutes: {
+ one: '1 minit',
+ other: '{{count}} minit',
+ },
+
+ aboutXHours: {
+ one: 'anviwon inè',
+ other: 'anviwon {{count}} è',
+ },
+
+ xHours: {
+ one: '1 lè',
+ other: '{{count}} lè',
+ },
+
+ xDays: {
+ one: '1 jou',
+ other: '{{count}} jou',
+ },
+
+ aboutXWeeks: {
+ one: 'anviwon 1 semèn',
+ other: 'anviwon {{count}} semèn',
+ },
+
+ xWeeks: {
+ one: '1 semèn',
+ other: '{{count}} semèn',
+ },
+
+ aboutXMonths: {
+ one: 'anviwon 1 mwa',
+ other: 'anviwon {{count}} mwa',
+ },
+
+ xMonths: {
+ one: '1 mwa',
+ other: '{{count}} mwa',
+ },
+
+ aboutXYears: {
+ one: 'anviwon 1 an',
+ other: 'anviwon {{count}} an',
+ },
+
+ xYears: {
+ one: '1 an',
+ other: '{{count}} an',
+ },
+
+ overXYears: {
+ one: 'plis pase 1 an',
+ other: 'plis pase {{count}} an',
+ },
+
+ almostXYears: {
+ one: 'prèske 1 an',
+ other: 'prèske {{count}} an',
+ },
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'nan ' + result
+ } else {
+ return 'sa fè ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ht/_lib/formatLong/index.js b/date-fns/src/locale/ht/_lib/formatLong/index.js
new file mode 100644
index 0000000..94972ec
--- /dev/null
+++ b/date-fns/src/locale/ht/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'dd/MM/y',
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm',
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'nan lè' {{time}}",
+ long: "{{date}} 'nan lè' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}',
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full',
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full',
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full',
+ }),
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ht/_lib/formatRelative/index.js b/date-fns/src/locale/ht/_lib/formatRelative/index.js
new file mode 100644
index 0000000..5de726c
--- /dev/null
+++ b/date-fns/src/locale/ht/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'pase nan lè' p",
+ yesterday: "'yè nan lè' p",
+ today: "'jodi a' p",
+ tomorrow: "'demen nan lè' p'",
+ nextWeek: "eeee 'pwochen nan lè' p",
+ other: 'P',
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ht/_lib/formatters/index.js b/date-fns/src/locale/ht/_lib/formatters/index.js
new file mode 100644
index 0000000..dfb0661
--- /dev/null
+++ b/date-fns/src/locale/ht/_lib/formatters/index.js
@@ -0,0 +1,19 @@
+var formatters = {}
+
+// Special case for day of month ordinals in long date format context:
+// 1er mars, 2 mars, 3 mars, …
+// See https://github.com/date-fns/date-fns/issues/437
+var monthsTokens = ['MMM', 'MMMM']
+monthsTokens.forEach(function (monthToken) {
+ formatters['Do ' + monthToken] = function (date, options) {
+ var commonFormatters = options.formatters
+ var dayOfMonthToken = date.getUTCDate() === 1 ? 'Do' : 'D'
+ var dayOfMonthFormatter = commonFormatters[dayOfMonthToken]
+ var monthFormatter = commonFormatters[monthToken]
+ return (
+ dayOfMonthFormatter(date, options) + ' ' + monthFormatter(date, options)
+ )
+ }
+})
+
+export default formatters
diff --git a/date-fns/src/locale/ht/_lib/localize/index.js b/date-fns/src/locale/ht/_lib/localize/index.js
new file mode 100644
index 0000000..a809fc6
--- /dev/null
+++ b/date-fns/src/locale/ht/_lib/localize/index.js
@@ -0,0 +1,147 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['av. J.-K', 'ap. J.-K'],
+ abbreviated: ['av. J.-K', 'ap. J.-K'],
+ wide: ['anvan Jezi Kris', 'apre Jezi Kris'],
+}
+
+var quarterValues = {
+ narrow: ['T1', 'T2', 'T3', 'T4'],
+ abbreviated: ['1ye trim.', '2yèm trim.', '3yèm trim.', '4yèm trim.'],
+ wide: ['1ye trimès', '2yèm trimès', '3yèm trimès', '4yèm trimès'],
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'O', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'janv.',
+ 'fevr.',
+ 'mas',
+ 'avr.',
+ 'me',
+ 'jen',
+ 'jiyè',
+ 'out',
+ 'sept.',
+ 'okt.',
+ 'nov.',
+ 'des.',
+ ],
+ wide: [
+ 'janvye',
+ 'fevrye',
+ 'mas',
+ 'avril',
+ 'me',
+ 'jen',
+ 'jiyè',
+ 'out',
+ 'septanm',
+ 'oktòb',
+ 'novanm',
+ 'desanm',
+ ],
+}
+
+var dayValues = {
+ narrow: ['D', 'L', 'M', 'M', 'J', 'V', 'S'],
+ short: ['di', 'le', 'ma', 'mè', 'je', 'va', 'sa'],
+ abbreviated: ['dim.', 'len.', 'mad.', 'mèk.', 'jed.', 'van.', 'sam.'],
+ wide: ['dimanch', 'lendi', 'madi', 'mèkredi', 'jedi', 'vandredi', 'samdi'],
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minwit',
+ noon: 'midi',
+ morning: 'mat.',
+ afternoon: 'ap.m.',
+ evening: 'swa',
+ night: 'mat.',
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minwit',
+ noon: 'midi',
+ morning: 'maten',
+ afternoon: 'aprèmidi',
+ evening: 'swa',
+ night: 'maten',
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'minwit',
+ noon: 'midi',
+ morning: 'nan maten',
+ afternoon: 'nan aprèmidi',
+ evening: 'nan aswè',
+ night: 'nan maten',
+ },
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var suffix
+
+ if (number === 0) {
+ return number
+ }
+
+ if (unit === 'year' || unit === 'hour' || unit === 'week') {
+ if (number === 1) {
+ suffix = 'ye'
+ } else {
+ suffix = 'yèm'
+ }
+ } else {
+ if (number === 1) {
+ suffix = 'ye'
+ } else {
+ suffix = 'yèm'
+ }
+ }
+
+ return number + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide',
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function (quarter) {
+ return Number(quarter) - 1
+ },
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ }),
+}
+
+export default localize
diff --git a/date-fns/src/locale/ht/_lib/match/index.js b/date-fns/src/locale/ht/_lib/match/index.js
new file mode 100644
index 0000000..2248991
--- /dev/null
+++ b/date-fns/src/locale/ht/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(ye|yèm)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(av\.J\.K|ap\.J\.K|ap\.J\.-K)/i,
+ abbreviated: /^(av\.J\.-K|av\.J-K|apr\.J\.-K|apr\.J-K|ap\.J-K)/i,
+ wide: /^(avan Jezi Kris|apre Jezi Kris)/i,
+}
+var parseEraPatterns = {
+ any: [/^av/i, /^ap/i],
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^t[1234]/i,
+ wide: /^[1234](ye|yèm)? trimès/i,
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i],
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(janv|fevr|mas|avr|me|jen|jiyè|out|sept|okt|nov|des)\.?/i,
+ wide: /^(janvye|fevrye|mas|avril|me|jen|jiyè|out|septanm|oktòb|novanm|desanm)/i,
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^o/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i,
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^ma/i,
+ /^av/i,
+ /^me/i,
+ /^je/i,
+ /^ji/i,
+ /^ou/i,
+ /^s/i,
+ /^ok/i,
+ /^n/i,
+ /^d/i,
+ ],
+}
+
+var matchDayPatterns = {
+ narrow: /^[lmjvsd]/i,
+ short: /^(di|le|ma|me|je|va|sa)/i,
+ abbreviated: /^(dim|len|mad|mèk|jed|van|sam)\.?/i,
+ wide: /^(dimanch|lendi|madi|mèkredi|jedi|vandredi|samdi)/i,
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
+ any: [/^di/i, /^le/i, /^ma/i, /^mè/i, /^je/i, /^va/i, /^sa/i],
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|minwit|midi|mat\.?|ap\.?m\.?|swa)/i,
+ any: /^([ap]\.?\s?m\.?|nan maten|nan aprèmidi|nan aswè)/i,
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^min/i,
+ noon: /^mid/i,
+ morning: /mat/i,
+ afternoon: /ap/i,
+ evening: /sw/i,
+ night: /nwit/i,
+ },
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function (value) {
+ return parseInt(value, 10)
+ },
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function (index) {
+ return index + 1
+ },
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any',
+ }),
+}
+
+export default match
diff --git a/date-fns/src/locale/ht/index.d.ts b/date-fns/src/locale/ht/index.d.ts
new file mode 100644
index 0000000..7362d75
--- /dev/null
+++ b/date-fns/src/locale/ht/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ht } from 'date-fns/locale'
+export default ht
diff --git a/date-fns/src/locale/ht/index.js b/date-fns/src/locale/ht/index.js
new file mode 100644
index 0000000..033406f
--- /dev/null
+++ b/date-fns/src/locale/ht/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Haitian Creole locale.
+ * @language Haitian Creole
+ * @iso-639-2 hat
+ * @author Rubens Mariuzzo [@rmariuzzo]{@link https://github.com/rmariuzzo}
+ * @author Watson Marcelain [@watsongm24]{@link https://github.com/watsongm24}
+ */
+
+var locale = {
+ code: 'ht',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4,
+ },
+}
+
+export default locale
diff --git a/date-fns/src/locale/ht/index.js.flow b/date-fns/src/locale/ht/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ht/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ht/snapshot.md b/date-fns/src/locale/ht/snapshot.md
new file mode 100644
index 0000000..9ffb330
--- /dev/null
+++ b/date-fns/src/locale/ht/snapshot.md
@@ -0,0 +1,304 @@
+# Haitian Creole (ht) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987yèm | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5yèm | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987yèm | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4yèm | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1ye | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2yèm | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1ye trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2yèm trim. | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1ye trimès | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2yèm trimès | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | T1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | T2 | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1ye | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2yèm | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1ye trim. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2yèm trim. | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1ye trimès | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2yèm trimès | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2yèm | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7yèm | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | fevr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jiyè | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | fevrye | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jiyè | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2yèm | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7yèm | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | fevr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jiyè | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | fevrye | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jiyè | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1ye | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48yèm | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1ye | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48yèm | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11yèm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28yèm | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42yèm | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365yèm | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | len. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | van. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | len. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | van. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | len. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | van. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | lendi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vandredi | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | le | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | va | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1ye | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5yèm | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | len. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | van. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | lendi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vandredi | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | le | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | va | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1ye | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5yèm | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | len. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | van. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | lendi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vandredi | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | le | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | va | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1ye | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5yèm | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | len. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | van. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | lendi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vandredi | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | le | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | va | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | maten | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | aprèmidi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | swa | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | maten | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | maten | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | aprèmidi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | swa | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | maten | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | maten | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | aprèmidi | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | swa | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | maten | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | nan maten | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nan aprèmidi | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nan aswè | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nan maten | 2019-02-11T04:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ap.m. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | swa | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | mat. | 2019-02-11T04:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11yèm | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11yèm | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11yèm | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23yèm | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11yèm | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11yèm | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11yèm | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23yèm | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1ye | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55yèm | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1ye | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55yèm | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 fevr. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 me 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 fevrye 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 me 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | mèkredi 11 fevrye 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | dimanch 29 me 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 fevr. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 me 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 fevrye 1987 nan lè 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 me 1453 nan lè 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | mèkredi 11 fevrye 1987 nan lè 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | dimanch 29 me 1453 nan lè 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------------- | ---------------------- | -------------------------- |
+| 2006-01-01T00:00:00.000Z | anviwon 6 an | anviwon 6 an | nan anviwon 6 an |
+| 2005-01-01T00:00:00.000Z | anviwon 5 an | anviwon 5 an | nan anviwon 5 an |
+| 2004-01-01T00:00:00.000Z | anviwon 4 an | anviwon 4 an | nan anviwon 4 an |
+| 2003-01-01T00:00:00.000Z | anviwon 3 an | anviwon 3 an | nan anviwon 3 an |
+| 2002-01-01T00:00:00.000Z | anviwon 2 an | anviwon 2 an | nan anviwon 2 an |
+| 2001-06-01T00:00:00.000Z | plis pase 1 an | plis pase 1 an | nan plis pase 1 an |
+| 2001-02-01T00:00:00.000Z | anviwon 1 an | anviwon 1 an | nan anviwon 1 an |
+| 2001-01-01T00:00:00.000Z | anviwon 1 an | anviwon 1 an | nan anviwon 1 an |
+| 2000-06-01T00:00:00.000Z | 5 mwa | 5 mwa | nan 5 mwa |
+| 2000-03-01T00:00:00.000Z | 2 mwa | 2 mwa | nan 2 mwa |
+| 2000-02-01T00:00:00.000Z | anviwon 1 mwa | anviwon 1 mwa | nan anviwon 1 mwa |
+| 2000-01-15T00:00:00.000Z | 14 jou | 14 jou | nan 14 jou |
+| 2000-01-02T00:00:00.000Z | 1 jou | 1 jou | nan 1 jou |
+| 2000-01-01T06:00:00.000Z | anviwon 6 è | anviwon 6 è | nan anviwon 6 è |
+| 2000-01-01T01:00:00.000Z | anviwon inè | anviwon inè | nan anviwon inè |
+| 2000-01-01T00:45:00.000Z | anviwon inè | anviwon inè | nan anviwon inè |
+| 2000-01-01T00:30:00.000Z | 30 minit | 30 minit | nan 30 minit |
+| 2000-01-01T00:15:00.000Z | 15 minit | 15 minit | nan 15 minit |
+| 2000-01-01T00:01:00.000Z | 1 minit | 1 minit | nan 1 minit |
+| 2000-01-01T00:00:25.000Z | mwens pase yon minit | 30 segond | nan mwens pase yon minit |
+| 2000-01-01T00:00:15.000Z | mwens pase yon minit | mwens pase 20 segond | nan mwens pase yon minit |
+| 2000-01-01T00:00:05.000Z | mwens pase yon minit | mwens pase 10 segond | nan mwens pase yon minit |
+| 2000-01-01T00:00:00.000Z | mwens pase yon minit | mwens pase 5 segond | sa fè mwens pase yon minit |
+| 1999-12-31T23:59:55.000Z | mwens pase yon minit | mwens pase 10 segond | sa fè mwens pase yon minit |
+| 1999-12-31T23:59:45.000Z | mwens pase yon minit | mwens pase 20 segond | sa fè mwens pase yon minit |
+| 1999-12-31T23:59:35.000Z | mwens pase yon minit | 30 segond | sa fè mwens pase yon minit |
+| 1999-12-31T23:59:00.000Z | 1 minit | 1 minit | sa fè 1 minit |
+| 1999-12-31T23:45:00.000Z | 15 minit | 15 minit | sa fè 15 minit |
+| 1999-12-31T23:30:00.000Z | 30 minit | 30 minit | sa fè 30 minit |
+| 1999-12-31T23:15:00.000Z | anviwon inè | anviwon inè | sa fè anviwon inè |
+| 1999-12-31T23:00:00.000Z | anviwon inè | anviwon inè | sa fè anviwon inè |
+| 1999-12-31T18:00:00.000Z | anviwon 6 è | anviwon 6 è | sa fè anviwon 6 è |
+| 1999-12-30T00:00:00.000Z | 2 jou | 2 jou | sa fè 2 jou |
+| 1999-12-15T00:00:00.000Z | 17 jou | 17 jou | sa fè 17 jou |
+| 1999-12-01T00:00:00.000Z | anviwon 1 mwa | anviwon 1 mwa | sa fè anviwon 1 mwa |
+| 1999-11-01T00:00:00.000Z | 2 mwa | 2 mwa | sa fè 2 mwa |
+| 1999-06-01T00:00:00.000Z | 7 mwa | 7 mwa | sa fè 7 mwa |
+| 1999-01-01T00:00:00.000Z | anviwon 1 an | anviwon 1 an | sa fè anviwon 1 an |
+| 1998-12-01T00:00:00.000Z | anviwon 1 an | anviwon 1 an | sa fè anviwon 1 an |
+| 1998-06-01T00:00:00.000Z | plis pase 1 an | plis pase 1 an | sa fè plis pase 1 an |
+| 1998-01-01T00:00:00.000Z | anviwon 2 an | anviwon 2 an | sa fè anviwon 2 an |
+| 1997-01-01T00:00:00.000Z | anviwon 3 an | anviwon 3 an | sa fè anviwon 3 an |
+| 1996-01-01T00:00:00.000Z | anviwon 4 an | anviwon 4 an | sa fè anviwon 4 an |
+| 1995-01-01T00:00:00.000Z | anviwon 5 an | anviwon 5 an | sa fè anviwon 5 an |
+| 1994-01-01T00:00:00.000Z | anviwon 6 an | anviwon 6 an | sa fè anviwon 6 an |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 an | nan 6 an | 52608 lè |
+| 2005-01-01T00:00:00.000Z | 5 an | nan 5 an | 43848 lè |
+| 2004-01-01T00:00:00.000Z | 4 an | nan 4 an | 35064 lè |
+| 2003-01-01T00:00:00.000Z | 3 an | nan 3 an | 26304 lè |
+| 2002-01-01T00:00:00.000Z | 2 an | nan 2 an | 17544 lè |
+| 2001-06-01T00:00:00.000Z | 1 an | nan 1 an | 12408 lè |
+| 2001-02-01T00:00:00.000Z | 1 an | nan 1 an | 9528 lè |
+| 2001-01-01T00:00:00.000Z | 1 an | nan 1 an | 8784 lè |
+| 2000-06-01T00:00:00.000Z | 5 mwa | nan 5 mwa | 3648 lè |
+| 2000-03-01T00:00:00.000Z | 2 mwa | nan 2 mwa | 1440 lè |
+| 2000-02-01T00:00:00.000Z | 1 mwa | nan 1 mwa | 744 lè |
+| 2000-01-15T00:00:00.000Z | 14 jou | nan 14 jou | 336 lè |
+| 2000-01-02T00:00:00.000Z | 1 jou | nan 1 jou | 24 lè |
+| 2000-01-01T06:00:00.000Z | 6 lè | nan 6 lè | 6 lè |
+| 2000-01-01T01:00:00.000Z | 1 lè | nan 1 lè | 1 lè |
+| 2000-01-01T00:45:00.000Z | 45 minit | nan 45 minit | 1 lè |
+| 2000-01-01T00:30:00.000Z | 30 minit | nan 30 minit | 1 lè |
+| 2000-01-01T00:15:00.000Z | 15 minit | nan 15 minit | 0 lè |
+| 2000-01-01T00:01:00.000Z | 1 minit | nan 1 minit | 0 lè |
+| 2000-01-01T00:00:25.000Z | 25 segond | nan 25 segond | 0 lè |
+| 2000-01-01T00:00:15.000Z | 15 segond | nan 15 segond | 0 lè |
+| 2000-01-01T00:00:05.000Z | 5 segond | nan 5 segond | 0 lè |
+| 2000-01-01T00:00:00.000Z | 0 segond | sa fè 0 segond | 0 lè |
+| 1999-12-31T23:59:55.000Z | 5 segond | sa fè 5 segond | 0 lè |
+| 1999-12-31T23:59:45.000Z | 15 segond | sa fè 15 segond | 0 lè |
+| 1999-12-31T23:59:35.000Z | 25 segond | sa fè 25 segond | 0 lè |
+| 1999-12-31T23:59:00.000Z | 1 minit | sa fè 1 minit | 0 lè |
+| 1999-12-31T23:45:00.000Z | 15 minit | sa fè 15 minit | 0 lè |
+| 1999-12-31T23:30:00.000Z | 30 minit | sa fè 30 minit | 1 lè |
+| 1999-12-31T23:15:00.000Z | 45 minit | sa fè 45 minit | 1 lè |
+| 1999-12-31T23:00:00.000Z | 1 lè | sa fè 1 lè | 1 lè |
+| 1999-12-31T18:00:00.000Z | 6 lè | sa fè 6 lè | 6 lè |
+| 1999-12-30T00:00:00.000Z | 2 jou | sa fè 2 jou | 48 lè |
+| 1999-12-15T00:00:00.000Z | 17 jou | sa fè 17 jou | 408 lè |
+| 1999-12-01T00:00:00.000Z | 1 mwa | sa fè 1 mwa | 744 lè |
+| 1999-11-01T00:00:00.000Z | 2 mwa | sa fè 2 mwa | 1464 lè |
+| 1999-06-01T00:00:00.000Z | 7 mwa | sa fè 7 mwa | 5136 lè |
+| 1999-01-01T00:00:00.000Z | 1 an | sa fè 1 an | 8760 lè |
+| 1998-12-01T00:00:00.000Z | 1 an | sa fè 1 an | 9504 lè |
+| 1998-06-01T00:00:00.000Z | 2 an | sa fè 2 an | 13896 lè |
+| 1998-01-01T00:00:00.000Z | 2 an | sa fè 2 an | 17520 lè |
+| 1997-01-01T00:00:00.000Z | 3 an | sa fè 3 an | 26280 lè |
+| 1996-01-01T00:00:00.000Z | 4 an | sa fè 4 an | 35064 lè |
+| 1995-01-01T00:00:00.000Z | 5 an | sa fè 5 an | 43824 lè |
+| 1994-01-01T00:00:00.000Z | 6 an | sa fè 6 an | 52584 lè |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | mèkredi pwochen nan lè 00:00 |
+| 2000-01-02T00:00:00.000Z | demen nan lè 00:00 |
+| 2000-01-01T00:00:00.000Z | jodi a 00:00 |
+| 1999-12-31T00:00:00.000Z | yè nan lè 00:00 |
+| 1999-12-27T00:00:00.000Z | lendi pase nan lè 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/hu/_lib/formatDistance/index.js b/date-fns/src/locale/hu/_lib/formatDistance/index.js
new file mode 100644
index 0000000..97d3af2
--- /dev/null
+++ b/date-fns/src/locale/hu/_lib/formatDistance/index.js
@@ -0,0 +1,92 @@
+var translations = {
+ about: 'körülbelül',
+ over: 'több mint',
+ almost: 'majdnem',
+ lessthan: 'kevesebb mint'
+}
+
+const withoutSuffixes = {
+ xseconds: ' másodperc',
+ halfaminute: 'fél perc',
+ xminutes: ' perc',
+ xhours: ' óra',
+ xdays: ' nap',
+ xweeks: ' hét',
+ xmonths: ' hónap',
+ xyears: ' év'
+}
+
+const withSuffixes = {
+ xseconds: {
+ '-1': ' másodperccel ezelőtt',
+ '1': ' másodperc múlva',
+ '0': ' másodperce'
+ },
+ halfaminute: {
+ '-1': 'fél perccel ezelőtt',
+ '1': 'fél perc múlva',
+ '0': 'fél perce'
+ },
+ xminutes: {
+ '-1': ' perccel ezelőtt',
+ '1': ' perc múlva',
+ '0': ' perce'
+ },
+ xhours: {
+ '-1': ' órával ezelőtt',
+ '1': ' óra múlva',
+ '0': ' órája'
+ },
+ xdays: {
+ '-1': ' nappal ezelőtt',
+ '1': ' nap múlva',
+ '0': ' napja'
+ },
+ xweeks: {
+ '-1': ' héttel ezelőtt',
+ '1': ' hét múlva',
+ '0': ' hete'
+ },
+ xmonths: {
+ '-1': ' hónappal ezelőtt',
+ '1': ' hónap múlva',
+ '0': ' hónapja'
+ },
+ xyears: {
+ '-1': ' évvel ezelőtt',
+ '1': ' év múlva',
+ '0': ' éve'
+ }
+}
+
+function translate(number, addSuffix, key, comparison) {
+ const translated = addSuffix
+ ? withSuffixes[key][comparison]
+ : withoutSuffixes[key]
+
+ if (key === 'halfaminute') {
+ return translated
+ }
+
+ return number + translated
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ var adverb = token.match(/about|over|almost|lessthan/i)
+ var unit = token.replace(adverb, '')
+
+ var result
+ result = translate(
+ count,
+ options.addSuffix,
+ unit.toLowerCase(),
+ options.comparison
+ )
+
+ if (adverb) {
+ result = translations[adverb[0].toLowerCase()] + ' ' + result
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/hu/_lib/formatLong/index.js b/date-fns/src/locale/hu/_lib/formatLong/index.js
new file mode 100644
index 0000000..3dd9916
--- /dev/null
+++ b/date-fns/src/locale/hu/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'y. MMMM d., EEEE',
+ long: 'y. MMMM d.',
+ medium: 'y. MMM d.',
+ short: 'y. MM. dd.'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/hu/_lib/formatRelative/index.js b/date-fns/src/locale/hu/_lib/formatRelative/index.js
new file mode 100644
index 0000000..cfdea74
--- /dev/null
+++ b/date-fns/src/locale/hu/_lib/formatRelative/index.js
@@ -0,0 +1,40 @@
+var accusativeWeekdays = [
+ 'vasárnap',
+ 'hétfőn',
+ 'kedden',
+ 'szerdán',
+ 'csütörtökön',
+ 'pénteken',
+ 'szombaton'
+]
+
+function week(isFuture) {
+ return function(date, _baseDate, _options) {
+ var day = date.getUTCDay()
+ return (
+ (isFuture ? '' : "'múlt' ") +
+ "'" +
+ accusativeWeekdays[day] +
+ "'" +
+ " p'-kor'"
+ )
+ }
+}
+var formatRelativeLocale = {
+ lastWeek: week(false),
+ yesterday: "'tegnap' p'-kor'",
+ today: "'ma' p'-kor'",
+ tomorrow: "'holnap' p'-kor'",
+ nextWeek: week(true),
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/hu/_lib/localize/index.js b/date-fns/src/locale/hu/_lib/localize/index.js
new file mode 100644
index 0000000..fd1e8a2
--- /dev/null
+++ b/date-fns/src/locale/hu/_lib/localize/index.js
@@ -0,0 +1,140 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ie.', 'isz.'],
+ abbreviated: ['i. e.', 'i. sz.'],
+ wide: ['Krisztus előtt', 'időszámításunk szerint']
+}
+
+var quarterValues = {
+ narrow: ['1.', '2.', '3.', '4.'],
+ abbreviated: ['1. n.év', '2. n.év', '3. n.év', '4. n.év'],
+ wide: ['1. negyedév', '2. negyedév', '3. negyedév', '4. negyedév']
+}
+
+var formattingQuarterValues = {
+ narrow: ['I.', 'II.', 'III.', 'IV.'],
+ abbreviated: ['I. n.év', 'II. n.év', 'III. n.év', 'IV. n.év'],
+ wide: ['I. negyedév', 'II. negyedév', 'III. negyedév', 'IV. negyedév']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'Á', 'M', 'J', 'J', 'A', 'Sz', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'febr.',
+ 'márc.',
+ 'ápr.',
+ 'máj.',
+ 'jún.',
+ 'júl.',
+ 'aug.',
+ 'szept.',
+ 'okt.',
+ 'nov.',
+ 'dec.'
+ ],
+ wide: [
+ 'január',
+ 'február',
+ 'március',
+ 'április',
+ 'május',
+ 'június',
+ 'július',
+ 'augusztus',
+ 'szeptember',
+ 'október',
+ 'november',
+ 'december'
+ ]
+}
+
+var dayValues = {
+ narrow: ['V', 'H', 'K', 'Sz', 'Cs', 'P', 'Sz'],
+ short: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
+ abbreviated: ['V', 'H', 'K', 'Sze', 'Cs', 'P', 'Szo'],
+ wide: [
+ 'vasárnap',
+ 'hétfő',
+ 'kedd',
+ 'szerda',
+ 'csütörtök',
+ 'péntek',
+ 'szombat'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'de.',
+ pm: 'du.',
+ midnight: 'éjfél',
+ noon: 'dél',
+ morning: 'reggel',
+ afternoon: 'du.',
+ evening: 'este',
+ night: 'éjjel'
+ },
+ abbreviated: {
+ am: 'de.',
+ pm: 'du.',
+ midnight: 'éjfél',
+ noon: 'dél',
+ morning: 'reggel',
+ afternoon: 'du.',
+ evening: 'este',
+ night: 'éjjel'
+ },
+ wide: {
+ am: 'de.',
+ pm: 'du.',
+ midnight: 'éjfél',
+ noon: 'dél',
+ morning: 'reggel',
+ afternoon: 'délután',
+ evening: 'este',
+ night: 'éjjel'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingQuarterValues,
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/hu/_lib/match/index.js b/date-fns/src/locale/hu/_lib/match/index.js
new file mode 100644
index 0000000..0ac275c
--- /dev/null
+++ b/date-fns/src/locale/hu/_lib/match/index.js
@@ -0,0 +1,138 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\.?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ie\.|isz\.)/i,
+ abbreviated: /^(i\.\s?e\.?|b?\s?c\s?e|i\.\s?sz\.?)/i,
+ wide: /^(Krisztus előtt|időszámításunk előtt|időszámításunk szerint|i\. sz\.)/i
+}
+var parseEraPatterns = {
+ narrow: [/ie/i, /isz/i],
+ abbreviated: [/^(i\.?\s?e\.?|b\s?ce)/i, /^(i\.?\s?sz\.?|c\s?e)/i],
+ any: [/előtt/i, /(szerint|i. sz.)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]\.?/i,
+ abbreviated: /^[1234]?\.?\s?n\.év/i,
+ wide: /^([1234]|I|II|III|IV)?\.?\s?negyedév/i
+}
+var parseQuarterPatterns = {
+ any: [/1|I$/i, /2|II$/i, /3|III/i, /4|IV/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmaásond]|sz/i,
+ abbreviated: /^(jan\.?|febr\.?|márc\.?|ápr\.?|máj\.?|jún\.?|júl\.?|aug\.?|szept\.?|okt\.?|nov\.?|dec\.?)/i,
+ wide: /^(január|február|március|április|május|június|július|augusztus|szeptember|október|november|december)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a|á/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s|sz/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^már/i,
+ /^áp/i,
+ /^máj/i,
+ /^jún/i,
+ /^júl/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^([vhkpc]|sz|cs|sz)/i,
+ short: /^([vhkp]|sze|cs|szo)/i,
+ abbreviated: /^([vhkp]|sze|cs|szo)/i,
+ wide: /^(vasárnap|hétfő|kedd|szerda|csütörtök|péntek|szombat)/i
+}
+var parseDayPatterns = {
+ narrow: [/^v/i, /^h/i, /^k/i, /^sz/i, /^c/i, /^p/i, /^sz/i],
+ any: [/^v/i, /^h/i, /^k/i, /^sze/i, /^c/i, /^p/i, /^szo/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^((de|du)\.?|éjfél|délután|dél|reggel|este|éjjel)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^de\.?/i,
+ pm: /^du\.?/i,
+ midnight: /^éjf/i,
+ noon: /^dé/i,
+ morning: /reg/i,
+ afternoon: /^délu\.?/i,
+ evening: /es/i,
+ night: /éjj/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/hu/index.d.ts b/date-fns/src/locale/hu/index.d.ts
new file mode 100644
index 0000000..979baa6
--- /dev/null
+++ b/date-fns/src/locale/hu/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hu } from 'date-fns/locale'
+export default hu
diff --git a/date-fns/src/locale/hu/index.js b/date-fns/src/locale/hu/index.js
new file mode 100644
index 0000000..13e9cb4
--- /dev/null
+++ b/date-fns/src/locale/hu/index.js
@@ -0,0 +1,33 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ *
+ * @summary Hungarian locale.
+ * @language Hungarian
+ *
+ * @iso-639-2 hun
+ *
+ * @author Pavlo Shpak [@pshpak]{@link https://github.com/pshpak}
+ * @author Eduardo Pardo [@eduardopsll]{@link https://github.com/eduardopsll}
+ * @author Zoltan Szepesi [@twodcube]{@link https://github.com/twodcube}
+ */
+var locale = {
+ code: 'hu',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/hu/index.js.flow b/date-fns/src/locale/hu/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/hu/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/hu/snapshot.md b/date-fns/src/locale/hu/snapshot.md
new file mode 100644
index 0000000..848adac
--- /dev/null
+++ b/date-fns/src/locale/hu/snapshot.md
@@ -0,0 +1,304 @@
+# Hungarian (hu) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | I. n.év | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II. n.év | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | I. negyedév | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II. negyedév | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | I. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II. | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. n.év | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. n.év | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. negyedév | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. negyedév | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | febr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júl. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | február | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | július | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | febr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júl. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | február | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | július | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | hétfő | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | péntek | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | hétfő | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | péntek | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | hétfő | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | péntek | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | hétfő | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | péntek | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | de. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | reggel | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | este | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | éjjel | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | reggel | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | este | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | éjjel | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | reggel | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | este | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | éjjel | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | reggel | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | délután | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | este | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | éjjel | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | reggel | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | du. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | este | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | éjjel | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987. 02. 11. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453. 05. 29. | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987. febr. 11. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453. máj. 29. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987. február 11. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453. május 29. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 1987. február 11., szerda | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453. május 29., vasárnap | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987. 02. 11. 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453. 05. 29. 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987. febr. 11. 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453. máj. 29. 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987. február 11. 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453. május 29. 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 1987. február 11., szerda 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453. május 29., vasárnap 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------------- | -------------------------- | ------------------------------- |
+| 2006-01-01T00:00:00.000Z | körülbelül 6 év | körülbelül 6 év | körülbelül 6 év múlva |
+| 2005-01-01T00:00:00.000Z | körülbelül 5 év | körülbelül 5 év | körülbelül 5 év múlva |
+| 2004-01-01T00:00:00.000Z | körülbelül 4 év | körülbelül 4 év | körülbelül 4 év múlva |
+| 2003-01-01T00:00:00.000Z | körülbelül 3 év | körülbelül 3 év | körülbelül 3 év múlva |
+| 2002-01-01T00:00:00.000Z | körülbelül 2 év | körülbelül 2 év | körülbelül 2 év múlva |
+| 2001-06-01T00:00:00.000Z | több mint 1 év | több mint 1 év | több mint 1 év múlva |
+| 2001-02-01T00:00:00.000Z | körülbelül 1 év | körülbelül 1 év | körülbelül 1 év múlva |
+| 2001-01-01T00:00:00.000Z | körülbelül 1 év | körülbelül 1 év | körülbelül 1 év múlva |
+| 2000-06-01T00:00:00.000Z | 5 hónap | 5 hónap | 5 hónap múlva |
+| 2000-03-01T00:00:00.000Z | 2 hónap | 2 hónap | 2 hónap múlva |
+| 2000-02-01T00:00:00.000Z | körülbelül 1 hónap | körülbelül 1 hónap | körülbelül 1 hónap múlva |
+| 2000-01-15T00:00:00.000Z | 14 nap | 14 nap | 14 nap múlva |
+| 2000-01-02T00:00:00.000Z | 1 nap | 1 nap | 1 nap múlva |
+| 2000-01-01T06:00:00.000Z | körülbelül 6 óra | körülbelül 6 óra | körülbelül 6 óra múlva |
+| 2000-01-01T01:00:00.000Z | körülbelül 1 óra | körülbelül 1 óra | körülbelül 1 óra múlva |
+| 2000-01-01T00:45:00.000Z | körülbelül 1 óra | körülbelül 1 óra | körülbelül 1 óra múlva |
+| 2000-01-01T00:30:00.000Z | 30 perc | 30 perc | 30 perc múlva |
+| 2000-01-01T00:15:00.000Z | 15 perc | 15 perc | 15 perc múlva |
+| 2000-01-01T00:01:00.000Z | 1 perc | 1 perc | 1 perc múlva |
+| 2000-01-01T00:00:25.000Z | kevesebb mint 1 perc | fél perc | kevesebb mint 1 perc múlva |
+| 2000-01-01T00:00:15.000Z | kevesebb mint 1 perc | kevesebb mint 20 másodperc | kevesebb mint 1 perc múlva |
+| 2000-01-01T00:00:05.000Z | kevesebb mint 1 perc | kevesebb mint 10 másodperc | kevesebb mint 1 perc múlva |
+| 2000-01-01T00:00:00.000Z | kevesebb mint 1 perc | kevesebb mint 5 másodperc | kevesebb mint 1 perce |
+| 1999-12-31T23:59:55.000Z | kevesebb mint 1 perc | kevesebb mint 10 másodperc | kevesebb mint 1 perccel ezelőtt |
+| 1999-12-31T23:59:45.000Z | kevesebb mint 1 perc | kevesebb mint 20 másodperc | kevesebb mint 1 perccel ezelőtt |
+| 1999-12-31T23:59:35.000Z | kevesebb mint 1 perc | fél perc | kevesebb mint 1 perccel ezelőtt |
+| 1999-12-31T23:59:00.000Z | 1 perc | 1 perc | 1 perccel ezelőtt |
+| 1999-12-31T23:45:00.000Z | 15 perc | 15 perc | 15 perccel ezelőtt |
+| 1999-12-31T23:30:00.000Z | 30 perc | 30 perc | 30 perccel ezelőtt |
+| 1999-12-31T23:15:00.000Z | körülbelül 1 óra | körülbelül 1 óra | körülbelül 1 órával ezelőtt |
+| 1999-12-31T23:00:00.000Z | körülbelül 1 óra | körülbelül 1 óra | körülbelül 1 órával ezelőtt |
+| 1999-12-31T18:00:00.000Z | körülbelül 6 óra | körülbelül 6 óra | körülbelül 6 órával ezelőtt |
+| 1999-12-30T00:00:00.000Z | 2 nap | 2 nap | 2 nappal ezelőtt |
+| 1999-12-15T00:00:00.000Z | 17 nap | 17 nap | 17 nappal ezelőtt |
+| 1999-12-01T00:00:00.000Z | körülbelül 1 hónap | körülbelül 1 hónap | körülbelül 1 hónappal ezelőtt |
+| 1999-11-01T00:00:00.000Z | 2 hónap | 2 hónap | 2 hónappal ezelőtt |
+| 1999-06-01T00:00:00.000Z | 7 hónap | 7 hónap | 7 hónappal ezelőtt |
+| 1999-01-01T00:00:00.000Z | körülbelül 1 év | körülbelül 1 év | körülbelül 1 évvel ezelőtt |
+| 1998-12-01T00:00:00.000Z | körülbelül 1 év | körülbelül 1 év | körülbelül 1 évvel ezelőtt |
+| 1998-06-01T00:00:00.000Z | több mint 1 év | több mint 1 év | több mint 1 évvel ezelőtt |
+| 1998-01-01T00:00:00.000Z | körülbelül 2 év | körülbelül 2 év | körülbelül 2 évvel ezelőtt |
+| 1997-01-01T00:00:00.000Z | körülbelül 3 év | körülbelül 3 év | körülbelül 3 évvel ezelőtt |
+| 1996-01-01T00:00:00.000Z | körülbelül 4 év | körülbelül 4 év | körülbelül 4 évvel ezelőtt |
+| 1995-01-01T00:00:00.000Z | körülbelül 5 év | körülbelül 5 év | körülbelül 5 évvel ezelőtt |
+| 1994-01-01T00:00:00.000Z | körülbelül 6 év | körülbelül 6 év | körülbelül 6 évvel ezelőtt |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------ | ----------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 év | 6 év múlva | 52608 óra |
+| 2005-01-01T00:00:00.000Z | 5 év | 5 év múlva | 43848 óra |
+| 2004-01-01T00:00:00.000Z | 4 év | 4 év múlva | 35064 óra |
+| 2003-01-01T00:00:00.000Z | 3 év | 3 év múlva | 26304 óra |
+| 2002-01-01T00:00:00.000Z | 2 év | 2 év múlva | 17544 óra |
+| 2001-06-01T00:00:00.000Z | 1 év | 1 év múlva | 12408 óra |
+| 2001-02-01T00:00:00.000Z | 1 év | 1 év múlva | 9528 óra |
+| 2001-01-01T00:00:00.000Z | 1 év | 1 év múlva | 8784 óra |
+| 2000-06-01T00:00:00.000Z | 5 hónap | 5 hónap múlva | 3648 óra |
+| 2000-03-01T00:00:00.000Z | 2 hónap | 2 hónap múlva | 1440 óra |
+| 2000-02-01T00:00:00.000Z | 1 hónap | 1 hónap múlva | 744 óra |
+| 2000-01-15T00:00:00.000Z | 14 nap | 14 nap múlva | 336 óra |
+| 2000-01-02T00:00:00.000Z | 1 nap | 1 nap múlva | 24 óra |
+| 2000-01-01T06:00:00.000Z | 6 óra | 6 óra múlva | 6 óra |
+| 2000-01-01T01:00:00.000Z | 1 óra | 1 óra múlva | 1 óra |
+| 2000-01-01T00:45:00.000Z | 45 perc | 45 perc múlva | 1 óra |
+| 2000-01-01T00:30:00.000Z | 30 perc | 30 perc múlva | 1 óra |
+| 2000-01-01T00:15:00.000Z | 15 perc | 15 perc múlva | 0 óra |
+| 2000-01-01T00:01:00.000Z | 1 perc | 1 perc múlva | 0 óra |
+| 2000-01-01T00:00:25.000Z | 25 másodperc | 25 másodperc múlva | 0 óra |
+| 2000-01-01T00:00:15.000Z | 15 másodperc | 15 másodperc múlva | 0 óra |
+| 2000-01-01T00:00:05.000Z | 5 másodperc | 5 másodperc múlva | 0 óra |
+| 2000-01-01T00:00:00.000Z | 0 másodperc | 0 másodperce | 0 óra |
+| 1999-12-31T23:59:55.000Z | 5 másodperc | 5 másodperccel ezelőtt | 0 óra |
+| 1999-12-31T23:59:45.000Z | 15 másodperc | 15 másodperccel ezelőtt | 0 óra |
+| 1999-12-31T23:59:35.000Z | 25 másodperc | 25 másodperccel ezelőtt | 0 óra |
+| 1999-12-31T23:59:00.000Z | 1 perc | 1 perccel ezelőtt | 0 óra |
+| 1999-12-31T23:45:00.000Z | 15 perc | 15 perccel ezelőtt | 0 óra |
+| 1999-12-31T23:30:00.000Z | 30 perc | 30 perccel ezelőtt | 1 óra |
+| 1999-12-31T23:15:00.000Z | 45 perc | 45 perccel ezelőtt | 1 óra |
+| 1999-12-31T23:00:00.000Z | 1 óra | 1 órával ezelőtt | 1 óra |
+| 1999-12-31T18:00:00.000Z | 6 óra | 6 órával ezelőtt | 6 óra |
+| 1999-12-30T00:00:00.000Z | 2 nap | 2 nappal ezelőtt | 48 óra |
+| 1999-12-15T00:00:00.000Z | 17 nap | 17 nappal ezelőtt | 408 óra |
+| 1999-12-01T00:00:00.000Z | 1 hónap | 1 hónappal ezelőtt | 744 óra |
+| 1999-11-01T00:00:00.000Z | 2 hónap | 2 hónappal ezelőtt | 1464 óra |
+| 1999-06-01T00:00:00.000Z | 7 hónap | 7 hónappal ezelőtt | 5136 óra |
+| 1999-01-01T00:00:00.000Z | 1 év | 1 évvel ezelőtt | 8760 óra |
+| 1998-12-01T00:00:00.000Z | 1 év | 1 évvel ezelőtt | 9504 óra |
+| 1998-06-01T00:00:00.000Z | 2 év | 2 évvel ezelőtt | 13896 óra |
+| 1998-01-01T00:00:00.000Z | 2 év | 2 évvel ezelőtt | 17520 óra |
+| 1997-01-01T00:00:00.000Z | 3 év | 3 évvel ezelőtt | 26280 óra |
+| 1996-01-01T00:00:00.000Z | 4 év | 4 évvel ezelőtt | 35064 óra |
+| 1995-01-01T00:00:00.000Z | 5 év | 5 évvel ezelőtt | 43824 óra |
+| 1994-01-01T00:00:00.000Z | 6 év | 6 évvel ezelőtt | 52584 óra |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------- |
+| 2000-01-10T00:00:00.000Z | 2000. 01. 10. |
+| 2000-01-05T00:00:00.000Z | szerdán 0:00-kor |
+| 2000-01-02T00:00:00.000Z | holnap 0:00-kor |
+| 2000-01-01T00:00:00.000Z | ma 0:00-kor |
+| 1999-12-31T00:00:00.000Z | tegnap 0:00-kor |
+| 1999-12-27T00:00:00.000Z | múlt hétfőn 0:00-kor |
+| 1999-12-21T00:00:00.000Z | 1999. 12. 21. |
diff --git a/date-fns/src/locale/hy/_lib/formatDistance/index.js b/date-fns/src/locale/hy/_lib/formatDistance/index.js
new file mode 100644
index 0000000..1a13041
--- /dev/null
+++ b/date-fns/src/locale/hy/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'ավելի քիչ քան 1 վայրկյան',
+ other: 'ավելի քիչ քան {{count}} վայրկյան'
+ },
+
+ xSeconds: {
+ one: '1 վայրկյան',
+ other: '{{count}} վայրկյան'
+ },
+
+ halfAMinute: 'կես րոպե',
+
+ lessThanXMinutes: {
+ one: 'ավելի քիչ քան 1 րոպե',
+ other: 'ավելի քիչ քան {{count}} րոպե'
+ },
+
+ xMinutes: {
+ one: '1 րոպե',
+ other: '{{count}} րոպե'
+ },
+
+ aboutXHours: {
+ one: 'մոտ 1 ժամ',
+ other: 'մոտ {{count}} ժամ'
+ },
+
+ xHours: {
+ one: '1 ժամ',
+ other: '{{count}} ժամ'
+ },
+
+ xDays: {
+ one: '1 օր',
+ other: '{{count}} օր'
+ },
+
+ aboutXWeeks: {
+ one: 'մոտ 1 շաբաթ',
+ other: 'մոտ {{count}} շաբաթ'
+ },
+
+ xWeeks: {
+ one: '1 շաբաթ',
+ other: '{{count}} շաբաթ'
+ },
+
+ aboutXMonths: {
+ one: 'մոտ 1 ամիս',
+ other: 'մոտ {{count}} ամիս'
+ },
+
+ xMonths: {
+ one: '1 ամիս',
+ other: '{{count}} ամիս'
+ },
+
+ aboutXYears: {
+ one: 'մոտ 1 տարի',
+ other: 'մոտ {{count}} տարի'
+ },
+
+ xYears: {
+ one: '1 տարի',
+ other: '{{count}} տարի'
+ },
+
+ overXYears: {
+ one: 'ավելի քան 1 տարի',
+ other: 'ավելի քան {{count}} տարի'
+ },
+
+ almostXYears: {
+ one: 'համարյա 1 տարի',
+ other: 'համարյա {{count}} տարի'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ var result
+
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' հետո'
+ } else {
+ return result + ' առաջ'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/hy/_lib/formatLong/index.js b/date-fns/src/locale/hy/_lib/formatLong/index.js
new file mode 100644
index 0000000..ba7518c
--- /dev/null
+++ b/date-fns/src/locale/hy/_lib/formatLong/index.js
@@ -0,0 +1,36 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'd MMMM, y, EEEE',
+ long: 'd MMMM, y',
+ medium: 'd MMM, y',
+ short: 'dd.MM.yyyy'
+}
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+var dateTimeFormats = {
+ full: "{{date}} 'ժ․'{{time}}",
+ long: "{{date}} 'ժ․'{{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+export default formatLong
diff --git a/date-fns/src/locale/hy/_lib/formatRelative/index.js b/date-fns/src/locale/hy/_lib/formatRelative/index.js
new file mode 100644
index 0000000..60c8bf3
--- /dev/null
+++ b/date-fns/src/locale/hy/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'նախորդ' eeee p'֊ին'",
+ yesterday: "'երեկ' p'֊ին'",
+ today: "'այսօր' p'֊ին'",
+ tomorrow: "'վաղը' p'֊ին'",
+ nextWeek: "'հաջորդ' eeee p'֊ին'",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/hy/_lib/localize/index.js b/date-fns/src/locale/hy/_lib/localize/index.js
new file mode 100644
index 0000000..acd4bbb
--- /dev/null
+++ b/date-fns/src/locale/hy/_lib/localize/index.js
@@ -0,0 +1,179 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['Ք', 'Մ'],
+ abbreviated: ['ՔԱ', 'ՄԹ'],
+ wide: ['Քրիստոսից առաջ', 'Մեր թվարկության']
+}
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Ք1', 'Ք2', 'Ք3', 'Ք4'],
+ wide: ['1֊ին քառորդ', '2֊րդ քառորդ', '3֊րդ քառորդ', '4֊րդ քառորդ']
+}
+var monthValues = {
+ narrow: ['Հ', 'Փ', 'Մ', 'Ա', 'Մ', 'Հ', 'Հ', 'Օ', 'Ս', 'Հ', 'Ն', 'Դ'],
+ abbreviated: [
+ 'հուն',
+ 'փետ',
+ 'մար',
+ 'ապր',
+ 'մայ',
+ 'հուն',
+ 'հուլ',
+ 'օգս',
+ 'սեպ',
+ 'հոկ',
+ 'նոյ',
+ 'դեկ'
+ ],
+ wide: [
+ 'հունվար',
+ 'փետրվար',
+ 'մարտ',
+ 'ապրիլ',
+ 'մայիս',
+ 'հունիս',
+ 'հուլիս',
+ 'օգոստոս',
+ 'սեպտեմբեր',
+ 'հոկտեմբեր',
+ 'նոյեմբեր',
+ 'դեկտեմբեր'
+ ]
+}
+var dayValues = {
+ narrow: ['Կ', 'Ե', 'Ե', 'Չ', 'Հ', 'Ո', 'Շ'],
+ short: ['կր', 'եր', 'եք', 'չք', 'հգ', 'ուր', 'շբ'],
+ abbreviated: ['կիր', 'երկ', 'երք', 'չոր', 'հնգ', 'ուրբ', 'շաբ'],
+ wide: [
+ 'կիրակի',
+ 'երկուշաբթի',
+ 'երեքշաբթի',
+ 'չորեքշաբթի',
+ 'հինգշաբթի',
+ 'ուրբաթ',
+ 'շաբաթ'
+ ]
+}
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'կեսգշ',
+ noon: 'կեսօր',
+ morning: 'առավոտ',
+ afternoon: 'ցերեկ',
+ evening: 'երեկո',
+ night: 'գիշեր'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'կեսգիշեր',
+ noon: 'կեսօր',
+ morning: 'առավոտ',
+ afternoon: 'ցերեկ',
+ evening: 'երեկո',
+ night: 'գիշեր'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'կեսգիշեր',
+ noon: 'կեսօր',
+ morning: 'առավոտ',
+ afternoon: 'ցերեկ',
+ evening: 'երեկո',
+ night: 'գիշեր'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'կեսգշ',
+ noon: 'կեսօր',
+ morning: 'առավոտը',
+ afternoon: 'ցերեկը',
+ evening: 'երեկոյան',
+ night: 'գիշերը'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'կեսգիշերին',
+ noon: 'կեսօրին',
+ morning: 'առավոտը',
+ afternoon: 'ցերեկը',
+ evening: 'երեկոյան',
+ night: 'գիշերը'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'կեսգիշերին',
+ noon: 'կեսօրին',
+ morning: 'առավոտը',
+ afternoon: 'ցերեկը',
+ evening: 'երեկոյան',
+ night: 'գիշերը'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber) // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ var rem100 = number % 100
+
+ if (rem100 < 10) {
+ if (rem100 % 10 === 1) {
+ return number + '֊ին'
+ }
+ }
+
+ return number + '֊րդ'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/hy/_lib/match/index.js b/date-fns/src/locale/hy/_lib/match/index.js
new file mode 100644
index 0000000..3078402
--- /dev/null
+++ b/date-fns/src/locale/hy/_lib/match/index.js
@@ -0,0 +1,139 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)((-|֊)?(ին|րդ))?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(Ք|Մ)/i,
+ abbreviated: /^(Ք\.?\s?Ա\.?|Մ\.?\s?Թ\.?\s?Ա\.?|Մ\.?\s?Թ\.?|Ք\.?\s?Հ\.?)/i,
+ wide: /^(քրիստոսից առաջ|մեր թվարկությունից առաջ|մեր թվարկության|քրիստոսից հետո)/i
+}
+var parseEraPatterns = {
+ any: [/^(ք|մ)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^ք[1234]/i,
+ wide: /^[1234]((-|֊)?(ին|րդ)) քառորդ/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[հփմաօսնդ]/i,
+ abbreviated: /^(հուն|փետ|մար|ապր|մայ|հուն|հուլ|օգս|սեպ|հոկ|նոյ|դեկ)/i,
+ wide: /^(հունվար|փետրվար|մարտ|ապրիլ|մայիս|հունիս|հուլիս|օգոստոս|սեպտեմբեր|հոկտեմբեր|նոյեմբեր|դեկտեմբեր)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^հ/i,
+ /^փ/i,
+ /^մ/i,
+ /^ա/i,
+ /^մ/i,
+ /^հ/i,
+ /^հ/i,
+ /^օ/i,
+ /^ս/i,
+ /^հ/i,
+ /^ն/i,
+ /^դ/i
+ ],
+ any: [
+ /^հու/i,
+ /^փ/i,
+ /^մար/i,
+ /^ա/i,
+ /^մայ/i,
+ /^հուն/i,
+ /^հուլ/i,
+ /^օ/i,
+ /^ս/i,
+ /^հոկ/i,
+ /^ն/i,
+ /^դ/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[եչհոշկ]/i,
+ short: /^(կր|եր|եք|չք|հգ|ուր|շբ)/i,
+ abbreviated: /^(կիր|երկ|երք|չոր|հնգ|ուրբ|շաբ)/i,
+ wide: /^(կիրակի|երկուշաբթի|երեքշաբթի|չորեքշաբթի|հինգշաբթի|ուրբաթ|շաբաթ)/i
+}
+var parseDayPatterns = {
+ narrow: [/^կ/i, /^ե/i, /^ե/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i],
+ short: [/^կ/i, /^եր/i, /^եք/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i],
+ abbreviated: [/^կ/i, /^երկ/i, /^երք/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i],
+ wide: [/^կ/i, /^երկ/i, /^երե/i, /^չ/i, /^հ/i, /^(ո|Ո)/, /^շ/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^([ap]|կեսգշ|կեսօր|(առավոտը?|ցերեկը?|երեկո(յան)?|գիշերը?))/i,
+ any: /^([ap]\.?\s?m\.?|կեսգիշեր(ին)?|կեսօր(ին)?|(առավոտը?|ցերեկը?|երեկո(յան)?|գիշերը?))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /կեսգիշեր/i,
+ noon: /կեսօր/i,
+ morning: /առավոտ/i,
+ afternoon: /ցերեկ/i,
+ evening: /երեկո/i,
+ night: /գիշեր/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/hy/index.d.ts b/date-fns/src/locale/hy/index.d.ts
new file mode 100644
index 0000000..a79f29e
--- /dev/null
+++ b/date-fns/src/locale/hy/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { hy } from 'date-fns/locale'
+export default hy
diff --git a/date-fns/src/locale/hy/index.js b/date-fns/src/locale/hy/index.js
new file mode 100644
index 0000000..25a68f3
--- /dev/null
+++ b/date-fns/src/locale/hy/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Armenian locale
+ * @language Armenian
+ * @iso-639-2 arm
+ * @author Alex Igityan [@alexigityan]{@link https://github.com/alexigityan}
+ */
+
+var locale = {
+ code: 'hy',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/hy/index.js.flow b/date-fns/src/locale/hy/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/hy/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/hy/snapshot.md b/date-fns/src/locale/hy/snapshot.md
new file mode 100644
index 0000000..bd98019
--- /dev/null
+++ b/date-fns/src/locale/hy/snapshot.md
@@ -0,0 +1,304 @@
+# Armenian (hy) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987֊րդ | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5֊րդ | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987֊րդ | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5֊րդ | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1֊ին | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2֊րդ | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Ք1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Ք2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1֊ին քառորդ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2֊րդ քառորդ | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1֊ին | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2֊րդ | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Ք1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Ք2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1֊ին քառորդ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2֊րդ քառորդ | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2֊րդ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7֊րդ | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | փետ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | հուլ | 2019-01-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | փետրվար | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | հուլիս | 2019-01-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Փ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Հ | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2֊րդ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7֊րդ | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | փետ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | հուլ | 2019-01-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | փետրվար | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | հուլիս | 2019-01-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Փ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Հ | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1֊ին | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48֊րդ | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1֊ին | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48֊րդ | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11֊րդ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28֊րդ | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42֊րդ | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365֊րդ | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | երկ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբ | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | երկ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբ | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | երկ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբ | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | երկուշաբթի | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբաթ | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | Ե | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ո | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | եր | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուր | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1֊ին | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5֊րդ | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | երկ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբ | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | երկուշաբթի | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբաթ | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | Ե | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ո | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | եր | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուր | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1֊ին | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5֊րդ | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | երկ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբ | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | երկուշաբթի | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբաթ | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | Ե | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ո | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | եր | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուր | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1֊ին | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5֊րդ | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | երկ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբ | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | երկուշաբթի | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուրբաթ | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | Ե | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ո | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | եր | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ուր | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | առավոտը | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ցերեկը | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | երեկոյան | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | գիշերը | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | առավոտը | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ցերեկը | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | երեկոյան | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | գիշերը | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | առավոտը | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ցերեկը | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | երեկոյան | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | գիշերը | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | առավոտը | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ցերեկը | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | երեկոյան | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | գիշերը | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | առավոտը | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ցերեկը | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | երեկոյան | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | գիշերը | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11֊րդ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11֊րդ | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11֊րդ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23֊րդ | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11֊րդ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11֊րդ | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11֊րդ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23֊րդ | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1֊ին | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55֊րդ | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1֊ին | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55֊րդ | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 փետ, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 մայ, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 փետրվար, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 մայիս, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 11 փետրվար, 1987, չորեքշաբթի | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 մայիս, 1453, կիրակի | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 փետ, 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 մայ, 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 փետրվար, 1987 ժ․12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 մայիս, 1453 ժ․23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 11 փետրվար, 1987, չորեքշաբթի ժ․12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 մայիս, 1453, կիրակի ժ․23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------------- | ------------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | մոտ 6 տարի | մոտ 6 տարի | մոտ 6 տարի հետո |
+| 2005-01-01T00:00:00.000Z | մոտ 5 տարի | մոտ 5 տարի | մոտ 5 տարի հետո |
+| 2004-01-01T00:00:00.000Z | մոտ 4 տարի | մոտ 4 տարի | մոտ 4 տարի հետո |
+| 2003-01-01T00:00:00.000Z | մոտ 3 տարի | մոտ 3 տարի | մոտ 3 տարի հետո |
+| 2002-01-01T00:00:00.000Z | մոտ 2 տարի | մոտ 2 տարի | մոտ 2 տարի հետո |
+| 2001-06-01T00:00:00.000Z | ավելի քան 1 տարի | ավելի քան 1 տարի | ավելի քան 1 տարի հետո |
+| 2001-02-01T00:00:00.000Z | մոտ 1 տարի | մոտ 1 տարի | մոտ 1 տարի հետո |
+| 2001-01-01T00:00:00.000Z | մոտ 1 տարի | մոտ 1 տարի | մոտ 1 տարի հետո |
+| 2000-06-01T00:00:00.000Z | 5 ամիս | 5 ամիս | 5 ամիս հետո |
+| 2000-03-01T00:00:00.000Z | 2 ամիս | 2 ամիս | 2 ամիս հետո |
+| 2000-02-01T00:00:00.000Z | մոտ 1 ամիս | մոտ 1 ամիս | մոտ 1 ամիս հետո |
+| 2000-01-15T00:00:00.000Z | 14 օր | 14 օր | 14 օր հետո |
+| 2000-01-02T00:00:00.000Z | 1 օր | 1 օր | 1 օր հետո |
+| 2000-01-01T06:00:00.000Z | մոտ 6 ժամ | մոտ 6 ժամ | մոտ 6 ժամ հետո |
+| 2000-01-01T01:00:00.000Z | մոտ 1 ժամ | մոտ 1 ժամ | մոտ 1 ժամ հետո |
+| 2000-01-01T00:45:00.000Z | մոտ 1 ժամ | մոտ 1 ժամ | մոտ 1 ժամ հետո |
+| 2000-01-01T00:30:00.000Z | 30 րոպե | 30 րոպե | 30 րոպե հետո |
+| 2000-01-01T00:15:00.000Z | 15 րոպե | 15 րոպե | 15 րոպե հետո |
+| 2000-01-01T00:01:00.000Z | 1 րոպե | 1 րոպե | 1 րոպե հետո |
+| 2000-01-01T00:00:25.000Z | ավելի քիչ քան 1 րոպե | կես րոպե | ավելի քիչ քան 1 րոպե հետո |
+| 2000-01-01T00:00:15.000Z | ավելի քիչ քան 1 րոպե | ավելի քիչ քան 20 վայրկյան | ավելի քիչ քան 1 րոպե հետո |
+| 2000-01-01T00:00:05.000Z | ավելի քիչ քան 1 րոպե | ավելի քիչ քան 10 վայրկյան | ավելի քիչ քան 1 րոպե հետո |
+| 2000-01-01T00:00:00.000Z | ավելի քիչ քան 1 րոպե | ավելի քիչ քան 5 վայրկյան | ավելի քիչ քան 1 րոպե առաջ |
+| 1999-12-31T23:59:55.000Z | ավելի քիչ քան 1 րոպե | ավելի քիչ քան 10 վայրկյան | ավելի քիչ քան 1 րոպե առաջ |
+| 1999-12-31T23:59:45.000Z | ավելի քիչ քան 1 րոպե | ավելի քիչ քան 20 վայրկյան | ավելի քիչ քան 1 րոպե առաջ |
+| 1999-12-31T23:59:35.000Z | ավելի քիչ քան 1 րոպե | կես րոպե | ավելի քիչ քան 1 րոպե առաջ |
+| 1999-12-31T23:59:00.000Z | 1 րոպե | 1 րոպե | 1 րոպե առաջ |
+| 1999-12-31T23:45:00.000Z | 15 րոպե | 15 րոպե | 15 րոպե առաջ |
+| 1999-12-31T23:30:00.000Z | 30 րոպե | 30 րոպե | 30 րոպե առաջ |
+| 1999-12-31T23:15:00.000Z | մոտ 1 ժամ | մոտ 1 ժամ | մոտ 1 ժամ առաջ |
+| 1999-12-31T23:00:00.000Z | մոտ 1 ժամ | մոտ 1 ժամ | մոտ 1 ժամ առաջ |
+| 1999-12-31T18:00:00.000Z | մոտ 6 ժամ | մոտ 6 ժամ | մոտ 6 ժամ առաջ |
+| 1999-12-30T00:00:00.000Z | 2 օր | 2 օր | 2 օր առաջ |
+| 1999-12-15T00:00:00.000Z | 17 օր | 17 օր | 17 օր առաջ |
+| 1999-12-01T00:00:00.000Z | մոտ 1 ամիս | մոտ 1 ամիս | մոտ 1 ամիս առաջ |
+| 1999-11-01T00:00:00.000Z | 2 ամիս | 2 ամիս | 2 ամիս առաջ |
+| 1999-06-01T00:00:00.000Z | 7 ամիս | 7 ամիս | 7 ամիս առաջ |
+| 1999-01-01T00:00:00.000Z | մոտ 1 տարի | մոտ 1 տարի | մոտ 1 տարի առաջ |
+| 1998-12-01T00:00:00.000Z | մոտ 1 տարի | մոտ 1 տարի | մոտ 1 տարի առաջ |
+| 1998-06-01T00:00:00.000Z | ավելի քան 1 տարի | ավելի քան 1 տարի | ավելի քան 1 տարի առաջ |
+| 1998-01-01T00:00:00.000Z | մոտ 2 տարի | մոտ 2 տարի | մոտ 2 տարի առաջ |
+| 1997-01-01T00:00:00.000Z | մոտ 3 տարի | մոտ 3 տարի | մոտ 3 տարի առաջ |
+| 1996-01-01T00:00:00.000Z | մոտ 4 տարի | մոտ 4 տարի | մոտ 4 տարի առաջ |
+| 1995-01-01T00:00:00.000Z | մոտ 5 տարի | մոտ 5 տարի | մոտ 5 տարի առաջ |
+| 1994-01-01T00:00:00.000Z | մոտ 6 տարի | մոտ 6 տարի | մոտ 6 տարի առաջ |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 տարի | 6 տարի հետո | 52608 ժամ |
+| 2005-01-01T00:00:00.000Z | 5 տարի | 5 տարի հետո | 43848 ժամ |
+| 2004-01-01T00:00:00.000Z | 4 տարի | 4 տարի հետո | 35064 ժամ |
+| 2003-01-01T00:00:00.000Z | 3 տարի | 3 տարի հետո | 26304 ժամ |
+| 2002-01-01T00:00:00.000Z | 2 տարի | 2 տարի հետո | 17544 ժամ |
+| 2001-06-01T00:00:00.000Z | 1 տարի | 1 տարի հետո | 12408 ժամ |
+| 2001-02-01T00:00:00.000Z | 1 տարի | 1 տարի հետո | 9528 ժամ |
+| 2001-01-01T00:00:00.000Z | 1 տարի | 1 տարի հետո | 8784 ժամ |
+| 2000-06-01T00:00:00.000Z | 5 ամիս | 5 ամիս հետո | 3648 ժամ |
+| 2000-03-01T00:00:00.000Z | 2 ամիս | 2 ամիս հետո | 1440 ժամ |
+| 2000-02-01T00:00:00.000Z | 1 ամիս | 1 ամիս հետո | 744 ժամ |
+| 2000-01-15T00:00:00.000Z | 14 օր | 14 օր հետո | 336 ժամ |
+| 2000-01-02T00:00:00.000Z | 1 օր | 1 օր հետո | 24 ժամ |
+| 2000-01-01T06:00:00.000Z | 6 ժամ | 6 ժամ հետո | 6 ժամ |
+| 2000-01-01T01:00:00.000Z | 1 ժամ | 1 ժամ հետո | 1 ժամ |
+| 2000-01-01T00:45:00.000Z | 45 րոպե | 45 րոպե հետո | 1 ժամ |
+| 2000-01-01T00:30:00.000Z | 30 րոպե | 30 րոպե հետո | 1 ժամ |
+| 2000-01-01T00:15:00.000Z | 15 րոպե | 15 րոպե հետո | 0 ժամ |
+| 2000-01-01T00:01:00.000Z | 1 րոպե | 1 րոպե հետո | 0 ժամ |
+| 2000-01-01T00:00:25.000Z | 25 վայրկյան | 25 վայրկյան հետո | 0 ժամ |
+| 2000-01-01T00:00:15.000Z | 15 վայրկյան | 15 վայրկյան հետո | 0 ժամ |
+| 2000-01-01T00:00:05.000Z | 5 վայրկյան | 5 վայրկյան հետո | 0 ժամ |
+| 2000-01-01T00:00:00.000Z | 0 վայրկյան | 0 վայրկյան առաջ | 0 ժամ |
+| 1999-12-31T23:59:55.000Z | 5 վայրկյան | 5 վայրկյան առաջ | 0 ժամ |
+| 1999-12-31T23:59:45.000Z | 15 վայրկյան | 15 վայրկյան առաջ | 0 ժամ |
+| 1999-12-31T23:59:35.000Z | 25 վայրկյան | 25 վայրկյան առաջ | 0 ժամ |
+| 1999-12-31T23:59:00.000Z | 1 րոպե | 1 րոպե առաջ | 0 ժամ |
+| 1999-12-31T23:45:00.000Z | 15 րոպե | 15 րոպե առաջ | 0 ժամ |
+| 1999-12-31T23:30:00.000Z | 30 րոպե | 30 րոպե առաջ | 1 ժամ |
+| 1999-12-31T23:15:00.000Z | 45 րոպե | 45 րոպե առաջ | 1 ժամ |
+| 1999-12-31T23:00:00.000Z | 1 ժամ | 1 ժամ առաջ | 1 ժամ |
+| 1999-12-31T18:00:00.000Z | 6 ժամ | 6 ժամ առաջ | 6 ժամ |
+| 1999-12-30T00:00:00.000Z | 2 օր | 2 օր առաջ | 48 ժամ |
+| 1999-12-15T00:00:00.000Z | 17 օր | 17 օր առաջ | 408 ժամ |
+| 1999-12-01T00:00:00.000Z | 1 ամիս | 1 ամիս առաջ | 744 ժամ |
+| 1999-11-01T00:00:00.000Z | 2 ամիս | 2 ամիս առաջ | 1464 ժամ |
+| 1999-06-01T00:00:00.000Z | 7 ամիս | 7 ամիս առաջ | 5136 ժամ |
+| 1999-01-01T00:00:00.000Z | 1 տարի | 1 տարի առաջ | 8760 ժամ |
+| 1998-12-01T00:00:00.000Z | 1 տարի | 1 տարի առաջ | 9504 ժամ |
+| 1998-06-01T00:00:00.000Z | 2 տարի | 2 տարի առաջ | 13896 ժամ |
+| 1998-01-01T00:00:00.000Z | 2 տարի | 2 տարի առաջ | 17520 ժամ |
+| 1997-01-01T00:00:00.000Z | 3 տարի | 3 տարի առաջ | 26280 ժամ |
+| 1996-01-01T00:00:00.000Z | 4 տարի | 4 տարի առաջ | 35064 ժամ |
+| 1995-01-01T00:00:00.000Z | 5 տարի | 5 տարի առաջ | 43824 ժամ |
+| 1994-01-01T00:00:00.000Z | 6 տարի | 6 տարի առաջ | 52584 ժամ |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | հաջորդ չորեքշաբթի 00:00֊ին |
+| 2000-01-02T00:00:00.000Z | վաղը 00:00֊ին |
+| 2000-01-01T00:00:00.000Z | այսօր 00:00֊ին |
+| 1999-12-31T00:00:00.000Z | երեկ 00:00֊ին |
+| 1999-12-27T00:00:00.000Z | նախորդ երկուշաբթի 00:00֊ին |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/id/_lib/formatDistance/index.js b/date-fns/src/locale/id/_lib/formatDistance/index.js
new file mode 100644
index 0000000..2c19c22
--- /dev/null
+++ b/date-fns/src/locale/id/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'kurang dari 1 detik',
+ other: 'kurang dari {{count}} detik'
+ },
+
+ xSeconds: {
+ one: '1 detik',
+ other: '{{count}} detik'
+ },
+
+ halfAMinute: 'setengah menit',
+
+ lessThanXMinutes: {
+ one: 'kurang dari 1 menit',
+ other: 'kurang dari {{count}} menit'
+ },
+
+ xMinutes: {
+ one: '1 menit',
+ other: '{{count}} menit'
+ },
+
+ aboutXHours: {
+ one: 'sekitar 1 jam',
+ other: 'sekitar {{count}} jam'
+ },
+
+ xHours: {
+ one: '1 jam',
+ other: '{{count}} jam'
+ },
+
+ xDays: {
+ one: '1 hari',
+ other: '{{count}} hari'
+ },
+
+ aboutXWeeks: {
+ one: 'sekitar 1 minggu',
+ other: 'sekitar {{count}} minggu'
+ },
+
+ xWeeks: {
+ one: '1 minggu',
+ other: '{{count}} minggu'
+ },
+
+ aboutXMonths: {
+ one: 'sekitar 1 bulan',
+ other: 'sekitar {{count}} bulan'
+ },
+
+ xMonths: {
+ one: '1 bulan',
+ other: '{{count}} bulan'
+ },
+
+ aboutXYears: {
+ one: 'sekitar 1 tahun',
+ other: 'sekitar {{count}} tahun'
+ },
+
+ xYears: {
+ one: '1 tahun',
+ other: '{{count}} tahun'
+ },
+
+ overXYears: {
+ one: 'lebih dari 1 tahun',
+ other: 'lebih dari {{count}} tahun'
+ },
+
+ almostXYears: {
+ one: 'hampir 1 tahun',
+ other: 'hampir {{count}} tahun'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'dalam waktu ' + result
+ } else {
+ return result + ' yang lalu'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/id/_lib/formatLong/index.js b/date-fns/src/locale/id/_lib/formatLong/index.js
new file mode 100644
index 0000000..d8ea107
--- /dev/null
+++ b/date-fns/src/locale/id/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'd/M/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH.mm.ss',
+ long: 'HH.mm.ss',
+ medium: 'HH.mm',
+ short: 'HH.mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'pukul' {{time}}",
+ long: "{{date}} 'pukul' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/id/_lib/formatRelative/index.js b/date-fns/src/locale/id/_lib/formatRelative/index.js
new file mode 100644
index 0000000..ed8fa29
--- /dev/null
+++ b/date-fns/src/locale/id/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'lalu pukul' p",
+ yesterday: "'Kemarin pukul' p",
+ today: "'Hari ini pukul' p",
+ tomorrow: "'Besok pukul' p",
+ nextWeek: "eeee 'pukul' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/id/_lib/localize/index.js b/date-fns/src/locale/id/_lib/localize/index.js
new file mode 100644
index 0000000..5ab0723
--- /dev/null
+++ b/date-fns/src/locale/id/_lib/localize/index.js
@@ -0,0 +1,169 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+// All data for localization are taken from this page
+// https://www.unicode.org/cldr/charts/32/summary/id.html
+var eraValues = {
+ narrow: ['SM', 'M'],
+ abbreviated: ['SM', 'M'],
+ wide: ['Sebelum Masehi', 'Masehi']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['Kuartal ke-1', 'Kuartal ke-2', 'Kuartal ke-3', 'Kuartal ke-4']
+}
+
+// Note: in Indonesian, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Feb',
+ 'Mar',
+ 'Apr',
+ 'Mei',
+ 'Jun',
+ 'Jul',
+ 'Ags',
+ 'Sep',
+ 'Okt',
+ 'Nov',
+ 'Des'
+ ],
+ wide: [
+ 'Januari',
+ 'Februari',
+ 'Maret',
+ 'April',
+ 'Mei',
+ 'Juni',
+ 'Juli',
+ 'Agustus',
+ 'September',
+ 'Oktober',
+ 'November',
+ 'Desember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['M', 'S', 'S', 'R', 'K', 'J', 'S'],
+ short: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
+ abbreviated: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
+ wide: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'siang',
+ evening: 'sore',
+ night: 'malam'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'siang',
+ evening: 'sore',
+ night: 'malam'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'siang',
+ evening: 'sore',
+ night: 'malam'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'siang',
+ evening: 'sore',
+ night: 'malam'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'siang',
+ evening: 'sore',
+ night: 'malam'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'siang',
+ evening: 'sore',
+ night: 'malam'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // Can't use "pertama", "kedua" because can't be parsed
+ switch (number) {
+ default:
+ return 'ke-' + number
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/id/_lib/match/index.js b/date-fns/src/locale/id/_lib/match/index.js
new file mode 100644
index 0000000..2d49ac8
--- /dev/null
+++ b/date-fns/src/locale/id/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^ke-(\d+)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(sm|m)/i,
+ abbreviated: /^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,
+ wide: /^(sebelum masehi|sebelum era umum|masehi|era umum)/i
+}
+var parseEraPatterns = {
+ any: [/^s/i, /^(m|e)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^K-?\s[1234]/i,
+ wide: /^Kuartal ke-?\s?[1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,
+ wide: /^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^ma/i,
+ /^ap/i,
+ /^me/i,
+ /^jun/i,
+ /^jul/i,
+ /^ag/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[srkjm]/i,
+ short: /^(min|sen|sel|rab|kam|jum|sab)/i,
+ abbreviated: /^(min|sen|sel|rab|kam|jum|sab)/i,
+ wide: /^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i
+}
+var parseDayPatterns = {
+ narrow: [/^m/i, /^s/i, /^s/i, /^r/i, /^k/i, /^j/i, /^s/i],
+ any: [/^m/i, /^sen/i, /^sel/i, /^r/i, /^k/i, /^j/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,
+ any: /^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^pm/i,
+ midnight: /^tengah m/i,
+ noon: /^tengah h/i,
+ morning: /pagi/i,
+ afternoon: /siang/i,
+ evening: /sore/i,
+ night: /malam/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/id/index.d.ts b/date-fns/src/locale/id/index.d.ts
new file mode 100644
index 0000000..2bf83f4
--- /dev/null
+++ b/date-fns/src/locale/id/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { id } from 'date-fns/locale'
+export default id
diff --git a/date-fns/src/locale/id/index.js b/date-fns/src/locale/id/index.js
new file mode 100644
index 0000000..ab331e8
--- /dev/null
+++ b/date-fns/src/locale/id/index.js
@@ -0,0 +1,31 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Indonesian locale.
+ * @language Indonesian
+ * @iso-639-2 ind
+ * @author Rahmat Budiharso [@rbudiharso]{@link https://github.com/rbudiharso}
+ * @author Benget Nata [@bentinata]{@link https://github.com/bentinata}
+ * @author Budi Irawan [@deerawan]{@link https://github.com/deerawan}
+ * @author Try Ajitiono [@imballinst]{@link https://github.com/imballinst}
+ */
+var locale = {
+ code: 'id',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/id/index.js.flow b/date-fns/src/locale/id/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/id/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/id/snapshot.md b/date-fns/src/locale/id/snapshot.md
new file mode 100644
index 0000000..e331679
--- /dev/null
+++ b/date-fns/src/locale/id/snapshot.md
@@ -0,0 +1,304 @@
+# Indonesian (id) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | ke-1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | ke-5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | ke-1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | ke-5 | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | ke-1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ke-2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | K2 | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | Kuartal ke-1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Kuartal ke-2 | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | ke-1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ke-2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | K2 | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | Kuartal ke-1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Kuartal ke-2 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | ke-2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ke-7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | ke-2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ke-7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | ke-1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | ke-48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | ke-1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | ke-48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | ke-11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | ke-28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | ke-42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | ke-365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Senin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumat | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | S | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | ke-1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ke-5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Senin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumat | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | S | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | ke-1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ke-5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Senin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumat | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | S | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | ke-1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ke-5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Senin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumat | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | S | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Sen | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | pagi | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | siang | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | sore | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | malam | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | pagi | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | siang | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | sore | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | malam | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | pagi | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | siang | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | sore | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | malam | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | pagi | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | siang | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | sore | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | malam | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | pagi | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | siang | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | sore | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | malam | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | ke-1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | ke-55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | ke-1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | ke-55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/2/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Rabu, 11 Februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Minggu, 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59 | 1453-05-29T23:59:00.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59.59 | 1453-05-29T23:59:59.000Z |
+| | pppp | 1987-02-11T12:13:14.015Z | 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59.59 | 1453-05-29T23:59:59.000Z |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/2/1987, 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/1453, 23.59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb 1987, 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453, 23.59 | 1453-05-29T23:59:00.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Februari 1987 pukul 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 pukul 23.59.59 | 1453-05-29T23:59:59.000Z |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Rabu, 11 Februari 1987 pukul 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | Minggu, 29 Mei 1453 pukul 23.59.59 | 1453-05-29T23:59:59.000Z |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------- | ---------------------- | ------------------------------- |
+| 2006-01-01T00:00:00.000Z | sekitar 6 tahun | sekitar 6 tahun | dalam waktu sekitar 6 tahun |
+| 2005-01-01T00:00:00.000Z | sekitar 5 tahun | sekitar 5 tahun | dalam waktu sekitar 5 tahun |
+| 2004-01-01T00:00:00.000Z | sekitar 4 tahun | sekitar 4 tahun | dalam waktu sekitar 4 tahun |
+| 2003-01-01T00:00:00.000Z | sekitar 3 tahun | sekitar 3 tahun | dalam waktu sekitar 3 tahun |
+| 2002-01-01T00:00:00.000Z | sekitar 2 tahun | sekitar 2 tahun | dalam waktu sekitar 2 tahun |
+| 2001-06-01T00:00:00.000Z | lebih dari 1 tahun | lebih dari 1 tahun | dalam waktu lebih dari 1 tahun |
+| 2001-02-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | dalam waktu sekitar 1 tahun |
+| 2001-01-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | dalam waktu sekitar 1 tahun |
+| 2000-06-01T00:00:00.000Z | 5 bulan | 5 bulan | dalam waktu 5 bulan |
+| 2000-03-01T00:00:00.000Z | 2 bulan | 2 bulan | dalam waktu 2 bulan |
+| 2000-02-01T00:00:00.000Z | sekitar 1 bulan | sekitar 1 bulan | dalam waktu sekitar 1 bulan |
+| 2000-01-15T00:00:00.000Z | 14 hari | 14 hari | dalam waktu 14 hari |
+| 2000-01-02T00:00:00.000Z | 1 hari | 1 hari | dalam waktu 1 hari |
+| 2000-01-01T06:00:00.000Z | sekitar 6 jam | sekitar 6 jam | dalam waktu sekitar 6 jam |
+| 2000-01-01T01:00:00.000Z | sekitar 1 jam | sekitar 1 jam | dalam waktu sekitar 1 jam |
+| 2000-01-01T00:45:00.000Z | sekitar 1 jam | sekitar 1 jam | dalam waktu sekitar 1 jam |
+| 2000-01-01T00:30:00.000Z | 30 menit | 30 menit | dalam waktu 30 menit |
+| 2000-01-01T00:15:00.000Z | 15 menit | 15 menit | dalam waktu 15 menit |
+| 2000-01-01T00:01:00.000Z | 1 menit | 1 menit | dalam waktu 1 menit |
+| 2000-01-01T00:00:25.000Z | kurang dari 1 menit | setengah menit | dalam waktu kurang dari 1 menit |
+| 2000-01-01T00:00:15.000Z | kurang dari 1 menit | kurang dari 20 detik | dalam waktu kurang dari 1 menit |
+| 2000-01-01T00:00:05.000Z | kurang dari 1 menit | kurang dari 10 detik | dalam waktu kurang dari 1 menit |
+| 2000-01-01T00:00:00.000Z | kurang dari 1 menit | kurang dari 5 detik | kurang dari 1 menit yang lalu |
+| 1999-12-31T23:59:55.000Z | kurang dari 1 menit | kurang dari 10 detik | kurang dari 1 menit yang lalu |
+| 1999-12-31T23:59:45.000Z | kurang dari 1 menit | kurang dari 20 detik | kurang dari 1 menit yang lalu |
+| 1999-12-31T23:59:35.000Z | kurang dari 1 menit | setengah menit | kurang dari 1 menit yang lalu |
+| 1999-12-31T23:59:00.000Z | 1 menit | 1 menit | 1 menit yang lalu |
+| 1999-12-31T23:45:00.000Z | 15 menit | 15 menit | 15 menit yang lalu |
+| 1999-12-31T23:30:00.000Z | 30 menit | 30 menit | 30 menit yang lalu |
+| 1999-12-31T23:15:00.000Z | sekitar 1 jam | sekitar 1 jam | sekitar 1 jam yang lalu |
+| 1999-12-31T23:00:00.000Z | sekitar 1 jam | sekitar 1 jam | sekitar 1 jam yang lalu |
+| 1999-12-31T18:00:00.000Z | sekitar 6 jam | sekitar 6 jam | sekitar 6 jam yang lalu |
+| 1999-12-30T00:00:00.000Z | 2 hari | 2 hari | 2 hari yang lalu |
+| 1999-12-15T00:00:00.000Z | 17 hari | 17 hari | 17 hari yang lalu |
+| 1999-12-01T00:00:00.000Z | sekitar 1 bulan | sekitar 1 bulan | sekitar 1 bulan yang lalu |
+| 1999-11-01T00:00:00.000Z | 2 bulan | 2 bulan | 2 bulan yang lalu |
+| 1999-06-01T00:00:00.000Z | 7 bulan | 7 bulan | 7 bulan yang lalu |
+| 1999-01-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | sekitar 1 tahun yang lalu |
+| 1998-12-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | sekitar 1 tahun yang lalu |
+| 1998-06-01T00:00:00.000Z | lebih dari 1 tahun | lebih dari 1 tahun | lebih dari 1 tahun yang lalu |
+| 1998-01-01T00:00:00.000Z | sekitar 2 tahun | sekitar 2 tahun | sekitar 2 tahun yang lalu |
+| 1997-01-01T00:00:00.000Z | sekitar 3 tahun | sekitar 3 tahun | sekitar 3 tahun yang lalu |
+| 1996-01-01T00:00:00.000Z | sekitar 4 tahun | sekitar 4 tahun | sekitar 4 tahun yang lalu |
+| 1995-01-01T00:00:00.000Z | sekitar 5 tahun | sekitar 5 tahun | sekitar 5 tahun yang lalu |
+| 1994-01-01T00:00:00.000Z | sekitar 6 tahun | sekitar 6 tahun | sekitar 6 tahun yang lalu |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | -------- | -------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 tahun | dalam waktu 6 tahun | 52608 jam |
+| 2005-01-01T00:00:00.000Z | 5 tahun | dalam waktu 5 tahun | 43848 jam |
+| 2004-01-01T00:00:00.000Z | 4 tahun | dalam waktu 4 tahun | 35064 jam |
+| 2003-01-01T00:00:00.000Z | 3 tahun | dalam waktu 3 tahun | 26304 jam |
+| 2002-01-01T00:00:00.000Z | 2 tahun | dalam waktu 2 tahun | 17544 jam |
+| 2001-06-01T00:00:00.000Z | 1 tahun | dalam waktu 1 tahun | 12408 jam |
+| 2001-02-01T00:00:00.000Z | 1 tahun | dalam waktu 1 tahun | 9528 jam |
+| 2001-01-01T00:00:00.000Z | 1 tahun | dalam waktu 1 tahun | 8784 jam |
+| 2000-06-01T00:00:00.000Z | 5 bulan | dalam waktu 5 bulan | 3648 jam |
+| 2000-03-01T00:00:00.000Z | 2 bulan | dalam waktu 2 bulan | 1440 jam |
+| 2000-02-01T00:00:00.000Z | 1 bulan | dalam waktu 1 bulan | 744 jam |
+| 2000-01-15T00:00:00.000Z | 14 hari | dalam waktu 14 hari | 336 jam |
+| 2000-01-02T00:00:00.000Z | 1 hari | dalam waktu 1 hari | 24 jam |
+| 2000-01-01T06:00:00.000Z | 6 jam | dalam waktu 6 jam | 6 jam |
+| 2000-01-01T01:00:00.000Z | 1 jam | dalam waktu 1 jam | 1 jam |
+| 2000-01-01T00:45:00.000Z | 45 menit | dalam waktu 45 menit | 1 jam |
+| 2000-01-01T00:30:00.000Z | 30 menit | dalam waktu 30 menit | 1 jam |
+| 2000-01-01T00:15:00.000Z | 15 menit | dalam waktu 15 menit | 0 jam |
+| 2000-01-01T00:01:00.000Z | 1 menit | dalam waktu 1 menit | 0 jam |
+| 2000-01-01T00:00:25.000Z | 25 detik | dalam waktu 25 detik | 0 jam |
+| 2000-01-01T00:00:15.000Z | 15 detik | dalam waktu 15 detik | 0 jam |
+| 2000-01-01T00:00:05.000Z | 5 detik | dalam waktu 5 detik | 0 jam |
+| 2000-01-01T00:00:00.000Z | 0 detik | 0 detik yang lalu | 0 jam |
+| 1999-12-31T23:59:55.000Z | 5 detik | 5 detik yang lalu | 0 jam |
+| 1999-12-31T23:59:45.000Z | 15 detik | 15 detik yang lalu | 0 jam |
+| 1999-12-31T23:59:35.000Z | 25 detik | 25 detik yang lalu | 0 jam |
+| 1999-12-31T23:59:00.000Z | 1 menit | 1 menit yang lalu | 0 jam |
+| 1999-12-31T23:45:00.000Z | 15 menit | 15 menit yang lalu | 0 jam |
+| 1999-12-31T23:30:00.000Z | 30 menit | 30 menit yang lalu | 1 jam |
+| 1999-12-31T23:15:00.000Z | 45 menit | 45 menit yang lalu | 1 jam |
+| 1999-12-31T23:00:00.000Z | 1 jam | 1 jam yang lalu | 1 jam |
+| 1999-12-31T18:00:00.000Z | 6 jam | 6 jam yang lalu | 6 jam |
+| 1999-12-30T00:00:00.000Z | 2 hari | 2 hari yang lalu | 48 jam |
+| 1999-12-15T00:00:00.000Z | 17 hari | 17 hari yang lalu | 408 jam |
+| 1999-12-01T00:00:00.000Z | 1 bulan | 1 bulan yang lalu | 744 jam |
+| 1999-11-01T00:00:00.000Z | 2 bulan | 2 bulan yang lalu | 1464 jam |
+| 1999-06-01T00:00:00.000Z | 7 bulan | 7 bulan yang lalu | 5136 jam |
+| 1999-01-01T00:00:00.000Z | 1 tahun | 1 tahun yang lalu | 8760 jam |
+| 1998-12-01T00:00:00.000Z | 1 tahun | 1 tahun yang lalu | 9504 jam |
+| 1998-06-01T00:00:00.000Z | 2 tahun | 2 tahun yang lalu | 13896 jam |
+| 1998-01-01T00:00:00.000Z | 2 tahun | 2 tahun yang lalu | 17520 jam |
+| 1997-01-01T00:00:00.000Z | 3 tahun | 3 tahun yang lalu | 26280 jam |
+| 1996-01-01T00:00:00.000Z | 4 tahun | 4 tahun yang lalu | 35064 jam |
+| 1995-01-01T00:00:00.000Z | 5 tahun | 5 tahun yang lalu | 43824 jam |
+| 1994-01-01T00:00:00.000Z | 6 tahun | 6 tahun yang lalu | 52584 jam |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------- |
+| 2000-01-10T00:00:00.000Z | 10/1/2000 |
+| 2000-01-05T00:00:00.000Z | Rabu pukul 00.00 |
+| 2000-01-02T00:00:00.000Z | Besok pukul 00.00 |
+| 2000-01-01T00:00:00.000Z | Hari ini pukul 00.00 |
+| 1999-12-31T00:00:00.000Z | Kemarin pukul 00.00 |
+| 1999-12-27T00:00:00.000Z | Senin lalu pukul 00.00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/index.js b/date-fns/src/locale/index.js
new file mode 100644
index 0000000..dc56bfb
--- /dev/null
+++ b/date-fns/src/locale/index.js
@@ -0,0 +1,82 @@
+// This file is generated automatically by `scripts/build/indices.js`. Please, don't change it.
+
+export { default as af } from './af/index'
+export { default as arDZ } from './ar-DZ/index'
+export { default as arMA } from './ar-MA/index'
+export { default as arSA } from './ar-SA/index'
+export { default as az } from './az/index'
+export { default as be } from './be/index'
+export { default as bg } from './bg/index'
+export { default as bn } from './bn/index'
+export { default as ca } from './ca/index'
+export { default as cs } from './cs/index'
+export { default as cy } from './cy/index'
+export { default as da } from './da/index'
+export { default as de } from './de/index'
+export { default as deAT } from './de-AT/index'
+export { default as el } from './el/index'
+export { default as enAU } from './en-AU/index'
+export { default as enCA } from './en-CA/index'
+export { default as enGB } from './en-GB/index'
+export { default as enIN } from './en-IN/index'
+export { default as enNZ } from './en-NZ/index'
+export { default as enUS } from './en-US/index'
+export { default as enZA } from './en-ZA/index'
+export { default as eo } from './eo/index'
+export { default as es } from './es/index'
+export { default as et } from './et/index'
+export { default as eu } from './eu/index'
+export { default as faIR } from './fa-IR/index'
+export { default as fi } from './fi/index'
+export { default as fr } from './fr/index'
+export { default as frCA } from './fr-CA/index'
+export { default as frCH } from './fr-CH/index'
+export { default as gd } from './gd/index'
+export { default as gl } from './gl/index'
+export { default as gu } from './gu/index'
+export { default as he } from './he/index'
+export { default as hi } from './hi/index'
+export { default as hr } from './hr/index'
+export { default as ht } from './ht/index'
+export { default as hu } from './hu/index'
+export { default as hy } from './hy/index'
+export { default as id } from './id/index'
+export { default as is } from './is/index'
+export { default as it } from './it/index'
+export { default as ja } from './ja/index'
+export { default as ka } from './ka/index'
+export { default as kk } from './kk/index'
+export { default as kn } from './kn/index'
+export { default as ko } from './ko/index'
+export { default as lb } from './lb/index'
+export { default as lt } from './lt/index'
+export { default as lv } from './lv/index'
+export { default as mk } from './mk/index'
+export { default as mn } from './mn/index'
+export { default as ms } from './ms/index'
+export { default as mt } from './mt/index'
+export { default as nb } from './nb/index'
+export { default as nl } from './nl/index'
+export { default as nlBE } from './nl-BE/index'
+export { default as nn } from './nn/index'
+export { default as pl } from './pl/index'
+export { default as pt } from './pt/index'
+export { default as ptBR } from './pt-BR/index'
+export { default as ro } from './ro/index'
+export { default as ru } from './ru/index'
+export { default as sk } from './sk/index'
+export { default as sl } from './sl/index'
+export { default as sq } from './sq/index'
+export { default as sr } from './sr/index'
+export { default as srLatn } from './sr-Latn/index'
+export { default as sv } from './sv/index'
+export { default as ta } from './ta/index'
+export { default as te } from './te/index'
+export { default as th } from './th/index'
+export { default as tr } from './tr/index'
+export { default as ug } from './ug/index'
+export { default as uk } from './uk/index'
+export { default as uz } from './uz/index'
+export { default as vi } from './vi/index'
+export { default as zhCN } from './zh-CN/index'
+export { default as zhTW } from './zh-TW/index'
diff --git a/date-fns/src/locale/index.js.flow b/date-fns/src/locale/index.js.flow
new file mode 100644
index 0000000..4998a2e
--- /dev/null
+++ b/date-fns/src/locale/index.js.flow
@@ -0,0 +1,118 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: {
+ af: Locale,
+ ar: Locale,
+ arDZ: Locale,
+ arMA: Locale,
+ arSA: Locale,
+ az: Locale,
+ be: Locale,
+ bg: Locale,
+ bn: Locale,
+ ca: Locale,
+ cs: Locale,
+ cy: Locale,
+ da: Locale,
+ de: Locale,
+ deAT: Locale,
+ el: Locale,
+ enAU: Locale,
+ enCA: Locale,
+ enGB: Locale,
+ enIN: Locale,
+ enNZ: Locale,
+ enUS: Locale,
+ enZA: Locale,
+ eo: Locale,
+ es: Locale,
+ et: Locale,
+ eu: Locale,
+ faIR: Locale,
+ fi: Locale,
+ fil: Locale,
+ fr: Locale,
+ frCA: Locale,
+ frCH: Locale,
+ gd: Locale,
+ gl: Locale,
+ gu: Locale,
+ he: Locale,
+ hi: Locale,
+ hr: Locale,
+ ht: Locale,
+ hu: Locale,
+ hy: Locale,
+ id: Locale,
+ is: Locale,
+ it: Locale,
+ ja: Locale,
+ ka: Locale,
+ kk: Locale,
+ kn: Locale,
+ ko: Locale,
+ lb: Locale,
+ lt: Locale,
+ lv: Locale,
+ mk: Locale,
+ mn: Locale,
+ ms: Locale,
+ mt: Locale,
+ nb: Locale,
+ nl: Locale,
+ nlBE: Locale,
+ nn: Locale,
+ pl: Locale,
+ pt: Locale,
+ ptBR: Locale,
+ ro: Locale,
+ ru: Locale,
+ sk: Locale,
+ sl: Locale,
+ sq: Locale,
+ sr: Locale,
+ srLatn: Locale,
+ sv: Locale,
+ ta: Locale,
+ te: Locale,
+ th: Locale,
+ tr: Locale,
+ ug: Locale,
+ uk: Locale,
+ uz: Locale,
+ vi: Locale,
+ zhCN: Locale,
+ zhTW: Locale,
+}
diff --git a/date-fns/src/locale/is/_lib/formatDistance/index.js b/date-fns/src/locale/is/_lib/formatDistance/index.js
new file mode 100644
index 0000000..4a21daf
--- /dev/null
+++ b/date-fns/src/locale/is/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'minna en 1 sekúnda',
+ other: 'minna en {{count}} sekúndur'
+ },
+
+ xSeconds: {
+ one: '1 sekúnda',
+ other: '{{count}} sekúndur'
+ },
+
+ halfAMinute: 'hálf mínúta',
+
+ lessThanXMinutes: {
+ one: 'minna en 1 mínúta',
+ other: 'minna en {{count}} mínútur'
+ },
+
+ xMinutes: {
+ one: '1 mínúta',
+ other: '{{count}} mínútur'
+ },
+
+ aboutXHours: {
+ one: 'u.þ.b. 1 klukkustund',
+ other: 'u.þ.b. {{count}} klukkustundir'
+ },
+
+ xHours: {
+ one: '1 klukkustund',
+ other: '{{count}} klukkustundir'
+ },
+
+ xDays: {
+ one: '1 dagur',
+ other: '{{count}} dagar'
+ },
+
+ aboutXWeeks: {
+ one: 'um viku',
+ other: 'um {{count}} vikur'
+ },
+
+ xWeeks: {
+ one: '1 viku',
+ other: '{{count}} vikur'
+ },
+
+ aboutXMonths: {
+ one: 'u.þ.b. 1 mánuður',
+ other: 'u.þ.b. {{count}} mánuðir'
+ },
+
+ xMonths: {
+ one: '1 mánuður',
+ other: '{{count}} mánuðir'
+ },
+
+ aboutXYears: {
+ one: 'u.þ.b. 1 ár',
+ other: 'u.þ.b. {{count}} ár'
+ },
+
+ xYears: {
+ one: '1 ár',
+ other: '{{count}} ár'
+ },
+
+ overXYears: {
+ one: 'meira en 1 ár',
+ other: 'meira en {{count}} ár'
+ },
+
+ almostXYears: {
+ one: 'næstum 1 ár',
+ other: 'næstum {{count}} ár'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'í ' + result
+ } else {
+ return result + ' síðan'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/is/_lib/formatLong/index.js b/date-fns/src/locale/is/_lib/formatLong/index.js
new file mode 100644
index 0000000..5d67398
--- /dev/null
+++ b/date-fns/src/locale/is/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, do MMMM y',
+ long: 'do MMMM y',
+ medium: 'do MMM y',
+ short: 'd.MM.y'
+}
+
+var timeFormats = {
+ full: "'kl'. HH:mm:ss zzzz",
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'kl.' {{time}}",
+ long: "{{date}} 'kl.' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/is/_lib/formatRelative/index.js b/date-fns/src/locale/is/_lib/formatRelative/index.js
new file mode 100644
index 0000000..14de903
--- /dev/null
+++ b/date-fns/src/locale/is/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'síðasta' dddd 'kl.' p",
+ yesterday: "'í gær kl.' p",
+ today: "'í dag kl.' p",
+ tomorrow: "'á morgun kl.' p",
+ nextWeek: "dddd 'kl.' p",
+ other: 'L'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/is/_lib/localize/index.js b/date-fns/src/locale/is/_lib/localize/index.js
new file mode 100644
index 0000000..06fcc6d
--- /dev/null
+++ b/date-fns/src/locale/is/_lib/localize/index.js
@@ -0,0 +1,167 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['f.Kr.', 'e.Kr.'],
+ abbreviated: ['f.Kr.', 'e.Kr.'],
+ wide: ['fyrir Krist', 'eftir Krist']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1F', '2F', '3F', '4F'],
+ wide: ['1. fjórðungur', '2. fjórðungur', '3. fjórðungur', '4. fjórðungur']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'Á', 'S', 'Ó', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mars',
+ 'apríl',
+ 'maí',
+ 'júní',
+ 'júlí',
+ 'ágúst',
+ 'sept.',
+ 'okt.',
+ 'nóv.',
+ 'des.'
+ ],
+ wide: [
+ 'janúar',
+ 'febrúar',
+ 'mars',
+ 'apríl',
+ 'maí',
+ 'júní',
+ 'júlí',
+ 'ágúst',
+ 'september',
+ 'október',
+ 'nóvember',
+ 'desember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'Þ', 'M', 'F', 'F', 'L'],
+ short: ['Su', 'Má', 'Þr', 'Mi', 'Fi', 'Fö', 'La'],
+ abbreviated: ['sun.', 'mán.', 'þri.', 'mið.', 'fim.', 'fös.', 'lau'],
+ wide: [
+ 'sunnudagur',
+ 'mánudagur',
+ 'þriðjudagur',
+ 'miðvikudagur',
+ 'fimmtudagur',
+ 'föstudagur',
+ 'laugardagur'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'f',
+ pm: 'e',
+ midnight: 'miðnætti',
+ noon: 'hádegi',
+ morning: 'morgunn',
+ afternoon: 'síðdegi',
+ evening: 'kvöld',
+ night: 'nótt'
+ },
+ abbreviated: {
+ am: 'f.h.',
+ pm: 'e.h.',
+ midnight: 'miðnætti',
+ noon: 'hádegi',
+ morning: 'morgunn',
+ afternoon: 'síðdegi',
+ evening: 'kvöld',
+ night: 'nótt'
+ },
+ wide: {
+ am: 'fyrir hádegi',
+ pm: 'eftir hádegi',
+ midnight: 'miðnætti',
+ noon: 'hádegi',
+ morning: 'morgunn',
+ afternoon: 'síðdegi',
+ evening: 'kvöld',
+ night: 'nótt'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'f',
+ pm: 'e',
+ midnight: 'á miðnætti',
+ noon: 'á hádegi',
+ morning: 'að morgni',
+ afternoon: 'síðdegis',
+ evening: 'um kvöld',
+ night: 'um nótt'
+ },
+ abbreviated: {
+ am: 'f.h.',
+ pm: 'e.h.',
+ midnight: 'á miðnætti',
+ noon: 'á hádegi',
+ morning: 'að morgni',
+ afternoon: 'síðdegis',
+ evening: 'um kvöld',
+ night: 'um nótt'
+ },
+ wide: {
+ am: 'fyrir hádegi',
+ pm: 'eftir hádegi',
+ midnight: 'á miðnætti',
+ noon: 'á hádegi',
+ morning: 'að morgni',
+ afternoon: 'síðdegis',
+ evening: 'um kvöld',
+ night: 'um nótt'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/is/_lib/match/index.js b/date-fns/src/locale/is/_lib/match/index.js
new file mode 100644
index 0000000..889c7ca
--- /dev/null
+++ b/date-fns/src/locale/is/_lib/match/index.js
@@ -0,0 +1,141 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(f\.Kr\.|e\.Kr\.)/i,
+ abbreviated: /^(f\.Kr\.|e\.Kr\.)/i,
+ wide: /^(fyrir Krist|eftir Krist)/i
+}
+
+var parseEraPatterns = {
+ any: [/^(f\.Kr\.|e\.Kr\.)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234] fjórðungur/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmásónd]/i,
+ abbreviated: /^(jan\.|feb\.|mars\.|apríl\.|maí|júní|júlí|águst|sep\.|oct\.|nov\.|dec\.)/i,
+ wide: /^(januar|februar|mars|apríl|maí|júní|júlí|águst|september|október|nóvember|desember)/i
+}
+
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^á/i,
+ /^s/i,
+ /^ó/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^maí/i,
+ /^jún/i,
+ /^júl/i,
+ /^áu/i,
+ /^s/i,
+ /^ó/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smtwf]/i,
+ short: /^(su|má|þr|mi|fi|fö|la)/i,
+ abbreviated: /^(sun|mán|þri|mið|fim|fös|lau)\.?/i,
+ wide: /^(sunnudagur|mánudagur|þriðjudagur|miðvikudagur|fimmtudagur|föstudagur|laugardagur)/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^þ/i, /^m/i, /^f/i, /^f/i, /^l/i],
+ any: [/^su/i, /^má/i, /^þr/i, /^mi/i, /^fi/i, /^fö/i, /^la/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(f|e|síðdegis|(á|að|um) (morgni|kvöld|nótt|miðnætti))/i,
+ any: /^(fyrir hádegi|eftir hádegi|[ef]\.?h\.?|síðdegis|morgunn|(á|að|um) (morgni|kvöld|nótt|miðnætti))/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^f/i,
+ pm: /^e/i,
+ midnight: /^mi/i,
+ noon: /^há/i,
+ morning: /morgunn/i,
+ afternoon: /síðdegi/i,
+ evening: /kvöld/i,
+ night: /nótt/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/is/index.d.ts b/date-fns/src/locale/is/index.d.ts
new file mode 100644
index 0000000..0d12119
--- /dev/null
+++ b/date-fns/src/locale/is/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { is } from 'date-fns/locale'
+export default is
diff --git a/date-fns/src/locale/is/index.js b/date-fns/src/locale/is/index.js
new file mode 100644
index 0000000..0d46f93
--- /dev/null
+++ b/date-fns/src/locale/is/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Icelandic locale.
+ * @language Icelandic
+ * @iso-639-2 isl
+ * @author Derek Blank [@derekblank]{@link https://github.com/derekblank}
+ * @author Arnór Ýmir [@lamayg]{@link https://github.com/lamayg}
+ */
+var locale = {
+ code: 'is',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/is/index.js.flow b/date-fns/src/locale/is/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/is/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/is/snapshot.md b/date-fns/src/locale/is/snapshot.md
new file mode 100644
index 0000000..629dfc8
--- /dev/null
+++ b/date-fns/src/locale/is/snapshot.md
@@ -0,0 +1,304 @@
+# Icelandic (is) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | Invalid Date |
+| | | 0005-01-01T12:13:14.015Z | 5. | Invalid Date |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | Invalid Date |
+| | | 0005-01-01T12:13:14.015Z | 4. | Invalid Date |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2. | Invalid Date |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1F | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2F | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. fjórðungur | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2. fjórðungur | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2. | Invalid Date |
+| | qqq | 2019-01-01T12:13:14.015Z | 1F | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2F | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. fjórðungur | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2. fjórðungur | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | 7. | Invalid Date |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júlí | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | febrúar | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | júlí | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | 7. | Invalid Date |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júlí | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | febrúar | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | júlí | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-12-01T12:13:14.015Z | 48. | Invalid Date |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-12-01T12:13:14.015Z | 48. | Invalid Date |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | Invalid Date |
+| | | 2019-02-28T12:13:14.015Z | 28. | Invalid Date |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | Invalid Date |
+| | | 2019-12-31T12:13:14.015Z | 365. | Invalid Date |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | mán. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fös. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | mán. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fös. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | mán. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fös. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | mánudagur | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | föstudagur | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-14T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Má | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fö | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | 5. | Invalid Date |
+| | iii | 2019-02-11T12:13:14.015Z | mán. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fös. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | mánudagur | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | föstudagur | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-14T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Má | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fö | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | 5. | Invalid Date |
+| | eee | 2019-02-11T12:13:14.015Z | mán. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fös. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | mánudagur | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | föstudagur | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-14T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Má | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fö | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | 5. | Invalid Date |
+| | ccc | 2019-02-11T12:13:14.015Z | mán. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fös. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | mánudagur | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | föstudagur | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-14T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Má | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fö | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | fyrir hádegi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | eftir hádegi | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | eftir hádegi | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fyrir hádegi | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | f | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e.h. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f.h. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | fyrir hádegi | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | eftir hádegi | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | eftir hádegi | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fyrir hádegi | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | f | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | e | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | e | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | f | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | að morgni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | síðdegis | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | um kvöld | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | um nótt | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | að morgni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | síðdegis | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | um kvöld | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | um nótt | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | að morgni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | síðdegis | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | um kvöld | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | um nótt | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | að morgni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | síðdegis | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | um kvöld | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | um nótt | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | að morgni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | síðdegis | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | um kvöld | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | um nótt | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | 11. | Invalid Date |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | 23. | Invalid Date |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | 11. | Invalid Date |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | Invalid Date |
+| | | 2019-02-11T23:13:14.015Z | 23. | Invalid Date |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | Invalid Date |
+| | | 2019-04-01T12:55:14.015Z | 55. | Invalid Date |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | Invalid Date |
+| | | 2019-04-01T12:13:55.015Z | 55. | Invalid Date |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. feb. 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29. maí 1453 | Invalid Date |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. febrúar 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29. maí 1453 | Invalid Date |
+| | PPPP | 1987-02-11T12:13:14.015Z | miðvikudagur, 11. febrúar 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | sunnudagur, 29. maí 1453 | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | kl. 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. feb. 1987 12:13:14 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29. maí 1453 23:59:59 | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. febrúar 1987 kl. 12:13:14 GMT+0 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29. maí 1453 kl. 23:59:59 GMT+0 | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | miðvikudagur, 11. febrúar 1987 kl. kl. 12:13:14 GMT+00:00 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | sunnudagur, 29. maí 1453 kl. kl. 23:59:59 GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------------- | ---------------------- | ---------------------------- |
+| 2006-01-01T00:00:00.000Z | u.þ.b. 6 ár | u.þ.b. 6 ár | í u.þ.b. 6 ár |
+| 2005-01-01T00:00:00.000Z | u.þ.b. 5 ár | u.þ.b. 5 ár | í u.þ.b. 5 ár |
+| 2004-01-01T00:00:00.000Z | u.þ.b. 4 ár | u.þ.b. 4 ár | í u.þ.b. 4 ár |
+| 2003-01-01T00:00:00.000Z | u.þ.b. 3 ár | u.þ.b. 3 ár | í u.þ.b. 3 ár |
+| 2002-01-01T00:00:00.000Z | u.þ.b. 2 ár | u.þ.b. 2 ár | í u.þ.b. 2 ár |
+| 2001-06-01T00:00:00.000Z | meira en 1 ár | meira en 1 ár | í meira en 1 ár |
+| 2001-02-01T00:00:00.000Z | u.þ.b. 1 ár | u.þ.b. 1 ár | í u.þ.b. 1 ár |
+| 2001-01-01T00:00:00.000Z | u.þ.b. 1 ár | u.þ.b. 1 ár | í u.þ.b. 1 ár |
+| 2000-06-01T00:00:00.000Z | 5 mánuðir | 5 mánuðir | í 5 mánuðir |
+| 2000-03-01T00:00:00.000Z | 2 mánuðir | 2 mánuðir | í 2 mánuðir |
+| 2000-02-01T00:00:00.000Z | u.þ.b. 1 mánuður | u.þ.b. 1 mánuður | í u.þ.b. 1 mánuður |
+| 2000-01-15T00:00:00.000Z | 14 dagar | 14 dagar | í 14 dagar |
+| 2000-01-02T00:00:00.000Z | 1 dagur | 1 dagur | í 1 dagur |
+| 2000-01-01T06:00:00.000Z | u.þ.b. 6 klukkustundir | u.þ.b. 6 klukkustundir | í u.þ.b. 6 klukkustundir |
+| 2000-01-01T01:00:00.000Z | u.þ.b. 1 klukkustund | u.þ.b. 1 klukkustund | í u.þ.b. 1 klukkustund |
+| 2000-01-01T00:45:00.000Z | u.þ.b. 1 klukkustund | u.þ.b. 1 klukkustund | í u.þ.b. 1 klukkustund |
+| 2000-01-01T00:30:00.000Z | 30 mínútur | 30 mínútur | í 30 mínútur |
+| 2000-01-01T00:15:00.000Z | 15 mínútur | 15 mínútur | í 15 mínútur |
+| 2000-01-01T00:01:00.000Z | 1 mínúta | 1 mínúta | í 1 mínúta |
+| 2000-01-01T00:00:25.000Z | minna en 1 mínúta | hálf mínúta | í minna en 1 mínúta |
+| 2000-01-01T00:00:15.000Z | minna en 1 mínúta | minna en 20 sekúndur | í minna en 1 mínúta |
+| 2000-01-01T00:00:05.000Z | minna en 1 mínúta | minna en 10 sekúndur | í minna en 1 mínúta |
+| 2000-01-01T00:00:00.000Z | minna en 1 mínúta | minna en 5 sekúndur | minna en 1 mínúta síðan |
+| 1999-12-31T23:59:55.000Z | minna en 1 mínúta | minna en 10 sekúndur | minna en 1 mínúta síðan |
+| 1999-12-31T23:59:45.000Z | minna en 1 mínúta | minna en 20 sekúndur | minna en 1 mínúta síðan |
+| 1999-12-31T23:59:35.000Z | minna en 1 mínúta | hálf mínúta | minna en 1 mínúta síðan |
+| 1999-12-31T23:59:00.000Z | 1 mínúta | 1 mínúta | 1 mínúta síðan |
+| 1999-12-31T23:45:00.000Z | 15 mínútur | 15 mínútur | 15 mínútur síðan |
+| 1999-12-31T23:30:00.000Z | 30 mínútur | 30 mínútur | 30 mínútur síðan |
+| 1999-12-31T23:15:00.000Z | u.þ.b. 1 klukkustund | u.þ.b. 1 klukkustund | u.þ.b. 1 klukkustund síðan |
+| 1999-12-31T23:00:00.000Z | u.þ.b. 1 klukkustund | u.þ.b. 1 klukkustund | u.þ.b. 1 klukkustund síðan |
+| 1999-12-31T18:00:00.000Z | u.þ.b. 6 klukkustundir | u.þ.b. 6 klukkustundir | u.þ.b. 6 klukkustundir síðan |
+| 1999-12-30T00:00:00.000Z | 2 dagar | 2 dagar | 2 dagar síðan |
+| 1999-12-15T00:00:00.000Z | 17 dagar | 17 dagar | 17 dagar síðan |
+| 1999-12-01T00:00:00.000Z | u.þ.b. 1 mánuður | u.þ.b. 1 mánuður | u.þ.b. 1 mánuður síðan |
+| 1999-11-01T00:00:00.000Z | 2 mánuðir | 2 mánuðir | 2 mánuðir síðan |
+| 1999-06-01T00:00:00.000Z | 7 mánuðir | 7 mánuðir | 7 mánuðir síðan |
+| 1999-01-01T00:00:00.000Z | u.þ.b. 1 ár | u.þ.b. 1 ár | u.þ.b. 1 ár síðan |
+| 1998-12-01T00:00:00.000Z | u.þ.b. 1 ár | u.þ.b. 1 ár | u.þ.b. 1 ár síðan |
+| 1998-06-01T00:00:00.000Z | meira en 1 ár | meira en 1 ár | meira en 1 ár síðan |
+| 1998-01-01T00:00:00.000Z | u.þ.b. 2 ár | u.þ.b. 2 ár | u.þ.b. 2 ár síðan |
+| 1997-01-01T00:00:00.000Z | u.þ.b. 3 ár | u.þ.b. 3 ár | u.þ.b. 3 ár síðan |
+| 1996-01-01T00:00:00.000Z | u.þ.b. 4 ár | u.þ.b. 4 ár | u.þ.b. 4 ár síðan |
+| 1995-01-01T00:00:00.000Z | u.þ.b. 5 ár | u.þ.b. 5 ár | u.þ.b. 5 ár síðan |
+| 1994-01-01T00:00:00.000Z | u.þ.b. 6 ár | u.þ.b. 6 ár | u.þ.b. 6 ár síðan |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------------- | --------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ár | í 6 ár | 52608 klukkustundir |
+| 2005-01-01T00:00:00.000Z | 5 ár | í 5 ár | 43848 klukkustundir |
+| 2004-01-01T00:00:00.000Z | 4 ár | í 4 ár | 35064 klukkustundir |
+| 2003-01-01T00:00:00.000Z | 3 ár | í 3 ár | 26304 klukkustundir |
+| 2002-01-01T00:00:00.000Z | 2 ár | í 2 ár | 17544 klukkustundir |
+| 2001-06-01T00:00:00.000Z | 1 ár | í 1 ár | 12408 klukkustundir |
+| 2001-02-01T00:00:00.000Z | 1 ár | í 1 ár | 9528 klukkustundir |
+| 2001-01-01T00:00:00.000Z | 1 ár | í 1 ár | 8784 klukkustundir |
+| 2000-06-01T00:00:00.000Z | 5 mánuðir | í 5 mánuðir | 3648 klukkustundir |
+| 2000-03-01T00:00:00.000Z | 2 mánuðir | í 2 mánuðir | 1440 klukkustundir |
+| 2000-02-01T00:00:00.000Z | 1 mánuður | í 1 mánuður | 744 klukkustundir |
+| 2000-01-15T00:00:00.000Z | 14 dagar | í 14 dagar | 336 klukkustundir |
+| 2000-01-02T00:00:00.000Z | 1 dagur | í 1 dagur | 24 klukkustundir |
+| 2000-01-01T06:00:00.000Z | 6 klukkustundir | í 6 klukkustundir | 6 klukkustundir |
+| 2000-01-01T01:00:00.000Z | 1 klukkustund | í 1 klukkustund | 1 klukkustund |
+| 2000-01-01T00:45:00.000Z | 45 mínútur | í 45 mínútur | 1 klukkustund |
+| 2000-01-01T00:30:00.000Z | 30 mínútur | í 30 mínútur | 1 klukkustund |
+| 2000-01-01T00:15:00.000Z | 15 mínútur | í 15 mínútur | 0 klukkustundir |
+| 2000-01-01T00:01:00.000Z | 1 mínúta | í 1 mínúta | 0 klukkustundir |
+| 2000-01-01T00:00:25.000Z | 25 sekúndur | í 25 sekúndur | 0 klukkustundir |
+| 2000-01-01T00:00:15.000Z | 15 sekúndur | í 15 sekúndur | 0 klukkustundir |
+| 2000-01-01T00:00:05.000Z | 5 sekúndur | í 5 sekúndur | 0 klukkustundir |
+| 2000-01-01T00:00:00.000Z | 0 sekúndur | 0 sekúndur síðan | 0 klukkustundir |
+| 1999-12-31T23:59:55.000Z | 5 sekúndur | 5 sekúndur síðan | 0 klukkustundir |
+| 1999-12-31T23:59:45.000Z | 15 sekúndur | 15 sekúndur síðan | 0 klukkustundir |
+| 1999-12-31T23:59:35.000Z | 25 sekúndur | 25 sekúndur síðan | 0 klukkustundir |
+| 1999-12-31T23:59:00.000Z | 1 mínúta | 1 mínúta síðan | 0 klukkustundir |
+| 1999-12-31T23:45:00.000Z | 15 mínútur | 15 mínútur síðan | 0 klukkustundir |
+| 1999-12-31T23:30:00.000Z | 30 mínútur | 30 mínútur síðan | 1 klukkustund |
+| 1999-12-31T23:15:00.000Z | 45 mínútur | 45 mínútur síðan | 1 klukkustund |
+| 1999-12-31T23:00:00.000Z | 1 klukkustund | 1 klukkustund síðan | 1 klukkustund |
+| 1999-12-31T18:00:00.000Z | 6 klukkustundir | 6 klukkustundir síðan | 6 klukkustundir |
+| 1999-12-30T00:00:00.000Z | 2 dagar | 2 dagar síðan | 48 klukkustundir |
+| 1999-12-15T00:00:00.000Z | 17 dagar | 17 dagar síðan | 408 klukkustundir |
+| 1999-12-01T00:00:00.000Z | 1 mánuður | 1 mánuður síðan | 744 klukkustundir |
+| 1999-11-01T00:00:00.000Z | 2 mánuðir | 2 mánuðir síðan | 1464 klukkustundir |
+| 1999-06-01T00:00:00.000Z | 7 mánuðir | 7 mánuðir síðan | 5136 klukkustundir |
+| 1999-01-01T00:00:00.000Z | 1 ár | 1 ár síðan | 8760 klukkustundir |
+| 1998-12-01T00:00:00.000Z | 1 ár | 1 ár síðan | 9504 klukkustundir |
+| 1998-06-01T00:00:00.000Z | 2 ár | 2 ár síðan | 13896 klukkustundir |
+| 1998-01-01T00:00:00.000Z | 2 ár | 2 ár síðan | 17520 klukkustundir |
+| 1997-01-01T00:00:00.000Z | 3 ár | 3 ár síðan | 26280 klukkustundir |
+| 1996-01-01T00:00:00.000Z | 4 ár | 4 ár síðan | 35064 klukkustundir |
+| 1995-01-01T00:00:00.000Z | 5 ár | 5 ár síðan | 43824 klukkustundir |
+| 1994-01-01T00:00:00.000Z | 6 ár | 6 ár síðan | 52584 klukkustundir |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------- |
+| 2000-01-10T00:00:00.000Z | 1 |
+| 2000-01-05T00:00:00.000Z | 0005 kl. 00:00 |
+| 2000-01-02T00:00:00.000Z | á morgun kl. 00:00 |
+| 2000-01-01T00:00:00.000Z | í dag kl. 00:00 |
+| 1999-12-31T00:00:00.000Z | í gær kl. 00:00 |
+| 1999-12-27T00:00:00.000Z | síðasta 0027 kl. 00:00 |
+| 1999-12-21T00:00:00.000Z | 12 |
diff --git a/date-fns/src/locale/it/_lib/formatDistance/index.js b/date-fns/src/locale/it/_lib/formatDistance/index.js
new file mode 100644
index 0000000..be8b937
--- /dev/null
+++ b/date-fns/src/locale/it/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'meno di un secondo',
+ other: 'meno di {{count}} secondi'
+ },
+
+ xSeconds: {
+ one: 'un secondo',
+ other: '{{count}} secondi'
+ },
+
+ halfAMinute: 'alcuni secondi',
+
+ lessThanXMinutes: {
+ one: 'meno di un minuto',
+ other: 'meno di {{count}} minuti'
+ },
+
+ xMinutes: {
+ one: 'un minuto',
+ other: '{{count}} minuti'
+ },
+
+ aboutXHours: {
+ one: "circa un'ora",
+ other: 'circa {{count}} ore'
+ },
+
+ xHours: {
+ one: "un'ora",
+ other: '{{count}} ore'
+ },
+
+ xDays: {
+ one: 'un giorno',
+ other: '{{count}} giorni'
+ },
+
+ aboutXWeeks: {
+ one: 'circa una settimana',
+ other: 'circa {{count}} settimane'
+ },
+
+ xWeeks: {
+ one: 'una settimana',
+ other: '{{count}} settimane'
+ },
+
+ aboutXMonths: {
+ one: 'circa un mese',
+ other: 'circa {{count}} mesi'
+ },
+
+ xMonths: {
+ one: 'un mese',
+ other: '{{count}} mesi'
+ },
+
+ aboutXYears: {
+ one: 'circa un anno',
+ other: 'circa {{count}} anni'
+ },
+
+ xYears: {
+ one: 'un anno',
+ other: '{{count}} anni'
+ },
+
+ overXYears: {
+ one: 'più di un anno',
+ other: 'più di {{count}} anni'
+ },
+
+ almostXYears: {
+ one: 'quasi un anno',
+ other: 'quasi {{count}} anni'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'tra ' + result
+ } else {
+ return result + ' fa'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/it/_lib/formatLong/index.js b/date-fns/src/locale/it/_lib/formatLong/index.js
new file mode 100644
index 0000000..6a45204
--- /dev/null
+++ b/date-fns/src/locale/it/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/it/_lib/formatRelative/index.js b/date-fns/src/locale/it/_lib/formatRelative/index.js
new file mode 100644
index 0000000..7258059
--- /dev/null
+++ b/date-fns/src/locale/it/_lib/formatRelative/index.js
@@ -0,0 +1,66 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+var weekdays = [
+ 'domenica',
+ 'lunedì',
+ 'martedì',
+ 'mercoledì',
+ 'giovedì',
+ 'venerdì',
+ 'sabato'
+]
+
+function lastWeek(day) {
+ switch (day) {
+ case 0:
+ return "'domenica scorsa alle' p"
+ default:
+ return "'" + weekdays[day] + " scorso alle' p"
+ }
+}
+
+function thisWeek(day) {
+ return "'" + weekdays[day] + " alle' p"
+}
+
+function nextWeek(day) {
+ switch (day) {
+ case 0:
+ return "'domenica prossima alle' p"
+ default:
+ return "'" + weekdays[day] + " prossimo alle' p"
+ }
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'ieri alle' p",
+ today: "'oggi alle' p",
+ tomorrow: "'domani alle' p",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/it/_lib/localize/index.js b/date-fns/src/locale/it/_lib/localize/index.js
new file mode 100644
index 0000000..2707f5c
--- /dev/null
+++ b/date-fns/src/locale/it/_lib/localize/index.js
@@ -0,0 +1,166 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['aC', 'dC'],
+ abbreviated: ['a.C.', 'd.C.'],
+ wide: ['avanti Cristo', 'dopo Cristo']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
+ wide: ['1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre']
+}
+
+var monthValues = {
+ narrow: ['G', 'F', 'M', 'A', 'M', 'G', 'L', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'gen',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'mag',
+ 'giu',
+ 'lug',
+ 'ago',
+ 'set',
+ 'ott',
+ 'nov',
+ 'dic'
+ ],
+ wide: [
+ 'gennaio',
+ 'febbraio',
+ 'marzo',
+ 'aprile',
+ 'maggio',
+ 'giugno',
+ 'luglio',
+ 'agosto',
+ 'settembre',
+ 'ottobre',
+ 'novembre',
+ 'dicembre'
+ ]
+}
+
+var dayValues = {
+ narrow: ['D', 'L', 'M', 'M', 'G', 'V', 'S'],
+ short: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
+ abbreviated: ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'],
+ wide: [
+ 'domenica',
+ 'lunedì',
+ 'martedì',
+ 'mercoledì',
+ 'giovedì',
+ 'venerdì',
+ 'sabato'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'm.',
+ pm: 'p.',
+ midnight: 'mezzanotte',
+ noon: 'mezzogiorno',
+ morning: 'mattina',
+ afternoon: 'pomeriggio',
+ evening: 'sera',
+ night: 'notte'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'mezzanotte',
+ noon: 'mezzogiorno',
+ morning: 'mattina',
+ afternoon: 'pomeriggio',
+ evening: 'sera',
+ night: 'notte'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'mezzanotte',
+ noon: 'mezzogiorno',
+ morning: 'mattina',
+ afternoon: 'pomeriggio',
+ evening: 'sera',
+ night: 'notte'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'm.',
+ pm: 'p.',
+ midnight: 'mezzanotte',
+ noon: 'mezzogiorno',
+ morning: 'di mattina',
+ afternoon: 'del pomeriggio',
+ evening: 'di sera',
+ night: 'di notte'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'mezzanotte',
+ noon: 'mezzogiorno',
+ morning: 'di mattina',
+ afternoon: 'del pomeriggio',
+ evening: 'di sera',
+ night: 'di notte'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'mezzanotte',
+ noon: 'mezzogiorno',
+ morning: 'di mattina',
+ afternoon: 'del pomeriggio',
+ evening: 'di sera',
+ night: 'di notte'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + 'º'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/it/_lib/match/index.js b/date-fns/src/locale/it/_lib/match/index.js
new file mode 100644
index 0000000..fa4e057
--- /dev/null
+++ b/date-fns/src/locale/it/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(º)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(aC|dC)/i,
+ abbreviated: /^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,
+ wide: /^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i
+}
+var parseEraPatterns = {
+ any: [/^a/i, /^(d|e)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^t[1234]/i,
+ wide: /^[1234](º)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[gfmalsond]/i,
+ abbreviated: /^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,
+ wide: /^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^g/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^g/i,
+ /^l/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ge/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^mag/i,
+ /^gi/i,
+ /^l/i,
+ /^ag/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dlmgvs]/i,
+ short: /^(do|lu|ma|me|gi|ve|sa)/i,
+ abbreviated: /^(dom|lun|mar|mer|gio|ven|sab)/i,
+ wide: /^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^g/i, /^v/i, /^s/i],
+ any: [/^d/i, /^l/i, /^ma/i, /^me/i, /^g/i, /^v/i, /^s/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,
+ any: /^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mezza/i,
+ noon: /^mezzo/i,
+ morning: /mattina/i,
+ afternoon: /pomeriggio/i,
+ evening: /sera/i,
+ night: /notte/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/it/index.d.ts b/date-fns/src/locale/it/index.d.ts
new file mode 100644
index 0000000..6e0422e
--- /dev/null
+++ b/date-fns/src/locale/it/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { it } from 'date-fns/locale'
+export default it
diff --git a/date-fns/src/locale/it/index.js b/date-fns/src/locale/it/index.js
new file mode 100644
index 0000000..b7aeec0
--- /dev/null
+++ b/date-fns/src/locale/it/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Italian locale.
+ * @language Italian
+ * @iso-639-2 ita
+ * @author Alberto Restifo [@albertorestifo]{@link https://github.com/albertorestifo}
+ * @author Giovanni Polimeni [@giofilo]{@link https://github.com/giofilo}
+ * @author Vincenzo Carrese [@vin-car]{@link https://github.com/vin-car}
+ */
+var locale = {
+ code: 'it',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/it/index.js.flow b/date-fns/src/locale/it/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/it/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/it/snapshot.md b/date-fns/src/locale/it/snapshot.md
new file mode 100644
index 0000000..53f0aea
--- /dev/null
+++ b/date-fns/src/locale/it/snapshot.md
@@ -0,0 +1,304 @@
+# Italian (it) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | --------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987º | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987º | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4º | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | lug | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | febbraio | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | luglio | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | L | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | lug | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | febbraio | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | luglio | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | L | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28º | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42º | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365º | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | lunedì | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venerdì | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lun | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ven | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | lunedì | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venerdì | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lun | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ven | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | lunedì | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venerdì | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lun | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ven | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ven | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | lunedì | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | venerdì | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | L | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lun | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | ven | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | p. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | p. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | m. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | di mattina | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | del pomeriggio | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | di sera | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | di notte | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | di mattina | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | del pomeriggio | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | di sera | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | di notte | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | di mattina | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | del pomeriggio | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | di sera | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | di notte | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | di mattina | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | del pomeriggio | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | di sera | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | di notte | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | di mattina | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | del pomeriggio | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | di sera | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | di notte | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1º | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55º | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1º | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55º | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mag 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 febbraio 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maggio 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | mercoledì 11 febbraio 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | domenica 29 maggio 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 feb 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mag 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 febbraio 1987 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 maggio 1453 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | mercoledì 11 febbraio 1987 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | domenica 29 maggio 1453 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | circa 6 anni | circa 6 anni | tra circa 6 anni |
+| 2005-01-01T00:00:00.000Z | circa 5 anni | circa 5 anni | tra circa 5 anni |
+| 2004-01-01T00:00:00.000Z | circa 4 anni | circa 4 anni | tra circa 4 anni |
+| 2003-01-01T00:00:00.000Z | circa 3 anni | circa 3 anni | tra circa 3 anni |
+| 2002-01-01T00:00:00.000Z | circa 2 anni | circa 2 anni | tra circa 2 anni |
+| 2001-06-01T00:00:00.000Z | più di un anno | più di un anno | tra più di un anno |
+| 2001-02-01T00:00:00.000Z | circa un anno | circa un anno | tra circa un anno |
+| 2001-01-01T00:00:00.000Z | circa un anno | circa un anno | tra circa un anno |
+| 2000-06-01T00:00:00.000Z | 5 mesi | 5 mesi | tra 5 mesi |
+| 2000-03-01T00:00:00.000Z | 2 mesi | 2 mesi | tra 2 mesi |
+| 2000-02-01T00:00:00.000Z | circa un mese | circa un mese | tra circa un mese |
+| 2000-01-15T00:00:00.000Z | 14 giorni | 14 giorni | tra 14 giorni |
+| 2000-01-02T00:00:00.000Z | un giorno | un giorno | tra un giorno |
+| 2000-01-01T06:00:00.000Z | circa 6 ore | circa 6 ore | tra circa 6 ore |
+| 2000-01-01T01:00:00.000Z | circa un'ora | circa un'ora | tra circa un'ora |
+| 2000-01-01T00:45:00.000Z | circa un'ora | circa un'ora | tra circa un'ora |
+| 2000-01-01T00:30:00.000Z | 30 minuti | 30 minuti | tra 30 minuti |
+| 2000-01-01T00:15:00.000Z | 15 minuti | 15 minuti | tra 15 minuti |
+| 2000-01-01T00:01:00.000Z | un minuto | un minuto | tra un minuto |
+| 2000-01-01T00:00:25.000Z | meno di un minuto | alcuni secondi | tra meno di un minuto |
+| 2000-01-01T00:00:15.000Z | meno di un minuto | meno di 20 secondi | tra meno di un minuto |
+| 2000-01-01T00:00:05.000Z | meno di un minuto | meno di 10 secondi | tra meno di un minuto |
+| 2000-01-01T00:00:00.000Z | meno di un minuto | meno di 5 secondi | meno di un minuto fa |
+| 1999-12-31T23:59:55.000Z | meno di un minuto | meno di 10 secondi | meno di un minuto fa |
+| 1999-12-31T23:59:45.000Z | meno di un minuto | meno di 20 secondi | meno di un minuto fa |
+| 1999-12-31T23:59:35.000Z | meno di un minuto | alcuni secondi | meno di un minuto fa |
+| 1999-12-31T23:59:00.000Z | un minuto | un minuto | un minuto fa |
+| 1999-12-31T23:45:00.000Z | 15 minuti | 15 minuti | 15 minuti fa |
+| 1999-12-31T23:30:00.000Z | 30 minuti | 30 minuti | 30 minuti fa |
+| 1999-12-31T23:15:00.000Z | circa un'ora | circa un'ora | circa un'ora fa |
+| 1999-12-31T23:00:00.000Z | circa un'ora | circa un'ora | circa un'ora fa |
+| 1999-12-31T18:00:00.000Z | circa 6 ore | circa 6 ore | circa 6 ore fa |
+| 1999-12-30T00:00:00.000Z | 2 giorni | 2 giorni | 2 giorni fa |
+| 1999-12-15T00:00:00.000Z | 17 giorni | 17 giorni | 17 giorni fa |
+| 1999-12-01T00:00:00.000Z | circa un mese | circa un mese | circa un mese fa |
+| 1999-11-01T00:00:00.000Z | 2 mesi | 2 mesi | 2 mesi fa |
+| 1999-06-01T00:00:00.000Z | 7 mesi | 7 mesi | 7 mesi fa |
+| 1999-01-01T00:00:00.000Z | circa un anno | circa un anno | circa un anno fa |
+| 1998-12-01T00:00:00.000Z | circa un anno | circa un anno | circa un anno fa |
+| 1998-06-01T00:00:00.000Z | più di un anno | più di un anno | più di un anno fa |
+| 1998-01-01T00:00:00.000Z | circa 2 anni | circa 2 anni | circa 2 anni fa |
+| 1997-01-01T00:00:00.000Z | circa 3 anni | circa 3 anni | circa 3 anni fa |
+| 1996-01-01T00:00:00.000Z | circa 4 anni | circa 4 anni | circa 4 anni fa |
+| 1995-01-01T00:00:00.000Z | circa 5 anni | circa 5 anni | circa 5 anni fa |
+| 1994-01-01T00:00:00.000Z | circa 6 anni | circa 6 anni | circa 6 anni fa |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 anni | tra 6 anni | 52608 ore |
+| 2005-01-01T00:00:00.000Z | 5 anni | tra 5 anni | 43848 ore |
+| 2004-01-01T00:00:00.000Z | 4 anni | tra 4 anni | 35064 ore |
+| 2003-01-01T00:00:00.000Z | 3 anni | tra 3 anni | 26304 ore |
+| 2002-01-01T00:00:00.000Z | 2 anni | tra 2 anni | 17544 ore |
+| 2001-06-01T00:00:00.000Z | un anno | tra un anno | 12408 ore |
+| 2001-02-01T00:00:00.000Z | un anno | tra un anno | 9528 ore |
+| 2001-01-01T00:00:00.000Z | un anno | tra un anno | 8784 ore |
+| 2000-06-01T00:00:00.000Z | 5 mesi | tra 5 mesi | 3648 ore |
+| 2000-03-01T00:00:00.000Z | 2 mesi | tra 2 mesi | 1440 ore |
+| 2000-02-01T00:00:00.000Z | un mese | tra un mese | 744 ore |
+| 2000-01-15T00:00:00.000Z | 14 giorni | tra 14 giorni | 336 ore |
+| 2000-01-02T00:00:00.000Z | un giorno | tra un giorno | 24 ore |
+| 2000-01-01T06:00:00.000Z | 6 ore | tra 6 ore | 6 ore |
+| 2000-01-01T01:00:00.000Z | un'ora | tra un'ora | un'ora |
+| 2000-01-01T00:45:00.000Z | 45 minuti | tra 45 minuti | un'ora |
+| 2000-01-01T00:30:00.000Z | 30 minuti | tra 30 minuti | un'ora |
+| 2000-01-01T00:15:00.000Z | 15 minuti | tra 15 minuti | 0 ore |
+| 2000-01-01T00:01:00.000Z | un minuto | tra un minuto | 0 ore |
+| 2000-01-01T00:00:25.000Z | 25 secondi | tra 25 secondi | 0 ore |
+| 2000-01-01T00:00:15.000Z | 15 secondi | tra 15 secondi | 0 ore |
+| 2000-01-01T00:00:05.000Z | 5 secondi | tra 5 secondi | 0 ore |
+| 2000-01-01T00:00:00.000Z | 0 secondi | 0 secondi fa | 0 ore |
+| 1999-12-31T23:59:55.000Z | 5 secondi | 5 secondi fa | 0 ore |
+| 1999-12-31T23:59:45.000Z | 15 secondi | 15 secondi fa | 0 ore |
+| 1999-12-31T23:59:35.000Z | 25 secondi | 25 secondi fa | 0 ore |
+| 1999-12-31T23:59:00.000Z | un minuto | un minuto fa | 0 ore |
+| 1999-12-31T23:45:00.000Z | 15 minuti | 15 minuti fa | 0 ore |
+| 1999-12-31T23:30:00.000Z | 30 minuti | 30 minuti fa | un'ora |
+| 1999-12-31T23:15:00.000Z | 45 minuti | 45 minuti fa | un'ora |
+| 1999-12-31T23:00:00.000Z | un'ora | un'ora fa | un'ora |
+| 1999-12-31T18:00:00.000Z | 6 ore | 6 ore fa | 6 ore |
+| 1999-12-30T00:00:00.000Z | 2 giorni | 2 giorni fa | 48 ore |
+| 1999-12-15T00:00:00.000Z | 17 giorni | 17 giorni fa | 408 ore |
+| 1999-12-01T00:00:00.000Z | un mese | un mese fa | 744 ore |
+| 1999-11-01T00:00:00.000Z | 2 mesi | 2 mesi fa | 1464 ore |
+| 1999-06-01T00:00:00.000Z | 7 mesi | 7 mesi fa | 5136 ore |
+| 1999-01-01T00:00:00.000Z | un anno | un anno fa | 8760 ore |
+| 1998-12-01T00:00:00.000Z | un anno | un anno fa | 9504 ore |
+| 1998-06-01T00:00:00.000Z | 2 anni | 2 anni fa | 13896 ore |
+| 1998-01-01T00:00:00.000Z | 2 anni | 2 anni fa | 17520 ore |
+| 1997-01-01T00:00:00.000Z | 3 anni | 3 anni fa | 26280 ore |
+| 1996-01-01T00:00:00.000Z | 4 anni | 4 anni fa | 35064 ore |
+| 1995-01-01T00:00:00.000Z | 5 anni | 5 anni fa | 43824 ore |
+| 1994-01-01T00:00:00.000Z | 6 anni | 6 anni fa | 52584 ore |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | mercoledì prossimo alle 00:00 |
+| 2000-01-02T00:00:00.000Z | domani alle 00:00 |
+| 2000-01-01T00:00:00.000Z | oggi alle 00:00 |
+| 1999-12-31T00:00:00.000Z | ieri alle 00:00 |
+| 1999-12-27T00:00:00.000Z | lunedì alle 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/ja/_lib/formatDistance/index.js b/date-fns/src/locale/ja/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e3f05e1
--- /dev/null
+++ b/date-fns/src/locale/ja/_lib/formatDistance/index.js
@@ -0,0 +1,116 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: '1秒未満',
+ other: '{{count}}秒未満',
+ oneWithSuffix: '約1秒',
+ otherWithSuffix: '約{{count}}秒'
+ },
+
+ xSeconds: {
+ one: '1秒',
+ other: '{{count}}秒'
+ },
+
+ halfAMinute: '30秒',
+
+ lessThanXMinutes: {
+ one: '1分未満',
+ other: '{{count}}分未満',
+ oneWithSuffix: '約1分',
+ otherWithSuffix: '約{{count}}分'
+ },
+
+ xMinutes: {
+ one: '1分',
+ other: '{{count}}分'
+ },
+
+ aboutXHours: {
+ one: '約1時間',
+ other: '約{{count}}時間'
+ },
+
+ xHours: {
+ one: '1時間',
+ other: '{{count}}時間'
+ },
+
+ xDays: {
+ one: '1日',
+ other: '{{count}}日'
+ },
+
+ aboutXWeeks: {
+ one: '約1週間',
+ other: '約{{count}}週間'
+ },
+
+ xWeeks: {
+ one: '1週間',
+ other: '{{count}}週間'
+ },
+
+ aboutXMonths: {
+ one: '約1か月',
+ other: '約{{count}}か月'
+ },
+
+ xMonths: {
+ one: '1か月',
+ other: '{{count}}か月'
+ },
+
+ aboutXYears: {
+ one: '約1年',
+ other: '約{{count}}年'
+ },
+
+ xYears: {
+ one: '1年',
+ other: '{{count}}年'
+ },
+
+ overXYears: {
+ one: '1年以上',
+ other: '{{count}}年以上'
+ },
+
+ almostXYears: {
+ one: '1年近く',
+ other: '{{count}}年近く'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ if (options.addSuffix && formatDistanceLocale[token].oneWithSuffix) {
+ result = formatDistanceLocale[token].oneWithSuffix
+ } else {
+ result = formatDistanceLocale[token].one
+ }
+ } else {
+ if (options.addSuffix && formatDistanceLocale[token].otherWithSuffix) {
+ result = formatDistanceLocale[token].otherWithSuffix.replace(
+ '{{count}}',
+ count
+ )
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + '後'
+ } else {
+ return result + '前'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ja/_lib/formatLong/index.js b/date-fns/src/locale/ja/_lib/formatLong/index.js
new file mode 100644
index 0000000..c1331de
--- /dev/null
+++ b/date-fns/src/locale/ja/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'y年M月d日EEEE',
+ long: 'y年M月d日',
+ medium: 'y/MM/dd',
+ short: 'y/MM/dd'
+}
+
+var timeFormats = {
+ full: 'H時mm分ss秒 zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ja/_lib/formatRelative/index.js b/date-fns/src/locale/ja/_lib/formatRelative/index.js
new file mode 100644
index 0000000..38c57b3
--- /dev/null
+++ b/date-fns/src/locale/ja/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: '先週のeeeeのp',
+ yesterday: '昨日のp',
+ today: '今日のp',
+ tomorrow: '明日のp',
+ nextWeek: '翌週のeeeeのp',
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ja/_lib/localize/index.js b/date-fns/src/locale/ja/_lib/localize/index.js
new file mode 100644
index 0000000..165e97c
--- /dev/null
+++ b/date-fns/src/locale/ja/_lib/localize/index.js
@@ -0,0 +1,180 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['BC', 'AC'],
+ abbreviated: ['紀元前', '西暦'],
+ wide: ['紀元前', '西暦'],
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['第1四半期', '第2四半期', '第3四半期', '第4四半期'],
+}
+
+var monthValues = {
+ narrow: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+ abbreviated: [
+ '1月',
+ '2月',
+ '3月',
+ '4月',
+ '5月',
+ '6月',
+ '7月',
+ '8月',
+ '9月',
+ '10月',
+ '11月',
+ '12月',
+ ],
+ wide: [
+ '1月',
+ '2月',
+ '3月',
+ '4月',
+ '5月',
+ '6月',
+ '7月',
+ '8月',
+ '9月',
+ '10月',
+ '11月',
+ '12月',
+ ],
+}
+
+var dayValues = {
+ narrow: ['日', '月', '火', '水', '木', '金', '土'],
+ short: ['日', '月', '火', '水', '木', '金', '土'],
+ abbreviated: ['日', '月', '火', '水', '木', '金', '土'],
+ wide: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'],
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: '午前',
+ pm: '午後',
+ midnight: '深夜',
+ noon: '正午',
+ morning: '朝',
+ afternoon: '午後',
+ evening: '夜',
+ night: '深夜',
+ },
+ abbreviated: {
+ am: '午前',
+ pm: '午後',
+ midnight: '深夜',
+ noon: '正午',
+ morning: '朝',
+ afternoon: '午後',
+ evening: '夜',
+ night: '深夜',
+ },
+ wide: {
+ am: '午前',
+ pm: '午後',
+ midnight: '深夜',
+ noon: '正午',
+ morning: '朝',
+ afternoon: '午後',
+ evening: '夜',
+ night: '深夜',
+ },
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: '午前',
+ pm: '午後',
+ midnight: '深夜',
+ noon: '正午',
+ morning: '朝',
+ afternoon: '午後',
+ evening: '夜',
+ night: '深夜',
+ },
+ abbreviated: {
+ am: '午前',
+ pm: '午後',
+ midnight: '深夜',
+ noon: '正午',
+ morning: '朝',
+ afternoon: '午後',
+ evening: '夜',
+ night: '深夜',
+ },
+ wide: {
+ am: '午前',
+ pm: '午後',
+ midnight: '深夜',
+ noon: '正午',
+ morning: '朝',
+ afternoon: '午後',
+ evening: '夜',
+ night: '深夜',
+ },
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+
+ if (unit === 'date') {
+ return number + '日'
+ }
+
+ if (unit === 'year') {
+ return number + '年'
+ }
+
+ return number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide',
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function (quarter) {
+ return Number(quarter) - 1
+ },
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide',
+ }),
+}
+
+export default localize
diff --git a/date-fns/src/locale/ja/_lib/match/index.js b/date-fns/src/locale/ja/_lib/match/index.js
new file mode 100644
index 0000000..0f14680
--- /dev/null
+++ b/date-fns/src/locale/ja/_lib/match/index.js
@@ -0,0 +1,122 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^第?\d+(日)?(年)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(B\.?C\.?|A\.?D\.?)/i,
+ abbreviated: /^(紀元[前後]|西暦)/i,
+ wide: /^(紀元[前後]|西暦)/i,
+}
+var parseEraPatterns = {
+ narrow: [/^B/i, /^A/i],
+ any: [/^(紀元前)/i, /^(西暦|紀元後)/i],
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^Q[1234]/i,
+ wide: /^第[1234一二三四1234]四半期/i,
+}
+var parseQuarterPatterns = {
+ any: [/(1|一|1)/i, /(2|二|2)/i, /(3|三|3)/i, /(4|四|4)/i],
+}
+
+var matchMonthPatterns = {
+ narrow: /^([123456789]|1[012])/,
+ abbreviated: /^([123456789]|1[012])月/i,
+ wide: /^([123456789]|1[012])月/i,
+}
+var parseMonthPatterns = {
+ any: [
+ /^1\D/,
+ /^2/,
+ /^3/,
+ /^4/,
+ /^5/,
+ /^6/,
+ /^7/,
+ /^8/,
+ /^9/,
+ /^10/,
+ /^11/,
+ /^12/,
+ ],
+}
+
+var matchDayPatterns = {
+ narrow: /^[日月火水木金土]/,
+ short: /^[日月火水木金土]/,
+ abbreviated: /^[日月火水木金土]/,
+ wide: /^[日月火水木金土]曜日/,
+}
+var parseDayPatterns = {
+ any: [/^日/, /^月/, /^火/, /^水/, /^木/, /^金/, /^土/],
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i,
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^(A|午前)/i,
+ pm: /^(P|午後)/i,
+ midnight: /^深夜|真夜中/i,
+ noon: /^正午/i,
+ morning: /^朝/i,
+ afternoon: /^午後/i,
+ evening: /^夜/i,
+ night: /^深夜/i,
+ },
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function (value) {
+ return parseInt(value, 10)
+ },
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function (index) {
+ return index + 1
+ },
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any',
+ }),
+}
+
+export default match
diff --git a/date-fns/src/locale/ja/index.d.ts b/date-fns/src/locale/ja/index.d.ts
new file mode 100644
index 0000000..dec4f9c
--- /dev/null
+++ b/date-fns/src/locale/ja/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ja } from 'date-fns/locale'
+export default ja
diff --git a/date-fns/src/locale/ja/index.js b/date-fns/src/locale/ja/index.js
new file mode 100644
index 0000000..251eda9
--- /dev/null
+++ b/date-fns/src/locale/ja/index.js
@@ -0,0 +1,32 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Japanese locale.
+ * @language Japanese
+ * @iso-639-2 jpn
+ * @author Thomas Eilmsteiner [@DeMuu]{@link https://github.com/DeMuu}
+ * @author Yamagishi Kazutoshi [@ykzts]{@link https://github.com/ykzts}
+ * @author Luca Ban [@mesqueeb]{@link https://github.com/mesqueeb}
+ * @author Terrence Lam [@skyuplam]{@link https://github.com/skyuplam}
+ * @author Taiki IKeda [@so99ynoodles]{@link https://github.com/so99ynoodles}
+ */
+var locale = {
+ code: 'ja',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ja/index.js.flow b/date-fns/src/locale/ja/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ja/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ja/snapshot.md b/date-fns/src/locale/ja/snapshot.md
new file mode 100644
index 0000000..ed600e5
--- /dev/null
+++ b/date-fns/src/locale/ja/snapshot.md
@@ -0,0 +1,304 @@
+# Japanese (ja) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 年 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 年 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 年 | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 年 | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 第 1 四半期 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第 2 四半期 | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 第 1 四半期 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第 2 四半期 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49 | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 日 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 日 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | 月曜日 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金曜日 | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | 月曜日 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金曜日 | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | 月曜日 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金曜日 | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | 月曜日 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金曜日 | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | 月 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 金 | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 午前 | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | 朝 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 夜 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 深夜 | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | 朝 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 夜 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 深夜 | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | 朝 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 夜 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 深夜 | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | 朝 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 夜 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 深夜 | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | 朝 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 午後 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 夜 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 深夜 | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987/02/11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987/02/11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日水曜日 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日日曜日 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12 時 13 分 14 秒 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23 時 59 分 59 秒 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987/02/11 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987/02/11 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453/05/29 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日水曜日 12 時 13 分 14 秒 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日日曜日 23 時 59 分 59 秒 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------- | ---------------------- | ----------------- |
+| 2006-01-01T00:00:00.000Z | 約 6 年 | 約 6 年 | 約 6 年後 |
+| 2005-01-01T00:00:00.000Z | 約 5 年 | 約 5 年 | 約 5 年後 |
+| 2004-01-01T00:00:00.000Z | 約 4 年 | 約 4 年 | 約 4 年後 |
+| 2003-01-01T00:00:00.000Z | 約 3 年 | 約 3 年 | 約 3 年後 |
+| 2002-01-01T00:00:00.000Z | 約 2 年 | 約 2 年 | 約 2 年後 |
+| 2001-06-01T00:00:00.000Z | 1 年以上 | 1 年以上 | 1 年以上後 |
+| 2001-02-01T00:00:00.000Z | 約 1 年 | 約 1 年 | 約 1 年後 |
+| 2001-01-01T00:00:00.000Z | 約 1 年 | 約 1 年 | 約 1 年後 |
+| 2000-06-01T00:00:00.000Z | 5 か月 | 5 か月 | 5 か月後 |
+| 2000-03-01T00:00:00.000Z | 2 か月 | 2 か月 | 2 か月後 |
+| 2000-02-01T00:00:00.000Z | 約 1 か月 | 約 1 か月 | 約 1 か月後 |
+| 2000-01-15T00:00:00.000Z | 14 日 | 14 日 | 14 日後 |
+| 2000-01-02T00:00:00.000Z | 1 日 | 1 日 | 1 日後 |
+| 2000-01-01T06:00:00.000Z | 約 6 時間 | 約 6 時間 | 約 6 時間後 |
+| 2000-01-01T01:00:00.000Z | 約 1 時間 | 約 1 時間 | 約 1 時間後 |
+| 2000-01-01T00:45:00.000Z | 約 1 時間 | 約 1 時間 | 約 1 時間後 |
+| 2000-01-01T00:30:00.000Z | 30 分 | 30 分 | 30 分後 |
+| 2000-01-01T00:15:00.000Z | 15 分 | 15 分 | 15 分後 |
+| 2000-01-01T00:01:00.000Z | 1 分 | 1 分 | 1 分後 |
+| 2000-01-01T00:00:25.000Z | 1 分未満 | 30 秒 | 約 1 分後 |
+| 2000-01-01T00:00:15.000Z | 1 分未満 | 20 秒未満 | 約 1 分後 |
+| 2000-01-01T00:00:05.000Z | 1 分未満 | 10 秒未満 | 約 1 分後 |
+| 2000-01-01T00:00:00.000Z | 1 分未満 | 5 秒未満 | 約 1 分前 |
+| 1999-12-31T23:59:55.000Z | 1 分未満 | 10 秒未満 | 約 1 分前 |
+| 1999-12-31T23:59:45.000Z | 1 分未満 | 20 秒未満 | 約 1 分前 |
+| 1999-12-31T23:59:35.000Z | 1 分未満 | 30 秒 | 約 1 分前 |
+| 1999-12-31T23:59:00.000Z | 1 分 | 1 分 | 1 分前 |
+| 1999-12-31T23:45:00.000Z | 15 分 | 15 分 | 15 分前 |
+| 1999-12-31T23:30:00.000Z | 30 分 | 30 分 | 30 分前 |
+| 1999-12-31T23:15:00.000Z | 約 1 時間 | 約 1 時間 | 約 1 時間前 |
+| 1999-12-31T23:00:00.000Z | 約 1 時間 | 約 1 時間 | 約 1 時間前 |
+| 1999-12-31T18:00:00.000Z | 約 6 時間 | 約 6 時間 | 約 6 時間前 |
+| 1999-12-30T00:00:00.000Z | 2 日 | 2 日 | 2 日前 |
+| 1999-12-15T00:00:00.000Z | 17 日 | 17 日 | 17 日前 |
+| 1999-12-01T00:00:00.000Z | 約 1 か月 | 約 1 か月 | 約 1 か月前 |
+| 1999-11-01T00:00:00.000Z | 2 か月 | 2 か月 | 2 か月前 |
+| 1999-06-01T00:00:00.000Z | 7 か月 | 7 か月 | 7 か月前 |
+| 1999-01-01T00:00:00.000Z | 約 1 年 | 約 1 年 | 約 1 年前 |
+| 1998-12-01T00:00:00.000Z | 約 1 年 | 約 1 年 | 約 1 年前 |
+| 1998-06-01T00:00:00.000Z | 1 年以上 | 1 年以上 | 1 年以上前 |
+| 1998-01-01T00:00:00.000Z | 約 2 年 | 約 2 年 | 約 2 年前 |
+| 1997-01-01T00:00:00.000Z | 約 3 年 | 約 3 年 | 約 3 年前 |
+| 1996-01-01T00:00:00.000Z | 約 4 年 | 約 4 年 | 約 4 年前 |
+| 1995-01-01T00:00:00.000Z | 約 5 年 | 約 5 年 | 約 5 年前 |
+| 1994-01-01T00:00:00.000Z | 約 6 年 | 約 6 年 | 約 6 年前 |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------ | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 年 | 6 年後 | 52608 時間 |
+| 2005-01-01T00:00:00.000Z | 5 年 | 5 年後 | 43848 時間 |
+| 2004-01-01T00:00:00.000Z | 4 年 | 4 年後 | 35064 時間 |
+| 2003-01-01T00:00:00.000Z | 3 年 | 3 年後 | 26304 時間 |
+| 2002-01-01T00:00:00.000Z | 2 年 | 2 年後 | 17544 時間 |
+| 2001-06-01T00:00:00.000Z | 1 年 | 1 年後 | 12408 時間 |
+| 2001-02-01T00:00:00.000Z | 1 年 | 1 年後 | 9528 時間 |
+| 2001-01-01T00:00:00.000Z | 1 年 | 1 年後 | 8784 時間 |
+| 2000-06-01T00:00:00.000Z | 5 か月 | 5 か月後 | 3648 時間 |
+| 2000-03-01T00:00:00.000Z | 2 か月 | 2 か月後 | 1440 時間 |
+| 2000-02-01T00:00:00.000Z | 1 か月 | 1 か月後 | 744 時間 |
+| 2000-01-15T00:00:00.000Z | 14 日 | 14 日後 | 336 時間 |
+| 2000-01-02T00:00:00.000Z | 1 日 | 1 日後 | 24 時間 |
+| 2000-01-01T06:00:00.000Z | 6 時間 | 6 時間後 | 6 時間 |
+| 2000-01-01T01:00:00.000Z | 1 時間 | 1 時間後 | 1 時間 |
+| 2000-01-01T00:45:00.000Z | 45 分 | 45 分後 | 1 時間 |
+| 2000-01-01T00:30:00.000Z | 30 分 | 30 分後 | 1 時間 |
+| 2000-01-01T00:15:00.000Z | 15 分 | 15 分後 | 0 時間 |
+| 2000-01-01T00:01:00.000Z | 1 分 | 1 分後 | 0 時間 |
+| 2000-01-01T00:00:25.000Z | 25 秒 | 25 秒後 | 0 時間 |
+| 2000-01-01T00:00:15.000Z | 15 秒 | 15 秒後 | 0 時間 |
+| 2000-01-01T00:00:05.000Z | 5 秒 | 5 秒後 | 0 時間 |
+| 2000-01-01T00:00:00.000Z | 0 秒 | 0 秒前 | 0 時間 |
+| 1999-12-31T23:59:55.000Z | 5 秒 | 5 秒前 | 0 時間 |
+| 1999-12-31T23:59:45.000Z | 15 秒 | 15 秒前 | 0 時間 |
+| 1999-12-31T23:59:35.000Z | 25 秒 | 25 秒前 | 0 時間 |
+| 1999-12-31T23:59:00.000Z | 1 分 | 1 分前 | 0 時間 |
+| 1999-12-31T23:45:00.000Z | 15 分 | 15 分前 | 0 時間 |
+| 1999-12-31T23:30:00.000Z | 30 分 | 30 分前 | 1 時間 |
+| 1999-12-31T23:15:00.000Z | 45 分 | 45 分前 | 1 時間 |
+| 1999-12-31T23:00:00.000Z | 1 時間 | 1 時間前 | 1 時間 |
+| 1999-12-31T18:00:00.000Z | 6 時間 | 6 時間前 | 6 時間 |
+| 1999-12-30T00:00:00.000Z | 2 日 | 2 日前 | 48 時間 |
+| 1999-12-15T00:00:00.000Z | 17 日 | 17 日前 | 408 時間 |
+| 1999-12-01T00:00:00.000Z | 1 か月 | 1 か月前 | 744 時間 |
+| 1999-11-01T00:00:00.000Z | 2 か月 | 2 か月前 | 1464 時間 |
+| 1999-06-01T00:00:00.000Z | 7 か月 | 7 か月前 | 5136 時間 |
+| 1999-01-01T00:00:00.000Z | 1 年 | 1 年前 | 8760 時間 |
+| 1998-12-01T00:00:00.000Z | 1 年 | 1 年前 | 9504 時間 |
+| 1998-06-01T00:00:00.000Z | 2 年 | 2 年前 | 13896 時間 |
+| 1998-01-01T00:00:00.000Z | 2 年 | 2 年前 | 17520 時間 |
+| 1997-01-01T00:00:00.000Z | 3 年 | 3 年前 | 26280 時間 |
+| 1996-01-01T00:00:00.000Z | 4 年 | 4 年前 | 35064 時間 |
+| 1995-01-01T00:00:00.000Z | 5 年 | 5 年前 | 43824 時間 |
+| 1994-01-01T00:00:00.000Z | 6 年 | 6 年前 | 52584 時間 |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------- |
+| 2000-01-10T00:00:00.000Z | 2000/01/10 |
+| 2000-01-05T00:00:00.000Z | 翌週の水曜日の 0:00 |
+| 2000-01-02T00:00:00.000Z | 明日の 0:00 |
+| 2000-01-01T00:00:00.000Z | 今日の 0:00 |
+| 1999-12-31T00:00:00.000Z | 昨日の 0:00 |
+| 1999-12-27T00:00:00.000Z | 先週の月曜日の 0:00 |
+| 1999-12-21T00:00:00.000Z | 1999/12/21 |
diff --git a/date-fns/src/locale/ka/_lib/formatDistance/index.js b/date-fns/src/locale/ka/_lib/formatDistance/index.js
new file mode 100644
index 0000000..717f353
--- /dev/null
+++ b/date-fns/src/locale/ka/_lib/formatDistance/index.js
@@ -0,0 +1,114 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ past: '{{count}} წამზე ნაკლები ხნის წინ',
+ present: '{{count}} წამზე ნაკლები',
+ future: '{{count}} წამზე ნაკლებში'
+ },
+
+ xSeconds: {
+ past: '{{count}} წამის წინ',
+ present: '{{count}} წამი',
+ future: '{{count}} წამში'
+ },
+
+ halfAMinute: {
+ past: 'ნახევარი წუთის წინ',
+ present: 'ნახევარი წუთი',
+ future: 'ნახევარი წუთში'
+ },
+
+ lessThanXMinutes: {
+ past: '{{count}} წუთზე ნაკლები ხნის წინ',
+ present: '{{count}} წუთზე ნაკლები',
+ future: '{{count}} წუთზე ნაკლებში'
+ },
+
+ xMinutes: {
+ past: '{{count}} წუთის წინ',
+ present: '{{count}} წუთი',
+ future: '{{count}} წუთში'
+ },
+
+ aboutXHours: {
+ past: 'დაახლოებით {{count}} საათის წინ',
+ present: 'დაახლოებით {{count}} საათი',
+ future: 'დაახლოებით {{count}} საათში'
+ },
+
+ xHours: {
+ past: '{{count}} საათის წინ',
+ present: '{{count}} საათი',
+ future: '{{count}} საათში'
+ },
+
+ xDays: {
+ past: '{{count}} დღის წინ',
+ present: '{{count}} დღე',
+ future: '{{count}} დღეში'
+ },
+
+ aboutXWeeks: {
+ past: 'დაახლოებით {{count}} კვირას წინ',
+ present: 'დაახლოებით {{count}} კვირა',
+ future: 'დაახლოებით {{count}} კვირაში'
+ },
+
+ xWeeks: {
+ past: '{{count}} კვირას კვირა',
+ present: '{{count}} კვირა',
+ future: '{{count}} კვირაში'
+ },
+
+ aboutXMonths: {
+ past: 'დაახლოებით {{count}} თვის წინ',
+ present: 'დაახლოებით {{count}} თვე',
+ future: 'დაახლოებით {{count}} თვეში'
+ },
+
+ xMonths: {
+ past: '{{count}} თვის წინ',
+ present: '{{count}} თვე',
+ future: '{{count}} თვეში'
+ },
+
+ aboutXYears: {
+ past: 'დაახლოებით {{count}} წლის წინ',
+ present: 'დაახლოებით {{count}} წელი',
+ future: 'დაახლოებით {{count}} წელში'
+ },
+
+ xYears: {
+ past: '{{count}} წლის წინ',
+ present: '{{count}} წელი',
+ future: '{{count}} წელში'
+ },
+
+ overXYears: {
+ past: '{{count}} წელზე მეტი ხნის წინ',
+ present: '{{count}} წელზე მეტი',
+ future: '{{count}} წელზე მეტი ხნის შემდეგ'
+ },
+
+ almostXYears: {
+ past: 'თითქმის {{count}} წლის წინ',
+ present: 'თითქმის {{count}} წელი',
+ future: 'თითქმის {{count}} წელში'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (options.addSuffix && options.comparison > 0) {
+ result = formatDistanceLocale[token].future.replace('{{count}}', count)
+ } else if (options.addSuffix && options.comparison <= 0) {
+ result = formatDistanceLocale[token].past.replace('{{count}}', count)
+ } else {
+ result = formatDistanceLocale[token].present.replace('{{count}}', count)
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ka/_lib/formatLong/index.js b/date-fns/src/locale/ka/_lib/formatLong/index.js
new file mode 100644
index 0000000..a310361
--- /dev/null
+++ b/date-fns/src/locale/ka/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, do MMMM, y',
+ long: 'do, MMMM, y',
+ medium: 'd, MMM, y',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} {{time}}'-ზე'",
+ long: "{{date}} {{time}}'-ზე'",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ka/_lib/formatRelative/index.js b/date-fns/src/locale/ka/_lib/formatRelative/index.js
new file mode 100644
index 0000000..e4f0ef0
--- /dev/null
+++ b/date-fns/src/locale/ka/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'წინა' eeee LT'-ზე'",
+ yesterday: "'გუშინ' LT'-ზე'",
+ today: "'დღეს' LT'-ზე'",
+ tomorrow: "'ხვალ' LT'-ზე'",
+ nextWeek: "'შემდეგი' eeee LT'-ზე'",
+ other: 'L'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ka/_lib/localize/index.js b/date-fns/src/locale/ka/_lib/localize/index.js
new file mode 100644
index 0000000..f658893
--- /dev/null
+++ b/date-fns/src/locale/ka/_lib/localize/index.js
@@ -0,0 +1,198 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ჩ.წ-მდე', 'ჩ.წ'],
+ abbreviated: ['ჩვ.წ-მდე', 'ჩვ.წ'],
+ wide: ['ჩვენს წელთაღრიცხვამდე', 'ჩვენი წელთაღრიცხვით']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1-ლი კვ', '2-ე კვ', '3-ე კვ', '4-ე კვ'],
+ wide: ['1-ლი კვარტალი', '2-ე კვარტალი', '3-ე კვარტალი', '4-ე კვარტალი']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: [
+ 'ია',
+ 'თე',
+ 'მა',
+ 'აპ',
+ 'მს',
+ 'ვნ',
+ 'ვლ',
+ 'აგ',
+ 'სე',
+ 'ოქ',
+ 'ნო',
+ 'დე'
+ ],
+ abbreviated: [
+ 'იან',
+ 'თებ',
+ 'მარ',
+ 'აპრ',
+ 'მაი',
+ 'ივნ',
+ 'ივლ',
+ 'აგვ',
+ 'სექ',
+ 'ოქტ',
+ 'ნოე',
+ 'დეკ'
+ ],
+ wide: [
+ 'იანვარი',
+ 'თებერვალი',
+ 'მარტი',
+ 'აპრილი',
+ 'მაისი',
+ 'ივნისი',
+ 'ივლისი',
+ 'აგვისტო',
+ 'სექტემბერი',
+ 'ოქტომბერი',
+ 'ნოემბერი',
+ 'დეკემბერი'
+ ]
+}
+
+var dayValues = {
+ narrow: ['კვ', 'ორ', 'სა', 'ოთ', 'ხუ', 'პა', 'შა'],
+ short: ['კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ'],
+ abbreviated: ['კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ'],
+ wide: [
+ 'კვირა',
+ 'ორშაბათი',
+ 'სამშაბათი',
+ 'ოთხშაბათი',
+ 'ხუთშაბათი',
+ 'პარასკევი',
+ 'შაბათი'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'შუაღამე',
+ noon: 'შუადღე',
+ morning: 'დილა',
+ afternoon: 'საღამო',
+ evening: 'საღამო',
+ night: 'ღამე'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'შუაღამე',
+ noon: 'შუადღე',
+ morning: 'დილა',
+ afternoon: 'საღამო',
+ evening: 'საღამო',
+ night: 'ღამე'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'შუაღამე',
+ noon: 'შუადღე',
+ morning: 'დილა',
+ afternoon: 'საღამო',
+ evening: 'საღამო',
+ night: 'ღამე'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'შუაღამით',
+ noon: 'შუადღისას',
+ morning: 'დილით',
+ afternoon: 'ნაშუადღევს',
+ evening: 'საღამოს',
+ night: 'ღამით'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'შუაღამით',
+ noon: 'შუადღისას',
+ morning: 'დილით',
+ afternoon: 'ნაშუადღევს',
+ evening: 'საღამოს',
+ night: 'ღამით'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'შუაღამით',
+ noon: 'შუადღისას',
+ morning: 'დილით',
+ afternoon: 'ნაშუადღევს',
+ evening: 'საღამოს',
+ night: 'ღამით'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ if (number === 1) {
+ return number + '-ლი'
+ }
+
+ return number + '-ე'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ka/_lib/match/index.js b/date-fns/src/locale/ka/_lib/match/index.js
new file mode 100644
index 0000000..f7493d4
--- /dev/null
+++ b/date-fns/src/locale/ka/_lib/match/index.js
@@ -0,0 +1,121 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-ლი|-ე)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ჩვ?\.წ)/i,
+ abbreviated: /^(ჩვ?\.წ)/i,
+ wide: /^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე|ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i
+}
+var parseEraPatterns = {
+ any: [
+ /^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე)/i,
+ /^(ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i
+ ]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]-(ლი|ე)? კვ/i,
+ wide: /^[1234]-(ლი|ე)? კვარტალი/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ any: /^(ია|თე|მა|აპ|მს|ვნ|ვლ|აგ|სე|ოქ|ნო|დე)/i
+}
+var parseMonthPatterns = {
+ any: [
+ /^ია/i,
+ /^თ/i,
+ /^მარ/i,
+ /^აპ/i,
+ /^მაი/i,
+ /^ი?ვნ/i,
+ /^ი?ვლ/i,
+ /^აგ/i,
+ /^ს/i,
+ /^ო/i,
+ /^ნ/i,
+ /^დ/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(კვ|ორ|სა|ოთ|ხუ|პა|შა)/i,
+ short: /^(კვი|ორშ|სამ|ოთხ|ხუთ|პარ|შაბ)/i,
+ long: /^(კვირა|ორშაბათი|სამშაბათი|ოთხშაბათი|ხუთშაბათი|პარასკევი|შაბათი)/i
+}
+var parseDayPatterns = {
+ any: [/^კვ/i, /^ორ/i, /^სა/i, /^ოთ/i, /^ხუ/i, /^პა/i, /^შა/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^([ap]\.?\s?m\.?|შუაღ|დილ)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^შუაღ/i,
+ noon: /^შუადღ/i,
+ morning: /^დილ/i,
+ afternoon: /ნაშუადღევს/i,
+ evening: /საღამო/i,
+ night: /ღამ/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ka/index.d.ts b/date-fns/src/locale/ka/index.d.ts
new file mode 100644
index 0000000..c0be71a
--- /dev/null
+++ b/date-fns/src/locale/ka/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ka } from 'date-fns/locale'
+export default ka
diff --git a/date-fns/src/locale/ka/index.js b/date-fns/src/locale/ka/index.js
new file mode 100644
index 0000000..f586bad
--- /dev/null
+++ b/date-fns/src/locale/ka/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Georgian locale.
+ * @language Georgian
+ * @iso-639-2 geo
+ * @author Lado Lomidze [@Landish]{@link https://github.com/Landish}
+ * @author Nick Shvelidze [@shvelo]{@link https://github.com/shvelo}
+ */
+var locale = {
+ code: 'ka',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ka/index.js.flow b/date-fns/src/locale/ka/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ka/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ka/snapshot.md b/date-fns/src/locale/ka/snapshot.md
new file mode 100644
index 0000000..4c878bf
--- /dev/null
+++ b/date-fns/src/locale/ka/snapshot.md
@@ -0,0 +1,304 @@
+# Georgian (ka) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-ე | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-ე | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-ე | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-ე | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-ლი | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ე | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1-ლი კვ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ე კვ | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-ლი კვარტალი | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ე კვარტალი | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-ლი | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ე | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1-ლი კვ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ე კვ | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-ლი კვარტალი | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ე კვარტალი | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-ე | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ე | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | თებ | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ივლ | Invalid Date |
+| | MMMM | 2019-02-11T12:13:14.015Z | თებერვალი | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ივლისი | Invalid Date |
+| | MMMMM | 2019-02-11T12:13:14.015Z | თე | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ვლ | Invalid Date |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-ე | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ე | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | თებ | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ივლ | Invalid Date |
+| | LLLL | 2019-02-11T12:13:14.015Z | თებერვალი | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ივლისი | Invalid Date |
+| | LLLLL | 2019-02-11T12:13:14.015Z | თე | Invalid Date |
+| | | 2019-07-10T12:13:14.015Z | ვლ | Invalid Date |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-ლი | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ე | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-ლი | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ე | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-ე | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-ე | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-ე | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-ე | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | ორშ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარ | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | ორშ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარ | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | ორშ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარ | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | ორშაბათი | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარასკევი | Invalid Date |
+| | EEEEE | 2019-02-11T12:13:14.015Z | ორ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პა | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ორშ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პარ | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-ლი | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ე | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | ორშ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარ | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | ორშაბათი | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარასკევი | Invalid Date |
+| | iiiii | 2019-02-11T12:13:14.015Z | ორ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პა | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ორშ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პარ | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-ლი | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ე | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | ორშ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარ | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | ორშაბათი | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარასკევი | Invalid Date |
+| | eeeee | 2019-02-11T12:13:14.015Z | ორ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პა | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ორშ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პარ | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-ლი | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ე | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | ორშ | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარ | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | ორშაბათი | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | პარასკევი | Invalid Date |
+| | ccccc | 2019-02-11T12:13:14.015Z | ორ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პა | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ორშ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | პარ | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | p | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | p | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | a | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | p | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | p | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | a | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | დილით | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | ნაშუადღევს | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | საღამოს | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ღამით | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | დილით | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | ნაშუადღევს | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | საღამოს | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ღამით | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | დილით | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | ნაშუადღევს | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | საღამოს | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ღამით | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | დილით | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | ნაშუადღევს | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | საღამოს | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ღამით | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | დილით | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | ნაშუადღევს | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | საღამოს | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ღამით | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-ე | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ე | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-ე | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ე | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-ე | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ე | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-ე | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ე | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-ლი | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-ე | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-ლი | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-ე | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11, თებ, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29, მაი, 1453 | Invalid Date |
+| | PPP | 1987-02-11T12:13:14.015Z | 11-ე, თებერვალი, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29-ე, მაისი, 1453 | Invalid Date |
+| | PPPP | 1987-02-11T12:13:14.015Z | ოთხშაბათი, 11-ე თებერვალი, 1987 | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | კვირა, 29-ე მაისი, 1453 | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 PM | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 PM GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 PM GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 PM | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 PM | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11, თებ, 1987, 12:13:14 PM | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29, მაი, 1453, 11:59:59 PM | Invalid Date |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11-ე, თებერვალი, 1987 12:13:14 PM GMT+0-ზე | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | 29-ე, მაისი, 1453 11:59:59 PM GMT+0-ზე | Invalid Date |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | ოთხშაბათი, 11-ე თებერვალი, 1987 12:13:14 PM GMT+00:00-ზე | Invalid Date |
+| | | 1453-05-29T23:59:59.999Z | კვირა, 29-ე მაისი, 1453 11:59:59 PM GMT+00:00-ზე | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------ |
+| 2006-01-01T00:00:00.000Z | დაახლოებით 6 წელი | დაახლოებით 6 წელი | დაახლოებით 6 წელში |
+| 2005-01-01T00:00:00.000Z | დაახლოებით 5 წელი | დაახლოებით 5 წელი | დაახლოებით 5 წელში |
+| 2004-01-01T00:00:00.000Z | დაახლოებით 4 წელი | დაახლოებით 4 წელი | დაახლოებით 4 წელში |
+| 2003-01-01T00:00:00.000Z | დაახლოებით 3 წელი | დაახლოებით 3 წელი | დაახლოებით 3 წელში |
+| 2002-01-01T00:00:00.000Z | დაახლოებით 2 წელი | დაახლოებით 2 წელი | დაახლოებით 2 წელში |
+| 2001-06-01T00:00:00.000Z | 1 წელზე მეტი | 1 წელზე მეტი | 1 წელზე მეტი ხნის შემდეგ |
+| 2001-02-01T00:00:00.000Z | დაახლოებით 1 წელი | დაახლოებით 1 წელი | დაახლოებით 1 წელში |
+| 2001-01-01T00:00:00.000Z | დაახლოებით 1 წელი | დაახლოებით 1 წელი | დაახლოებით 1 წელში |
+| 2000-06-01T00:00:00.000Z | 5 თვე | 5 თვე | 5 თვეში |
+| 2000-03-01T00:00:00.000Z | 2 თვე | 2 თვე | 2 თვეში |
+| 2000-02-01T00:00:00.000Z | დაახლოებით 1 თვე | დაახლოებით 1 თვე | დაახლოებით 1 თვეში |
+| 2000-01-15T00:00:00.000Z | 14 დღე | 14 დღე | 14 დღეში |
+| 2000-01-02T00:00:00.000Z | 1 დღე | 1 დღე | 1 დღეში |
+| 2000-01-01T06:00:00.000Z | დაახლოებით 6 საათი | დაახლოებით 6 საათი | დაახლოებით 6 საათში |
+| 2000-01-01T01:00:00.000Z | დაახლოებით 1 საათი | დაახლოებით 1 საათი | დაახლოებით 1 საათში |
+| 2000-01-01T00:45:00.000Z | დაახლოებით 1 საათი | დაახლოებით 1 საათი | დაახლოებით 1 საათში |
+| 2000-01-01T00:30:00.000Z | 30 წუთი | 30 წუთი | 30 წუთში |
+| 2000-01-01T00:15:00.000Z | 15 წუთი | 15 წუთი | 15 წუთში |
+| 2000-01-01T00:01:00.000Z | 1 წუთი | 1 წუთი | 1 წუთში |
+| 2000-01-01T00:00:25.000Z | 1 წუთზე ნაკლები | ნახევარი წუთი | 1 წუთზე ნაკლებში |
+| 2000-01-01T00:00:15.000Z | 1 წუთზე ნაკლები | 20 წამზე ნაკლები | 1 წუთზე ნაკლებში |
+| 2000-01-01T00:00:05.000Z | 1 წუთზე ნაკლები | 10 წამზე ნაკლები | 1 წუთზე ნაკლებში |
+| 2000-01-01T00:00:00.000Z | 1 წუთზე ნაკლები | 5 წამზე ნაკლები | 1 წუთზე ნაკლები ხნის წინ |
+| 1999-12-31T23:59:55.000Z | 1 წუთზე ნაკლები | 10 წამზე ნაკლები | 1 წუთზე ნაკლები ხნის წინ |
+| 1999-12-31T23:59:45.000Z | 1 წუთზე ნაკლები | 20 წამზე ნაკლები | 1 წუთზე ნაკლები ხნის წინ |
+| 1999-12-31T23:59:35.000Z | 1 წუთზე ნაკლები | ნახევარი წუთი | 1 წუთზე ნაკლები ხნის წინ |
+| 1999-12-31T23:59:00.000Z | 1 წუთი | 1 წუთი | 1 წუთის წინ |
+| 1999-12-31T23:45:00.000Z | 15 წუთი | 15 წუთი | 15 წუთის წინ |
+| 1999-12-31T23:30:00.000Z | 30 წუთი | 30 წუთი | 30 წუთის წინ |
+| 1999-12-31T23:15:00.000Z | დაახლოებით 1 საათი | დაახლოებით 1 საათი | დაახლოებით 1 საათის წინ |
+| 1999-12-31T23:00:00.000Z | დაახლოებით 1 საათი | დაახლოებით 1 საათი | დაახლოებით 1 საათის წინ |
+| 1999-12-31T18:00:00.000Z | დაახლოებით 6 საათი | დაახლოებით 6 საათი | დაახლოებით 6 საათის წინ |
+| 1999-12-30T00:00:00.000Z | 2 დღე | 2 დღე | 2 დღის წინ |
+| 1999-12-15T00:00:00.000Z | 17 დღე | 17 დღე | 17 დღის წინ |
+| 1999-12-01T00:00:00.000Z | დაახლოებით 1 თვე | დაახლოებით 1 თვე | დაახლოებით 1 თვის წინ |
+| 1999-11-01T00:00:00.000Z | 2 თვე | 2 თვე | 2 თვის წინ |
+| 1999-06-01T00:00:00.000Z | 7 თვე | 7 თვე | 7 თვის წინ |
+| 1999-01-01T00:00:00.000Z | დაახლოებით 1 წელი | დაახლოებით 1 წელი | დაახლოებით 1 წლის წინ |
+| 1998-12-01T00:00:00.000Z | დაახლოებით 1 წელი | დაახლოებით 1 წელი | დაახლოებით 1 წლის წინ |
+| 1998-06-01T00:00:00.000Z | 1 წელზე მეტი | 1 წელზე მეტი | 1 წელზე მეტი ხნის წინ |
+| 1998-01-01T00:00:00.000Z | დაახლოებით 2 წელი | დაახლოებით 2 წელი | დაახლოებით 2 წლის წინ |
+| 1997-01-01T00:00:00.000Z | დაახლოებით 3 წელი | დაახლოებით 3 წელი | დაახლოებით 3 წლის წინ |
+| 1996-01-01T00:00:00.000Z | დაახლოებით 4 წელი | დაახლოებით 4 წელი | დაახლოებით 4 წლის წინ |
+| 1995-01-01T00:00:00.000Z | დაახლოებით 5 წელი | დაახლოებით 5 წელი | დაახლოებით 5 წლის წინ |
+| 1994-01-01T00:00:00.000Z | დაახლოებით 6 წელი | დაახლოებით 6 წელი | დაახლოებით 6 წლის წინ |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 წელი | 6 წელში | 52608 საათი |
+| 2005-01-01T00:00:00.000Z | 5 წელი | 5 წელში | 43848 საათი |
+| 2004-01-01T00:00:00.000Z | 4 წელი | 4 წელში | 35064 საათი |
+| 2003-01-01T00:00:00.000Z | 3 წელი | 3 წელში | 26304 საათი |
+| 2002-01-01T00:00:00.000Z | 2 წელი | 2 წელში | 17544 საათი |
+| 2001-06-01T00:00:00.000Z | 1 წელი | 1 წელში | 12408 საათი |
+| 2001-02-01T00:00:00.000Z | 1 წელი | 1 წელში | 9528 საათი |
+| 2001-01-01T00:00:00.000Z | 1 წელი | 1 წელში | 8784 საათი |
+| 2000-06-01T00:00:00.000Z | 5 თვე | 5 თვეში | 3648 საათი |
+| 2000-03-01T00:00:00.000Z | 2 თვე | 2 თვეში | 1440 საათი |
+| 2000-02-01T00:00:00.000Z | 1 თვე | 1 თვეში | 744 საათი |
+| 2000-01-15T00:00:00.000Z | 14 დღე | 14 დღეში | 336 საათი |
+| 2000-01-02T00:00:00.000Z | 1 დღე | 1 დღეში | 24 საათი |
+| 2000-01-01T06:00:00.000Z | 6 საათი | 6 საათში | 6 საათი |
+| 2000-01-01T01:00:00.000Z | 1 საათი | 1 საათში | 1 საათი |
+| 2000-01-01T00:45:00.000Z | 45 წუთი | 45 წუთში | 1 საათი |
+| 2000-01-01T00:30:00.000Z | 30 წუთი | 30 წუთში | 1 საათი |
+| 2000-01-01T00:15:00.000Z | 15 წუთი | 15 წუთში | 0 საათი |
+| 2000-01-01T00:01:00.000Z | 1 წუთი | 1 წუთში | 0 საათი |
+| 2000-01-01T00:00:25.000Z | 25 წამი | 25 წამში | 0 საათი |
+| 2000-01-01T00:00:15.000Z | 15 წამი | 15 წამში | 0 საათი |
+| 2000-01-01T00:00:05.000Z | 5 წამი | 5 წამში | 0 საათი |
+| 2000-01-01T00:00:00.000Z | 0 წამი | 0 წამის წინ | 0 საათი |
+| 1999-12-31T23:59:55.000Z | 5 წამი | 5 წამის წინ | 0 საათი |
+| 1999-12-31T23:59:45.000Z | 15 წამი | 15 წამის წინ | 0 საათი |
+| 1999-12-31T23:59:35.000Z | 25 წამი | 25 წამის წინ | 0 საათი |
+| 1999-12-31T23:59:00.000Z | 1 წუთი | 1 წუთის წინ | 0 საათი |
+| 1999-12-31T23:45:00.000Z | 15 წუთი | 15 წუთის წინ | 0 საათი |
+| 1999-12-31T23:30:00.000Z | 30 წუთი | 30 წუთის წინ | 1 საათი |
+| 1999-12-31T23:15:00.000Z | 45 წუთი | 45 წუთის წინ | 1 საათი |
+| 1999-12-31T23:00:00.000Z | 1 საათი | 1 საათის წინ | 1 საათი |
+| 1999-12-31T18:00:00.000Z | 6 საათი | 6 საათის წინ | 6 საათი |
+| 1999-12-30T00:00:00.000Z | 2 დღე | 2 დღის წინ | 48 საათი |
+| 1999-12-15T00:00:00.000Z | 17 დღე | 17 დღის წინ | 408 საათი |
+| 1999-12-01T00:00:00.000Z | 1 თვე | 1 თვის წინ | 744 საათი |
+| 1999-11-01T00:00:00.000Z | 2 თვე | 2 თვის წინ | 1464 საათი |
+| 1999-06-01T00:00:00.000Z | 7 თვე | 7 თვის წინ | 5136 საათი |
+| 1999-01-01T00:00:00.000Z | 1 წელი | 1 წლის წინ | 8760 საათი |
+| 1998-12-01T00:00:00.000Z | 1 წელი | 1 წლის წინ | 9504 საათი |
+| 1998-06-01T00:00:00.000Z | 2 წელი | 2 წლის წინ | 13896 საათი |
+| 1998-01-01T00:00:00.000Z | 2 წელი | 2 წლის წინ | 17520 საათი |
+| 1997-01-01T00:00:00.000Z | 3 წელი | 3 წლის წინ | 26280 საათი |
+| 1996-01-01T00:00:00.000Z | 4 წელი | 4 წლის წინ | 35064 საათი |
+| 1995-01-01T00:00:00.000Z | 5 წელი | 5 წლის წინ | 43824 საათი |
+| 1994-01-01T00:00:00.000Z | 6 წელი | 6 წლის წინ | 52584 საათი |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------------------- |
+| 2000-01-10T00:00:00.000Z | 1 |
+| 2000-01-05T00:00:00.000Z | შემდეგი ოთხშაბათი 1947030400000-ზე |
+| 2000-01-02T00:00:00.000Z | ხვალ 1946771200000-ზე |
+| 2000-01-01T00:00:00.000Z | დღეს 1946684800000-ზე |
+| 1999-12-31T00:00:00.000Z | გუშინ 12946598400000-ზე |
+| 1999-12-27T00:00:00.000Z | წინა ორშაბათი 12946252800000-ზე |
+| 1999-12-21T00:00:00.000Z | 12 |
diff --git a/date-fns/src/locale/kk/_lib/formatDistance/index.js b/date-fns/src/locale/kk/_lib/formatDistance/index.js
new file mode 100644
index 0000000..a5c38de
--- /dev/null
+++ b/date-fns/src/locale/kk/_lib/formatDistance/index.js
@@ -0,0 +1,246 @@
+function declension(scheme, count) {
+ // scheme for count=1 exists
+ if (scheme.one !== undefined && count === 1) {
+ return scheme.one
+ }
+
+ var rem10 = count % 10
+ var rem100 = count % 100
+
+ // 1, 21, 31, ...
+ if (rem10 === 1 && rem100 !== 11) {
+ return scheme.singularNominative.replace('{{count}}', count)
+
+ // 2, 3, 4, 22, 23, 24, 32 ...
+ } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
+ return scheme.singularGenitive.replace('{{count}}', count)
+
+ // 5, 6, 7, 8, 9, 10, 11, ...
+ } else {
+ return scheme.pluralGenitive.replace('{{count}}', count)
+ }
+}
+
+function buildLocalizeTokenFn(scheme) {
+ return function(count, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ if (scheme.future) {
+ return declension(scheme.future, count)
+ } else {
+ return declension(scheme.regular, count) + ' кейін'
+ }
+ } else {
+ if (scheme.past) {
+ return declension(scheme.past, count)
+ } else {
+ return declension(scheme.regular, count) + ' бұрын'
+ }
+ }
+ } else {
+ return declension(scheme.regular, count)
+ }
+ }
+}
+
+var formatDistanceLocale = {
+ lessThanXSeconds: buildLocalizeTokenFn({
+ regular: {
+ one: '1 секундтан аз',
+ singularNominative: '{{count}} секундтан аз',
+ singularGenitive: '{{count}} секундтан аз',
+ pluralGenitive: '{{count}} секундтан аз'
+ },
+ future: {
+ one: 'бір секундтан кейін',
+ singularNominative: '{{count}} секундтан кейін',
+ singularGenitive: '{{count}} секундтан кейін',
+ pluralGenitive: '{{count}} секундтан кейін'
+ }
+ }),
+
+ xSeconds: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} секунд',
+ singularGenitive: '{{count}} секунд',
+ pluralGenitive: '{{count}} секунд'
+ },
+ past: {
+ singularNominative: '{{count}} секунд бұрын',
+ singularGenitive: '{{count}} секунд бұрын',
+ pluralGenitive: '{{count}} секунд бұрын'
+ },
+ future: {
+ singularNominative: '{{count}} секундтан кейін',
+ singularGenitive: '{{count}} секундтан кейін',
+ pluralGenitive: '{{count}} секундтан кейін'
+ }
+ }),
+
+ halfAMinute: function(_, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'жарты минут ішінде'
+ } else {
+ return 'жарты минут бұрын'
+ }
+ }
+
+ return 'жарты минут'
+ },
+
+ lessThanXMinutes: buildLocalizeTokenFn({
+ regular: {
+ one: '1 минуттан аз',
+ singularNominative: '{{count}} минуттан аз',
+ singularGenitive: '{{count}} минуттан аз',
+ pluralGenitive: '{{count}} минуттан аз'
+ },
+ future: {
+ one: 'минуттан кем ',
+ singularNominative: '{{count}} минуттан кем',
+ singularGenitive: '{{count}} минуттан кем',
+ pluralGenitive: '{{count}} минуттан кем'
+ }
+ }),
+
+ xMinutes: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} минут',
+ singularGenitive: '{{count}} минут',
+ pluralGenitive: '{{count}} минут'
+ },
+ past: {
+ singularNominative: '{{count}} минут бұрын',
+ singularGenitive: '{{count}} минут бұрын',
+ pluralGenitive: '{{count}} минут бұрын'
+ },
+ future: {
+ singularNominative: '{{count}} минуттан кейін',
+ singularGenitive: '{{count}} минуттан кейін',
+ pluralGenitive: '{{count}} минуттан кейін'
+ }
+ }),
+
+ aboutXHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'шамамен {{count}} сағат',
+ singularGenitive: 'шамамен {{count}} сағат',
+ pluralGenitive: 'шамамен {{count}} сағат'
+ },
+ future: {
+ singularNominative: 'шамамен {{count}} сағаттан кейін',
+ singularGenitive: 'шамамен {{count}} сағаттан кейін',
+ pluralGenitive: 'шамамен {{count}} сағаттан кейін'
+ }
+ }),
+
+ xHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} сағат',
+ singularGenitive: '{{count}} сағат',
+ pluralGenitive: '{{count}} сағат'
+ }
+ }),
+
+ xDays: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} күн',
+ singularGenitive: '{{count}} күн',
+ pluralGenitive: '{{count}} күн'
+ },
+ future: {
+ singularNominative: '{{count}} күннен кейін',
+ singularGenitive: '{{count}} күннен кейін',
+ pluralGenitive: '{{count}} күннен кейін'
+ }
+ }),
+
+ aboutXWeeks: {
+ one: 'шамамен 1 апта',
+ other: 'шамамен {{count}} апта'
+ },
+
+ xWeeks: {
+ one: '1 апта',
+ other: '{{count}} апта'
+ },
+
+ aboutXMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'шамамен {{count}} ай',
+ singularGenitive: 'шамамен {{count}} ай',
+ pluralGenitive: 'шамамен {{count}} ай'
+ },
+ future: {
+ singularNominative: 'шамамен {{count}} айдан кейін',
+ singularGenitive: 'шамамен {{count}} айдан кейін',
+ pluralGenitive: 'шамамен {{count}} айдан кейін'
+ }
+ }),
+
+ xMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} ай',
+ singularGenitive: '{{count}} ай',
+ pluralGenitive: '{{count}} ай'
+ }
+ }),
+
+ aboutXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'шамамен {{count}} жыл',
+ singularGenitive: 'шамамен {{count}} жыл',
+ pluralGenitive: 'шамамен {{count}} жыл'
+ },
+ future: {
+ singularNominative: 'шамамен {{count}} жылдан кейін',
+ singularGenitive: 'шамамен {{count}} жылдан кейін',
+ pluralGenitive: 'шамамен {{count}} жылдан кейін'
+ }
+ }),
+
+ xYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} жыл',
+ singularGenitive: '{{count}} жыл',
+ pluralGenitive: '{{count}} жыл'
+ },
+ future: {
+ singularNominative: '{{count}} жылдан кейін',
+ singularGenitive: '{{count}} жылдан кейін',
+ pluralGenitive: '{{count}} жылдан кейін'
+ }
+ }),
+
+ overXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} жылдан астам',
+ singularGenitive: '{{count}} жылдан астам',
+ pluralGenitive: '{{count}} жылдан астам'
+ },
+ future: {
+ singularNominative: '{{count}} жылдан астам',
+ singularGenitive: '{{count}} жылдан астам',
+ pluralGenitive: '{{count}} жылдан астам'
+ }
+ }),
+
+ almostXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} жылға жақын',
+ singularGenitive: '{{count}} жылға жақын',
+ pluralGenitive: '{{count}} жылға жақын'
+ },
+ future: {
+ singularNominative: '{{count}} жылдан кейін',
+ singularGenitive: '{{count}} жылдан кейін',
+ pluralGenitive: '{{count}} жылдан кейін'
+ }
+ })
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ return formatDistanceLocale[token](count, options)
+}
diff --git a/date-fns/src/locale/kk/_lib/formatLong/index.js b/date-fns/src/locale/kk/_lib/formatLong/index.js
new file mode 100644
index 0000000..83f9208
--- /dev/null
+++ b/date-fns/src/locale/kk/_lib/formatLong/index.js
@@ -0,0 +1,38 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, do MMMM y 'ж.'",
+ long: "do MMMM y 'ж.'",
+ medium: "d MMM y 'ж.'",
+ short: 'dd.MM.yyyy'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ any: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'any'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/kk/_lib/formatRelative/index.js b/date-fns/src/locale/kk/_lib/formatRelative/index.js
new file mode 100644
index 0000000..0ffadc3
--- /dev/null
+++ b/date-fns/src/locale/kk/_lib/formatRelative/index.js
@@ -0,0 +1,62 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+var accusativeWeekdays = [
+ 'жексенбіде',
+ 'дүйсенбіде',
+ 'сейсенбіде',
+ 'сәрсенбіде',
+ 'бейсенбіде',
+ 'жұмада',
+ 'сенбіде'
+]
+
+function lastWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ return "'өткен " + weekday + " сағат' p'-де'"
+}
+
+function thisWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ return "'" + weekday + " сағат' p'-де'"
+}
+
+function nextWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ return "'келесі " + weekday + " сағат' p'-де'"
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'кеше сағат' p'-де'",
+ today: "'бүгін сағат' p'-де'",
+ tomorrow: "'ертең сағат' p'-де'",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/kk/_lib/localize/index.js b/date-fns/src/locale/kk/_lib/localize/index.js
new file mode 100644
index 0000000..eda70b2
--- /dev/null
+++ b/date-fns/src/locale/kk/_lib/localize/index.js
@@ -0,0 +1,203 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['б.з.д.', 'б.з.'],
+ abbreviated: ['б.з.д.', 'б.з.'],
+ wide: ['біздің заманымызға дейін', 'біздің заманымыз']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1-ші тоқ.', '2-ші тоқ.', '3-ші тоқ.', '4-ші тоқ.'],
+ wide: ['1-ші тоқсан', '2-ші тоқсан', '3-ші тоқсан', '4-ші тоқсан']
+}
+
+var monthValues = {
+ narrow: ['Қ', 'А', 'Н', 'С', 'М', 'М', 'Ш', 'Т', 'Қ', 'Қ', 'Қ', 'Ж'],
+ abbreviated: [
+ 'қаң',
+ 'ақп',
+ 'нау',
+ 'сәу',
+ 'мам',
+ 'мау',
+ 'шіл',
+ 'там',
+ 'қыр',
+ 'қаз',
+ 'қар',
+ 'жел'
+ ],
+ wide: [
+ 'қаңтар',
+ 'ақпан',
+ 'наурыз',
+ 'сәуір',
+ 'мамыр',
+ 'маусым',
+ 'шілде',
+ 'тамыз',
+ 'қыркүйек',
+ 'қазан',
+ 'қараша',
+ 'желтоқсан'
+ ]
+}
+var formattingMonthValues = {
+ narrow: ['Қ', 'А', 'Н', 'С', 'М', 'М', 'Ш', 'Т', 'Қ', 'Қ', 'Қ', 'Ж'],
+ abbreviated: [
+ 'қаң',
+ 'ақп',
+ 'нау',
+ 'сәу',
+ 'мам',
+ 'мау',
+ 'шіл',
+ 'там',
+ 'қыр',
+ 'қаз',
+ 'қар',
+ 'жел'
+ ],
+ wide: [
+ 'қаңтар',
+ 'ақпан',
+ 'наурыз',
+ 'сәуір',
+ 'мамыр',
+ 'маусым',
+ 'шілде',
+ 'тамыз',
+ 'қыркүйек',
+ 'қазан',
+ 'қараша',
+ 'желтоқсан'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Ж', 'Д', 'С', 'С', 'Б', 'Ж', 'С'],
+ short: ['жс', 'дс', 'сс', 'ср', 'бс', 'жм', 'сб'],
+ abbreviated: ['жс', 'дс', 'сс', 'ср', 'бс', 'жм', 'сб'],
+ wide: [
+ 'жексенбі',
+ 'дүйсенбі',
+ 'сейсенбі',
+ 'сәрсенбі',
+ 'бейсенбі',
+ 'жұма',
+ 'сенбі'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ТД',
+ pm: 'ТК',
+ midnight: 'түн ортасы',
+ noon: 'түс',
+ morning: 'таң',
+ afternoon: 'күндіз',
+ evening: 'кеш',
+ night: 'түн'
+ },
+ wide: {
+ am: 'ТД',
+ pm: 'ТК',
+ midnight: 'түн ортасы',
+ noon: 'түс',
+ morning: 'таң',
+ afternoon: 'күндіз',
+ evening: 'кеш',
+ night: 'түн'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ТД',
+ pm: 'ТК',
+ midnight: 'түн ортасында',
+ noon: 'түс',
+ morning: 'таң',
+ afternoon: 'күн',
+ evening: 'кеш',
+ night: 'түн'
+ },
+ wide: {
+ am: 'ТД',
+ pm: 'ТК',
+ midnight: 'түн ортасында',
+ noon: 'түсте',
+ morning: 'таңертең',
+ afternoon: 'күндіз',
+ evening: 'кеште',
+ night: 'түнде'
+ }
+}
+var suffixes = {
+ 0: '-ші',
+ 1: '-ші',
+ 2: '-ші',
+ 3: '-ші',
+ 4: '-ші',
+ 5: '-ші',
+ 6: '-шы',
+ 7: '-ші',
+ 8: '-ші',
+ 9: '-шы',
+ 10: '-шы',
+ 20: '-шы',
+ 30: '-шы',
+ 40: '-шы',
+ 50: '-ші',
+ 60: '-шы',
+ 70: '-ші',
+ 80: '-ші',
+ 90: '-шы',
+ 100: '-ші'
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ var a = number % 10
+ var b = number >= 100 ? 100 : null
+ return number + (suffixes[number] || suffixes[a] || suffixes[b])
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'any',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/kk/_lib/match/index.js b/date-fns/src/locale/kk/_lib/match/index.js
new file mode 100644
index 0000000..80bd558
--- /dev/null
+++ b/date-fns/src/locale/kk/_lib/match/index.js
@@ -0,0 +1,160 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?(ші|шы))?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^((б )?з\.?\s?д\.?)/i,
+ abbreviated: /^((б )?з\.?\s?д\.?)/i,
+ wide: /^(біздің заманымызға дейін|біздің заманымыз|біздің заманымыздан)/i
+}
+var parseEraPatterns = {
+ any: [/^б/i, /^з/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234](-?ші)? тоқ.?/i,
+ wide: /^[1234](-?ші)? тоқсан/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(қ|а|н|с|м|мау|ш|т|қыр|қаз|қар|ж)/i,
+ abbreviated: /^(қаң|ақп|нау|сәу|мам|мау|шіл|там|қыр|қаз|қар|жел)/i,
+ wide: /^(қаңтар|ақпан|наурыз|сәуір|мамыр|маусым|шілде|тамыз|қыркүйек|қазан|қараша|желтоқсан)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^қ/i,
+ /^а/i,
+ /^н/i,
+ /^с/i,
+ /^м/i,
+ /^м/i,
+ /^ш/i,
+ /^т/i,
+ /^қ/i,
+ /^қ/i,
+ /^қ/i,
+ /^ж/i
+ ],
+ abbreviated: [
+ /^қаң/i,
+ /^ақп/i,
+ /^нау/i,
+ /^сәу/i,
+ /^мам/i,
+ /^мау/i,
+ /^шіл/i,
+ /^там/i,
+ /^қыр/i,
+ /^қаз/i,
+ /^қар/i,
+ /^жел/i
+ ],
+ any: [
+ /^қ/i,
+ /^а/i,
+ /^н/i,
+ /^с/i,
+ /^м/i,
+ /^м/i,
+ /^ш/i,
+ /^т/i,
+ /^қ/i,
+ /^қ/i,
+ /^қ/i,
+ /^ж/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(ж|д|с|с|б|ж|с)/i,
+ short: /^(жс|дс|сс|ср|бс|жм|сб)/i,
+ wide: /^(жексенбі|дүйсенбі|сейсенбі|сәрсенбі|бейсенбі|жұма|сенбі)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ж/i, /^д/i, /^с/i, /^с/i, /^б/i, /^ж/i, /^с/i],
+ short: [/^жс/i, /^дс/i, /^сс/i, /^ср/i, /^бс/i, /^жм/i, /^сб/i],
+ any: [
+ /^ж[ек]/i,
+ /^д[үй]/i,
+ /^сe[й]/i,
+ /^сә[р]/i,
+ /^б[ей]/i,
+ /^ж[ұм]/i,
+ /^се[н]/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i,
+ wide: /^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i,
+ any: /^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^ТД/i,
+ pm: /^ТК/i,
+ midnight: /^түн орта/i,
+ noon: /^күндіз/i,
+ morning: /таң/i,
+ afternoon: /түс/i,
+ evening: /кеш/i,
+ night: /түн/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/kk/index.d.ts b/date-fns/src/locale/kk/index.d.ts
new file mode 100644
index 0000000..8ccf1a7
--- /dev/null
+++ b/date-fns/src/locale/kk/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { kk } from 'date-fns/locale'
+export default kk
diff --git a/date-fns/src/locale/kk/index.js b/date-fns/src/locale/kk/index.js
new file mode 100644
index 0000000..0dbe714
--- /dev/null
+++ b/date-fns/src/locale/kk/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Kazakh locale.
+ * @language Kazakh
+ * @iso-639-2 kaz
+ * @author Nikita Bayev [@drugoi]{@link https://github.com/drugoi}
+ */
+var locale = {
+ code: 'kk',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/kk/index.js.flow b/date-fns/src/locale/kk/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/kk/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/kk/snapshot.md b/date-fns/src/locale/kk/snapshot.md
new file mode 100644
index 0000000..1daa59a
--- /dev/null
+++ b/date-fns/src/locale/kk/snapshot.md
@@ -0,0 +1,304 @@
+# Kazakh (kk) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-ші | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-ші | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-ші | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-ші | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-ші | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ші | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1-ші тоқ. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ші тоқ. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-ші тоқсан | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ші тоқсан | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-ші | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ші | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1-ші тоқ. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ші тоқ. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-ші тоқсан | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ші тоқсан | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-ші | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ші | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | ақп | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | шіл | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | ақпан | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | шілде | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | А | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ш | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-ші | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ші | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | ақп | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | шіл | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | ақпан | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | шілде | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | А | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Ш | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-ші | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ші | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-ші | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ші | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-ші | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-ші | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-ші | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-ші | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | дүйсенбі | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жұма | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ж | 2019-02-17T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-ші | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ші | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | дүйсенбі | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жұма | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ж | 2019-02-17T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-ші | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ші | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | дүйсенбі | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жұма | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ж | 2019-02-17T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-ші | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ші | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | дүйсенбі | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жұма | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ж | 2019-02-17T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | дс | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | жм | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | тд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | тк | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | тк | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | тд | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | тд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | тк | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | тк | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | тд | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ТК | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ТД | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | таңертең | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | күндіз | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | кеште | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | түнде | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | таңертең | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | күндіз | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | кеште | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | түнде | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | таңертең | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | күндіз | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | кеште | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | түнде | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | таңертең | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | күндіз | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | кеште | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | түнде | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | таң | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | күн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | кеш | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | түн | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-ші | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ші | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-ші | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ші | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-ші | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ші | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-ші | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ші | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-ші | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-ші | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-ші | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-ші | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 ақп 1987 ж. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мам 1453 ж. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11-ші ақпан 1987 ж. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-шы мамыр 1453 ж. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | сәрсенбі, 11-ші ақпан 1987 ж. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | жексенбі, 29-шы мамыр 1453 ж. | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 ақп 1987 ж., 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мам 1453 ж., 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11-ші ақпан 1987 ж., 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29-шы мамыр 1453 ж., 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | сәрсенбі, 11-ші ақпан 1987 ж., 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | жексенбі, 29-шы мамыр 1453 ж., 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------- | ---------------------- | ------------------------ |
+| 2006-01-01T00:00:00.000Z | шамамен 6 жыл | шамамен 6 жыл | шамамен 6 жылдан кейін |
+| 2005-01-01T00:00:00.000Z | шамамен 5 жыл | шамамен 5 жыл | шамамен 5 жылдан кейін |
+| 2004-01-01T00:00:00.000Z | шамамен 4 жыл | шамамен 4 жыл | шамамен 4 жылдан кейін |
+| 2003-01-01T00:00:00.000Z | шамамен 3 жыл | шамамен 3 жыл | шамамен 3 жылдан кейін |
+| 2002-01-01T00:00:00.000Z | шамамен 2 жыл | шамамен 2 жыл | шамамен 2 жылдан кейін |
+| 2001-06-01T00:00:00.000Z | 1 жылдан астам | 1 жылдан астам | 1 жылдан астам |
+| 2001-02-01T00:00:00.000Z | шамамен 1 жыл | шамамен 1 жыл | шамамен 1 жылдан кейін |
+| 2001-01-01T00:00:00.000Z | шамамен 1 жыл | шамамен 1 жыл | шамамен 1 жылдан кейін |
+| 2000-06-01T00:00:00.000Z | 5 ай | 5 ай | 5 ай кейін |
+| 2000-03-01T00:00:00.000Z | 2 ай | 2 ай | 2 ай кейін |
+| 2000-02-01T00:00:00.000Z | шамамен 1 ай | шамамен 1 ай | шамамен 1 айдан кейін |
+| 2000-01-15T00:00:00.000Z | 14 күн | 14 күн | 14 күннен кейін |
+| 2000-01-02T00:00:00.000Z | 1 күн | 1 күн | 1 күннен кейін |
+| 2000-01-01T06:00:00.000Z | шамамен 6 сағат | шамамен 6 сағат | шамамен 6 сағаттан кейін |
+| 2000-01-01T01:00:00.000Z | шамамен 1 сағат | шамамен 1 сағат | шамамен 1 сағаттан кейін |
+| 2000-01-01T00:45:00.000Z | шамамен 1 сағат | шамамен 1 сағат | шамамен 1 сағаттан кейін |
+| 2000-01-01T00:30:00.000Z | 30 минут | 30 минут | 30 минуттан кейін |
+| 2000-01-01T00:15:00.000Z | 15 минут | 15 минут | 15 минуттан кейін |
+| 2000-01-01T00:01:00.000Z | 1 минут | 1 минут | 1 минуттан кейін |
+| 2000-01-01T00:00:25.000Z | 1 минуттан аз | жарты минут | минуттан кем |
+| 2000-01-01T00:00:15.000Z | 1 минуттан аз | 20 секундтан аз | минуттан кем |
+| 2000-01-01T00:00:05.000Z | 1 минуттан аз | 10 секундтан аз | минуттан кем |
+| 2000-01-01T00:00:00.000Z | 1 минуттан аз | 5 секундтан аз | 1 минуттан аз бұрын |
+| 1999-12-31T23:59:55.000Z | 1 минуттан аз | 10 секундтан аз | 1 минуттан аз бұрын |
+| 1999-12-31T23:59:45.000Z | 1 минуттан аз | 20 секундтан аз | 1 минуттан аз бұрын |
+| 1999-12-31T23:59:35.000Z | 1 минуттан аз | жарты минут | 1 минуттан аз бұрын |
+| 1999-12-31T23:59:00.000Z | 1 минут | 1 минут | 1 минут бұрын |
+| 1999-12-31T23:45:00.000Z | 15 минут | 15 минут | 15 минут бұрын |
+| 1999-12-31T23:30:00.000Z | 30 минут | 30 минут | 30 минут бұрын |
+| 1999-12-31T23:15:00.000Z | шамамен 1 сағат | шамамен 1 сағат | шамамен 1 сағат бұрын |
+| 1999-12-31T23:00:00.000Z | шамамен 1 сағат | шамамен 1 сағат | шамамен 1 сағат бұрын |
+| 1999-12-31T18:00:00.000Z | шамамен 6 сағат | шамамен 6 сағат | шамамен 6 сағат бұрын |
+| 1999-12-30T00:00:00.000Z | 2 күн | 2 күн | 2 күн бұрын |
+| 1999-12-15T00:00:00.000Z | 17 күн | 17 күн | 17 күн бұрын |
+| 1999-12-01T00:00:00.000Z | шамамен 1 ай | шамамен 1 ай | шамамен 1 ай бұрын |
+| 1999-11-01T00:00:00.000Z | 2 ай | 2 ай | 2 ай бұрын |
+| 1999-06-01T00:00:00.000Z | 7 ай | 7 ай | 7 ай бұрын |
+| 1999-01-01T00:00:00.000Z | шамамен 1 жыл | шамамен 1 жыл | шамамен 1 жыл бұрын |
+| 1998-12-01T00:00:00.000Z | шамамен 1 жыл | шамамен 1 жыл | шамамен 1 жыл бұрын |
+| 1998-06-01T00:00:00.000Z | 1 жылдан астам | 1 жылдан астам | 1 жылдан астам бұрын |
+| 1998-01-01T00:00:00.000Z | шамамен 2 жыл | шамамен 2 жыл | шамамен 2 жыл бұрын |
+| 1997-01-01T00:00:00.000Z | шамамен 3 жыл | шамамен 3 жыл | шамамен 3 жыл бұрын |
+| 1996-01-01T00:00:00.000Z | шамамен 4 жыл | шамамен 4 жыл | шамамен 4 жыл бұрын |
+| 1995-01-01T00:00:00.000Z | шамамен 5 жыл | шамамен 5 жыл | шамамен 5 жыл бұрын |
+| 1994-01-01T00:00:00.000Z | шамамен 6 жыл | шамамен 6 жыл | шамамен 6 жыл бұрын |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 жыл | 6 жылдан кейін | 52608 сағат |
+| 2005-01-01T00:00:00.000Z | 5 жыл | 5 жылдан кейін | 43848 сағат |
+| 2004-01-01T00:00:00.000Z | 4 жыл | 4 жылдан кейін | 35064 сағат |
+| 2003-01-01T00:00:00.000Z | 3 жыл | 3 жылдан кейін | 26304 сағат |
+| 2002-01-01T00:00:00.000Z | 2 жыл | 2 жылдан кейін | 17544 сағат |
+| 2001-06-01T00:00:00.000Z | 1 жыл | 1 жылдан кейін | 12408 сағат |
+| 2001-02-01T00:00:00.000Z | 1 жыл | 1 жылдан кейін | 9528 сағат |
+| 2001-01-01T00:00:00.000Z | 1 жыл | 1 жылдан кейін | 8784 сағат |
+| 2000-06-01T00:00:00.000Z | 5 ай | 5 ай кейін | 3648 сағат |
+| 2000-03-01T00:00:00.000Z | 2 ай | 2 ай кейін | 1440 сағат |
+| 2000-02-01T00:00:00.000Z | 1 ай | 1 ай кейін | 744 сағат |
+| 2000-01-15T00:00:00.000Z | 14 күн | 14 күннен кейін | 336 сағат |
+| 2000-01-02T00:00:00.000Z | 1 күн | 1 күннен кейін | 24 сағат |
+| 2000-01-01T06:00:00.000Z | 6 сағат | 6 сағат кейін | 6 сағат |
+| 2000-01-01T01:00:00.000Z | 1 сағат | 1 сағат кейін | 1 сағат |
+| 2000-01-01T00:45:00.000Z | 45 минут | 45 минуттан кейін | 1 сағат |
+| 2000-01-01T00:30:00.000Z | 30 минут | 30 минуттан кейін | 1 сағат |
+| 2000-01-01T00:15:00.000Z | 15 минут | 15 минуттан кейін | 0 сағат |
+| 2000-01-01T00:01:00.000Z | 1 минут | 1 минуттан кейін | 0 сағат |
+| 2000-01-01T00:00:25.000Z | 25 секунд | 25 секундтан кейін | 0 сағат |
+| 2000-01-01T00:00:15.000Z | 15 секунд | 15 секундтан кейін | 0 сағат |
+| 2000-01-01T00:00:05.000Z | 5 секунд | 5 секундтан кейін | 0 сағат |
+| 2000-01-01T00:00:00.000Z | 0 секунд | 0 секунд бұрын | 0 сағат |
+| 1999-12-31T23:59:55.000Z | 5 секунд | 5 секунд бұрын | 0 сағат |
+| 1999-12-31T23:59:45.000Z | 15 секунд | 15 секунд бұрын | 0 сағат |
+| 1999-12-31T23:59:35.000Z | 25 секунд | 25 секунд бұрын | 0 сағат |
+| 1999-12-31T23:59:00.000Z | 1 минут | 1 минут бұрын | 0 сағат |
+| 1999-12-31T23:45:00.000Z | 15 минут | 15 минут бұрын | 0 сағат |
+| 1999-12-31T23:30:00.000Z | 30 минут | 30 минут бұрын | 1 сағат |
+| 1999-12-31T23:15:00.000Z | 45 минут | 45 минут бұрын | 1 сағат |
+| 1999-12-31T23:00:00.000Z | 1 сағат | 1 сағат бұрын | 1 сағат |
+| 1999-12-31T18:00:00.000Z | 6 сағат | 6 сағат бұрын | 6 сағат |
+| 1999-12-30T00:00:00.000Z | 2 күн | 2 күн бұрын | 48 сағат |
+| 1999-12-15T00:00:00.000Z | 17 күн | 17 күн бұрын | 408 сағат |
+| 1999-12-01T00:00:00.000Z | 1 ай | 1 ай бұрын | 744 сағат |
+| 1999-11-01T00:00:00.000Z | 2 ай | 2 ай бұрын | 1464 сағат |
+| 1999-06-01T00:00:00.000Z | 7 ай | 7 ай бұрын | 5136 сағат |
+| 1999-01-01T00:00:00.000Z | 1 жыл | 1 жыл бұрын | 8760 сағат |
+| 1998-12-01T00:00:00.000Z | 1 жыл | 1 жыл бұрын | 9504 сағат |
+| 1998-06-01T00:00:00.000Z | 2 жыл | 2 жыл бұрын | 13896 сағат |
+| 1998-01-01T00:00:00.000Z | 2 жыл | 2 жыл бұрын | 17520 сағат |
+| 1997-01-01T00:00:00.000Z | 3 жыл | 3 жыл бұрын | 26280 сағат |
+| 1996-01-01T00:00:00.000Z | 4 жыл | 4 жыл бұрын | 35064 сағат |
+| 1995-01-01T00:00:00.000Z | 5 жыл | 5 жыл бұрын | 43824 сағат |
+| 1994-01-01T00:00:00.000Z | 6 жыл | 6 жыл бұрын | 52584 сағат |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | келесі сәрсенбіде сағат 0:00-де |
+| 2000-01-02T00:00:00.000Z | ертең сағат 0:00-де |
+| 2000-01-01T00:00:00.000Z | бүгін сағат 0:00-де |
+| 1999-12-31T00:00:00.000Z | кеше сағат 0:00-де |
+| 1999-12-27T00:00:00.000Z | дүйсенбіде сағат 0:00-де |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/kn/_lib/formatDistance/index.js b/date-fns/src/locale/kn/_lib/formatDistance/index.js
new file mode 100644
index 0000000..a658c64
--- /dev/null
+++ b/date-fns/src/locale/kn/_lib/formatDistance/index.js
@@ -0,0 +1,203 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: {
+ default: '1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ',
+ future: '1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ',
+ past: '1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ'
+ },
+ other: {
+ default: '{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ',
+ future: '{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ',
+ past: '{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ'
+ }
+ },
+
+ xSeconds: {
+ one: {
+ default: '1 ಸೆಕೆಂಡ್',
+ future: '1 ಸೆಕೆಂಡ್‌ನಲ್ಲಿ',
+ past: '1 ಸೆಕೆಂಡ್ ಹಿಂದೆ'
+ },
+ other: {
+ default: '{{count}} ಸೆಕೆಂಡುಗಳು',
+ future: '{{count}} ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ',
+ past: '{{count}} ಸೆಕೆಂಡ್ ಹಿಂದೆ'
+ }
+ },
+
+ halfAMinute: {
+ other: {
+ default: 'ಅರ್ಧ ನಿಮಿಷ',
+ future: 'ಅರ್ಧ ನಿಮಿಷದಲ್ಲಿ',
+ past: 'ಅರ್ಧ ನಿಮಿಷದ ಹಿಂದೆ'
+ }
+ },
+
+ lessThanXMinutes: {
+ one: {
+ default: '1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ',
+ future: '1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ',
+ past: '1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ'
+ },
+ other: {
+ default: '{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ',
+ future: '{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ',
+ past: '{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ'
+ }
+ },
+
+ xMinutes: {
+ one: {
+ default: '1 ನಿಮಿಷ',
+ future: '1 ನಿಮಿಷದಲ್ಲಿ',
+ past: '1 ನಿಮಿಷದ ಹಿಂದೆ'
+ },
+ other: {
+ default: '{{count}} ನಿಮಿಷಗಳು',
+ future: '{{count}} ನಿಮಿಷಗಳಲ್ಲಿ',
+ past: '{{count}} ನಿಮಿಷಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ aboutXHours: {
+ one: {
+ default: 'ಸುಮಾರು 1 ಗಂಟೆ',
+ future: 'ಸುಮಾರು 1 ಗಂಟೆಯಲ್ಲಿ',
+ past: 'ಸುಮಾರು 1 ಗಂಟೆ ಹಿಂದೆ'
+ },
+ other: {
+ default: 'ಸುಮಾರು {{count}} ಗಂಟೆಗಳು',
+ future: 'ಸುಮಾರು {{count}} ಗಂಟೆಗಳಲ್ಲಿ',
+ past: 'ಸುಮಾರು {{count}} ಗಂಟೆಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ xHours: {
+ one: {
+ default: '1 ಗಂಟೆ',
+ future: '1 ಗಂಟೆಯಲ್ಲಿ',
+ past: '1 ಗಂಟೆ ಹಿಂದೆ'
+ },
+ other: {
+ default: '{{count}} ಗಂಟೆಗಳು',
+ future: '{{count}} ಗಂಟೆಗಳಲ್ಲಿ',
+ past: '{{count}} ಗಂಟೆಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ xDays: {
+ one: {
+ default: '1 ದಿನ',
+ future: '1 ದಿನದಲ್ಲಿ',
+ past: '1 ದಿನದ ಹಿಂದೆ'
+ },
+ other: {
+ default: '{{count}} ದಿನಗಳು',
+ future: '{{count}} ದಿನಗಳಲ್ಲಿ',
+ past: '{{count}} ದಿನಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ aboutXMonths: {
+ one: {
+ default: 'ಸುಮಾರು 1 ತಿಂಗಳು',
+ future: 'ಸುಮಾರು 1 ತಿಂಗಳಲ್ಲಿ',
+ past: 'ಸುಮಾರು 1 ತಿಂಗಳ ಹಿಂದೆ'
+ },
+ other: {
+ default: 'ಸುಮಾರು {{count}} ತಿಂಗಳು',
+ future: 'ಸುಮಾರು {{count}} ತಿಂಗಳುಗಳಲ್ಲಿ',
+ past: 'ಸುಮಾರು {{count}} ತಿಂಗಳುಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ xMonths: {
+ one: {
+ default: '1 ತಿಂಗಳು',
+ future: '1 ತಿಂಗಳಲ್ಲಿ',
+ past: '1 ತಿಂಗಳ ಹಿಂದೆ'
+ },
+ other: {
+ default: '{{count}} ತಿಂಗಳು',
+ future: '{{count}} ತಿಂಗಳುಗಳಲ್ಲಿ',
+ past: '{{count}} ತಿಂಗಳುಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ aboutXYears: {
+ one: {
+ default: 'ಸುಮಾರು 1 ವರ್ಷ',
+ future: 'ಸುಮಾರು 1 ವರ್ಷದಲ್ಲಿ',
+ past: 'ಸುಮಾರು 1 ವರ್ಷದ ಹಿಂದೆ'
+ },
+ other: {
+ default: 'ಸುಮಾರು {{count}} ವರ್ಷಗಳು',
+ future: 'ಸುಮಾರು {{count}} ವರ್ಷಗಳಲ್ಲಿ',
+ past: 'ಸುಮಾರು {{count}} ವರ್ಷಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ xYears: {
+ one: {
+ default: '1 ವರ್ಷ',
+ future: '1 ವರ್ಷದಲ್ಲಿ',
+ past: '1 ವರ್ಷದ ಹಿಂದೆ'
+ },
+ other: {
+ default: '{{count}} ವರ್ಷಗಳು',
+ future: '{{count}} ವರ್ಷಗಳಲ್ಲಿ',
+ past: '{{count}} ವರ್ಷಗಳ ಹಿಂದೆ'
+ }
+ },
+
+ overXYears: {
+ one: {
+ default: '1 ವರ್ಷದ ಮೇಲೆ',
+ future: '1 ವರ್ಷದ ಮೇಲೆ',
+ past: '1 ವರ್ಷದ ಮೇಲೆ'
+ },
+ other: {
+ default: '{{count}} ವರ್ಷಗಳ ಮೇಲೆ',
+ future: '{{count}} ವರ್ಷಗಳ ಮೇಲೆ',
+ past: '{{count}} ವರ್ಷಗಳ ಮೇಲೆ'
+ }
+ },
+
+ almostXYears: {
+ one: {
+ default: 'ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ',
+ future: 'ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ',
+ past: 'ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ'
+ },
+ other: {
+ default: 'ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ',
+ future: 'ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ',
+ past: 'ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ'
+ }
+ }
+}
+
+function getResultByTense(parentToken, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return parentToken.future
+ } else {
+ return parentToken.past
+ }
+ }
+ return parentToken.default
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = getResultByTense(formatDistanceLocale[token].one, options)
+ } else {
+ result = getResultByTense(formatDistanceLocale[token].other, options)
+ }
+ return result.replace('{{count}}', count)
+}
diff --git a/date-fns/src/locale/kn/_lib/formatLong/index.js b/date-fns/src/locale/kn/_lib/formatLong/index.js
new file mode 100644
index 0000000..124112a
--- /dev/null
+++ b/date-fns/src/locale/kn/_lib/formatLong/index.js
@@ -0,0 +1,42 @@
+// Reference: https://www.unicode.org/cldr/charts/32/summary/kn.html
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM d, y', // CLDR 1816
+ long: 'MMMM d, y', // CLDR 1817
+ medium: 'MMM d, y', // CLDR 1818
+ short: 'd/M/yy' // CLDR 1819
+}
+
+var timeFormats = {
+ full: 'hh:mm:ss a zzzz', // CLDR 1820
+ long: 'hh:mm:ss a z', // CLDR 1821
+ medium: 'hh:mm:ss a', // CLDR 1822
+ short: 'hh:mm a' // CLDR 1823
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}', // CLDR 1824
+ long: '{{date}} {{time}}', // CLDR 1825
+ medium: '{{date}} {{time}}', // CLDR 1826
+ short: '{{date}} {{time}}' // CLDR 1827
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/kn/_lib/formatRelative/index.js b/date-fns/src/locale/kn/_lib/formatRelative/index.js
new file mode 100644
index 0000000..aefa301
--- /dev/null
+++ b/date-fns/src/locale/kn/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'ಕಳೆದ' eeee p 'ಕ್ಕೆ'",
+ yesterday: "'ನಿನ್ನೆ' p 'ಕ್ಕೆ'",
+ today: "'ಇಂದು' p 'ಕ್ಕೆ'",
+ tomorrow: "'ನಾಳೆ' p 'ಕ್ಕೆ'",
+ nextWeek: "eeee p 'ಕ್ಕೆ'",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/kn/_lib/localize/index.js b/date-fns/src/locale/kn/_lib/localize/index.js
new file mode 100644
index 0000000..cfe8e26
--- /dev/null
+++ b/date-fns/src/locale/kn/_lib/localize/index.js
@@ -0,0 +1,171 @@
+// Reference: https://www.unicode.org/cldr/charts/32/summary/kn.html
+
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ಕ್ರಿ.ಪೂ', 'ಕ್ರಿ.ಶ'],
+ abbreviated: ['ಕ್ರಿ.ಪೂ', 'ಕ್ರಿ.ಶ'], // CLDR #1618, #1620
+ wide: ['ಕ್ರಿಸ್ತ ಪೂರ್ವ', 'ಕ್ರಿಸ್ತ ಶಕ'] // CLDR #1614, #1616
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['ತ್ರೈ 1', 'ತ್ರೈ 2', 'ತ್ರೈ 3', 'ತ್ರೈ 4'], // CLDR #1630 - #1638
+ wide: ['1ನೇ ತ್ರೈಮಾಸಿಕ', '2ನೇ ತ್ರೈಮಾಸಿಕ', '3ನೇ ತ್ರೈಮಾಸಿಕ', '4ನೇ ತ್ರೈಮಾಸಿಕ'] // CLDR #1622 - #1629
+}
+
+// CLDR #1646 - #1717
+var monthValues = {
+ narrow: ['ಜ', 'ಫೆ', 'ಮಾ', 'ಏ', 'ಮೇ', 'ಜೂ', 'ಜು', 'ಆ', 'ಸೆ', 'ಅ', 'ನ', 'ಡಿ'],
+ abbreviated: [
+ 'ಜನ',
+ 'ಫೆಬ್ರ',
+ 'ಮಾರ್ಚ್',
+ 'ಏಪ್ರಿ',
+ 'ಮೇ',
+ 'ಜೂನ್',
+ 'ಜುಲೈ',
+ 'ಆಗ',
+ 'ಸೆಪ್ಟೆಂ',
+ 'ಅಕ್ಟೋ',
+ 'ನವೆಂ',
+ 'ಡಿಸೆಂ'
+ ],
+ wide: [
+ 'ಜನವರಿ',
+ 'ಫೆಬ್ರವರಿ',
+ 'ಮಾರ್ಚ್',
+ 'ಏಪ್ರಿಲ್',
+ 'ಮೇ',
+ 'ಜೂನ್',
+ 'ಜುಲೈ',
+ 'ಆಗಸ್ಟ್',
+ 'ಸೆಪ್ಟೆಂಬರ್',
+ 'ಅಕ್ಟೋಬರ್',
+ 'ನವೆಂಬರ್',
+ 'ಡಿಸೆಂಬರ್'
+ ]
+}
+
+// CLDR #1718 - #1773
+var dayValues = {
+ narrow: ['ಭಾ', 'ಸೋ', 'ಮಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'],
+ short: ['ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ', 'ಶನಿ'],
+ abbreviated: ['ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ', 'ಶನಿ'],
+ wide: [
+ 'ಭಾನುವಾರ',
+ 'ಸೋಮವಾರ',
+ 'ಮಂಗಳವಾರ',
+ 'ಬುಧವಾರ',
+ 'ಗುರುವಾರ',
+ 'ಶುಕ್ರವಾರ',
+ 'ಶನಿವಾರ'
+ ]
+}
+
+// CLDR #1774 - #1815
+var dayPeriodValues = {
+ narrow: {
+ am: 'ಪೂರ್ವಾಹ್ನ',
+ pm: 'ಅಪರಾಹ್ನ',
+ midnight: 'ಮಧ್ಯರಾತ್ರಿ',
+ noon: 'ಮಧ್ಯಾಹ್ನ',
+ morning: 'ಬೆಳಗ್ಗೆ',
+ afternoon: 'ಮಧ್ಯಾಹ್ನ',
+ evening: 'ಸಂಜೆ',
+ night: 'ರಾತ್ರಿ'
+ },
+ abbreviated: {
+ am: 'ಪೂರ್ವಾಹ್ನ',
+ pm: 'ಅಪರಾಹ್ನ',
+ midnight: 'ಮಧ್ಯರಾತ್ರಿ',
+ noon: 'ಮಧ್ಯಾನ್ಹ',
+ morning: 'ಬೆಳಗ್ಗೆ',
+ afternoon: 'ಮಧ್ಯಾನ್ಹ',
+ evening: 'ಸಂಜೆ',
+ night: 'ರಾತ್ರಿ'
+ },
+ wide: {
+ am: 'ಪೂರ್ವಾಹ್ನ',
+ pm: 'ಅಪರಾಹ್ನ',
+ midnight: 'ಮಧ್ಯರಾತ್ರಿ',
+ noon: 'ಮಧ್ಯಾನ್ಹ',
+ morning: 'ಬೆಳಗ್ಗೆ',
+ afternoon: 'ಮಧ್ಯಾನ್ಹ',
+ evening: 'ಸಂಜೆ',
+ night: 'ರಾತ್ರಿ'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ಪೂ',
+ pm: 'ಅ',
+ midnight: 'ಮಧ್ಯರಾತ್ರಿ',
+ noon: 'ಮಧ್ಯಾನ್ಹ',
+ morning: 'ಬೆಳಗ್ಗೆ',
+ afternoon: 'ಮಧ್ಯಾನ್ಹ',
+ evening: 'ಸಂಜೆ',
+ night: 'ರಾತ್ರಿ'
+ },
+ abbreviated: {
+ am: 'ಪೂರ್ವಾಹ್ನ',
+ pm: 'ಅಪರಾಹ್ನ',
+ midnight: 'ಮಧ್ಯ ರಾತ್ರಿ',
+ noon: 'ಮಧ್ಯಾನ್ಹ',
+ morning: 'ಬೆಳಗ್ಗೆ',
+ afternoon: 'ಮಧ್ಯಾನ್ಹ',
+ evening: 'ಸಂಜೆ',
+ night: 'ರಾತ್ರಿ'
+ },
+ wide: {
+ am: 'ಪೂರ್ವಾಹ್ನ',
+ pm: 'ಅಪರಾಹ್ನ',
+ midnight: 'ಮಧ್ಯ ರಾತ್ರಿ',
+ noon: 'ಮಧ್ಯಾನ್ಹ',
+ morning: 'ಬೆಳಗ್ಗೆ',
+ afternoon: 'ಮಧ್ಯಾನ್ಹ',
+ evening: 'ಸಂಜೆ',
+ night: 'ರಾತ್ರಿ'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ return number + 'ನೇ'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/kn/_lib/match/index.js b/date-fns/src/locale/kn/_lib/match/index.js
new file mode 100644
index 0000000..0c3b0f1
--- /dev/null
+++ b/date-fns/src/locale/kn/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(ನೇ|ನೆ)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ಕ್ರಿ.ಪೂ|ಕ್ರಿ.ಶ)/i,
+ abbreviated: /^(ಕ್ರಿ\.?\s?ಪೂ\.?|ಕ್ರಿ\.?\s?ಶ\.?|ಪ್ರ\.?\s?ಶ\.?)/i,
+ wide: /^(ಕ್ರಿಸ್ತ ಪೂರ್ವ|ಕ್ರಿಸ್ತ ಶಕ|ಪ್ರಸಕ್ತ ಶಕ)/i
+}
+var parseEraPatterns = {
+ any: [/^ಪೂ/i, /^(ಶ|ಪ್ರ)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^ತ್ರೈ[1234]|ತ್ರೈ [1234]| [1234]ತ್ರೈ/i,
+ wide: /^[1234](ನೇ)? ತ್ರೈಮಾಸಿಕ/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(ಜೂ|ಜು|ಜ|ಫೆ|ಮಾ|ಏ|ಮೇ|ಆ|ಸೆ|ಅ|ನ|ಡಿ)/i,
+ abbreviated: /^(ಜನ|ಫೆಬ್ರ|ಮಾರ್ಚ್|ಏಪ್ರಿ|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗ|ಸೆಪ್ಟೆಂ|ಅಕ್ಟೋ|ನವೆಂ|ಡಿಸೆಂ)/i,
+ wide: /^(ಜನವರಿ|ಫೆಬ್ರವರಿ|ಮಾರ್ಚ್|ಏಪ್ರಿಲ್|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗಸ್ಟ್|ಸೆಪ್ಟೆಂಬರ್|ಅಕ್ಟೋಬರ್|ನವೆಂಬರ್|ಡಿಸೆಂಬರ್)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^ಜ$/i,
+ /^ಫೆ/i,
+ /^ಮಾ/i,
+ /^ಏ/i,
+ /^ಮೇ/i,
+ /^ಜೂ/i,
+ /^ಜು$/i,
+ /^ಆ/i,
+ /^ಸೆ/i,
+ /^ಅ/i,
+ /^ನ/i,
+ /^ಡಿ/i
+ ],
+ any: [
+ /^ಜನ/i,
+ /^ಫೆ/i,
+ /^ಮಾ/i,
+ /^ಏ/i,
+ /^ಮೇ/i,
+ /^ಜೂನ್/i,
+ /^ಜುಲೈ/i,
+ /^ಆ/i,
+ /^ಸೆ/i,
+ /^ಅ/i,
+ /^ನ/i,
+ /^ಡಿ/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(ಭಾ|ಸೋ|ಮ|ಬು|ಗು|ಶು|ಶ)/i,
+ short: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
+ abbreviated: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
+ wide: /^(ಭಾನುವಾರ|ಸೋಮವಾರ|ಮಂಗಳವಾರ|ಬುಧವಾರ|ಗುರುವಾರ|ಶುಕ್ರವಾರ|ಶನಿವಾರ)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ಭಾ/i, /^ಸೋ/i, /^ಮ/i, /^ಬು/i, /^ಗು/i, /^ಶು/i, /^ಶ/i],
+ any: [/^ಭಾ/i, /^ಸೋ/i, /^ಮ/i, /^ಬು/i, /^ಗು/i, /^ಶು/i, /^ಶ/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(ಪೂ|ಅ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i,
+ any: /^(ಪೂರ್ವಾಹ್ನ|ಅಪರಾಹ್ನ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^ಪೂ/i,
+ pm: /^ಅ/i,
+ midnight: /ಮಧ್ಯರಾತ್ರಿ/i,
+ noon: /ಮಧ್ಯಾನ್ಹ/i,
+ morning: /ಬೆಳಗ್ಗೆ/i,
+ afternoon: /ಮಧ್ಯಾನ್ಹ/i,
+ evening: /ಸಂಜೆ/i,
+ night: /ರಾತ್ರಿ/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/kn/index.d.ts b/date-fns/src/locale/kn/index.d.ts
new file mode 100644
index 0000000..85a2ed5
--- /dev/null
+++ b/date-fns/src/locale/kn/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { kn } from 'date-fns/locale'
+export default kn
diff --git a/date-fns/src/locale/kn/index.js b/date-fns/src/locale/kn/index.js
new file mode 100644
index 0000000..ad1012b
--- /dev/null
+++ b/date-fns/src/locale/kn/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Kannada locale (India).
+ * @language Kannada
+ * @iso-639-2 kan
+ * @author Manjunatha Gouli [@developergouli]{@link https://github.com/developergouli}
+ */
+var locale = {
+ code: 'kn',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/kn/index.js.flow b/date-fns/src/locale/kn/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/kn/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/kn/snapshot.md b/date-fns/src/locale/kn/snapshot.md
new file mode 100644
index 0000000..72ef2d2
--- /dev/null
+++ b/date-fns/src/locale/kn/snapshot.md
@@ -0,0 +1,304 @@
+# Kannada (kn) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987ನೇ | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ನೇ | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987ನೇ | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5ನೇ | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1ನೇ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ನೇ | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | ತ್ರೈ 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ತ್ರೈ 2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1ನೇ ತ್ರೈಮಾಸಿಕ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ನೇ ತ್ರೈಮಾಸಿಕ | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1ನೇ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ನೇ | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | ತ್ರೈ 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ತ್ರೈ 2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1ನೇ ತ್ರೈಮಾಸಿಕ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2ನೇ ತ್ರೈಮಾಸಿಕ | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2ನೇ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ನೇ | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | ಫೆಬ್ರ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ಜುಲೈ | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | ಫೆಬ್ರವರಿ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ಜುಲೈ | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ಫೆ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ಜು | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2ನೇ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7ನೇ | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | ಫೆಬ್ರ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ಜುಲೈ | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | ಫೆಬ್ರವರಿ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ಜುಲೈ | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ಫೆ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ಜು | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1ನೇ | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ನೇ | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1ನೇ | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ನೇ | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11ನೇ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28ನೇ | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42ನೇ | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365ನೇ | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | ಸೋಮವಾರ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರವಾರ | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | ಸೋ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶು | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1ನೇ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ನೇ | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | ಸೋಮವಾರ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರವಾರ | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | ಸೋ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶು | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1ನೇ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ನೇ | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | ಸೋಮವಾರ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರವಾರ | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | ಸೋ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶು | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1ನೇ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5ನೇ | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | ಸೋಮವಾರ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರವಾರ | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | ಸೋ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶು | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ಸೋಮ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ಶುಕ್ರ | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ಪೂ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂ | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅಪರಾಹ್ನ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂರ್ವಾಹ್ನ | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ಪೂ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಅ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಅ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ಪೂ | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ಬೆಳಗ್ಗೆ | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಮಧ್ಯಾನ್ಹ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಸಂಜೆ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ರಾತ್ರಿ | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ಬೆಳಗ್ಗೆ | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಮಧ್ಯಾನ್ಹ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಸಂಜೆ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ರಾತ್ರಿ | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ಬೆಳಗ್ಗೆ | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಮಧ್ಯಾನ್ಹ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಸಂಜೆ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ರಾತ್ರಿ | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ಬೆಳಗ್ಗೆ | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಮಧ್ಯಾನ್ಹ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಸಂಜೆ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ರಾತ್ರಿ | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ಬೆಳಗ್ಗೆ | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ಮಧ್ಯಾನ್ಹ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ಸಂಜೆ | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ರಾತ್ರಿ | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11ನೇ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ನೇ | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11ನೇ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ನೇ | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11ನೇ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11ನೇ | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11ನೇ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23ನೇ | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1ನೇ | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55ನೇ | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1ನೇ | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55ನೇ | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/2/87 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | ಫೆಬ್ರ 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ಮೇ 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | ಫೆಬ್ರವರಿ 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ಮೇ 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | ಬುಧವಾರ, ಫೆಬ್ರವರಿ 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ಭಾನುವಾರ, ಮೇ 29, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 ಅಪರಾಹ್ನ | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 ಅಪರಾಹ್ನ | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 ಅಪರಾಹ್ನ | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 ಅಪರಾಹ್ನ | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 ಅಪರಾಹ್ನ GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 ಅಪರಾಹ್ನ GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 ಅಪರಾಹ್ನ GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 ಅಪರಾಹ್ನ GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/2/87 12:13 ಅಪರಾಹ್ನ | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53 11:59 ಅಪರಾಹ್ನ | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | ಫೆಬ್ರ 11, 1987 12:13:14 ಅಪರಾಹ್ನ | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | ಮೇ 29, 1453 11:59:59 ಅಪರಾಹ್ನ | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | ಫೆಬ್ರವರಿ 11, 1987 12:13:14 ಅಪರಾಹ್ನ GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | ಮೇ 29, 1453 11:59:59 ಅಪರಾಹ್ನ GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | ಬುಧವಾರ, ಫೆಬ್ರವರಿ 11, 1987 12:13:14 ಅಪರಾಹ್ನ GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | ಭಾನುವಾರ, ಮೇ 29, 1453 11:59:59 ಅಪರಾಹ್ನ GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------- | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | ಸುಮಾರು 6 ವರ್ಷಗಳು | ಸುಮಾರು 6 ವರ್ಷಗಳು | ಸುಮಾರು 6 ವರ್ಷಗಳಲ್ಲಿ |
+| 2005-01-01T00:00:00.000Z | ಸುಮಾರು 5 ವರ್ಷಗಳು | ಸುಮಾರು 5 ವರ್ಷಗಳು | ಸುಮಾರು 5 ವರ್ಷಗಳಲ್ಲಿ |
+| 2004-01-01T00:00:00.000Z | ಸುಮಾರು 4 ವರ್ಷಗಳು | ಸುಮಾರು 4 ವರ್ಷಗಳು | ಸುಮಾರು 4 ವರ್ಷಗಳಲ್ಲಿ |
+| 2003-01-01T00:00:00.000Z | ಸುಮಾರು 3 ವರ್ಷಗಳು | ಸುಮಾರು 3 ವರ್ಷಗಳು | ಸುಮಾರು 3 ವರ್ಷಗಳಲ್ಲಿ |
+| 2002-01-01T00:00:00.000Z | ಸುಮಾರು 2 ವರ್ಷಗಳು | ಸುಮಾರು 2 ವರ್ಷಗಳು | ಸುಮಾರು 2 ವರ್ಷಗಳಲ್ಲಿ |
+| 2001-06-01T00:00:00.000Z | 1 ವರ್ಷದ ಮೇಲೆ | 1 ವರ್ಷದ ಮೇಲೆ | 1 ವರ್ಷದ ಮೇಲೆ |
+| 2001-02-01T00:00:00.000Z | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷದಲ್ಲಿ |
+| 2001-01-01T00:00:00.000Z | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷದಲ್ಲಿ |
+| 2000-06-01T00:00:00.000Z | 5 ತಿಂಗಳು | 5 ತಿಂಗಳು | 5 ತಿಂಗಳುಗಳಲ್ಲಿ |
+| 2000-03-01T00:00:00.000Z | 2 ತಿಂಗಳು | 2 ತಿಂಗಳು | 2 ತಿಂಗಳುಗಳಲ್ಲಿ |
+| 2000-02-01T00:00:00.000Z | ಸುಮಾರು 1 ತಿಂಗಳು | ಸುಮಾರು 1 ತಿಂಗಳು | ಸುಮಾರು 1 ತಿಂಗಳಲ್ಲಿ |
+| 2000-01-15T00:00:00.000Z | 14 ದಿನಗಳು | 14 ದಿನಗಳು | 14 ದಿನಗಳಲ್ಲಿ |
+| 2000-01-02T00:00:00.000Z | 1 ದಿನ | 1 ದಿನ | 1 ದಿನದಲ್ಲಿ |
+| 2000-01-01T06:00:00.000Z | ಸುಮಾರು 6 ಗಂಟೆಗಳು | ಸುಮಾರು 6 ಗಂಟೆಗಳು | ಸುಮಾರು 6 ಗಂಟೆಗಳಲ್ಲಿ |
+| 2000-01-01T01:00:00.000Z | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆಯಲ್ಲಿ |
+| 2000-01-01T00:45:00.000Z | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆಯಲ್ಲಿ |
+| 2000-01-01T00:30:00.000Z | 30 ನಿಮಿಷಗಳು | 30 ನಿಮಿಷಗಳು | 30 ನಿಮಿಷಗಳಲ್ಲಿ |
+| 2000-01-01T00:15:00.000Z | 15 ನಿಮಿಷಗಳು | 15 ನಿಮಿಷಗಳು | 15 ನಿಮಿಷಗಳಲ್ಲಿ |
+| 2000-01-01T00:01:00.000Z | 1 ನಿಮಿಷ | 1 ನಿಮಿಷ | 1 ನಿಮಿಷದಲ್ಲಿ |
+| 2000-01-01T00:00:25.000Z | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ | ಅರ್ಧ ನಿಮಿಷ | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ |
+| 2000-01-01T00:00:15.000Z | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ | 20 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ |
+| 2000-01-01T00:00:05.000Z | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ | 10 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ |
+| 2000-01-01T00:00:00.000Z | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ | 5 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ |
+| 1999-12-31T23:59:55.000Z | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ | 10 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ |
+| 1999-12-31T23:59:45.000Z | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ | 20 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ |
+| 1999-12-31T23:59:35.000Z | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ | ಅರ್ಧ ನಿಮಿಷ | 1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ |
+| 1999-12-31T23:59:00.000Z | 1 ನಿಮಿಷ | 1 ನಿಮಿಷ | 1 ನಿಮಿಷದ ಹಿಂದೆ |
+| 1999-12-31T23:45:00.000Z | 15 ನಿಮಿಷಗಳು | 15 ನಿಮಿಷಗಳು | 15 ನಿಮಿಷಗಳ ಹಿಂದೆ |
+| 1999-12-31T23:30:00.000Z | 30 ನಿಮಿಷಗಳು | 30 ನಿಮಿಷಗಳು | 30 ನಿಮಿಷಗಳ ಹಿಂದೆ |
+| 1999-12-31T23:15:00.000Z | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆ ಹಿಂದೆ |
+| 1999-12-31T23:00:00.000Z | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆ | ಸುಮಾರು 1 ಗಂಟೆ ಹಿಂದೆ |
+| 1999-12-31T18:00:00.000Z | ಸುಮಾರು 6 ಗಂಟೆಗಳು | ಸುಮಾರು 6 ಗಂಟೆಗಳು | ಸುಮಾರು 6 ಗಂಟೆಗಳ ಹಿಂದೆ |
+| 1999-12-30T00:00:00.000Z | 2 ದಿನಗಳು | 2 ದಿನಗಳು | 2 ದಿನಗಳ ಹಿಂದೆ |
+| 1999-12-15T00:00:00.000Z | 17 ದಿನಗಳು | 17 ದಿನಗಳು | 17 ದಿನಗಳ ಹಿಂದೆ |
+| 1999-12-01T00:00:00.000Z | ಸುಮಾರು 1 ತಿಂಗಳು | ಸುಮಾರು 1 ತಿಂಗಳು | ಸುಮಾರು 1 ತಿಂಗಳ ಹಿಂದೆ |
+| 1999-11-01T00:00:00.000Z | 2 ತಿಂಗಳು | 2 ತಿಂಗಳು | 2 ತಿಂಗಳುಗಳ ಹಿಂದೆ |
+| 1999-06-01T00:00:00.000Z | 7 ತಿಂಗಳು | 7 ತಿಂಗಳು | 7 ತಿಂಗಳುಗಳ ಹಿಂದೆ |
+| 1999-01-01T00:00:00.000Z | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷದ ಹಿಂದೆ |
+| 1998-12-01T00:00:00.000Z | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷ | ಸುಮಾರು 1 ವರ್ಷದ ಹಿಂದೆ |
+| 1998-06-01T00:00:00.000Z | 1 ವರ್ಷದ ಮೇಲೆ | 1 ವರ್ಷದ ಮೇಲೆ | 1 ವರ್ಷದ ಮೇಲೆ |
+| 1998-01-01T00:00:00.000Z | ಸುಮಾರು 2 ವರ್ಷಗಳು | ಸುಮಾರು 2 ವರ್ಷಗಳು | ಸುಮಾರು 2 ವರ್ಷಗಳ ಹಿಂದೆ |
+| 1997-01-01T00:00:00.000Z | ಸುಮಾರು 3 ವರ್ಷಗಳು | ಸುಮಾರು 3 ವರ್ಷಗಳು | ಸುಮಾರು 3 ವರ್ಷಗಳ ಹಿಂದೆ |
+| 1996-01-01T00:00:00.000Z | ಸುಮಾರು 4 ವರ್ಷಗಳು | ಸುಮಾರು 4 ವರ್ಷಗಳು | ಸುಮಾರು 4 ವರ್ಷಗಳ ಹಿಂದೆ |
+| 1995-01-01T00:00:00.000Z | ಸುಮಾರು 5 ವರ್ಷಗಳು | ಸುಮಾರು 5 ವರ್ಷಗಳು | ಸುಮಾರು 5 ವರ್ಷಗಳ ಹಿಂದೆ |
+| 1994-01-01T00:00:00.000Z | ಸುಮಾರು 6 ವರ್ಷಗಳು | ಸುಮಾರು 6 ವರ್ಷಗಳು | ಸುಮಾರು 6 ವರ್ಷಗಳ ಹಿಂದೆ |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ವರ್ಷಗಳು | 6 ವರ್ಷಗಳಲ್ಲಿ | 52608 ಗಂಟೆಗಳು |
+| 2005-01-01T00:00:00.000Z | 5 ವರ್ಷಗಳು | 5 ವರ್ಷಗಳಲ್ಲಿ | 43848 ಗಂಟೆಗಳು |
+| 2004-01-01T00:00:00.000Z | 4 ವರ್ಷಗಳು | 4 ವರ್ಷಗಳಲ್ಲಿ | 35064 ಗಂಟೆಗಳು |
+| 2003-01-01T00:00:00.000Z | 3 ವರ್ಷಗಳು | 3 ವರ್ಷಗಳಲ್ಲಿ | 26304 ಗಂಟೆಗಳು |
+| 2002-01-01T00:00:00.000Z | 2 ವರ್ಷಗಳು | 2 ವರ್ಷಗಳಲ್ಲಿ | 17544 ಗಂಟೆಗಳು |
+| 2001-06-01T00:00:00.000Z | 1 ವರ್ಷ | 1 ವರ್ಷದಲ್ಲಿ | 12408 ಗಂಟೆಗಳು |
+| 2001-02-01T00:00:00.000Z | 1 ವರ್ಷ | 1 ವರ್ಷದಲ್ಲಿ | 9528 ಗಂಟೆಗಳು |
+| 2001-01-01T00:00:00.000Z | 1 ವರ್ಷ | 1 ವರ್ಷದಲ್ಲಿ | 8784 ಗಂಟೆಗಳು |
+| 2000-06-01T00:00:00.000Z | 5 ತಿಂಗಳು | 5 ತಿಂಗಳುಗಳಲ್ಲಿ | 3648 ಗಂಟೆಗಳು |
+| 2000-03-01T00:00:00.000Z | 2 ತಿಂಗಳು | 2 ತಿಂಗಳುಗಳಲ್ಲಿ | 1440 ಗಂಟೆಗಳು |
+| 2000-02-01T00:00:00.000Z | 1 ತಿಂಗಳು | 1 ತಿಂಗಳಲ್ಲಿ | 744 ಗಂಟೆಗಳು |
+| 2000-01-15T00:00:00.000Z | 14 ದಿನಗಳು | 14 ದಿನಗಳಲ್ಲಿ | 336 ಗಂಟೆಗಳು |
+| 2000-01-02T00:00:00.000Z | 1 ದಿನ | 1 ದಿನದಲ್ಲಿ | 24 ಗಂಟೆಗಳು |
+| 2000-01-01T06:00:00.000Z | 6 ಗಂಟೆಗಳು | 6 ಗಂಟೆಗಳಲ್ಲಿ | 6 ಗಂಟೆಗಳು |
+| 2000-01-01T01:00:00.000Z | 1 ಗಂಟೆ | 1 ಗಂಟೆಯಲ್ಲಿ | 1 ಗಂಟೆ |
+| 2000-01-01T00:45:00.000Z | 45 ನಿಮಿಷಗಳು | 45 ನಿಮಿಷಗಳಲ್ಲಿ | 1 ಗಂಟೆ |
+| 2000-01-01T00:30:00.000Z | 30 ನಿಮಿಷಗಳು | 30 ನಿಮಿಷಗಳಲ್ಲಿ | 1 ಗಂಟೆ |
+| 2000-01-01T00:15:00.000Z | 15 ನಿಮಿಷಗಳು | 15 ನಿಮಿಷಗಳಲ್ಲಿ | 0 ಗಂಟೆಗಳು |
+| 2000-01-01T00:01:00.000Z | 1 ನಿಮಿಷ | 1 ನಿಮಿಷದಲ್ಲಿ | 0 ಗಂಟೆಗಳು |
+| 2000-01-01T00:00:25.000Z | 25 ಸೆಕೆಂಡುಗಳು | 25 ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ | 0 ಗಂಟೆಗಳು |
+| 2000-01-01T00:00:15.000Z | 15 ಸೆಕೆಂಡುಗಳು | 15 ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ | 0 ಗಂಟೆಗಳು |
+| 2000-01-01T00:00:05.000Z | 5 ಸೆಕೆಂಡುಗಳು | 5 ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ | 0 ಗಂಟೆಗಳು |
+| 2000-01-01T00:00:00.000Z | 0 ಸೆಕೆಂಡುಗಳು | 0 ಸೆಕೆಂಡ್ ಹಿಂದೆ | 0 ಗಂಟೆಗಳು |
+| 1999-12-31T23:59:55.000Z | 5 ಸೆಕೆಂಡುಗಳು | 5 ಸೆಕೆಂಡ್ ಹಿಂದೆ | 0 ಗಂಟೆಗಳು |
+| 1999-12-31T23:59:45.000Z | 15 ಸೆಕೆಂಡುಗಳು | 15 ಸೆಕೆಂಡ್ ಹಿಂದೆ | 0 ಗಂಟೆಗಳು |
+| 1999-12-31T23:59:35.000Z | 25 ಸೆಕೆಂಡುಗಳು | 25 ಸೆಕೆಂಡ್ ಹಿಂದೆ | 0 ಗಂಟೆಗಳು |
+| 1999-12-31T23:59:00.000Z | 1 ನಿಮಿಷ | 1 ನಿಮಿಷದ ಹಿಂದೆ | 0 ಗಂಟೆಗಳು |
+| 1999-12-31T23:45:00.000Z | 15 ನಿಮಿಷಗಳು | 15 ನಿಮಿಷಗಳ ಹಿಂದೆ | 0 ಗಂಟೆಗಳು |
+| 1999-12-31T23:30:00.000Z | 30 ನಿಮಿಷಗಳು | 30 ನಿಮಿಷಗಳ ಹಿಂದೆ | 1 ಗಂಟೆ |
+| 1999-12-31T23:15:00.000Z | 45 ನಿಮಿಷಗಳು | 45 ನಿಮಿಷಗಳ ಹಿಂದೆ | 1 ಗಂಟೆ |
+| 1999-12-31T23:00:00.000Z | 1 ಗಂಟೆ | 1 ಗಂಟೆ ಹಿಂದೆ | 1 ಗಂಟೆ |
+| 1999-12-31T18:00:00.000Z | 6 ಗಂಟೆಗಳು | 6 ಗಂಟೆಗಳ ಹಿಂದೆ | 6 ಗಂಟೆಗಳು |
+| 1999-12-30T00:00:00.000Z | 2 ದಿನಗಳು | 2 ದಿನಗಳ ಹಿಂದೆ | 48 ಗಂಟೆಗಳು |
+| 1999-12-15T00:00:00.000Z | 17 ದಿನಗಳು | 17 ದಿನಗಳ ಹಿಂದೆ | 408 ಗಂಟೆಗಳು |
+| 1999-12-01T00:00:00.000Z | 1 ತಿಂಗಳು | 1 ತಿಂಗಳ ಹಿಂದೆ | 744 ಗಂಟೆಗಳು |
+| 1999-11-01T00:00:00.000Z | 2 ತಿಂಗಳು | 2 ತಿಂಗಳುಗಳ ಹಿಂದೆ | 1464 ಗಂಟೆಗಳು |
+| 1999-06-01T00:00:00.000Z | 7 ತಿಂಗಳು | 7 ತಿಂಗಳುಗಳ ಹಿಂದೆ | 5136 ಗಂಟೆಗಳು |
+| 1999-01-01T00:00:00.000Z | 1 ವರ್ಷ | 1 ವರ್ಷದ ಹಿಂದೆ | 8760 ಗಂಟೆಗಳು |
+| 1998-12-01T00:00:00.000Z | 1 ವರ್ಷ | 1 ವರ್ಷದ ಹಿಂದೆ | 9504 ಗಂಟೆಗಳು |
+| 1998-06-01T00:00:00.000Z | 2 ವರ್ಷಗಳು | 2 ವರ್ಷಗಳ ಹಿಂದೆ | 13896 ಗಂಟೆಗಳು |
+| 1998-01-01T00:00:00.000Z | 2 ವರ್ಷಗಳು | 2 ವರ್ಷಗಳ ಹಿಂದೆ | 17520 ಗಂಟೆಗಳು |
+| 1997-01-01T00:00:00.000Z | 3 ವರ್ಷಗಳು | 3 ವರ್ಷಗಳ ಹಿಂದೆ | 26280 ಗಂಟೆಗಳು |
+| 1996-01-01T00:00:00.000Z | 4 ವರ್ಷಗಳು | 4 ವರ್ಷಗಳ ಹಿಂದೆ | 35064 ಗಂಟೆಗಳು |
+| 1995-01-01T00:00:00.000Z | 5 ವರ್ಷಗಳು | 5 ವರ್ಷಗಳ ಹಿಂದೆ | 43824 ಗಂಟೆಗಳು |
+| 1994-01-01T00:00:00.000Z | 6 ವರ್ಷಗಳು | 6 ವರ್ಷಗಳ ಹಿಂದೆ | 52584 ಗಂಟೆಗಳು |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/1/00 |
+| 2000-01-05T00:00:00.000Z | ಬುಧವಾರ 12:00 ಪೂರ್ವಾಹ್ನ ಕ್ಕೆ |
+| 2000-01-02T00:00:00.000Z | ನಾಳೆ 12:00 ಪೂರ್ವಾಹ್ನ ಕ್ಕೆ |
+| 2000-01-01T00:00:00.000Z | ಇಂದು 12:00 ಪೂರ್ವಾಹ್ನ ಕ್ಕೆ |
+| 1999-12-31T00:00:00.000Z | ನಿನ್ನೆ 12:00 ಪೂರ್ವಾಹ್ನ ಕ್ಕೆ |
+| 1999-12-27T00:00:00.000Z | ಕಳೆದ ಸೋಮವಾರ 12:00 ಪೂರ್ವಾಹ್ನ ಕ್ಕೆ |
+| 1999-12-21T00:00:00.000Z | 21/12/99 |
diff --git a/date-fns/src/locale/ko/_lib/formatDistance/index.js b/date-fns/src/locale/ko/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e05cc3a
--- /dev/null
+++ b/date-fns/src/locale/ko/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: '1초 미만',
+ other: '{{count}}초 미만'
+ },
+
+ xSeconds: {
+ one: '1초',
+ other: '{{count}}초'
+ },
+
+ halfAMinute: '30초',
+
+ lessThanXMinutes: {
+ one: '1분 미만',
+ other: '{{count}}분 미만'
+ },
+
+ xMinutes: {
+ one: '1분',
+ other: '{{count}}분'
+ },
+
+ aboutXHours: {
+ one: '약 1시간',
+ other: '약 {{count}}시간'
+ },
+
+ xHours: {
+ one: '1시간',
+ other: '{{count}}시간'
+ },
+
+ xDays: {
+ one: '1일',
+ other: '{{count}}일'
+ },
+
+ aboutXWeeks: {
+ one: '약 1주',
+ other: '약 {{count}}주'
+ },
+
+ xWeeks: {
+ one: '1주',
+ other: '{{count}}주'
+ },
+
+ aboutXMonths: {
+ one: '약 1개월',
+ other: '약 {{count}}개월'
+ },
+
+ xMonths: {
+ one: '1개월',
+ other: '{{count}}개월'
+ },
+
+ aboutXYears: {
+ one: '약 1년',
+ other: '약 {{count}}년'
+ },
+
+ xYears: {
+ one: '1년',
+ other: '{{count}}년'
+ },
+
+ overXYears: {
+ one: '1년 이상',
+ other: '{{count}}년 이상'
+ },
+
+ almostXYears: {
+ one: '거의 1년',
+ other: '거의 {{count}}년'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' 후'
+ } else {
+ return result + ' 전'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ko/_lib/formatLong/index.js b/date-fns/src/locale/ko/_lib/formatLong/index.js
new file mode 100644
index 0000000..6b40e1d
--- /dev/null
+++ b/date-fns/src/locale/ko/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'y년 M월 d일 EEEE',
+ long: 'y년 M월 d일',
+ medium: 'y.MM.dd',
+ short: 'y.MM.dd'
+}
+
+var timeFormats = {
+ full: 'a H시 mm분 ss초 zzzz',
+ long: 'a H:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ko/_lib/formatRelative/index.js b/date-fns/src/locale/ko/_lib/formatRelative/index.js
new file mode 100644
index 0000000..724448b
--- /dev/null
+++ b/date-fns/src/locale/ko/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'지난' eeee p",
+ yesterday: "'어제' p",
+ today: "'오늘' p",
+ tomorrow: "'내일' p",
+ nextWeek: "'다음' eeee p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ko/_lib/localize/index.js b/date-fns/src/locale/ko/_lib/localize/index.js
new file mode 100644
index 0000000..71a4f96
--- /dev/null
+++ b/date-fns/src/locale/ko/_lib/localize/index.js
@@ -0,0 +1,171 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['BC', 'AD'],
+ abbreviated: ['BC', 'AD'],
+ wide: ['기원전', '서기']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1분기', '2분기', '3분기', '4분기']
+}
+
+var monthValues = {
+ narrow: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+ abbreviated: [
+ '1월',
+ '2월',
+ '3월',
+ '4월',
+ '5월',
+ '6월',
+ '7월',
+ '8월',
+ '9월',
+ '10월',
+ '11월',
+ '12월'
+ ],
+ wide: [
+ '1월',
+ '2월',
+ '3월',
+ '4월',
+ '5월',
+ '6월',
+ '7월',
+ '8월',
+ '9월',
+ '10월',
+ '11월',
+ '12월'
+ ]
+}
+
+var dayValues = {
+ narrow: ['일', '월', '화', '수', '목', '금', '토'],
+ short: ['일', '월', '화', '수', '목', '금', '토'],
+ abbreviated: ['일', '월', '화', '수', '목', '금', '토'],
+ wide: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: '오전',
+ pm: '오후',
+ midnight: '자정',
+ noon: '정오',
+ morning: '아침',
+ afternoon: '오후',
+ evening: '저녁',
+ night: '밤'
+ },
+ abbreviated: {
+ am: '오전',
+ pm: '오후',
+ midnight: '자정',
+ noon: '정오',
+ morning: '아침',
+ afternoon: '오후',
+ evening: '저녁',
+ night: '밤'
+ },
+ wide: {
+ am: '오전',
+ pm: '오후',
+ midnight: '자정',
+ noon: '정오',
+ morning: '아침',
+ afternoon: '오후',
+ evening: '저녁',
+ night: '밤'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: '오전',
+ pm: '오후',
+ midnight: '자정',
+ noon: '정오',
+ morning: '아침',
+ afternoon: '오후',
+ evening: '저녁',
+ night: '밤'
+ },
+ abbreviated: {
+ am: '오전',
+ pm: '오후',
+ midnight: '자정',
+ noon: '정오',
+ morning: '아침',
+ afternoon: '오후',
+ evening: '저녁',
+ night: '밤'
+ },
+ wide: {
+ am: '오전',
+ pm: '오후',
+ midnight: '자정',
+ noon: '정오',
+ morning: '아침',
+ afternoon: '오후',
+ evening: '저녁',
+ night: '밤'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+
+ switch (unit) {
+ case 'minute':
+ case 'second':
+ return number
+ case 'date':
+ return number + '일'
+ default:
+ return number + '번째'
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ko/_lib/match/index.js b/date-fns/src/locale/ko/_lib/match/index.js
new file mode 100644
index 0000000..7f495af
--- /dev/null
+++ b/date-fns/src/locale/ko/_lib/match/index.js
@@ -0,0 +1,126 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(일|번째)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
+ wide: /^(기원전|서기)/i
+}
+
+var parseEraPatterns = {
+ any: [/^(bc|기원전)/i, /^(ad|서기)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234]사?분기/i
+}
+
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(1[012]|[123456789])/,
+ abbreviated: /^(1[012]|[123456789])월/i,
+ wide: /^(1[012]|[123456789])월/i
+}
+
+var parseMonthPatterns = {
+ any: [
+ /^1월?$/,
+ /^2/,
+ /^3/,
+ /^4/,
+ /^5/,
+ /^6/,
+ /^7/,
+ /^8/,
+ /^9/,
+ /^10/,
+ /^11/,
+ /^12/
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[일월화수목금토]/,
+ short: /^[일월화수목금토]/,
+ abbreviated: /^[일월화수목금토]/,
+ wide: /^[일월화수목금토]요일/
+}
+
+var parseDayPatterns = {
+ any: [/^일/, /^월/, /^화/, /^수/, /^목/, /^금/, /^토/]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^(am|오전)/i,
+ pm: /^(pm|오후)/i,
+ midnight: /^자정/i,
+ noon: /^정오/i,
+ morning: /^아침/i,
+ afternoon: /^오후/i,
+ evening: /^저녁/i,
+ night: /^밤/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ko/index.d.ts b/date-fns/src/locale/ko/index.d.ts
new file mode 100644
index 0000000..eac8228
--- /dev/null
+++ b/date-fns/src/locale/ko/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ko } from 'date-fns/locale'
+export default ko
diff --git a/date-fns/src/locale/ko/index.js b/date-fns/src/locale/ko/index.js
new file mode 100644
index 0000000..c0725f8
--- /dev/null
+++ b/date-fns/src/locale/ko/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Korean locale.
+ * @language Korean
+ * @iso-639-2 kor
+ * @author Hong Chulju [@angdev]{@link https://github.com/angdev}
+ * @author Lee Seoyoen [@iamssen]{@link https://github.com/iamssen}
+ * @author Taiki IKeda [@so99ynoodles]{@link https://github.com/so99ynoodles}
+ */
+var locale = {
+ code: 'ko',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ko/index.js.flow b/date-fns/src/locale/ko/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ko/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ko/snapshot.md b/date-fns/src/locale/ko/snapshot.md
new file mode 100644
index 0000000..9618884
--- /dev/null
+++ b/date-fns/src/locale/ko/snapshot.md
@@ -0,0 +1,304 @@
+# Korean (ko) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987번째 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5번째 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987번째 | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5번째 | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1번째 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2번째 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1분기 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2분기 | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1번째 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2번째 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1분기 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2분기 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2번째 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7번째 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | 2월 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7월 | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | 2월 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7월 | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2번째 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7번째 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | 2월 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7월 | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | 2월 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7월 | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1번째 | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49번째 | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1번째 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48번째 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11일 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28일 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42번째 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365번째 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | 월요일 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금요일 | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1번째 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5번째 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | 월요일 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금요일 | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2번째 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6번째 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | 월요일 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금요일 | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2번째 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6번째 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | 월요일 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금요일 | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | 월 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 금 | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 오전 | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | 아침 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 저녁 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 밤 | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | 아침 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 저녁 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 밤 | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | 아침 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 저녁 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 밤 | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | 아침 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 저녁 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 밤 | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | 아침 | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 오후 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 저녁 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 밤 | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11번째 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11번째 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11번째 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23번째 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11번째 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11번째 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11번째 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23번째 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987.02.11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453.05.29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987.02.11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453.05.29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987년 2월 11일 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453년 5월 29일 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 1987년 2월 11일 수요일 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453년 5월 29일 일요일 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 오후 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 오후 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 오후 12시 13분 14초 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 오후 23시 59분 59초 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987.02.11 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453.05.29 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987.02.11 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453.05.29 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987년 2월 11일 오후 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453년 5월 29일 오후 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 1987년 2월 11일 수요일 오후 12시 13분 14초 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453년 5월 29일 일요일 오후 23시 59분 59초 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------- | ---------------------- | ----------------- |
+| 2006-01-01T00:00:00.000Z | 약 6년 | 약 6년 | 약 6년 후 |
+| 2005-01-01T00:00:00.000Z | 약 5년 | 약 5년 | 약 5년 후 |
+| 2004-01-01T00:00:00.000Z | 약 4년 | 약 4년 | 약 4년 후 |
+| 2003-01-01T00:00:00.000Z | 약 3년 | 약 3년 | 약 3년 후 |
+| 2002-01-01T00:00:00.000Z | 약 2년 | 약 2년 | 약 2년 후 |
+| 2001-06-01T00:00:00.000Z | 1년 이상 | 1년 이상 | 1년 이상 후 |
+| 2001-02-01T00:00:00.000Z | 약 1년 | 약 1년 | 약 1년 후 |
+| 2001-01-01T00:00:00.000Z | 약 1년 | 약 1년 | 약 1년 후 |
+| 2000-06-01T00:00:00.000Z | 5개월 | 5개월 | 5개월 후 |
+| 2000-03-01T00:00:00.000Z | 2개월 | 2개월 | 2개월 후 |
+| 2000-02-01T00:00:00.000Z | 약 1개월 | 약 1개월 | 약 1개월 후 |
+| 2000-01-15T00:00:00.000Z | 14일 | 14일 | 14일 후 |
+| 2000-01-02T00:00:00.000Z | 1일 | 1일 | 1일 후 |
+| 2000-01-01T06:00:00.000Z | 약 6시간 | 약 6시간 | 약 6시간 후 |
+| 2000-01-01T01:00:00.000Z | 약 1시간 | 약 1시간 | 약 1시간 후 |
+| 2000-01-01T00:45:00.000Z | 약 1시간 | 약 1시간 | 약 1시간 후 |
+| 2000-01-01T00:30:00.000Z | 30분 | 30분 | 30분 후 |
+| 2000-01-01T00:15:00.000Z | 15분 | 15분 | 15분 후 |
+| 2000-01-01T00:01:00.000Z | 1분 | 1분 | 1분 후 |
+| 2000-01-01T00:00:25.000Z | 1분 미만 | 30초 | 1분 미만 후 |
+| 2000-01-01T00:00:15.000Z | 1분 미만 | 20초 미만 | 1분 미만 후 |
+| 2000-01-01T00:00:05.000Z | 1분 미만 | 10초 미만 | 1분 미만 후 |
+| 2000-01-01T00:00:00.000Z | 1분 미만 | 5초 미만 | 1분 미만 전 |
+| 1999-12-31T23:59:55.000Z | 1분 미만 | 10초 미만 | 1분 미만 전 |
+| 1999-12-31T23:59:45.000Z | 1분 미만 | 20초 미만 | 1분 미만 전 |
+| 1999-12-31T23:59:35.000Z | 1분 미만 | 30초 | 1분 미만 전 |
+| 1999-12-31T23:59:00.000Z | 1분 | 1분 | 1분 전 |
+| 1999-12-31T23:45:00.000Z | 15분 | 15분 | 15분 전 |
+| 1999-12-31T23:30:00.000Z | 30분 | 30분 | 30분 전 |
+| 1999-12-31T23:15:00.000Z | 약 1시간 | 약 1시간 | 약 1시간 전 |
+| 1999-12-31T23:00:00.000Z | 약 1시간 | 약 1시간 | 약 1시간 전 |
+| 1999-12-31T18:00:00.000Z | 약 6시간 | 약 6시간 | 약 6시간 전 |
+| 1999-12-30T00:00:00.000Z | 2일 | 2일 | 2일 전 |
+| 1999-12-15T00:00:00.000Z | 17일 | 17일 | 17일 전 |
+| 1999-12-01T00:00:00.000Z | 약 1개월 | 약 1개월 | 약 1개월 전 |
+| 1999-11-01T00:00:00.000Z | 2개월 | 2개월 | 2개월 전 |
+| 1999-06-01T00:00:00.000Z | 7개월 | 7개월 | 7개월 전 |
+| 1999-01-01T00:00:00.000Z | 약 1년 | 약 1년 | 약 1년 전 |
+| 1998-12-01T00:00:00.000Z | 약 1년 | 약 1년 | 약 1년 전 |
+| 1998-06-01T00:00:00.000Z | 1년 이상 | 1년 이상 | 1년 이상 전 |
+| 1998-01-01T00:00:00.000Z | 약 2년 | 약 2년 | 약 2년 전 |
+| 1997-01-01T00:00:00.000Z | 약 3년 | 약 3년 | 약 3년 전 |
+| 1996-01-01T00:00:00.000Z | 약 4년 | 약 4년 | 약 4년 전 |
+| 1995-01-01T00:00:00.000Z | 약 5년 | 약 5년 | 약 5년 전 |
+| 1994-01-01T00:00:00.000Z | 약 6년 | 약 6년 | 약 6년 전 |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------ | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6년 | 6년 후 | 52608시간 |
+| 2005-01-01T00:00:00.000Z | 5년 | 5년 후 | 43848시간 |
+| 2004-01-01T00:00:00.000Z | 4년 | 4년 후 | 35064시간 |
+| 2003-01-01T00:00:00.000Z | 3년 | 3년 후 | 26304시간 |
+| 2002-01-01T00:00:00.000Z | 2년 | 2년 후 | 17544시간 |
+| 2001-06-01T00:00:00.000Z | 1년 | 1년 후 | 12408시간 |
+| 2001-02-01T00:00:00.000Z | 1년 | 1년 후 | 9528시간 |
+| 2001-01-01T00:00:00.000Z | 1년 | 1년 후 | 8784시간 |
+| 2000-06-01T00:00:00.000Z | 5개월 | 5개월 후 | 3648시간 |
+| 2000-03-01T00:00:00.000Z | 2개월 | 2개월 후 | 1440시간 |
+| 2000-02-01T00:00:00.000Z | 1개월 | 1개월 후 | 744시간 |
+| 2000-01-15T00:00:00.000Z | 14일 | 14일 후 | 336시간 |
+| 2000-01-02T00:00:00.000Z | 1일 | 1일 후 | 24시간 |
+| 2000-01-01T06:00:00.000Z | 6시간 | 6시간 후 | 6시간 |
+| 2000-01-01T01:00:00.000Z | 1시간 | 1시간 후 | 1시간 |
+| 2000-01-01T00:45:00.000Z | 45분 | 45분 후 | 1시간 |
+| 2000-01-01T00:30:00.000Z | 30분 | 30분 후 | 1시간 |
+| 2000-01-01T00:15:00.000Z | 15분 | 15분 후 | 0시간 |
+| 2000-01-01T00:01:00.000Z | 1분 | 1분 후 | 0시간 |
+| 2000-01-01T00:00:25.000Z | 25초 | 25초 후 | 0시간 |
+| 2000-01-01T00:00:15.000Z | 15초 | 15초 후 | 0시간 |
+| 2000-01-01T00:00:05.000Z | 5초 | 5초 후 | 0시간 |
+| 2000-01-01T00:00:00.000Z | 0초 | 0초 전 | 0시간 |
+| 1999-12-31T23:59:55.000Z | 5초 | 5초 전 | 0시간 |
+| 1999-12-31T23:59:45.000Z | 15초 | 15초 전 | 0시간 |
+| 1999-12-31T23:59:35.000Z | 25초 | 25초 전 | 0시간 |
+| 1999-12-31T23:59:00.000Z | 1분 | 1분 전 | 0시간 |
+| 1999-12-31T23:45:00.000Z | 15분 | 15분 전 | 0시간 |
+| 1999-12-31T23:30:00.000Z | 30분 | 30분 전 | 1시간 |
+| 1999-12-31T23:15:00.000Z | 45분 | 45분 전 | 1시간 |
+| 1999-12-31T23:00:00.000Z | 1시간 | 1시간 전 | 1시간 |
+| 1999-12-31T18:00:00.000Z | 6시간 | 6시간 전 | 6시간 |
+| 1999-12-30T00:00:00.000Z | 2일 | 2일 전 | 48시간 |
+| 1999-12-15T00:00:00.000Z | 17일 | 17일 전 | 408시간 |
+| 1999-12-01T00:00:00.000Z | 1개월 | 1개월 전 | 744시간 |
+| 1999-11-01T00:00:00.000Z | 2개월 | 2개월 전 | 1464시간 |
+| 1999-06-01T00:00:00.000Z | 7개월 | 7개월 전 | 5136시간 |
+| 1999-01-01T00:00:00.000Z | 1년 | 1년 전 | 8760시간 |
+| 1998-12-01T00:00:00.000Z | 1년 | 1년 전 | 9504시간 |
+| 1998-06-01T00:00:00.000Z | 2년 | 2년 전 | 13896시간 |
+| 1998-01-01T00:00:00.000Z | 2년 | 2년 전 | 17520시간 |
+| 1997-01-01T00:00:00.000Z | 3년 | 3년 전 | 26280시간 |
+| 1996-01-01T00:00:00.000Z | 4년 | 4년 전 | 35064시간 |
+| 1995-01-01T00:00:00.000Z | 5년 | 5년 전 | 43824시간 |
+| 1994-01-01T00:00:00.000Z | 6년 | 6년 전 | 52584시간 |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------- |
+| 2000-01-10T00:00:00.000Z | 2000.01.10 |
+| 2000-01-05T00:00:00.000Z | 다음 수요일 00:00 |
+| 2000-01-02T00:00:00.000Z | 내일 00:00 |
+| 2000-01-01T00:00:00.000Z | 오늘 00:00 |
+| 1999-12-31T00:00:00.000Z | 어제 00:00 |
+| 1999-12-27T00:00:00.000Z | 지난 월요일 00:00 |
+| 1999-12-21T00:00:00.000Z | 1999.12.21 |
diff --git a/date-fns/src/locale/lb/_lib/formatDistance/index.js b/date-fns/src/locale/lb/_lib/formatDistance/index.js
new file mode 100644
index 0000000..3cde42c
--- /dev/null
+++ b/date-fns/src/locale/lb/_lib/formatDistance/index.js
@@ -0,0 +1,231 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ standalone: {
+ one: 'manner wéi eng Sekonn',
+ other: 'manner wéi {{count}} Sekonnen'
+ },
+ withPreposition: {
+ one: 'manner wéi enger Sekonn',
+ other: 'manner wéi {{count}} Sekonnen'
+ }
+ },
+
+ xSeconds: {
+ standalone: {
+ one: 'eng Sekonn',
+ other: '{{count}} Sekonnen'
+ },
+ withPreposition: {
+ one: 'enger Sekonn',
+ other: '{{count}} Sekonnen'
+ }
+ },
+
+ halfAMinute: {
+ standalone: 'eng hallef Minutt',
+ withPreposition: 'enger hallwer Minutt'
+ },
+
+ lessThanXMinutes: {
+ standalone: {
+ one: 'manner wéi eng Minutt',
+ other: 'manner wéi {{count}} Minutten'
+ },
+ withPreposition: {
+ one: 'manner wéi enger Minutt',
+ other: 'manner wéi {{count}} Minutten'
+ }
+ },
+
+ xMinutes: {
+ standalone: {
+ one: 'eng Minutt',
+ other: '{{count}} Minutten'
+ },
+ withPreposition: {
+ one: 'enger Minutt',
+ other: '{{count}} Minutten'
+ }
+ },
+
+ aboutXHours: {
+ standalone: {
+ one: 'ongeféier eng Stonn',
+ other: 'ongeféier {{count}} Stonnen'
+ },
+ withPreposition: {
+ one: 'ongeféier enger Stonn',
+ other: 'ongeféier {{count}} Stonnen'
+ }
+ },
+
+ xHours: {
+ standalone: {
+ one: 'eng Stonn',
+ other: '{{count}} Stonnen'
+ },
+ withPreposition: {
+ one: 'enger Stonn',
+ other: '{{count}} Stonnen'
+ }
+ },
+
+ xDays: {
+ standalone: {
+ one: 'een Dag',
+ other: '{{count}} Deeg'
+ },
+ withPreposition: {
+ one: 'engem Dag',
+ other: '{{count}} Deeg'
+ }
+ },
+
+ aboutXWeeks: {
+ standalone: {
+ one: 'ongeféier eng Woch',
+ other: 'ongeféier {{count}} Wochen'
+ },
+ withPreposition: {
+ one: 'ongeféier enger Woche',
+ other: 'ongeféier {{count}} Wochen'
+ }
+ },
+
+ xWeeks: {
+ standalone: {
+ one: 'eng Woch',
+ other: '{{count}} Wochen'
+ },
+ withPreposition: {
+ one: 'enger Woch',
+ other: '{{count}} Wochen'
+ }
+ },
+
+ aboutXMonths: {
+ standalone: {
+ one: 'ongeféier ee Mount',
+ other: 'ongeféier {{count}} Méint'
+ },
+ withPreposition: {
+ one: 'ongeféier engem Mount',
+ other: 'ongeféier {{count}} Méint'
+ }
+ },
+
+ xMonths: {
+ standalone: {
+ one: 'ee Mount',
+ other: '{{count}} Méint'
+ },
+ withPreposition: {
+ one: 'engem Mount',
+ other: '{{count}} Méint'
+ }
+ },
+
+ aboutXYears: {
+ standalone: {
+ one: 'ongeféier ee Joer',
+ other: 'ongeféier {{count}} Joer'
+ },
+ withPreposition: {
+ one: 'ongeféier engem Joer',
+ other: 'ongeféier {{count}} Joer'
+ }
+ },
+
+ xYears: {
+ standalone: {
+ one: 'ee Joer',
+ other: '{{count}} Joer'
+ },
+ withPreposition: {
+ one: 'engem Joer',
+ other: '{{count}} Joer'
+ }
+ },
+
+ overXYears: {
+ standalone: {
+ one: 'méi wéi ee Joer',
+ other: 'méi wéi {{count}} Joer'
+ },
+ withPreposition: {
+ one: 'méi wéi engem Joer',
+ other: 'méi wéi {{count}} Joer'
+ }
+ },
+
+ almostXYears: {
+ standalone: {
+ one: 'bal ee Joer',
+ other: 'bal {{count}} Joer'
+ },
+ withPreposition: {
+ one: 'bal engem Joer',
+ other: 'bal {{count}} Joer'
+ }
+ }
+}
+
+var EXCEPTION_CONSONANTS = ['d', 'h', 'n', 't', 'z']
+var VOWELS = ['a,', 'e', 'i', 'o', 'u']
+var DIGITS_SPOKEN_N_NEEDED = [0, 1, 2, 3, 8, 9]
+var FIRST_TWO_DIGITS_SPOKEN_NO_N_NEEDED = [40, 50, 60, 70]
+
+// Eifeler Regel
+function isFinalNNeeded(nextWords) {
+ var firstLetter = nextWords.charAt(0).toLowerCase()
+ if (
+ VOWELS.indexOf(firstLetter) != -1 ||
+ EXCEPTION_CONSONANTS.indexOf(firstLetter) != -1
+ ) {
+ return true
+ }
+
+ // Numbers would need to converted into words for checking.
+ // Therefore, I have listed the digits that require a preceeding n with a few exceptions.
+ var firstWord = nextWords.split(' ')[0]
+ var number = parseInt(firstWord)
+ if (
+ !isNaN(number) &&
+ DIGITS_SPOKEN_N_NEEDED.indexOf(number % 10) != -1 &&
+ FIRST_TWO_DIGITS_SPOKEN_NO_N_NEEDED.indexOf(
+ parseInt(firstWord.substring(0, 2))
+ ) == -1
+ ) {
+ return true
+ }
+
+ // Omit other checks as they are not expected here.
+ return false
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var usageGroup = options.addSuffix
+ ? formatDistanceLocale[token].withPreposition
+ : formatDistanceLocale[token].standalone
+
+ var result
+ if (typeof usageGroup === 'string') {
+ result = usageGroup
+ } else if (count === 1) {
+ result = usageGroup.one
+ } else {
+ result = usageGroup.other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'a' + (isFinalNNeeded(result) ? 'n' : '') + ' ' + result
+ } else {
+ return 'viru' + (isFinalNNeeded(result) ? 'n' : '') + ' ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/lb/_lib/formatLong/index.js b/date-fns/src/locale/lb/_lib/formatLong/index.js
new file mode 100644
index 0000000..fd4a4ed
--- /dev/null
+++ b/date-fns/src/locale/lb/_lib/formatLong/index.js
@@ -0,0 +1,42 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+// DIN 5008: https://de.wikipedia.org/wiki/Datumsformat#DIN_5008
+var dateFormats = {
+ full: 'EEEE, do MMMM y', // Méindeg, 7. Januar 2018
+ long: 'do MMMM y', // 7. Januar 2018
+ medium: 'do MMM y', // 7. Jan 2018
+ short: 'dd.MM.yy' // 07.01.18
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'um' {{time}}",
+ long: "{{date}} 'um' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/lb/_lib/formatRelative/index.js b/date-fns/src/locale/lb/_lib/formatRelative/index.js
new file mode 100644
index 0000000..75062cb
--- /dev/null
+++ b/date-fns/src/locale/lb/_lib/formatRelative/index.js
@@ -0,0 +1,27 @@
+var formatRelativeLocale = {
+ lastWeek: function(date) {
+ var day = date.getUTCDay()
+ var result = "'läschte"
+ if (day === 2 || day === 4) {
+ // Eifeler Regel: Add an n before the consonant d; Here "Dënschdeg" "and Donneschde".
+ result += 'n'
+ }
+ result += "' eeee 'um' p"
+ return result
+ },
+ yesterday: "'gëschter um' p",
+ today: "'haut um' p",
+ tomorrow: "'moien um' p",
+ nextWeek: "eeee 'um' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/lb/_lib/localize/index.js b/date-fns/src/locale/lb/_lib/localize/index.js
new file mode 100644
index 0000000..33ee0b1
--- /dev/null
+++ b/date-fns/src/locale/lb/_lib/localize/index.js
@@ -0,0 +1,167 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['v.Chr.', 'n.Chr.'],
+ abbreviated: ['v.Chr.', 'n.Chr.'],
+ wide: ['viru Christus', 'no Christus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Feb',
+ 'Mäe',
+ 'Abr',
+ 'Mee',
+ 'Jun',
+ 'Jul',
+ 'Aug',
+ 'Sep',
+ 'Okt',
+ 'Nov',
+ 'Dez'
+ ],
+ wide: [
+ 'Januar',
+ 'Februar',
+ 'Mäerz',
+ 'Abrëll',
+ 'Mee',
+ 'Juni',
+ 'Juli',
+ 'August',
+ 'September',
+ 'Oktober',
+ 'November',
+ 'Dezember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
+ short: ['So', 'Mé', 'Dë', 'Më', 'Do', 'Fr', 'Sa'],
+ abbreviated: ['So.', 'Mé.', 'Dë.', 'Më.', 'Do.', 'Fr.', 'Sa.'],
+ wide: [
+ 'Sonndeg',
+ 'Méindeg',
+ 'Dënschdeg',
+ 'Mëttwoch',
+ 'Donneschdeg',
+ 'Freideg',
+ 'Samschdeg'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'mo.',
+ pm: 'nomë.',
+ midnight: 'Mëtternuecht',
+ noon: 'Mëtteg',
+ morning: 'Moien',
+ afternoon: 'Nomëtteg',
+ evening: 'Owend',
+ night: 'Nuecht'
+ },
+ abbreviated: {
+ am: 'moies',
+ pm: 'nomëttes',
+ midnight: 'Mëtternuecht',
+ noon: 'Mëtteg',
+ morning: 'Moien',
+ afternoon: 'Nomëtteg',
+ evening: 'Owend',
+ night: 'Nuecht'
+ },
+ wide: {
+ am: 'moies',
+ pm: 'nomëttes',
+ midnight: 'Mëtternuecht',
+ noon: 'Mëtteg',
+ morning: 'Moien',
+ afternoon: 'Nomëtteg',
+ evening: 'Owend',
+ night: 'Nuecht'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'mo.',
+ pm: 'nom.',
+ midnight: 'Mëtternuecht',
+ noon: 'mëttes',
+ morning: 'moies',
+ afternoon: 'nomëttes',
+ evening: 'owes',
+ night: 'nuets'
+ },
+ abbreviated: {
+ am: 'moies',
+ pm: 'nomëttes',
+ midnight: 'Mëtternuecht',
+ noon: 'mëttes',
+ morning: 'moies',
+ afternoon: 'nomëttes',
+ evening: 'owes',
+ night: 'nuets'
+ },
+ wide: {
+ am: 'moies',
+ pm: 'nomëttes',
+ midnight: 'Mëtternuecht',
+ noon: 'mëttes',
+ morning: 'moies',
+ afternoon: 'nomëttes',
+ evening: 'owes',
+ night: 'nuets'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/lb/_lib/match/index.js b/date-fns/src/locale/lb/_lib/match/index.js
new file mode 100644
index 0000000..5935d86
--- /dev/null
+++ b/date-fns/src/locale/lb/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(\.)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
+ abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
+ wide: /^(viru Christus|virun eiser Zäitrechnung|no Christus|eiser Zäitrechnung)/i
+}
+var parseEraPatterns = {
+ any: [/^v/i, /^n/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](\.)? Quartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mäe|abr|mee|jun|jul|aug|sep|okt|nov|dez)/i,
+ wide: /^(januar|februar|mäerz|abrëll|mee|juni|juli|august|september|oktober|november|dezember)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mä/i,
+ /^ab/i,
+ /^me/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smdf]/i,
+ short: /^(so|mé|dë|më|do|fr|sa)/i,
+ abbreviated: /^(son?|méi?|dën?|mët?|don?|fre?|sam?)\.?/i,
+ wide: /^(sonndeg|méindeg|dënschdeg|mëttwoch|donneschdeg|freideg|samschdeg)/i
+}
+var parseDayPatterns = {
+ any: [/^so/i, /^mé/i, /^dë/i, /^më/i, /^do/i, /^f/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(mo\.?|nomë\.?|Mëtternuecht|mëttes|moies|nomëttes|owes|nuets)/i,
+ abbreviated: /^(moi\.?|nomët\.?|Mëtternuecht|mëttes|moies|nomëttes|owes|nuets)/i,
+ wide: /^(moies|nomëttes|Mëtternuecht|mëttes|moies|nomëttes|owes|nuets)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^m/i,
+ pm: /^n/i,
+ midnight: /^Mëtter/i,
+ noon: /^mëttes/i,
+ morning: /moies/i,
+ afternoon: /nomëttes/i, // will never be matched. Afternoon is matched by `pm`
+ evening: /owes/i,
+ night: /nuets/i // will never be matched. Night is matched by `pm`
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/lb/index.d.ts b/date-fns/src/locale/lb/index.d.ts
new file mode 100644
index 0000000..727529b
--- /dev/null
+++ b/date-fns/src/locale/lb/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lb } from 'date-fns/locale'
+export default lb
diff --git a/date-fns/src/locale/lb/index.js b/date-fns/src/locale/lb/index.js
new file mode 100644
index 0000000..25c95c2
--- /dev/null
+++ b/date-fns/src/locale/lb/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Luxembourgish locale.
+ * @language Luxembourgish
+ * @iso-639-2 ltz
+ * @author Daniel Waxweiler [@dwaxweiler]{@link https://github.com/dwaxweiler}
+ */
+var locale = {
+ code: 'lb',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/lb/index.js.flow b/date-fns/src/locale/lb/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/lb/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/lb/snapshot.md b/date-fns/src/locale/lb/snapshot.md
new file mode 100644
index 0000000..0820db5
--- /dev/null
+++ b/date-fns/src/locale/lb/snapshot.md
@@ -0,0 +1,304 @@
+# Luxembourgish (lb) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. Quartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. Quartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. Quartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. Quartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Mé. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Mé. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Mé. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Méindeg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freideg | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Mé | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Mé. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Méindeg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freideg | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Mé | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Mé. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Méindeg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freideg | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Mé | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Mé. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Méindeg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Freideg | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Mé | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | moies | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | moies | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | moies | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | moies | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | moies | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nom. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nom. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | mo. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | moies | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | moies | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | moies | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | moies | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | nomëttes | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | moies | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | mo. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nom. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | nom. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | mo. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | owes | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nuets | 2019-02-11T12:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | owes | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nuets | 2019-02-11T12:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | owes | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nuets | 2019-02-11T12:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | moies | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | owes | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nuets | 2019-02-11T12:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | moies | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | nomëttes | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | owes | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | nuets | 2019-02-11T12:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.87 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.53 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mee 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. Februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mee 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Mëttwoch, 11. Februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Sonndeg, 29. Mee 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.87 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.53 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. Feb 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. Mee 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. Februar 1987 um 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. Mee 1453 um 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Mëttwoch, 11. Februar 1987 um 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Sonndeg, 29. Mee 1453 um 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------- | ---------------------- | ---------------------------- |
+| 2006-01-01T00:00:00.000Z | ongeféier 6 Joer | ongeféier 6 Joer | an ongeféier 6 Joer |
+| 2005-01-01T00:00:00.000Z | ongeféier 5 Joer | ongeféier 5 Joer | an ongeféier 5 Joer |
+| 2004-01-01T00:00:00.000Z | ongeféier 4 Joer | ongeféier 4 Joer | an ongeféier 4 Joer |
+| 2003-01-01T00:00:00.000Z | ongeféier 3 Joer | ongeféier 3 Joer | an ongeféier 3 Joer |
+| 2002-01-01T00:00:00.000Z | ongeféier 2 Joer | ongeféier 2 Joer | an ongeféier 2 Joer |
+| 2001-06-01T00:00:00.000Z | méi wéi ee Joer | méi wéi ee Joer | a méi wéi engem Joer |
+| 2001-02-01T00:00:00.000Z | ongeféier ee Joer | ongeféier ee Joer | an ongeféier engem Joer |
+| 2001-01-01T00:00:00.000Z | ongeféier ee Joer | ongeféier ee Joer | an ongeféier engem Joer |
+| 2000-06-01T00:00:00.000Z | 5 Méint | 5 Méint | a 5 Méint |
+| 2000-03-01T00:00:00.000Z | 2 Méint | 2 Méint | an 2 Méint |
+| 2000-02-01T00:00:00.000Z | ongeféier ee Mount | ongeféier ee Mount | an ongeféier engem Mount |
+| 2000-01-15T00:00:00.000Z | 14 Deeg | 14 Deeg | a 14 Deeg |
+| 2000-01-02T00:00:00.000Z | een Dag | een Dag | an engem Dag |
+| 2000-01-01T06:00:00.000Z | ongeféier 6 Stonnen | ongeféier 6 Stonnen | an ongeféier 6 Stonnen |
+| 2000-01-01T01:00:00.000Z | ongeféier eng Stonn | ongeféier eng Stonn | an ongeféier enger Stonn |
+| 2000-01-01T00:45:00.000Z | ongeféier eng Stonn | ongeféier eng Stonn | an ongeféier enger Stonn |
+| 2000-01-01T00:30:00.000Z | 30 Minutten | 30 Minutten | an 30 Minutten |
+| 2000-01-01T00:15:00.000Z | 15 Minutten | 15 Minutten | a 15 Minutten |
+| 2000-01-01T00:01:00.000Z | eng Minutt | eng Minutt | an enger Minutt |
+| 2000-01-01T00:00:25.000Z | manner wéi eng Minutt | eng hallef Minutt | a manner wéi enger Minutt |
+| 2000-01-01T00:00:15.000Z | manner wéi eng Minutt | manner wéi 20 Sekonnen | a manner wéi enger Minutt |
+| 2000-01-01T00:00:05.000Z | manner wéi eng Minutt | manner wéi 10 Sekonnen | a manner wéi enger Minutt |
+| 2000-01-01T00:00:00.000Z | manner wéi eng Minutt | manner wéi 5 Sekonnen | viru manner wéi enger Minutt |
+| 1999-12-31T23:59:55.000Z | manner wéi eng Minutt | manner wéi 10 Sekonnen | viru manner wéi enger Minutt |
+| 1999-12-31T23:59:45.000Z | manner wéi eng Minutt | manner wéi 20 Sekonnen | viru manner wéi enger Minutt |
+| 1999-12-31T23:59:35.000Z | manner wéi eng Minutt | eng hallef Minutt | viru manner wéi enger Minutt |
+| 1999-12-31T23:59:00.000Z | eng Minutt | eng Minutt | virun enger Minutt |
+| 1999-12-31T23:45:00.000Z | 15 Minutten | 15 Minutten | viru 15 Minutten |
+| 1999-12-31T23:30:00.000Z | 30 Minutten | 30 Minutten | virun 30 Minutten |
+| 1999-12-31T23:15:00.000Z | ongeféier eng Stonn | ongeféier eng Stonn | virun ongeféier enger Stonn |
+| 1999-12-31T23:00:00.000Z | ongeféier eng Stonn | ongeféier eng Stonn | virun ongeféier enger Stonn |
+| 1999-12-31T18:00:00.000Z | ongeféier 6 Stonnen | ongeféier 6 Stonnen | virun ongeféier 6 Stonnen |
+| 1999-12-30T00:00:00.000Z | 2 Deeg | 2 Deeg | virun 2 Deeg |
+| 1999-12-15T00:00:00.000Z | 17 Deeg | 17 Deeg | viru 17 Deeg |
+| 1999-12-01T00:00:00.000Z | ongeféier ee Mount | ongeféier ee Mount | virun ongeféier engem Mount |
+| 1999-11-01T00:00:00.000Z | 2 Méint | 2 Méint | virun 2 Méint |
+| 1999-06-01T00:00:00.000Z | 7 Méint | 7 Méint | viru 7 Méint |
+| 1999-01-01T00:00:00.000Z | ongeféier ee Joer | ongeféier ee Joer | virun ongeféier engem Joer |
+| 1998-12-01T00:00:00.000Z | ongeféier ee Joer | ongeféier ee Joer | virun ongeféier engem Joer |
+| 1998-06-01T00:00:00.000Z | méi wéi ee Joer | méi wéi ee Joer | viru méi wéi engem Joer |
+| 1998-01-01T00:00:00.000Z | ongeféier 2 Joer | ongeféier 2 Joer | virun ongeféier 2 Joer |
+| 1997-01-01T00:00:00.000Z | ongeféier 3 Joer | ongeféier 3 Joer | virun ongeféier 3 Joer |
+| 1996-01-01T00:00:00.000Z | ongeféier 4 Joer | ongeféier 4 Joer | virun ongeféier 4 Joer |
+| 1995-01-01T00:00:00.000Z | ongeféier 5 Joer | ongeféier 5 Joer | virun ongeféier 5 Joer |
+| 1994-01-01T00:00:00.000Z | ongeféier 6 Joer | ongeféier 6 Joer | virun ongeféier 6 Joer |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 Joer | a 6 Joer | 52608 Stonnen |
+| 2005-01-01T00:00:00.000Z | 5 Joer | a 5 Joer | 43848 Stonnen |
+| 2004-01-01T00:00:00.000Z | 4 Joer | a 4 Joer | 35064 Stonnen |
+| 2003-01-01T00:00:00.000Z | 3 Joer | an 3 Joer | 26304 Stonnen |
+| 2002-01-01T00:00:00.000Z | 2 Joer | an 2 Joer | 17544 Stonnen |
+| 2001-06-01T00:00:00.000Z | ee Joer | an engem Joer | 12408 Stonnen |
+| 2001-02-01T00:00:00.000Z | ee Joer | an engem Joer | 9528 Stonnen |
+| 2001-01-01T00:00:00.000Z | ee Joer | an engem Joer | 8784 Stonnen |
+| 2000-06-01T00:00:00.000Z | 5 Méint | a 5 Méint | 3648 Stonnen |
+| 2000-03-01T00:00:00.000Z | 2 Méint | an 2 Méint | 1440 Stonnen |
+| 2000-02-01T00:00:00.000Z | ee Mount | an engem Mount | 744 Stonnen |
+| 2000-01-15T00:00:00.000Z | 14 Deeg | a 14 Deeg | 336 Stonnen |
+| 2000-01-02T00:00:00.000Z | een Dag | an engem Dag | 24 Stonnen |
+| 2000-01-01T06:00:00.000Z | 6 Stonnen | a 6 Stonnen | 6 Stonnen |
+| 2000-01-01T01:00:00.000Z | eng Stonn | an enger Stonn | eng Stonn |
+| 2000-01-01T00:45:00.000Z | 45 Minutten | a 45 Minutten | eng Stonn |
+| 2000-01-01T00:30:00.000Z | 30 Minutten | an 30 Minutten | eng Stonn |
+| 2000-01-01T00:15:00.000Z | 15 Minutten | a 15 Minutten | 0 Stonnen |
+| 2000-01-01T00:01:00.000Z | eng Minutt | an enger Minutt | 0 Stonnen |
+| 2000-01-01T00:00:25.000Z | 25 Sekonnen | a 25 Sekonnen | 0 Stonnen |
+| 2000-01-01T00:00:15.000Z | 15 Sekonnen | a 15 Sekonnen | 0 Stonnen |
+| 2000-01-01T00:00:05.000Z | 5 Sekonnen | a 5 Sekonnen | 0 Stonnen |
+| 2000-01-01T00:00:00.000Z | 0 Sekonnen | virun 0 Sekonnen | 0 Stonnen |
+| 1999-12-31T23:59:55.000Z | 5 Sekonnen | viru 5 Sekonnen | 0 Stonnen |
+| 1999-12-31T23:59:45.000Z | 15 Sekonnen | viru 15 Sekonnen | 0 Stonnen |
+| 1999-12-31T23:59:35.000Z | 25 Sekonnen | viru 25 Sekonnen | 0 Stonnen |
+| 1999-12-31T23:59:00.000Z | eng Minutt | virun enger Minutt | 0 Stonnen |
+| 1999-12-31T23:45:00.000Z | 15 Minutten | viru 15 Minutten | 0 Stonnen |
+| 1999-12-31T23:30:00.000Z | 30 Minutten | virun 30 Minutten | eng Stonn |
+| 1999-12-31T23:15:00.000Z | 45 Minutten | viru 45 Minutten | eng Stonn |
+| 1999-12-31T23:00:00.000Z | eng Stonn | virun enger Stonn | eng Stonn |
+| 1999-12-31T18:00:00.000Z | 6 Stonnen | viru 6 Stonnen | 6 Stonnen |
+| 1999-12-30T00:00:00.000Z | 2 Deeg | virun 2 Deeg | 48 Stonnen |
+| 1999-12-15T00:00:00.000Z | 17 Deeg | viru 17 Deeg | 408 Stonnen |
+| 1999-12-01T00:00:00.000Z | ee Mount | virun engem Mount | 744 Stonnen |
+| 1999-11-01T00:00:00.000Z | 2 Méint | virun 2 Méint | 1464 Stonnen |
+| 1999-06-01T00:00:00.000Z | 7 Méint | viru 7 Méint | 5136 Stonnen |
+| 1999-01-01T00:00:00.000Z | ee Joer | virun engem Joer | 8760 Stonnen |
+| 1998-12-01T00:00:00.000Z | ee Joer | virun engem Joer | 9504 Stonnen |
+| 1998-06-01T00:00:00.000Z | 2 Joer | virun 2 Joer | 13896 Stonnen |
+| 1998-01-01T00:00:00.000Z | 2 Joer | virun 2 Joer | 17520 Stonnen |
+| 1997-01-01T00:00:00.000Z | 3 Joer | virun 3 Joer | 26280 Stonnen |
+| 1996-01-01T00:00:00.000Z | 4 Joer | viru 4 Joer | 35064 Stonnen |
+| 1995-01-01T00:00:00.000Z | 5 Joer | viru 5 Joer | 43824 Stonnen |
+| 1994-01-01T00:00:00.000Z | 6 Joer | viru 6 Joer | 52584 Stonnen |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 10.01.00 |
+| 2000-01-05T00:00:00.000Z | Mëttwoch um 00:00 |
+| 2000-01-02T00:00:00.000Z | moien um 00:00 |
+| 2000-01-01T00:00:00.000Z | haut um 00:00 |
+| 1999-12-31T00:00:00.000Z | gëschter um 00:00 |
+| 1999-12-27T00:00:00.000Z | läschte Méindeg um 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.99 |
diff --git a/date-fns/src/locale/lt/_lib/formatDistance/index.js b/date-fns/src/locale/lt/_lib/formatDistance/index.js
new file mode 100644
index 0000000..0ec0f66
--- /dev/null
+++ b/date-fns/src/locale/lt/_lib/formatDistance/index.js
@@ -0,0 +1,165 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: translateSeconds,
+ other: translate
+ },
+
+ xSeconds: {
+ one: translateSeconds,
+ other: translate
+ },
+
+ halfAMinute: 'pusė minutės',
+
+ lessThanXMinutes: {
+ one: translateSingular,
+ other: translate
+ },
+
+ xMinutes: {
+ one: translateSingular,
+ other: translate
+ },
+
+ aboutXHours: {
+ one: translateSingular,
+ other: translate
+ },
+
+ xHours: {
+ one: translateSingular,
+ other: translate
+ },
+
+ xDays: {
+ one: translateSingular,
+ other: translate
+ },
+
+ aboutWeeks: {
+ one: translateSingular,
+ other: translate
+ },
+
+ xWeeks: {
+ one: translateSingular,
+ other: translate
+ },
+
+ aboutXMonths: {
+ one: translateSingular,
+ other: translate
+ },
+
+ xMonths: {
+ one: translateSingular,
+ other: translate
+ },
+
+ aboutXYears: {
+ one: translateSingular,
+ other: translate
+ },
+
+ xYears: {
+ one: translateSingular,
+ other: translate
+ },
+
+ overXYears: {
+ one: translateSingular,
+ other: translate
+ },
+
+ almostXYears: {
+ one: translateSingular,
+ other: translate
+ }
+}
+
+var translations = {
+ xseconds_other: 'sekundė_sekundžių_sekundes',
+ xminutes_one: 'minutė_minutės_minutę',
+ xminutes_other: 'minutės_minučių_minutes',
+ xhours_one: 'valanda_valandos_valandą',
+ xhours_other: 'valandos_valandų_valandas',
+ xdays_one: 'diena_dienos_dieną',
+ xdays_other: 'dienos_dienų_dienas',
+ xweeks_one: 'savaitė_savaitės_savaitę',
+ xweeks_other: 'savaitės_savaičių_savaites',
+ xmonths_one: 'mėnuo_mėnesio_mėnesį',
+ xmonths_other: 'mėnesiai_mėnesių_mėnesius',
+ xyears_one: 'metai_metų_metus',
+ xyears_other: 'metai_metų_metus',
+ about: 'apie',
+ over: 'daugiau nei',
+ almost: 'beveik',
+ lessthan: 'mažiau nei'
+}
+function translateSeconds(number, addSuffix, key, isFuture) {
+ if (!addSuffix) {
+ return 'kelios sekundės'
+ } else {
+ return isFuture ? 'kelių sekundžių' : 'kelias sekundes'
+ }
+}
+function translateSingular(number, addSuffix, key, isFuture) {
+ return !addSuffix ? forms(key)[0] : isFuture ? forms(key)[1] : forms(key)[2]
+}
+function special(number) {
+ return number % 10 === 0 || (number > 10 && number < 20)
+}
+function forms(key) {
+ return translations[key].split('_')
+}
+function translate(number, addSuffix, key, isFuture) {
+ var result = number + ' '
+ if (number === 1) {
+ return result + translateSingular(number, addSuffix, key[0], isFuture)
+ } else if (!addSuffix) {
+ return result + (special(number) ? forms(key)[1] : forms(key)[0])
+ } else {
+ if (isFuture) {
+ return result + forms(key)[1]
+ } else {
+ return result + (special(number) ? forms(key)[1] : forms(key)[2])
+ }
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ var adverb = token.match(/about|over|almost|lessthan/i)
+ var unit = token.replace(adverb, '')
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one(
+ count,
+ options.addSuffix,
+ unit.toLowerCase() + '_one'
+ )
+ } else {
+ result = formatDistanceLocale[token].other(
+ count,
+ options.addSuffix,
+ unit.toLowerCase() + '_other'
+ )
+ }
+
+ if (adverb) {
+ result = translations[adverb[0].toLowerCase()] + ' ' + result
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'po ' + result
+ } else {
+ return 'prieš ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/lt/_lib/formatLong/index.js b/date-fns/src/locale/lt/_lib/formatLong/index.js
new file mode 100644
index 0000000..74448f9
--- /dev/null
+++ b/date-fns/src/locale/lt/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "y 'm'. MMMM d 'd'., EEEE",
+ long: "y 'm'. MMMM d 'd'.",
+ medium: 'y-MM-dd',
+ short: 'y-MM-dd'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/lt/_lib/formatRelative/index.js b/date-fns/src/locale/lt/_lib/formatRelative/index.js
new file mode 100644
index 0000000..ca7f71e
--- /dev/null
+++ b/date-fns/src/locale/lt/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'Praėjusį' eeee p",
+ yesterday: "'Vakar' p",
+ today: "'Šiandien' p",
+ tomorrow: "'Rytoj' p",
+ nextWeek: 'eeee p',
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/lt/_lib/localize/index.js b/date-fns/src/locale/lt/_lib/localize/index.js
new file mode 100644
index 0000000..f318617
--- /dev/null
+++ b/date-fns/src/locale/lt/_lib/localize/index.js
@@ -0,0 +1,225 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['pr. Kr.', 'po Kr.'],
+ abbreviated: ['pr. Kr.', 'po Kr.'],
+ wide: ['prieš Kristų', 'po Kristaus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['I ketv.', 'II ketv.', 'III ketv.', 'IV ketv.'],
+ wide: ['I ketvirtis', 'II ketvirtis', 'III ketvirtis', 'IV ketvirtis']
+}
+
+var formattingQuarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['I k.', 'II k.', 'III k.', 'IV k.'],
+ wide: ['I ketvirtis', 'II ketvirtis', 'III ketvirtis', 'IV ketvirtis']
+}
+
+var monthValues = {
+ narrow: ['S', 'V', 'K', 'B', 'G', 'B', 'L', 'R', 'R', 'S', 'L', 'G'],
+ abbreviated: [
+ 'saus.',
+ 'vas.',
+ 'kov.',
+ 'bal.',
+ 'geg.',
+ 'birž.',
+ 'liep.',
+ 'rugp.',
+ 'rugs.',
+ 'spal.',
+ 'lapkr.',
+ 'gruod.'
+ ],
+ wide: [
+ 'sausis',
+ 'vasaris',
+ 'kovas',
+ 'balandis',
+ 'gegužė',
+ 'birželis',
+ 'liepa',
+ 'rugpjūtis',
+ 'rugsėjis',
+ 'spalis',
+ 'lapkritis',
+ 'gruodis'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: ['S', 'V', 'K', 'B', 'G', 'B', 'L', 'R', 'R', 'S', 'L', 'G'],
+ abbreviated: [
+ 'saus.',
+ 'vas.',
+ 'kov.',
+ 'bal.',
+ 'geg.',
+ 'birž.',
+ 'liep.',
+ 'rugp.',
+ 'rugs.',
+ 'spal.',
+ 'lapkr.',
+ 'gruod.'
+ ],
+ wide: [
+ 'sausio',
+ 'vasario',
+ 'kovo',
+ 'balandžio',
+ 'gegužės',
+ 'birželio',
+ 'liepos',
+ 'rugpjūčio',
+ 'rugsėjo',
+ 'spalio',
+ 'lapkričio',
+ 'gruodžio'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'P', 'A', 'T', 'K', 'P', 'Š'],
+ short: ['Sk', 'Pr', 'An', 'Tr', 'Kt', 'Pn', 'Št'],
+ abbreviated: ['sk', 'pr', 'an', 'tr', 'kt', 'pn', 'št'],
+ wide: [
+ 'sekmadienis',
+ 'pirmadienis',
+ 'antradienis',
+ 'trečiadienis',
+ 'ketvirtadienis',
+ 'penktadienis',
+ 'šeštadienis'
+ ]
+}
+
+var formattingDayValues = {
+ narrow: ['S', 'P', 'A', 'T', 'K', 'P', 'Š'],
+ short: ['Sk', 'Pr', 'An', 'Tr', 'Kt', 'Pn', 'Št'],
+ abbreviated: ['sk', 'pr', 'an', 'tr', 'kt', 'pn', 'št'],
+ wide: [
+ 'sekmadienį',
+ 'pirmadienį',
+ 'antradienį',
+ 'trečiadienį',
+ 'ketvirtadienį',
+ 'penktadienį',
+ 'šeštadienį'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'pr. p.',
+ pm: 'pop.',
+ midnight: 'vidurnaktis',
+ noon: 'vidurdienis',
+ morning: 'rytas',
+ afternoon: 'diena',
+ evening: 'vakaras',
+ night: 'naktis'
+ },
+ abbreviated: {
+ am: 'priešpiet',
+ pm: 'popiet',
+ midnight: 'vidurnaktis',
+ noon: 'vidurdienis',
+ morning: 'rytas',
+ afternoon: 'diena',
+ evening: 'vakaras',
+ night: 'naktis'
+ },
+ wide: {
+ am: 'priešpiet',
+ pm: 'popiet',
+ midnight: 'vidurnaktis',
+ noon: 'vidurdienis',
+ morning: 'rytas',
+ afternoon: 'diena',
+ evening: 'vakaras',
+ night: 'naktis'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'pr. p.',
+ pm: 'pop.',
+ midnight: 'vidurnaktis',
+ noon: 'perpiet',
+ morning: 'rytas',
+ afternoon: 'popietė',
+ evening: 'vakaras',
+ night: 'naktis'
+ },
+ abbreviated: {
+ am: 'priešpiet',
+ pm: 'popiet',
+ midnight: 'vidurnaktis',
+ noon: 'perpiet',
+ morning: 'rytas',
+ afternoon: 'popietė',
+ evening: 'vakaras',
+ night: 'naktis'
+ },
+ wide: {
+ am: 'priešpiet',
+ pm: 'popiet',
+ midnight: 'vidurnaktis',
+ noon: 'perpiet',
+ morning: 'rytas',
+ afternoon: 'popietė',
+ evening: 'vakaras',
+ night: 'naktis'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ return number + '-oji'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingQuarterValues,
+ defaultFormattingWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/lt/_lib/match/index.js b/date-fns/src/locale/lt/_lib/match/index.js
new file mode 100644
index 0000000..5bebf37
--- /dev/null
+++ b/date-fns/src/locale/lt/_lib/match/index.js
@@ -0,0 +1,150 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-oji)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^p(r|o)\.?\s?(kr\.?|me)/i,
+ abbreviated: /^(pr\.\s?(kr\.|m\.\s?e\.)|po\s?kr\.|mūsų eroje)/i,
+ wide: /^(prieš Kristų|prieš mūsų erą|po Kristaus|mūsų eroje)/i
+}
+var parseEraPatterns = {
+ wide: [/prieš/i, /(po|mūsų)/i],
+ any: [/^pr/i, /^(po|m)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^([1234])/i,
+ abbreviated: /^(I|II|III|IV)\s?ketv?\.?/i,
+ wide: /^(I|II|III|IV)\s?ketvirtis/i
+}
+var parseQuarterPatterns = {
+ narrow: [/1/i, /2/i, /3/i, /4/i],
+ any: [/I$/i, /II$/i, /III/i, /IV/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[svkbglr]/i,
+ abbreviated: /^(saus\.|vas\.|kov\.|bal\.|geg\.|birž\.|liep\.|rugp\.|rugs\.|spal\.|lapkr\.|gruod\.)/i,
+ wide: /^(sausi(s|o)|vasari(s|o)|kov(a|o)s|balandž?i(s|o)|gegužės?|birželi(s|o)|liep(a|os)|rugpjū(t|č)i(s|o)|rugsėj(is|o)|spali(s|o)|lapkri(t|č)i(s|o)|gruodž?i(s|o))/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^s/i,
+ /^v/i,
+ /^k/i,
+ /^b/i,
+ /^g/i,
+ /^b/i,
+ /^l/i,
+ /^r/i,
+ /^r/i,
+ /^s/i,
+ /^l/i,
+ /^g/i
+ ],
+ any: [
+ /^saus/i,
+ /^vas/i,
+ /^kov/i,
+ /^bal/i,
+ /^geg/i,
+ /^birž/i,
+ /^liep/i,
+ /^rugp/i,
+ /^rugs/i,
+ /^spal/i,
+ /^lapkr/i,
+ /^gruod/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[spatkš]/i,
+ short: /^(sk|pr|an|tr|kt|pn|št)/i,
+ abbreviated: /^(sk|pr|an|tr|kt|pn|št)/i,
+ wide: /^(sekmadien(is|į)|pirmadien(is|į)|antradien(is|į)|trečiadien(is|į)|ketvirtadien(is|į)|penktadien(is|į)|šeštadien(is|į))/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^p/i, /^a/i, /^t/i, /^k/i, /^p/i, /^š/i],
+ wide: [/^se/i, /^pi/i, /^an/i, /^tr/i, /^ke/i, /^pe/i, /^še/i],
+ any: [/^sk/i, /^pr/i, /^an/i, /^tr/i, /^kt/i, /^pn/i, /^št/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(pr.\s?p.|pop.|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i,
+ any: /^(priešpiet|popiet$|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i
+}
+var parseDayPeriodPatterns = {
+ narrow: {
+ am: /^pr/i,
+ pm: /^pop./i,
+ midnight: /^vidurnaktis/i,
+ noon: /^(vidurdienis|perp)/i,
+ morning: /rytas/i,
+ afternoon: /(die|popietė)/i,
+ evening: /vakaras/i,
+ night: /naktis/i
+ },
+ any: {
+ am: /^pr/i,
+ pm: /^popiet$/i,
+ midnight: /^vidurnaktis/i,
+ noon: /^(vidurdienis|perp)/i,
+ morning: /rytas/i,
+ afternoon: /(die|popietė)/i,
+ evening: /vakaras/i,
+ night: /naktis/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/lt/index.d.ts b/date-fns/src/locale/lt/index.d.ts
new file mode 100644
index 0000000..573a840
--- /dev/null
+++ b/date-fns/src/locale/lt/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lt } from 'date-fns/locale'
+export default lt
diff --git a/date-fns/src/locale/lt/index.js b/date-fns/src/locale/lt/index.js
new file mode 100644
index 0000000..c954ccd
--- /dev/null
+++ b/date-fns/src/locale/lt/index.js
@@ -0,0 +1,32 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ *
+ * @summary Lithuanian locale.
+ * @language Lithuanian
+ *
+ * @iso-639-2 lit
+ *
+ * @author Pavlo Shpak [@pshpak]{@link https://github.com/pshpak}
+ * @author Eduardo Pardo [@eduardopsll]{@link https://github.com/eduardopsll}
+ */
+var locale = {
+ code: 'lt',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/lt/index.js.flow b/date-fns/src/locale/lt/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/lt/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/lt/snapshot.md b/date-fns/src/locale/lt/snapshot.md
new file mode 100644
index 0000000..368443f
--- /dev/null
+++ b/date-fns/src/locale/lt/snapshot.md
@@ -0,0 +1,304 @@
+# Lithuanian (lt) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-oji | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-oji | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-oji | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4-oji | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-oji | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-oji | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | I k. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II k. | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | I ketvirtis | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II ketvirtis | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-oji | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-oji | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | I ketv. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II ketv. | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | I ketvirtis | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II ketvirtis | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-oji | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-oji | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | vas. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | liep. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | vasario | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | liepos | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | V | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | L | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-oji | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-oji | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | vas. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | liep. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | vasaris | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | liepa | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | V | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | L | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-oji | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-oji | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-oji | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-oji | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-oji | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-oji | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-oji | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-oji | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pn | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pn | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pn | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | pirmadienį | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | penktadienį | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pn | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-oji | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-oji | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pn | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | pirmadienį | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | penktadienį | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pn | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-oji | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-oji | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pn | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | pirmadienį | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | penktadienį | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pn | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-oji | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-oji | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pn | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | pirmadienis | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | penktadienis | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Pr | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pn | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | pr. p. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | pr. p. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | popiet | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | priešpiet | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | pr. p. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | pr. p. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | rytas | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popietė | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakaras | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktis | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | rytas | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popietė | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakaras | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktis | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | rytas | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popietė | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakaras | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktis | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | rytas | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popietė | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakaras | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktis | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | rytas | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popietė | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | vakaras | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktis | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-oji | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-oji | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-oji | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-oji | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-oji | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-oji | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-oji | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-oji | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-oji | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-oji | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-oji | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-oji | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987 m. vasario 11 d. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 m. gegužės 29 d. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 1987 m. vasario 11 d., trečiadienį | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 m. gegužės 29 d., sekmadienį | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987-02-11 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987-02-11 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987 m. vasario 11 d. 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 m. gegužės 29 d. 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 1987 m. vasario 11 d., trečiadienį 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 m. gegužės 29 d., sekmadienį 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ----------------------- | ----------------------- |
+| 2006-01-01T00:00:00.000Z | apie 6 metai | apie 6 metai | po apie 6 metus |
+| 2005-01-01T00:00:00.000Z | apie 5 metai | apie 5 metai | po apie 5 metus |
+| 2004-01-01T00:00:00.000Z | apie 4 metai | apie 4 metai | po apie 4 metus |
+| 2003-01-01T00:00:00.000Z | apie 3 metai | apie 3 metai | po apie 3 metus |
+| 2002-01-01T00:00:00.000Z | apie 2 metai | apie 2 metai | po apie 2 metus |
+| 2001-06-01T00:00:00.000Z | daugiau nei metai | daugiau nei metai | po daugiau nei metus |
+| 2001-02-01T00:00:00.000Z | apie metai | apie metai | po apie metus |
+| 2001-01-01T00:00:00.000Z | apie metai | apie metai | po apie metus |
+| 2000-06-01T00:00:00.000Z | 5 mėnesiai | 5 mėnesiai | po 5 mėnesius |
+| 2000-03-01T00:00:00.000Z | 2 mėnesiai | 2 mėnesiai | po 2 mėnesius |
+| 2000-02-01T00:00:00.000Z | apie mėnuo | apie mėnuo | po apie mėnesį |
+| 2000-01-15T00:00:00.000Z | 14 dienų | 14 dienų | po 14 dienų |
+| 2000-01-02T00:00:00.000Z | diena | diena | po dieną |
+| 2000-01-01T06:00:00.000Z | apie 6 valandos | apie 6 valandos | po apie 6 valandas |
+| 2000-01-01T01:00:00.000Z | apie valanda | apie valanda | po apie valandą |
+| 2000-01-01T00:45:00.000Z | apie valanda | apie valanda | po apie valandą |
+| 2000-01-01T00:30:00.000Z | 30 minučių | 30 minučių | po 30 minučių |
+| 2000-01-01T00:15:00.000Z | 15 minučių | 15 minučių | po 15 minučių |
+| 2000-01-01T00:01:00.000Z | minutė | minutė | po minutę |
+| 2000-01-01T00:00:25.000Z | mažiau nei minutė | pusė minutės | po mažiau nei minutę |
+| 2000-01-01T00:00:15.000Z | mažiau nei minutė | mažiau nei 20 sekundžių | po mažiau nei minutę |
+| 2000-01-01T00:00:05.000Z | mažiau nei minutė | mažiau nei 10 sekundžių | po mažiau nei minutę |
+| 2000-01-01T00:00:00.000Z | mažiau nei minutė | mažiau nei 5 sekundė | prieš mažiau nei minutę |
+| 1999-12-31T23:59:55.000Z | mažiau nei minutė | mažiau nei 10 sekundžių | prieš mažiau nei minutę |
+| 1999-12-31T23:59:45.000Z | mažiau nei minutė | mažiau nei 20 sekundžių | prieš mažiau nei minutę |
+| 1999-12-31T23:59:35.000Z | mažiau nei minutė | pusė minutės | prieš mažiau nei minutę |
+| 1999-12-31T23:59:00.000Z | minutė | minutė | prieš minutę |
+| 1999-12-31T23:45:00.000Z | 15 minučių | 15 minučių | prieš 15 minučių |
+| 1999-12-31T23:30:00.000Z | 30 minučių | 30 minučių | prieš 30 minučių |
+| 1999-12-31T23:15:00.000Z | apie valanda | apie valanda | prieš apie valandą |
+| 1999-12-31T23:00:00.000Z | apie valanda | apie valanda | prieš apie valandą |
+| 1999-12-31T18:00:00.000Z | apie 6 valandos | apie 6 valandos | prieš apie 6 valandas |
+| 1999-12-30T00:00:00.000Z | 2 dienos | 2 dienos | prieš 2 dienas |
+| 1999-12-15T00:00:00.000Z | 17 dienų | 17 dienų | prieš 17 dienų |
+| 1999-12-01T00:00:00.000Z | apie mėnuo | apie mėnuo | prieš apie mėnesį |
+| 1999-11-01T00:00:00.000Z | 2 mėnesiai | 2 mėnesiai | prieš 2 mėnesius |
+| 1999-06-01T00:00:00.000Z | 7 mėnesiai | 7 mėnesiai | prieš 7 mėnesius |
+| 1999-01-01T00:00:00.000Z | apie metai | apie metai | prieš apie metus |
+| 1998-12-01T00:00:00.000Z | apie metai | apie metai | prieš apie metus |
+| 1998-06-01T00:00:00.000Z | daugiau nei metai | daugiau nei metai | prieš daugiau nei metus |
+| 1998-01-01T00:00:00.000Z | apie 2 metai | apie 2 metai | prieš apie 2 metus |
+| 1997-01-01T00:00:00.000Z | apie 3 metai | apie 3 metai | prieš apie 3 metus |
+| 1996-01-01T00:00:00.000Z | apie 4 metai | apie 4 metai | prieš apie 4 metus |
+| 1995-01-01T00:00:00.000Z | apie 5 metai | apie 5 metai | prieš apie 5 metus |
+| 1994-01-01T00:00:00.000Z | apie 6 metai | apie 6 metai | prieš apie 6 metus |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------ | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 metai | po 6 metus | 52608 valandos |
+| 2005-01-01T00:00:00.000Z | 5 metai | po 5 metus | 43848 valandos |
+| 2004-01-01T00:00:00.000Z | 4 metai | po 4 metus | 35064 valandos |
+| 2003-01-01T00:00:00.000Z | 3 metai | po 3 metus | 26304 valandos |
+| 2002-01-01T00:00:00.000Z | 2 metai | po 2 metus | 17544 valandos |
+| 2001-06-01T00:00:00.000Z | metai | po metus | 12408 valandos |
+| 2001-02-01T00:00:00.000Z | metai | po metus | 9528 valandos |
+| 2001-01-01T00:00:00.000Z | metai | po metus | 8784 valandos |
+| 2000-06-01T00:00:00.000Z | 5 mėnesiai | po 5 mėnesius | 3648 valandos |
+| 2000-03-01T00:00:00.000Z | 2 mėnesiai | po 2 mėnesius | 1440 valandų |
+| 2000-02-01T00:00:00.000Z | mėnuo | po mėnesį | 744 valandos |
+| 2000-01-15T00:00:00.000Z | 14 dienų | po 14 dienų | 336 valandos |
+| 2000-01-02T00:00:00.000Z | diena | po dieną | 24 valandos |
+| 2000-01-01T06:00:00.000Z | 6 valandos | po 6 valandas | 6 valandos |
+| 2000-01-01T01:00:00.000Z | valanda | po valandą | valanda |
+| 2000-01-01T00:45:00.000Z | 45 minutės | po 45 minutes | valanda |
+| 2000-01-01T00:30:00.000Z | 30 minučių | po 30 minučių | valanda |
+| 2000-01-01T00:15:00.000Z | 15 minučių | po 15 minučių | 0 valandų |
+| 2000-01-01T00:01:00.000Z | minutė | po minutę | 0 valandų |
+| 2000-01-01T00:00:25.000Z | 25 sekundė | po 25 sekundes | 0 valandų |
+| 2000-01-01T00:00:15.000Z | 15 sekundžių | po 15 sekundžių | 0 valandų |
+| 2000-01-01T00:00:05.000Z | 5 sekundė | po 5 sekundes | 0 valandų |
+| 2000-01-01T00:00:00.000Z | 0 sekundžių | prieš 0 sekundžių | 0 valandų |
+| 1999-12-31T23:59:55.000Z | 5 sekundė | prieš 5 sekundes | 0 valandų |
+| 1999-12-31T23:59:45.000Z | 15 sekundžių | prieš 15 sekundžių | 0 valandų |
+| 1999-12-31T23:59:35.000Z | 25 sekundė | prieš 25 sekundes | 0 valandų |
+| 1999-12-31T23:59:00.000Z | minutė | prieš minutę | 0 valandų |
+| 1999-12-31T23:45:00.000Z | 15 minučių | prieš 15 minučių | 0 valandų |
+| 1999-12-31T23:30:00.000Z | 30 minučių | prieš 30 minučių | valanda |
+| 1999-12-31T23:15:00.000Z | 45 minutės | prieš 45 minutes | valanda |
+| 1999-12-31T23:00:00.000Z | valanda | prieš valandą | valanda |
+| 1999-12-31T18:00:00.000Z | 6 valandos | prieš 6 valandas | 6 valandos |
+| 1999-12-30T00:00:00.000Z | 2 dienos | prieš 2 dienas | 48 valandos |
+| 1999-12-15T00:00:00.000Z | 17 dienų | prieš 17 dienų | 408 valandos |
+| 1999-12-01T00:00:00.000Z | mėnuo | prieš mėnesį | 744 valandos |
+| 1999-11-01T00:00:00.000Z | 2 mėnesiai | prieš 2 mėnesius | 1464 valandos |
+| 1999-06-01T00:00:00.000Z | 7 mėnesiai | prieš 7 mėnesius | 5136 valandos |
+| 1999-01-01T00:00:00.000Z | metai | prieš metus | 8760 valandų |
+| 1998-12-01T00:00:00.000Z | metai | prieš metus | 9504 valandos |
+| 1998-06-01T00:00:00.000Z | 2 metai | prieš 2 metus | 13896 valandos |
+| 1998-01-01T00:00:00.000Z | 2 metai | prieš 2 metus | 17520 valandų |
+| 1997-01-01T00:00:00.000Z | 3 metai | prieš 3 metus | 26280 valandų |
+| 1996-01-01T00:00:00.000Z | 4 metai | prieš 4 metus | 35064 valandos |
+| 1995-01-01T00:00:00.000Z | 5 metai | prieš 5 metus | 43824 valandos |
+| 1994-01-01T00:00:00.000Z | 6 metai | prieš 6 metus | 52584 valandos |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------- |
+| 2000-01-10T00:00:00.000Z | 2000-01-10 |
+| 2000-01-05T00:00:00.000Z | trečiadienį 00:00 |
+| 2000-01-02T00:00:00.000Z | Rytoj 00:00 |
+| 2000-01-01T00:00:00.000Z | Šiandien 00:00 |
+| 1999-12-31T00:00:00.000Z | Vakar 00:00 |
+| 1999-12-27T00:00:00.000Z | Praėjusį pirmadienį 00:00 |
+| 1999-12-21T00:00:00.000Z | 1999-12-21 |
diff --git a/date-fns/src/locale/lv/_lib/formatDistance/index.js b/date-fns/src/locale/lv/_lib/formatDistance/index.js
new file mode 100644
index 0000000..012a98d
--- /dev/null
+++ b/date-fns/src/locale/lv/_lib/formatDistance/index.js
@@ -0,0 +1,158 @@
+function buildLocalizeTokenFn(schema) {
+ return function(count, options) {
+ if (count === 1) {
+ if (options.addSuffix) {
+ return schema.one[0].replace('{{time}}', schema.one[2])
+ } else {
+ return schema.one[0].replace('{{time}}', schema.one[1])
+ }
+ } else {
+ var rem = count % 10 === 1 && count % 100 !== 11
+ if (options.addSuffix) {
+ return schema.other[0]
+ .replace('{{time}}', rem ? schema.other[3] : schema.other[4])
+ .replace('{{count}}', count)
+ } else {
+ return schema.other[0]
+ .replace('{{time}}', rem ? schema.other[1] : schema.other[2])
+ .replace('{{count}}', count)
+ }
+ }
+ }
+}
+
+var formatDistanceLocale = {
+ lessThanXSeconds: buildLocalizeTokenFn({
+ one: ['mazāk par {{time}}', 'sekundi', 'sekundi'],
+ other: [
+ 'mazāk nekā {{count}} {{time}}',
+ 'sekunde',
+ 'sekundes',
+ 'sekundes',
+ 'sekundēm'
+ ]
+ }),
+
+ xSeconds: buildLocalizeTokenFn({
+ one: ['1 {{time}}', 'sekunde', 'sekundes'],
+ other: ['{{count}} {{time}}', 'sekunde', 'sekundes', 'sekundes', 'sekundēm']
+ }),
+
+ halfAMinute: function(count, options) {
+ if (options.addSuffix) {
+ return 'pusminūtes'
+ } else {
+ return 'pusminūte'
+ }
+ },
+
+ lessThanXMinutes: buildLocalizeTokenFn({
+ one: ['mazāk par {{time}}', 'minūti', 'minūti'],
+ other: [
+ 'mazāk nekā {{count}} {{time}}',
+ 'minūte',
+ 'minūtes',
+ 'minūtes',
+ 'minūtēm'
+ ]
+ }),
+
+ xMinutes: buildLocalizeTokenFn({
+ one: ['1 {{time}}', 'minūte', 'minūtes'],
+ other: ['{{count}} {{time}}', 'minūte', 'minūtes', 'minūtes', 'minūtēm']
+ }),
+
+ aboutXHours: buildLocalizeTokenFn({
+ one: ['apmēram 1 {{time}}', 'stunda', 'stundas'],
+ other: [
+ 'apmēram {{count}} {{time}}',
+ 'stunda',
+ 'stundas',
+ 'stundas',
+ 'stundām'
+ ]
+ }),
+
+ xHours: buildLocalizeTokenFn({
+ one: ['1 {{time}}', 'stunda', 'stundas'],
+ other: ['{{count}} {{time}}', 'stunda', 'stundas', 'stundas', 'stundām']
+ }),
+
+ xDays: buildLocalizeTokenFn({
+ one: ['1 {{time}}', 'diena', 'dienas'],
+ other: ['{{count}} {{time}}', 'diena', 'dienas', 'dienas', 'dienām']
+ }),
+
+ aboutXWeeks: buildLocalizeTokenFn({
+ one: ['apmēram 1 {{time}}', 'nedēļa', 'nedēļas'],
+ other: [
+ 'apmēram {{count}} {{time}}',
+ 'nedēļa',
+ 'nedēļu',
+ 'nedēļas',
+ 'nedēļām'
+ ]
+ }),
+
+ xWeeks: buildLocalizeTokenFn({
+ one: ['1 {{time}}', 'nedēļa', 'nedēļas'],
+ other: [
+ '{{count}} {{time}}', // TODO
+ 'nedēļa',
+ 'nedēļu',
+ 'nedēļas',
+ 'nedēļām'
+ ]
+ }),
+
+ aboutXMonths: buildLocalizeTokenFn({
+ one: ['apmēram 1 {{time}}', 'mēnesis', 'mēneša'],
+ other: [
+ 'apmēram {{count}} {{time}}',
+ 'mēnesis',
+ 'mēneši',
+ 'mēneša',
+ 'mēnešiem'
+ ]
+ }),
+
+ xMonths: buildLocalizeTokenFn({
+ one: ['1 {{time}}', 'mēnesis', 'mēneša'],
+ other: ['{{count}} {{time}}', 'mēnesis', 'mēneši', 'mēneša', 'mēnešiem']
+ }),
+
+ aboutXYears: buildLocalizeTokenFn({
+ one: ['apmēram 1 {{time}}', 'gads', 'gada'],
+ other: ['apmēram {{count}} {{time}}', 'gads', 'gadi', 'gada', 'gadiem']
+ }),
+
+ xYears: buildLocalizeTokenFn({
+ one: ['1 {{time}}', 'gads', 'gada'],
+ other: ['{{count}} {{time}}', 'gads', 'gadi', 'gada', 'gadiem']
+ }),
+
+ overXYears: buildLocalizeTokenFn({
+ one: ['ilgāk par 1 {{time}}', 'gadu', 'gadu'],
+ other: ['vairāk nekā {{count}} {{time}}', 'gads', 'gadi', 'gada', 'gadiem']
+ }),
+
+ almostXYears: buildLocalizeTokenFn({
+ one: ['gandrīz 1 {{time}}', 'gads', 'gada'],
+ other: ['vairāk nekā {{count}} {{time}}', 'gads', 'gadi', 'gada', 'gadiem']
+ })
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ var result = formatDistanceLocale[token](count, options)
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'pēc ' + result
+ } else {
+ return 'pirms ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/lv/_lib/formatLong/index.js b/date-fns/src/locale/lv/_lib/formatLong/index.js
new file mode 100644
index 0000000..673a967
--- /dev/null
+++ b/date-fns/src/locale/lv/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, y. 'gada' d. MMMM",
+ long: "y. 'gada' d. MMMM",
+ medium: 'dd.MM.y.',
+ short: 'dd.MM.y.',
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm',
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'plkst.' {{time}}",
+ long: "{{date}} 'plkst.' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}',
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full',
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full',
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full',
+ }),
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/lv/_lib/formatRelative/index.js b/date-fns/src/locale/lv/_lib/formatRelative/index.js
new file mode 100644
index 0000000..9f9b72d
--- /dev/null
+++ b/date-fns/src/locale/lv/_lib/formatRelative/index.js
@@ -0,0 +1,43 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+var weekdays = [
+ 'svētdienā',
+ 'pirmdienā',
+ 'otrdienā',
+ 'trešdienā',
+ 'ceturtdienā',
+ 'piektdienā',
+ 'sestdienā'
+]
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return "eeee 'plkst.' p"
+ }
+
+ var weekday = weekdays[date.getUTCDay()]
+ return "'Pagājušā " + weekday + " plkst.' p"
+ },
+ yesterday: "'Vakar plkst.' p",
+ today: "'Šodien plkst.' p",
+ tomorrow: "'Rīt plkst.' p",
+ nextWeek: function(date, baseDate, options) {
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return "eeee 'plkst.' p"
+ }
+
+ var weekday = weekdays[date.getUTCDay()]
+ return "'Nākamajā " + weekday + " plkst.' p"
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/lv/_lib/localize/index.js b/date-fns/src/locale/lv/_lib/localize/index.js
new file mode 100644
index 0000000..480fd4d
--- /dev/null
+++ b/date-fns/src/locale/lv/_lib/localize/index.js
@@ -0,0 +1,250 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['p.m.ē', 'm.ē'],
+ abbreviated: ['p. m. ē.', 'm. ē.'],
+ wide: ['pirms mūsu ēras', 'mūsu ērā']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1. cet.', '2. cet.', '3. cet.', '4. cet.'],
+ wide: [
+ 'pirmais ceturksnis',
+ 'otrais ceturksnis',
+ 'trešais ceturksnis',
+ 'ceturtais ceturksnis'
+ ]
+}
+
+var formattingQuarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1. cet.', '2. cet.', '3. cet.', '4. cet.'],
+ wide: [
+ 'pirmajā ceturksnī',
+ 'otrajā ceturksnī',
+ 'trešajā ceturksnī',
+ 'ceturtajā ceturksnī'
+ ]
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'janv.',
+ 'febr.',
+ 'marts',
+ 'apr.',
+ 'maijs',
+ 'jūn.',
+ 'jūl.',
+ 'aug.',
+ 'sept.',
+ 'okt.',
+ 'nov.',
+ 'dec.'
+ ],
+ wide: [
+ 'janvāris',
+ 'februāris',
+ 'marts',
+ 'aprīlis',
+ 'maijs',
+ 'jūnijs',
+ 'jūlijs',
+ 'augusts',
+ 'septembris',
+ 'oktobris',
+ 'novembris',
+ 'decembris'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'janv.',
+ 'febr.',
+ 'martā',
+ 'apr.',
+ 'maijs',
+ 'jūn.',
+ 'jūl.',
+ 'aug.',
+ 'sept.',
+ 'okt.',
+ 'nov.',
+ 'dec.'
+ ],
+ wide: [
+ 'janvārī',
+ 'februārī',
+ 'martā',
+ 'aprīlī',
+ 'maijā',
+ 'jūnijā',
+ 'jūlijā',
+ 'augustā',
+ 'septembrī',
+ 'oktobrī',
+ 'novembrī',
+ 'decembrī'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'P', 'O', 'T', 'C', 'P', 'S'],
+ short: ['Sv', 'P', 'O', 'T', 'C', 'Pk', 'S'],
+ abbreviated: [
+ 'svētd.',
+ 'pirmd.',
+ 'otrd.',
+ 'trešd.',
+ 'ceturtd.',
+ 'piektd.',
+ 'sestd.'
+ ],
+ wide: [
+ 'svētdiena',
+ 'pirmdiena',
+ 'otrdiena',
+ 'trešdiena',
+ 'ceturtdiena',
+ 'piektdiena',
+ 'sestdiena'
+ ]
+}
+
+var formattingDayValues = {
+ narrow: ['S', 'P', 'O', 'T', 'C', 'P', 'S'],
+ short: ['Sv', 'P', 'O', 'T', 'C', 'Pk', 'S'],
+ abbreviated: [
+ 'svētd.',
+ 'pirmd.',
+ 'otrd.',
+ 'trešd.',
+ 'ceturtd.',
+ 'piektd.',
+ 'sestd.'
+ ],
+ wide: [
+ 'svētdienā',
+ 'pirmdienā',
+ 'otrdienā',
+ 'trešdienā',
+ 'ceturtdienā',
+ 'piektdienā',
+ 'sestdienā'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'pusn.',
+ noon: 'pusd.',
+ morning: 'rīts',
+ afternoon: 'diena',
+ evening: 'vakars',
+ night: 'nakts'
+ },
+ abbreviated: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'pusn.',
+ noon: 'pusd.',
+ morning: 'rīts',
+ afternoon: 'pēcpusd.',
+ evening: 'vakars',
+ night: 'nakts'
+ },
+ wide: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'pusnakts',
+ noon: 'pusdienlaiks',
+ morning: 'rīts',
+ afternoon: 'pēcpusdiena',
+ evening: 'vakars',
+ night: 'nakts'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'pusn.',
+ noon: 'pusd.',
+ morning: 'rītā',
+ afternoon: 'dienā',
+ evening: 'vakarā',
+ night: 'naktī'
+ },
+ abbreviated: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'pusn.',
+ noon: 'pusd.',
+ morning: 'rītā',
+ afternoon: 'pēcpusd.',
+ evening: 'vakarā',
+ night: 'naktī'
+ },
+ wide: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'pusnaktī',
+ noon: 'pusdienlaikā',
+ morning: 'rītā',
+ afternoon: 'pēcpusdienā',
+ evening: 'vakarā',
+ night: 'naktī'
+ }
+}
+
+function ordinalNumber(number, _options) {
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingQuarterValues,
+ defaultFormattingWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/lv/_lib/match/index.js b/date-fns/src/locale/lv/_lib/match/index.js
new file mode 100644
index 0000000..abfdc8a
--- /dev/null
+++ b/date-fns/src/locale/lv/_lib/match/index.js
@@ -0,0 +1,140 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\./i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(p\.m\.ē|m\.ē)/i,
+ abbreviated: /^(p\. m\. ē\.|m\. ē\.)/i,
+ wide: /^(pirms mūsu ēras|mūsu ērā)/i
+}
+var parseEraPatterns = {
+ any: [/^p/i, /^m/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234](\. cet\.)/i,
+ wide: /^(pirma(is|jā)|otra(is|jā)|treša(is|jā)|ceturta(is|jā)) ceturksn(is|ī)/i
+}
+var parseQuarterPatterns = {
+ narrow: [/^1/i, /^2/i, /^3/i, /^4/i],
+ abbreviated: [/^1/i, /^2/i, /^3/i, /^4/i],
+ wide: [/^p/i, /^o/i, /^t/i, /^c/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(janv\.|febr\.|marts|apr\.|maijs|jūn\.|jūl\.|aug\.|sept\.|okt\.|nov\.|dec\.)/i,
+ wide: /^(janvār(is|ī)|februār(is|ī)|mart[sā]|aprīl(is|ī)|maij[sā]|jūnij[sā]|jūlij[sā]|august[sā]|septembr(is|ī)|oktobr(is|ī)|novembr(is|ī)|decembr(is|ī))/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^mai/i,
+ /^jūn/i,
+ /^jūl/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[spotc]/i,
+ short: /^(sv|pi|o|t|c|pk|s)/i,
+ abbreviated: /^(svētd\.|pirmd\.|otrd.\|trešd\.|ceturtd\.|piektd\.|sestd\.)/i,
+ wide: /^(svētdien(a|ā)|pirmdien(a|ā)|otrdien(a|ā)|trešdien(a|ā)|ceturtdien(a|ā)|piektdien(a|ā)|sestdien(a|ā))/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^p/i, /^o/i, /^t/i, /^c/i, /^p/i, /^s/i],
+ any: [/^sv/i, /^pi/i, /^o/i, /^t/i, /^c/i, /^p/i, /^se/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(am|pm|pusn\.|pusd\.|rīt(s|ā)|dien(a|ā)|vakar(s|ā)|nakt(s|ī))/,
+ abbreviated: /^(am|pm|pusn\.|pusd\.|rīt(s|ā)|pēcpusd\.|vakar(s|ā)|nakt(s|ī))/,
+ wide: /^(am|pm|pusnakt(s|ī)|pusdienlaik(s|ā)|rīt(s|ā)|pēcpusdien(a|ā)|vakar(s|ā)|nakt(s|ī))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^am/i,
+ pm: /^pm/i,
+ midnight: /^pusn/i,
+ noon: /^pusd/i,
+ morning: /^r/i,
+ afternoon: /^(d|pēc)/i,
+ evening: /^v/i,
+ night: /^n/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/lv/index.d.ts b/date-fns/src/locale/lv/index.d.ts
new file mode 100644
index 0000000..14686a2
--- /dev/null
+++ b/date-fns/src/locale/lv/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { lv } from 'date-fns/locale'
+export default lv
diff --git a/date-fns/src/locale/lv/index.js b/date-fns/src/locale/lv/index.js
new file mode 100644
index 0000000..34dd097
--- /dev/null
+++ b/date-fns/src/locale/lv/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Latvian locale (Latvia).
+ * @language Latvian
+ * @iso-639-2 lav
+ * @author Rūdolfs Puķītis [@prudolfs]{@link https://github.com/prudolfs}
+ */
+var locale = {
+ code: 'lv',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/lv/index.js.flow b/date-fns/src/locale/lv/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/lv/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/lv/snapshot.md b/date-fns/src/locale/lv/snapshot.md
new file mode 100644
index 0000000..96dd5e3
--- /dev/null
+++ b/date-fns/src/locale/lv/snapshot.md
@@ -0,0 +1,304 @@
+# Latvian (lv) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1. cet. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. cet. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | pirmajā ceturksnī | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | otrajā ceturksnī | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. cet. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. cet. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | pirmais ceturksnis | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | otrais ceturksnis | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | febr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jūl. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februārī | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jūlijā | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | febr. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jūl. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februāris | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jūlijs | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | pirmd. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektd. | 2019-02-11T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | pirmd. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektd. | 2019-02-11T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | pirmd. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektd. | 2019-02-11T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | pirmdienā | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektdienā | 2019-02-11T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pk | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | pirmd. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektd. | 2019-02-11T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | pirmdienā | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektdienā | 2019-02-11T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pk | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | pirmd. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektd. | 2019-02-11T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | pirmdienā | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektdienā | 2019-02-11T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pk | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | pirmd. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektd. | 2019-02-11T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | pirmdiena | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piektdiena | 2019-02-11T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pk | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | rītā | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pēcpusd. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakarā | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktī | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | rītā | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pēcpusd. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakarā | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktī | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | rītā | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pēcpusd. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakarā | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktī | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | rītā | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pēcpusdienā | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakarā | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktī | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | rītā | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | dienā | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | vakarā | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | naktī | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453. | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11.02.1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987. gada 11. februārī | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453. gada 29. maijā | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | trešdienā, 1987. gada 11. februārī | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | svētdienā, 1453. gada 29. maijā | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987., 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453., 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11.02.1987., 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453., 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987. gada 11. februārī plkst. 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453. gada 29. maijā plkst. 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | trešdienā, 1987. gada 11. februārī plkst. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | svētdienā, 1453. gada 29. maijā plkst. 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | ----------------------- |
+| 2006-01-01T00:00:00.000Z | apmēram 6 gadi | apmēram 6 gadi | pēc apmēram 6 gadiem |
+| 2005-01-01T00:00:00.000Z | apmēram 5 gadi | apmēram 5 gadi | pēc apmēram 5 gadiem |
+| 2004-01-01T00:00:00.000Z | apmēram 4 gadi | apmēram 4 gadi | pēc apmēram 4 gadiem |
+| 2003-01-01T00:00:00.000Z | apmēram 3 gadi | apmēram 3 gadi | pēc apmēram 3 gadiem |
+| 2002-01-01T00:00:00.000Z | apmēram 2 gadi | apmēram 2 gadi | pēc apmēram 2 gadiem |
+| 2001-06-01T00:00:00.000Z | ilgāk par 1 gadu | ilgāk par 1 gadu | pēc ilgāk par 1 gadu |
+| 2001-02-01T00:00:00.000Z | apmēram 1 gads | apmēram 1 gads | pēc apmēram 1 gada |
+| 2001-01-01T00:00:00.000Z | apmēram 1 gads | apmēram 1 gads | pēc apmēram 1 gada |
+| 2000-06-01T00:00:00.000Z | 5 mēneši | 5 mēneši | pēc 5 mēnešiem |
+| 2000-03-01T00:00:00.000Z | 2 mēneši | 2 mēneši | pēc 2 mēnešiem |
+| 2000-02-01T00:00:00.000Z | apmēram 1 mēnesis | apmēram 1 mēnesis | pēc apmēram 1 mēneša |
+| 2000-01-15T00:00:00.000Z | 14 dienas | 14 dienas | pēc 14 dienām |
+| 2000-01-02T00:00:00.000Z | 1 diena | 1 diena | pēc 1 dienas |
+| 2000-01-01T06:00:00.000Z | apmēram 6 stundas | apmēram 6 stundas | pēc apmēram 6 stundām |
+| 2000-01-01T01:00:00.000Z | apmēram 1 stunda | apmēram 1 stunda | pēc apmēram 1 stundas |
+| 2000-01-01T00:45:00.000Z | apmēram 1 stunda | apmēram 1 stunda | pēc apmēram 1 stundas |
+| 2000-01-01T00:30:00.000Z | 30 minūtes | 30 minūtes | pēc 30 minūtēm |
+| 2000-01-01T00:15:00.000Z | 15 minūtes | 15 minūtes | pēc 15 minūtēm |
+| 2000-01-01T00:01:00.000Z | 1 minūte | 1 minūte | pēc 1 minūtes |
+| 2000-01-01T00:00:25.000Z | mazāk par minūti | pusminūte | pēc mazāk par minūti |
+| 2000-01-01T00:00:15.000Z | mazāk par minūti | mazāk nekā 20 sekundes | pēc mazāk par minūti |
+| 2000-01-01T00:00:05.000Z | mazāk par minūti | mazāk nekā 10 sekundes | pēc mazāk par minūti |
+| 2000-01-01T00:00:00.000Z | mazāk par minūti | mazāk nekā 5 sekundes | pirms mazāk par minūti |
+| 1999-12-31T23:59:55.000Z | mazāk par minūti | mazāk nekā 10 sekundes | pirms mazāk par minūti |
+| 1999-12-31T23:59:45.000Z | mazāk par minūti | mazāk nekā 20 sekundes | pirms mazāk par minūti |
+| 1999-12-31T23:59:35.000Z | mazāk par minūti | pusminūte | pirms mazāk par minūti |
+| 1999-12-31T23:59:00.000Z | 1 minūte | 1 minūte | pirms 1 minūtes |
+| 1999-12-31T23:45:00.000Z | 15 minūtes | 15 minūtes | pirms 15 minūtēm |
+| 1999-12-31T23:30:00.000Z | 30 minūtes | 30 minūtes | pirms 30 minūtēm |
+| 1999-12-31T23:15:00.000Z | apmēram 1 stunda | apmēram 1 stunda | pirms apmēram 1 stundas |
+| 1999-12-31T23:00:00.000Z | apmēram 1 stunda | apmēram 1 stunda | pirms apmēram 1 stundas |
+| 1999-12-31T18:00:00.000Z | apmēram 6 stundas | apmēram 6 stundas | pirms apmēram 6 stundām |
+| 1999-12-30T00:00:00.000Z | 2 dienas | 2 dienas | pirms 2 dienām |
+| 1999-12-15T00:00:00.000Z | 17 dienas | 17 dienas | pirms 17 dienām |
+| 1999-12-01T00:00:00.000Z | apmēram 1 mēnesis | apmēram 1 mēnesis | pirms apmēram 1 mēneša |
+| 1999-11-01T00:00:00.000Z | 2 mēneši | 2 mēneši | pirms 2 mēnešiem |
+| 1999-06-01T00:00:00.000Z | 7 mēneši | 7 mēneši | pirms 7 mēnešiem |
+| 1999-01-01T00:00:00.000Z | apmēram 1 gads | apmēram 1 gads | pirms apmēram 1 gada |
+| 1998-12-01T00:00:00.000Z | apmēram 1 gads | apmēram 1 gads | pirms apmēram 1 gada |
+| 1998-06-01T00:00:00.000Z | ilgāk par 1 gadu | ilgāk par 1 gadu | pirms ilgāk par 1 gadu |
+| 1998-01-01T00:00:00.000Z | apmēram 2 gadi | apmēram 2 gadi | pirms apmēram 2 gadiem |
+| 1997-01-01T00:00:00.000Z | apmēram 3 gadi | apmēram 3 gadi | pirms apmēram 3 gadiem |
+| 1996-01-01T00:00:00.000Z | apmēram 4 gadi | apmēram 4 gadi | pirms apmēram 4 gadiem |
+| 1995-01-01T00:00:00.000Z | apmēram 5 gadi | apmēram 5 gadi | pirms apmēram 5 gadiem |
+| 1994-01-01T00:00:00.000Z | apmēram 6 gadi | apmēram 6 gadi | pirms apmēram 6 gadiem |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 gadi | pēc 6 gadiem | 52608 stundas |
+| 2005-01-01T00:00:00.000Z | 5 gadi | pēc 5 gadiem | 43848 stundas |
+| 2004-01-01T00:00:00.000Z | 4 gadi | pēc 4 gadiem | 35064 stundas |
+| 2003-01-01T00:00:00.000Z | 3 gadi | pēc 3 gadiem | 26304 stundas |
+| 2002-01-01T00:00:00.000Z | 2 gadi | pēc 2 gadiem | 17544 stundas |
+| 2001-06-01T00:00:00.000Z | 1 gads | pēc 1 gada | 12408 stundas |
+| 2001-02-01T00:00:00.000Z | 1 gads | pēc 1 gada | 9528 stundas |
+| 2001-01-01T00:00:00.000Z | 1 gads | pēc 1 gada | 8784 stundas |
+| 2000-06-01T00:00:00.000Z | 5 mēneši | pēc 5 mēnešiem | 3648 stundas |
+| 2000-03-01T00:00:00.000Z | 2 mēneši | pēc 2 mēnešiem | 1440 stundas |
+| 2000-02-01T00:00:00.000Z | 1 mēnesis | pēc 1 mēneša | 744 stundas |
+| 2000-01-15T00:00:00.000Z | 14 dienas | pēc 14 dienām | 336 stundas |
+| 2000-01-02T00:00:00.000Z | 1 diena | pēc 1 dienas | 24 stundas |
+| 2000-01-01T06:00:00.000Z | 6 stundas | pēc 6 stundām | 6 stundas |
+| 2000-01-01T01:00:00.000Z | 1 stunda | pēc 1 stundas | 1 stunda |
+| 2000-01-01T00:45:00.000Z | 45 minūtes | pēc 45 minūtēm | 1 stunda |
+| 2000-01-01T00:30:00.000Z | 30 minūtes | pēc 30 minūtēm | 1 stunda |
+| 2000-01-01T00:15:00.000Z | 15 minūtes | pēc 15 minūtēm | 0 stundas |
+| 2000-01-01T00:01:00.000Z | 1 minūte | pēc 1 minūtes | 0 stundas |
+| 2000-01-01T00:00:25.000Z | 25 sekundes | pēc 25 sekundēm | 0 stundas |
+| 2000-01-01T00:00:15.000Z | 15 sekundes | pēc 15 sekundēm | 0 stundas |
+| 2000-01-01T00:00:05.000Z | 5 sekundes | pēc 5 sekundēm | 0 stundas |
+| 2000-01-01T00:00:00.000Z | 0 sekundes | pirms 0 sekundēm | 0 stundas |
+| 1999-12-31T23:59:55.000Z | 5 sekundes | pirms 5 sekundēm | 0 stundas |
+| 1999-12-31T23:59:45.000Z | 15 sekundes | pirms 15 sekundēm | 0 stundas |
+| 1999-12-31T23:59:35.000Z | 25 sekundes | pirms 25 sekundēm | 0 stundas |
+| 1999-12-31T23:59:00.000Z | 1 minūte | pirms 1 minūtes | 0 stundas |
+| 1999-12-31T23:45:00.000Z | 15 minūtes | pirms 15 minūtēm | 0 stundas |
+| 1999-12-31T23:30:00.000Z | 30 minūtes | pirms 30 minūtēm | 1 stunda |
+| 1999-12-31T23:15:00.000Z | 45 minūtes | pirms 45 minūtēm | 1 stunda |
+| 1999-12-31T23:00:00.000Z | 1 stunda | pirms 1 stundas | 1 stunda |
+| 1999-12-31T18:00:00.000Z | 6 stundas | pirms 6 stundām | 6 stundas |
+| 1999-12-30T00:00:00.000Z | 2 dienas | pirms 2 dienām | 48 stundas |
+| 1999-12-15T00:00:00.000Z | 17 dienas | pirms 17 dienām | 408 stundas |
+| 1999-12-01T00:00:00.000Z | 1 mēnesis | pirms 1 mēneša | 744 stundas |
+| 1999-11-01T00:00:00.000Z | 2 mēneši | pirms 2 mēnešiem | 1464 stundas |
+| 1999-06-01T00:00:00.000Z | 7 mēneši | pirms 7 mēnešiem | 5136 stundas |
+| 1999-01-01T00:00:00.000Z | 1 gads | pirms 1 gada | 8760 stundas |
+| 1998-12-01T00:00:00.000Z | 1 gads | pirms 1 gada | 9504 stundas |
+| 1998-06-01T00:00:00.000Z | 2 gadi | pirms 2 gadiem | 13896 stundas |
+| 1998-01-01T00:00:00.000Z | 2 gadi | pirms 2 gadiem | 17520 stundas |
+| 1997-01-01T00:00:00.000Z | 3 gadi | pirms 3 gadiem | 26280 stundas |
+| 1996-01-01T00:00:00.000Z | 4 gadi | pirms 4 gadiem | 35064 stundas |
+| 1995-01-01T00:00:00.000Z | 5 gadi | pirms 5 gadiem | 43824 stundas |
+| 1994-01-01T00:00:00.000Z | 6 gadi | pirms 6 gadiem | 52584 stundas |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000. |
+| 2000-01-05T00:00:00.000Z | Nākamajā trešdienā plkst. 00:00 |
+| 2000-01-02T00:00:00.000Z | Rīt plkst. 00:00 |
+| 2000-01-01T00:00:00.000Z | Šodien plkst. 00:00 |
+| 1999-12-31T00:00:00.000Z | Vakar plkst. 00:00 |
+| 1999-12-27T00:00:00.000Z | pirmdienā plkst. 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999. |
diff --git a/date-fns/src/locale/mk/_lib/formatDistance/index.js b/date-fns/src/locale/mk/_lib/formatDistance/index.js
new file mode 100644
index 0000000..395ebf4
--- /dev/null
+++ b/date-fns/src/locale/mk/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'помалку од секунда',
+ other: 'помалку од {{count}} секунди'
+ },
+
+ xSeconds: {
+ one: '1 секунда',
+ other: '{{count}} секунди'
+ },
+
+ halfAMinute: 'половина минута',
+
+ lessThanXMinutes: {
+ one: 'помалку од минута',
+ other: 'помалку од {{count}} минути'
+ },
+
+ xMinutes: {
+ one: '1 минута',
+ other: '{{count}} минути'
+ },
+
+ aboutXHours: {
+ one: 'околу 1 час',
+ other: 'околу {{count}} часа'
+ },
+
+ xHours: {
+ one: '1 час',
+ other: '{{count}} часа'
+ },
+
+ xDays: {
+ one: '1 ден',
+ other: '{{count}} дена'
+ },
+
+ aboutXWeeks: {
+ one: 'околу 1 недела',
+ other: 'околу {{count}} месеци'
+ },
+
+ xWeeks: {
+ one: '1 недела',
+ other: '{{count}} недели'
+ },
+
+ aboutXMonths: {
+ one: 'околу 1 месец',
+ other: 'околу {{count}} недели'
+ },
+
+ xMonths: {
+ one: '1 месец',
+ other: '{{count}} месеци'
+ },
+
+ aboutXYears: {
+ one: 'околу 1 година',
+ other: 'околу {{count}} години'
+ },
+
+ xYears: {
+ one: '1 година',
+ other: '{{count}} години'
+ },
+
+ overXYears: {
+ one: 'повеќе од 1 година',
+ other: 'повеќе од {{count}} години'
+ },
+
+ almostXYears: {
+ one: 'безмалку 1 година',
+ other: 'безмалку {{count}} години'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'за ' + result
+ } else {
+ return 'пред ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/mk/_lib/formatLong/index.js b/date-fns/src/locale/mk/_lib/formatLong/index.js
new file mode 100644
index 0000000..bf70409
--- /dev/null
+++ b/date-fns/src/locale/mk/_lib/formatLong/index.js
@@ -0,0 +1,38 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, dd MMMM yyyy',
+ long: 'dd MMMM yyyy',
+ medium: 'dd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ any: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'any'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/mk/_lib/formatRelative/index.js b/date-fns/src/locale/mk/_lib/formatRelative/index.js
new file mode 100644
index 0000000..380e1e2
--- /dev/null
+++ b/date-fns/src/locale/mk/_lib/formatRelative/index.js
@@ -0,0 +1,92 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+var weekdays = [
+ 'недела',
+ 'понеделник',
+ 'вторник',
+ 'среда',
+ 'четврток',
+ 'петок',
+ 'сабота'
+]
+
+function lastWeek(day) {
+ var weekday = weekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 6:
+ return "'минатата " + weekday + " во' p"
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return "'минатиот " + weekday + " во' p"
+ }
+}
+
+function thisWeek(day) {
+ var weekday = weekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 6:
+ return "'ова " + weekday + " вo' p"
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return "'овој " + weekday + " вo' p"
+ }
+}
+
+function nextWeek(day) {
+ var weekday = weekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 6:
+ return "'следната " + weekday + " вo' p"
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return "'следниот " + weekday + " вo' p"
+ }
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'вчера во' p",
+ today: "'денес во' p",
+ tomorrow: "'утре во' p",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/mk/_lib/localize/index.js b/date-fns/src/locale/mk/_lib/localize/index.js
new file mode 100644
index 0000000..cbda0ff
--- /dev/null
+++ b/date-fns/src/locale/mk/_lib/localize/index.js
@@ -0,0 +1,124 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['пр.н.е.', 'н.е.'],
+ abbreviated: ['пред н. е.', 'н. е.'],
+ wide: ['пред нашата ера', 'нашата ера']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1-ви кв.', '2-ри кв.', '3-ти кв.', '4-ти кв.'],
+ wide: ['1-ви квартал', '2-ри квартал', '3-ти квартал', '4-ти квартал']
+}
+
+var monthValues = {
+ abbreviated: [
+ 'јан',
+ 'фев',
+ 'мар',
+ 'апр',
+ 'мај',
+ 'јун',
+ 'јул',
+ 'авг',
+ 'септ',
+ 'окт',
+ 'ноем',
+ 'дек'
+ ],
+ wide: [
+ 'јануари',
+ 'февруари',
+ 'март',
+ 'април',
+ 'мај',
+ 'јуни',
+ 'јули',
+ 'август',
+ 'септември',
+ 'октомври',
+ 'ноември',
+ 'декември'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Н', 'П', 'В', 'С', 'Ч', 'П', 'С'],
+ short: ['не', 'по', 'вт', 'ср', 'че', 'пе', 'са'],
+ abbreviated: ['нед', 'пон', 'вто', 'сре', 'чет', 'пет', 'саб'],
+ wide: [
+ 'недела',
+ 'понеделник',
+ 'вторник',
+ 'среда',
+ 'четврток',
+ 'петок',
+ 'сабота'
+ ]
+}
+
+var dayPeriodValues = {
+ wide: {
+ am: 'претпладне',
+ pm: 'попладне',
+ midnight: 'полноќ',
+ noon: 'напладне',
+ morning: 'наутро',
+ afternoon: 'попладне',
+ evening: 'навечер',
+ night: 'ноќе'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+
+ var rem100 = number % 100
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ return number + '-ви'
+ case 2:
+ return number + '-ри'
+ case 7:
+ case 8:
+ return number + '-ми'
+ }
+ }
+ return number + '-ти'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/mk/_lib/match/index.js b/date-fns/src/locale/mk/_lib/match/index.js
new file mode 100644
index 0000000..c8ccda6
--- /dev/null
+++ b/date-fns/src/locale/mk/_lib/match/index.js
@@ -0,0 +1,124 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?[врмт][и])?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^((пр)?н\.?\s?е\.?)/i,
+ abbreviated: /^((пр)?н\.?\s?е\.?)/i,
+ wide: /^(пред нашата ера|нашата ера)/i
+}
+var parseEraPatterns = {
+ any: [/^п/i, /^н/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234](-?[врт]?и?)? кв.?/i,
+ wide: /^[1234](-?[врт]?и?)? квартал/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchDayPatterns = {
+ narrow: /^[нпвсч]/i,
+ short: /^(не|по|вт|ср|че|пе|са)/i,
+ abbreviated: /^(нед|пон|вто|сре|чет|пет|саб)/i,
+ wide: /^(недела|понеделник|вторник|среда|четврток|петок|сабота)/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
+ any: [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[аб]/i]
+}
+
+var matchMonthPatterns = {
+ abbreviated: /^(јан|фев|мар|апр|мај|јун|јул|авг|сеп|окт|ноем|дек)/i,
+ wide: /^(јануари|февруари|март|април|мај|јуни|јули|август|септември|октомври|ноември|декември)/i
+}
+
+var parseMonthPatterns = {
+ any: [
+ /^ја/i,
+ /^Ф/i,
+ /^мар/i,
+ /^ап/i,
+ /^мај/i,
+ /^јун/i,
+ /^јул/i,
+ /^ав/i,
+ /^се/i,
+ /^окт/i,
+ /^но/i,
+ /^де/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(претп|попл|полноќ|утро|пладне|вечер|ноќ)/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /претпладне/i,
+ pm: /попладне/i,
+ midnight: /полноќ/i,
+ noon: /напладне/i,
+ morning: /наутро/i,
+ afternoon: /попладне/i,
+ evening: /навечер/i,
+ night: /ноќе/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/mk/index.d.ts b/date-fns/src/locale/mk/index.d.ts
new file mode 100644
index 0000000..b845b31
--- /dev/null
+++ b/date-fns/src/locale/mk/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { mk } from 'date-fns/locale'
+export default mk
diff --git a/date-fns/src/locale/mk/index.js b/date-fns/src/locale/mk/index.js
new file mode 100644
index 0000000..469a3e2
--- /dev/null
+++ b/date-fns/src/locale/mk/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Macedonian locale.
+ * @language Macedonian
+ * @iso-639-2 mkd
+ * @author Petar Vlahu [@vlahupetar]{@link https://github.com/vlahupetar}
+ * @author Altrim Beqiri [@altrim]{@link https://github.com/altrim}
+ */
+var locale = {
+ code: 'mk',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/mk/index.js.flow b/date-fns/src/locale/mk/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/mk/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/mk/snapshot.md b/date-fns/src/locale/mk/snapshot.md
new file mode 100644
index 0000000..d4ef913
--- /dev/null
+++ b/date-fns/src/locale/mk/snapshot.md
@@ -0,0 +1,304 @@
+# Macedonian (mk) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-ми | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-ти | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-ми | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4-ти | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-ви | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ри | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1-ви кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ри кв. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-ви квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ри квартал | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-ви | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ри | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1-ви кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ри кв. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-ви квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-ри квартал | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-ри | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ми | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | фев | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јул | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јули | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јули | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-ри | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-ми | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | фев | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јул | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јули | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | февруари | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јули | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-ви | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ми | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-ви | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-ми | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-ти | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-ми | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-ри | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-ти | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петок | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | по | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пе | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-ви | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ти | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петок | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | по | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пе | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-ви | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ти | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петок | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | по | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пе | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-ви | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-ти | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | понеделник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петок | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | по | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пе | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | aa | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | aaa | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | aaaa | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | bb | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | bbb | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | bbbb | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | претпладне | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | претпладне | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | наутро | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | навечер | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ноќе | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | наутро | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | навечер | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ноќе | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | наутро | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | навечер | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ноќе | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | наутро | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | навечер | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ноќе | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | наутро | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | попладне | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | навечер | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | ноќе | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ти | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ти | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-ти | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-ти | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-ти | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-ви | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-ти | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-ви | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-ти | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 фев 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мај 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 февруари 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мај 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | среда, 11 февруари 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | недела, 29 мај 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 фев 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мај 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 февруари 1987 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 мај 1453 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | среда, 11 февруари 1987 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | недела, 29 мај 1453 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ----------------------- |
+| 2006-01-01T00:00:00.000Z | околу 6 години | околу 6 години | за околу 6 години |
+| 2005-01-01T00:00:00.000Z | околу 5 години | околу 5 години | за околу 5 години |
+| 2004-01-01T00:00:00.000Z | околу 4 години | околу 4 години | за околу 4 години |
+| 2003-01-01T00:00:00.000Z | околу 3 години | околу 3 години | за околу 3 години |
+| 2002-01-01T00:00:00.000Z | околу 2 години | околу 2 години | за околу 2 години |
+| 2001-06-01T00:00:00.000Z | повеќе од 1 година | повеќе од 1 година | за повеќе од 1 година |
+| 2001-02-01T00:00:00.000Z | околу 1 година | околу 1 година | за околу 1 година |
+| 2001-01-01T00:00:00.000Z | околу 1 година | околу 1 година | за околу 1 година |
+| 2000-06-01T00:00:00.000Z | 5 месеци | 5 месеци | за 5 месеци |
+| 2000-03-01T00:00:00.000Z | 2 месеци | 2 месеци | за 2 месеци |
+| 2000-02-01T00:00:00.000Z | околу 1 месец | околу 1 месец | за околу 1 месец |
+| 2000-01-15T00:00:00.000Z | 14 дена | 14 дена | за 14 дена |
+| 2000-01-02T00:00:00.000Z | 1 ден | 1 ден | за 1 ден |
+| 2000-01-01T06:00:00.000Z | околу 6 часа | околу 6 часа | за околу 6 часа |
+| 2000-01-01T01:00:00.000Z | околу 1 час | околу 1 час | за околу 1 час |
+| 2000-01-01T00:45:00.000Z | околу 1 час | околу 1 час | за околу 1 час |
+| 2000-01-01T00:30:00.000Z | 30 минути | 30 минути | за 30 минути |
+| 2000-01-01T00:15:00.000Z | 15 минути | 15 минути | за 15 минути |
+| 2000-01-01T00:01:00.000Z | 1 минута | 1 минута | за 1 минута |
+| 2000-01-01T00:00:25.000Z | помалку од минута | половина минута | за помалку од минута |
+| 2000-01-01T00:00:15.000Z | помалку од минута | помалку од 20 секунди | за помалку од минута |
+| 2000-01-01T00:00:05.000Z | помалку од минута | помалку од 10 секунди | за помалку од минута |
+| 2000-01-01T00:00:00.000Z | помалку од минута | помалку од 5 секунди | пред помалку од минута |
+| 1999-12-31T23:59:55.000Z | помалку од минута | помалку од 10 секунди | пред помалку од минута |
+| 1999-12-31T23:59:45.000Z | помалку од минута | помалку од 20 секунди | пред помалку од минута |
+| 1999-12-31T23:59:35.000Z | помалку од минута | половина минута | пред помалку од минута |
+| 1999-12-31T23:59:00.000Z | 1 минута | 1 минута | пред 1 минута |
+| 1999-12-31T23:45:00.000Z | 15 минути | 15 минути | пред 15 минути |
+| 1999-12-31T23:30:00.000Z | 30 минути | 30 минути | пред 30 минути |
+| 1999-12-31T23:15:00.000Z | околу 1 час | околу 1 час | пред околу 1 час |
+| 1999-12-31T23:00:00.000Z | околу 1 час | околу 1 час | пред околу 1 час |
+| 1999-12-31T18:00:00.000Z | околу 6 часа | околу 6 часа | пред околу 6 часа |
+| 1999-12-30T00:00:00.000Z | 2 дена | 2 дена | пред 2 дена |
+| 1999-12-15T00:00:00.000Z | 17 дена | 17 дена | пред 17 дена |
+| 1999-12-01T00:00:00.000Z | околу 1 месец | околу 1 месец | пред околу 1 месец |
+| 1999-11-01T00:00:00.000Z | 2 месеци | 2 месеци | пред 2 месеци |
+| 1999-06-01T00:00:00.000Z | 7 месеци | 7 месеци | пред 7 месеци |
+| 1999-01-01T00:00:00.000Z | околу 1 година | околу 1 година | пред околу 1 година |
+| 1998-12-01T00:00:00.000Z | околу 1 година | околу 1 година | пред околу 1 година |
+| 1998-06-01T00:00:00.000Z | повеќе од 1 година | повеќе од 1 година | пред повеќе од 1 година |
+| 1998-01-01T00:00:00.000Z | околу 2 години | околу 2 години | пред околу 2 години |
+| 1997-01-01T00:00:00.000Z | околу 3 години | околу 3 години | пред околу 3 години |
+| 1996-01-01T00:00:00.000Z | околу 4 години | околу 4 години | пред околу 4 години |
+| 1995-01-01T00:00:00.000Z | околу 5 години | околу 5 години | пред околу 5 години |
+| 1994-01-01T00:00:00.000Z | околу 6 години | околу 6 години | пред околу 6 години |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 години | за 6 години | 52608 часа |
+| 2005-01-01T00:00:00.000Z | 5 години | за 5 години | 43848 часа |
+| 2004-01-01T00:00:00.000Z | 4 години | за 4 години | 35064 часа |
+| 2003-01-01T00:00:00.000Z | 3 години | за 3 години | 26304 часа |
+| 2002-01-01T00:00:00.000Z | 2 години | за 2 години | 17544 часа |
+| 2001-06-01T00:00:00.000Z | 1 година | за 1 година | 12408 часа |
+| 2001-02-01T00:00:00.000Z | 1 година | за 1 година | 9528 часа |
+| 2001-01-01T00:00:00.000Z | 1 година | за 1 година | 8784 часа |
+| 2000-06-01T00:00:00.000Z | 5 месеци | за 5 месеци | 3648 часа |
+| 2000-03-01T00:00:00.000Z | 2 месеци | за 2 месеци | 1440 часа |
+| 2000-02-01T00:00:00.000Z | 1 месец | за 1 месец | 744 часа |
+| 2000-01-15T00:00:00.000Z | 14 дена | за 14 дена | 336 часа |
+| 2000-01-02T00:00:00.000Z | 1 ден | за 1 ден | 24 часа |
+| 2000-01-01T06:00:00.000Z | 6 часа | за 6 часа | 6 часа |
+| 2000-01-01T01:00:00.000Z | 1 час | за 1 час | 1 час |
+| 2000-01-01T00:45:00.000Z | 45 минути | за 45 минути | 1 час |
+| 2000-01-01T00:30:00.000Z | 30 минути | за 30 минути | 1 час |
+| 2000-01-01T00:15:00.000Z | 15 минути | за 15 минути | 0 часа |
+| 2000-01-01T00:01:00.000Z | 1 минута | за 1 минута | 0 часа |
+| 2000-01-01T00:00:25.000Z | 25 секунди | за 25 секунди | 0 часа |
+| 2000-01-01T00:00:15.000Z | 15 секунди | за 15 секунди | 0 часа |
+| 2000-01-01T00:00:05.000Z | 5 секунди | за 5 секунди | 0 часа |
+| 2000-01-01T00:00:00.000Z | 0 секунди | пред 0 секунди | 0 часа |
+| 1999-12-31T23:59:55.000Z | 5 секунди | пред 5 секунди | 0 часа |
+| 1999-12-31T23:59:45.000Z | 15 секунди | пред 15 секунди | 0 часа |
+| 1999-12-31T23:59:35.000Z | 25 секунди | пред 25 секунди | 0 часа |
+| 1999-12-31T23:59:00.000Z | 1 минута | пред 1 минута | 0 часа |
+| 1999-12-31T23:45:00.000Z | 15 минути | пред 15 минути | 0 часа |
+| 1999-12-31T23:30:00.000Z | 30 минути | пред 30 минути | 1 час |
+| 1999-12-31T23:15:00.000Z | 45 минути | пред 45 минути | 1 час |
+| 1999-12-31T23:00:00.000Z | 1 час | пред 1 час | 1 час |
+| 1999-12-31T18:00:00.000Z | 6 часа | пред 6 часа | 6 часа |
+| 1999-12-30T00:00:00.000Z | 2 дена | пред 2 дена | 48 часа |
+| 1999-12-15T00:00:00.000Z | 17 дена | пред 17 дена | 408 часа |
+| 1999-12-01T00:00:00.000Z | 1 месец | пред 1 месец | 744 часа |
+| 1999-11-01T00:00:00.000Z | 2 месеци | пред 2 месеци | 1464 часа |
+| 1999-06-01T00:00:00.000Z | 7 месеци | пред 7 месеци | 5136 часа |
+| 1999-01-01T00:00:00.000Z | 1 година | пред 1 година | 8760 часа |
+| 1998-12-01T00:00:00.000Z | 1 година | пред 1 година | 9504 часа |
+| 1998-06-01T00:00:00.000Z | 2 години | пред 2 години | 13896 часа |
+| 1998-01-01T00:00:00.000Z | 2 години | пред 2 години | 17520 часа |
+| 1997-01-01T00:00:00.000Z | 3 години | пред 3 години | 26280 часа |
+| 1996-01-01T00:00:00.000Z | 4 години | пред 4 години | 35064 часа |
+| 1995-01-01T00:00:00.000Z | 5 години | пред 5 години | 43824 часа |
+| 1994-01-01T00:00:00.000Z | 6 години | пред 6 години | 52584 часа |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | следната среда вo 0:00 |
+| 2000-01-02T00:00:00.000Z | утре во 0:00 |
+| 2000-01-01T00:00:00.000Z | денес во 0:00 |
+| 1999-12-31T00:00:00.000Z | вчера во 0:00 |
+| 1999-12-27T00:00:00.000Z | овој понеделник вo 0:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/mn/_lib/formatDistance/index.js b/date-fns/src/locale/mn/_lib/formatDistance/index.js
new file mode 100644
index 0000000..28952ae
--- /dev/null
+++ b/date-fns/src/locale/mn/_lib/formatDistance/index.js
@@ -0,0 +1,138 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'секунд хүрэхгүй',
+ other: '{{count}} секунд хүрэхгүй'
+ },
+
+ xSeconds: {
+ one: '1 секунд',
+ other: '{{count}} секунд'
+ },
+
+ halfAMinute: 'хагас минут',
+
+ lessThanXMinutes: {
+ one: 'минут хүрэхгүй',
+ other: '{{count}} минут хүрэхгүй'
+ },
+
+ xMinutes: {
+ one: '1 минут',
+ other: '{{count}} минут'
+ },
+
+ aboutXHours: {
+ one: 'ойролцоогоор 1 цаг',
+ other: 'ойролцоогоор {{count}} цаг'
+ },
+
+ xHours: {
+ one: '1 цаг',
+ other: '{{count}} цаг'
+ },
+
+ xDays: {
+ one: '1 өдөр',
+ other: '{{count}} өдөр'
+ },
+
+ aboutXWeeks: {
+ one: 'ойролцоогоор 1 долоо хоног',
+ other: 'ойролцоогоор {{count}} долоо хоног'
+ },
+
+ xWeeks: {
+ one: '1 долоо хоног',
+ other: '{{count}} долоо хоног'
+ },
+
+ aboutXMonths: {
+ one: 'ойролцоогоор 1 сар',
+ other: 'ойролцоогоор {{count}} сар'
+ },
+
+ xMonths: {
+ one: '1 сар',
+ other: '{{count}} сар'
+ },
+
+ aboutXYears: {
+ one: 'ойролцоогоор 1 жил',
+ other: 'ойролцоогоор {{count}} жил'
+ },
+
+ xYears: {
+ one: '1 жил',
+ other: '{{count}} жил'
+ },
+
+ overXYears: {
+ one: '1 жил гаран',
+ other: '{{count}} жил гаран'
+ },
+
+ almostXYears: {
+ one: 'бараг 1 жил',
+ other: 'бараг {{count}} жил'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ /**
+ * Append genitive case
+ */
+ var words = result.split(' ')
+ var lastword = words.pop()
+ result = words.join(' ')
+ switch (lastword) {
+ case 'секунд':
+ result += ' секундийн'
+ break
+ case 'минут':
+ result += ' минутын'
+ break
+ case 'цаг':
+ result += ' цагийн'
+ break
+ case 'өдөр':
+ result += ' өдрийн'
+ break
+ case 'сар':
+ result += ' сарын'
+ break
+ case 'жил':
+ result += ' жилийн'
+ break
+ case 'хоног':
+ result += ' хоногийн'
+ break
+ case 'гаран':
+ result += ' гараны'
+ break
+ case 'хүрэхгүй':
+ result += ' хүрэхгүй хугацааны'
+ break
+ default:
+ result += lastword + '-н'
+ }
+ if (options.comparison > 0) {
+ return result + ' дараа'
+ } else {
+ return result + ' өмнө'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/mn/_lib/formatLong/index.js b/date-fns/src/locale/mn/_lib/formatLong/index.js
new file mode 100644
index 0000000..2db4a91
--- /dev/null
+++ b/date-fns/src/locale/mn/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "y 'оны' MMMM'ын' d, EEEE 'гараг'",
+ long: "y 'оны' MMMM'ын' d",
+ medium: "y 'оны' MMM'ын' d",
+ short: 'y.MM.dd'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/mn/_lib/formatRelative/index.js b/date-fns/src/locale/mn/_lib/formatRelative/index.js
new file mode 100644
index 0000000..52461ba
--- /dev/null
+++ b/date-fns/src/locale/mn/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'өнгөрсөн' eeee 'гарагийн' p 'цагт'",
+ yesterday: "'өчигдөр' p 'цагт'",
+ today: "'өнөөдөр' p 'цагт'",
+ tomorrow: "'маргааш' p 'цагт'",
+ nextWeek: "'ирэх' eeee 'гарагийн' p 'цагт'",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/mn/_lib/localize/index.js b/date-fns/src/locale/mn/_lib/localize/index.js
new file mode 100644
index 0000000..76b5ba2
--- /dev/null
+++ b/date-fns/src/locale/mn/_lib/localize/index.js
@@ -0,0 +1,208 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['НТӨ', 'НТ'],
+ abbreviated: ['НТӨ', 'НТ'],
+ wide: ['нийтийн тооллын өмнөх', 'нийтийн тооллын'],
+}
+
+var quarterValues = {
+ narrow: ['I', 'II', 'III', 'IV'],
+ abbreviated: ['I улирал', 'II улирал', 'III улирал', 'IV улирал'],
+ wide: ['1-р улирал', '2-р улирал', '3-р улирал', '4-р улирал'],
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: [
+ 'I',
+ 'II',
+ 'III',
+ 'IV',
+ 'V',
+ 'VI',
+ 'VII',
+ 'VIII',
+ 'IX',
+ 'X',
+ 'XI',
+ 'XII',
+ ],
+ abbreviated: [
+ '1-р сар',
+ '2-р сар',
+ '3-р сар',
+ '4-р сар',
+ '5-р сар',
+ '6-р сар',
+ '7-р сар',
+ '8-р сар',
+ '9-р сар',
+ '10-р сар',
+ '11-р сар',
+ '12-р сар',
+ ],
+ wide: [
+ 'Нэгдүгээр сар',
+ 'Хоёрдугаар сар',
+ 'Гуравдугаар сар',
+ 'Дөрөвдүгээр сар',
+ 'Тавдугаар сар',
+ 'Зургаадугаар сар',
+ 'Долоодугаар сар',
+ 'Наймдугаар сар',
+ 'Есдүгээр сар',
+ 'Аравдугаар сар',
+ 'Арваннэгдүгээр сар',
+ 'Арван хоёрдугаар сар',
+ ],
+}
+
+var formattingMonthValues = {
+ narrow: [
+ 'I',
+ 'II',
+ 'III',
+ 'IV',
+ 'V',
+ 'VI',
+ 'VII',
+ 'VIII',
+ 'IX',
+ 'X',
+ 'XI',
+ 'XII',
+ ],
+ abbreviated: [
+ '1-р сар',
+ '2-р сар',
+ '3-р сар',
+ '4-р сар',
+ '5-р сар',
+ '6-р сар',
+ '7-р сар',
+ '8-р сар',
+ '9-р сар',
+ '10-р сар',
+ '11-р сар',
+ '12-р сар',
+ ],
+ wide: [
+ 'нэгдүгээр сар',
+ 'хоёрдугаар сар',
+ 'гуравдугаар сар',
+ 'дөрөвдүгээр сар',
+ 'тавдугаар сар',
+ 'зургаадугаар сар',
+ 'долоодугаар сар',
+ 'наймдугаар сар',
+ 'есдүгээр сар',
+ 'аравдугаар сар',
+ 'арваннэгдүгээр сар',
+ 'арван хоёрдугаар сар',
+ ],
+}
+
+var dayValues = {
+ narrow: ['Н', 'Д', 'М', 'Л', 'П', 'Б', 'Б'],
+ short: ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'],
+ abbreviated: ['Ням', 'Дав', 'Мяг', 'Лха', 'Пүр', 'Баа', 'Бям'],
+ wide: ['Ням', 'Даваа', 'Мягмар', 'Лхагва', 'Пүрэв', 'Баасан', 'Бямба'],
+}
+
+var formattingDayValues = {
+ narrow: ['Н', 'Д', 'М', 'Л', 'П', 'Б', 'Б'],
+ short: ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'],
+ abbreviated: ['Ням', 'Дав', 'Мяг', 'Лха', 'Пүр', 'Баа', 'Бям'],
+ wide: ['ням', 'даваа', 'мягмар', 'лхагва', 'пүрэв', 'баасан', 'бямба'],
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ү.ө.',
+ pm: 'ү.х.',
+ midnight: 'шөнө дунд',
+ noon: 'үд дунд',
+ morning: 'өглөө',
+ afternoon: 'өдөр',
+ evening: 'орой',
+ night: 'шөнө',
+ },
+ abbreviated: {
+ am: 'ү.ө.',
+ pm: 'ү.х.',
+ midnight: 'шөнө дунд',
+ noon: 'үд дунд',
+ morning: 'өглөө',
+ afternoon: 'өдөр',
+ evening: 'орой',
+ night: 'шөнө',
+ },
+ wide: {
+ am: 'ү.ө.',
+ pm: 'ү.х.',
+ midnight: 'шөнө дунд',
+ noon: 'үд дунд',
+ morning: 'өглөө',
+ afternoon: 'өдөр',
+ evening: 'орой',
+ night: 'шөнө',
+ },
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ return number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide',
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function (quarter) {
+ return Number(quarter) - 1
+ },
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide',
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayValues,
+ defaultFormattingWidth: 'wide',
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ }),
+}
+
+export default localize
diff --git a/date-fns/src/locale/mn/_lib/match/index.js b/date-fns/src/locale/mn/_lib/match/index.js
new file mode 100644
index 0000000..de6a8b3
--- /dev/null
+++ b/date-fns/src/locale/mn/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /\d+/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(нтө|нт)/i,
+ abbreviated: /^(нтө|нт)/i,
+ wide: /^(нийтийн тооллын өмнө|нийтийн тооллын)/i
+}
+var parseEraPatterns = {
+ any: [/^(нтө|нийтийн тооллын өмнө)/i, /^(нт|нийтийн тооллын)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^(iv|iii|ii|i)/i,
+ abbreviated: /^(iv|iii|ii|i) улирал/i,
+ wide: /^[1-4]-р улирал/i
+}
+var parseQuarterPatterns = {
+ any: [/^(i(\s|$)|1)/i, /^(ii(\s|$)|2)/i, /^(iii(\s|$)|3)/i, /^(iv(\s|$)|4)/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(xii|xi|x|ix|viii|vii|vi|v|iv|iii|ii|i)/i,
+ abbreviated: /^(1-р сар|2-р сар|3-р сар|4-р сар|5-р сар|6-р сар|7-р сар|8-р сар|9-р сар|10-р сар|11-р сар|12-р сар)/i,
+ wide: /^(нэгдүгээр сар|хоёрдугаар сар|гуравдугаар сар|дөрөвдүгээр сар|тавдугаар сар|зургаадугаар сар|долоодугаар сар|наймдугаар сар|есдүгээр сар|аравдугаар сар|арван нэгдүгээр сар|арван хоёрдугаар сар)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^i$/i,
+ /^ii$/i,
+ /^iii$/i,
+ /^iv$/i,
+ /^v$/i,
+ /^vi$/i,
+ /^vii$/i,
+ /^viii$/i,
+ /^ix$/i,
+ /^x$/i,
+ /^xi$/i,
+ /^xii$/i
+ ],
+ any: [
+ /^(1|нэгдүгээр)/i,
+ /^(2|хоёрдугаар)/i,
+ /^(3|гуравдугаар)/i,
+ /^(4|дөрөвдүгээр)/i,
+ /^(5|тавдугаар)/i,
+ /^(6|зургаадугаар)/i,
+ /^(7|долоодугаар)/i,
+ /^(8|наймдугаар)/i,
+ /^(9|есдүгээр)/i,
+ /^(10|аравдугаар)/i,
+ /^(11|арван нэгдүгээр)/i,
+ /^(12|арван хоёрдугаар)/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[ндмлпбб]/i,
+ short: /^(ня|да|мя|лх|пү|ба|бя)/i,
+ abbreviated: /^(ням|дав|мяг|лха|пүр|баа|бям)/i,
+ wide: /^(ням|даваа|мягмар|лхагва|пүрэв|баасан|бямба)/i
+}
+var parseDayPatterns = {
+ narrow: [/^н/i, /^д/i, /^м/i, /^л/i, /^п/i, /^б/i, /^б/i],
+ any: [/^ня/i, /^да/i, /^мя/i, /^лх/i, /^пү/i, /^ба/i, /^бя/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
+ any: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^ү\.ө\./i,
+ pm: /^ү\.х\./i,
+ midnight: /^шөнө дунд/i,
+ noon: /^үд дунд/i,
+ morning: /өглөө/i,
+ afternoon: /өдөр/i,
+ evening: /орой/i,
+ night: /шөнө/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/mn/index.d.ts b/date-fns/src/locale/mn/index.d.ts
new file mode 100644
index 0000000..9b27ad9
--- /dev/null
+++ b/date-fns/src/locale/mn/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { mn } from 'date-fns/locale'
+export default mn
diff --git a/date-fns/src/locale/mn/index.js b/date-fns/src/locale/mn/index.js
new file mode 100644
index 0000000..dcb3562
--- /dev/null
+++ b/date-fns/src/locale/mn/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Mongolian locale.
+ * @language Mongolian
+ * @iso-639-2 mon
+ * @author Bilguun Ochirbat [@bilguun0203]{@link https://github.com/bilguun0203}
+ */
+var locale = {
+ code: 'mn',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/mn/index.js.flow b/date-fns/src/locale/mn/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/mn/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/mn/snapshot.md b/date-fns/src/locale/mn/snapshot.md
new file mode 100644
index 0000000..a94b472
--- /dev/null
+++ b/date-fns/src/locale/mn/snapshot.md
@@ -0,0 +1,304 @@
+# Mongolian (mn) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | I улирал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | II улирал | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-р улирал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-р улирал | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | I | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | II | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | I улирал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | II улирал | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-р улирал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-р улирал | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | 2-р сар | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-р сар | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | хоёрдугаар сар | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | долоодугаар сар | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | II | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | VII | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | 2-р сар | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-р сар | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Хоёрдугаар сар | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Долоодугаар сар | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | II | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | VII | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Дав | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Баа | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Дав | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Баа | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Дав | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Баа | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | даваа | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | баасан | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Б | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Да | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ба | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Дав | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Баа | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | даваа | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | баасан | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Б | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Да | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ба | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Дав | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Баа | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | даваа | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | баасан | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Б | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Да | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ба | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Дав | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Баа | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Даваа | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Баасан | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | Д | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Б | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Да | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ба | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ү.х. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ү.ө. | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | өглөө | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | өдөр | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | орой | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | шөнө | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | өглөө | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | өдөр | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | орой | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | шөнө | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | өглөө | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | өдөр | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | орой | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | шөнө | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | өглөө | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | өдөр | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | орой | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | шөнө | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | өглөө | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | өдөр | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | орой | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | шөнө | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987.02.11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453.05.29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987 оны 2-р сарын 11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 оны 5-р сарын 29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987 оны хоёрдугаар сарын 11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 оны тавдугаар сарын 29 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 1987 оны хоёрдугаар сарын 11, лхагва гараг | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 оны тавдугаар сарын 29, ням гараг | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987.02.11 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453.05.29 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987 оны 2-р сарын 11 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 оны 5-р сарын 29 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987 оны хоёрдугаар сарын 11 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 оны тавдугаар сарын 29 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 1987 оны хоёрдугаар сарын 11, лхагва гараг 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 оны тавдугаар сарын 29, ням гараг 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | ойролцоогоор 6 жил | ойролцоогоор 6 жил | ойролцоогоор 6 жилийн дараа |
+| 2005-01-01T00:00:00.000Z | ойролцоогоор 5 жил | ойролцоогоор 5 жил | ойролцоогоор 5 жилийн дараа |
+| 2004-01-01T00:00:00.000Z | ойролцоогоор 4 жил | ойролцоогоор 4 жил | ойролцоогоор 4 жилийн дараа |
+| 2003-01-01T00:00:00.000Z | ойролцоогоор 3 жил | ойролцоогоор 3 жил | ойролцоогоор 3 жилийн дараа |
+| 2002-01-01T00:00:00.000Z | ойролцоогоор 2 жил | ойролцоогоор 2 жил | ойролцоогоор 2 жилийн дараа |
+| 2001-06-01T00:00:00.000Z | 1 жил гаран | 1 жил гаран | 1 жил гараны дараа |
+| 2001-02-01T00:00:00.000Z | ойролцоогоор 1 жил | ойролцоогоор 1 жил | ойролцоогоор 1 жилийн дараа |
+| 2001-01-01T00:00:00.000Z | ойролцоогоор 1 жил | ойролцоогоор 1 жил | ойролцоогоор 1 жилийн дараа |
+| 2000-06-01T00:00:00.000Z | 5 сар | 5 сар | 5 сарын дараа |
+| 2000-03-01T00:00:00.000Z | 2 сар | 2 сар | 2 сарын дараа |
+| 2000-02-01T00:00:00.000Z | ойролцоогоор 1 сар | ойролцоогоор 1 сар | ойролцоогоор 1 сарын дараа |
+| 2000-01-15T00:00:00.000Z | 14 өдөр | 14 өдөр | 14 өдрийн дараа |
+| 2000-01-02T00:00:00.000Z | 1 өдөр | 1 өдөр | 1 өдрийн дараа |
+| 2000-01-01T06:00:00.000Z | ойролцоогоор 6 цаг | ойролцоогоор 6 цаг | ойролцоогоор 6 цагийн дараа |
+| 2000-01-01T01:00:00.000Z | ойролцоогоор 1 цаг | ойролцоогоор 1 цаг | ойролцоогоор 1 цагийн дараа |
+| 2000-01-01T00:45:00.000Z | ойролцоогоор 1 цаг | ойролцоогоор 1 цаг | ойролцоогоор 1 цагийн дараа |
+| 2000-01-01T00:30:00.000Z | 30 минут | 30 минут | 30 минутын дараа |
+| 2000-01-01T00:15:00.000Z | 15 минут | 15 минут | 15 минутын дараа |
+| 2000-01-01T00:01:00.000Z | 1 минут | 1 минут | 1 минутын дараа |
+| 2000-01-01T00:00:25.000Z | минут хүрэхгүй | хагас минут | минут хүрэхгүй хугацааны дараа |
+| 2000-01-01T00:00:15.000Z | минут хүрэхгүй | 20 секунд хүрэхгүй | минут хүрэхгүй хугацааны дараа |
+| 2000-01-01T00:00:05.000Z | минут хүрэхгүй | 10 секунд хүрэхгүй | минут хүрэхгүй хугацааны дараа |
+| 2000-01-01T00:00:00.000Z | минут хүрэхгүй | 5 секунд хүрэхгүй | минут хүрэхгүй хугацааны өмнө |
+| 1999-12-31T23:59:55.000Z | минут хүрэхгүй | 10 секунд хүрэхгүй | минут хүрэхгүй хугацааны өмнө |
+| 1999-12-31T23:59:45.000Z | минут хүрэхгүй | 20 секунд хүрэхгүй | минут хүрэхгүй хугацааны өмнө |
+| 1999-12-31T23:59:35.000Z | минут хүрэхгүй | хагас минут | минут хүрэхгүй хугацааны өмнө |
+| 1999-12-31T23:59:00.000Z | 1 минут | 1 минут | 1 минутын өмнө |
+| 1999-12-31T23:45:00.000Z | 15 минут | 15 минут | 15 минутын өмнө |
+| 1999-12-31T23:30:00.000Z | 30 минут | 30 минут | 30 минутын өмнө |
+| 1999-12-31T23:15:00.000Z | ойролцоогоор 1 цаг | ойролцоогоор 1 цаг | ойролцоогоор 1 цагийн өмнө |
+| 1999-12-31T23:00:00.000Z | ойролцоогоор 1 цаг | ойролцоогоор 1 цаг | ойролцоогоор 1 цагийн өмнө |
+| 1999-12-31T18:00:00.000Z | ойролцоогоор 6 цаг | ойролцоогоор 6 цаг | ойролцоогоор 6 цагийн өмнө |
+| 1999-12-30T00:00:00.000Z | 2 өдөр | 2 өдөр | 2 өдрийн өмнө |
+| 1999-12-15T00:00:00.000Z | 17 өдөр | 17 өдөр | 17 өдрийн өмнө |
+| 1999-12-01T00:00:00.000Z | ойролцоогоор 1 сар | ойролцоогоор 1 сар | ойролцоогоор 1 сарын өмнө |
+| 1999-11-01T00:00:00.000Z | 2 сар | 2 сар | 2 сарын өмнө |
+| 1999-06-01T00:00:00.000Z | 7 сар | 7 сар | 7 сарын өмнө |
+| 1999-01-01T00:00:00.000Z | ойролцоогоор 1 жил | ойролцоогоор 1 жил | ойролцоогоор 1 жилийн өмнө |
+| 1998-12-01T00:00:00.000Z | ойролцоогоор 1 жил | ойролцоогоор 1 жил | ойролцоогоор 1 жилийн өмнө |
+| 1998-06-01T00:00:00.000Z | 1 жил гаран | 1 жил гаран | 1 жил гараны өмнө |
+| 1998-01-01T00:00:00.000Z | ойролцоогоор 2 жил | ойролцоогоор 2 жил | ойролцоогоор 2 жилийн өмнө |
+| 1997-01-01T00:00:00.000Z | ойролцоогоор 3 жил | ойролцоогоор 3 жил | ойролцоогоор 3 жилийн өмнө |
+| 1996-01-01T00:00:00.000Z | ойролцоогоор 4 жил | ойролцоогоор 4 жил | ойролцоогоор 4 жилийн өмнө |
+| 1995-01-01T00:00:00.000Z | ойролцоогоор 5 жил | ойролцоогоор 5 жил | ойролцоогоор 5 жилийн өмнө |
+| 1994-01-01T00:00:00.000Z | ойролцоогоор 6 жил | ойролцоогоор 6 жил | ойролцоогоор 6 жилийн өмнө |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 жил | 6 жилийн дараа | 52608 цаг |
+| 2005-01-01T00:00:00.000Z | 5 жил | 5 жилийн дараа | 43848 цаг |
+| 2004-01-01T00:00:00.000Z | 4 жил | 4 жилийн дараа | 35064 цаг |
+| 2003-01-01T00:00:00.000Z | 3 жил | 3 жилийн дараа | 26304 цаг |
+| 2002-01-01T00:00:00.000Z | 2 жил | 2 жилийн дараа | 17544 цаг |
+| 2001-06-01T00:00:00.000Z | 1 жил | 1 жилийн дараа | 12408 цаг |
+| 2001-02-01T00:00:00.000Z | 1 жил | 1 жилийн дараа | 9528 цаг |
+| 2001-01-01T00:00:00.000Z | 1 жил | 1 жилийн дараа | 8784 цаг |
+| 2000-06-01T00:00:00.000Z | 5 сар | 5 сарын дараа | 3648 цаг |
+| 2000-03-01T00:00:00.000Z | 2 сар | 2 сарын дараа | 1440 цаг |
+| 2000-02-01T00:00:00.000Z | 1 сар | 1 сарын дараа | 744 цаг |
+| 2000-01-15T00:00:00.000Z | 14 өдөр | 14 өдрийн дараа | 336 цаг |
+| 2000-01-02T00:00:00.000Z | 1 өдөр | 1 өдрийн дараа | 24 цаг |
+| 2000-01-01T06:00:00.000Z | 6 цаг | 6 цагийн дараа | 6 цаг |
+| 2000-01-01T01:00:00.000Z | 1 цаг | 1 цагийн дараа | 1 цаг |
+| 2000-01-01T00:45:00.000Z | 45 минут | 45 минутын дараа | 1 цаг |
+| 2000-01-01T00:30:00.000Z | 30 минут | 30 минутын дараа | 1 цаг |
+| 2000-01-01T00:15:00.000Z | 15 минут | 15 минутын дараа | 0 цаг |
+| 2000-01-01T00:01:00.000Z | 1 минут | 1 минутын дараа | 0 цаг |
+| 2000-01-01T00:00:25.000Z | 25 секунд | 25 секундийн дараа | 0 цаг |
+| 2000-01-01T00:00:15.000Z | 15 секунд | 15 секундийн дараа | 0 цаг |
+| 2000-01-01T00:00:05.000Z | 5 секунд | 5 секундийн дараа | 0 цаг |
+| 2000-01-01T00:00:00.000Z | 0 секунд | 0 секундийн өмнө | 0 цаг |
+| 1999-12-31T23:59:55.000Z | 5 секунд | 5 секундийн өмнө | 0 цаг |
+| 1999-12-31T23:59:45.000Z | 15 секунд | 15 секундийн өмнө | 0 цаг |
+| 1999-12-31T23:59:35.000Z | 25 секунд | 25 секундийн өмнө | 0 цаг |
+| 1999-12-31T23:59:00.000Z | 1 минут | 1 минутын өмнө | 0 цаг |
+| 1999-12-31T23:45:00.000Z | 15 минут | 15 минутын өмнө | 0 цаг |
+| 1999-12-31T23:30:00.000Z | 30 минут | 30 минутын өмнө | 1 цаг |
+| 1999-12-31T23:15:00.000Z | 45 минут | 45 минутын өмнө | 1 цаг |
+| 1999-12-31T23:00:00.000Z | 1 цаг | 1 цагийн өмнө | 1 цаг |
+| 1999-12-31T18:00:00.000Z | 6 цаг | 6 цагийн өмнө | 6 цаг |
+| 1999-12-30T00:00:00.000Z | 2 өдөр | 2 өдрийн өмнө | 48 цаг |
+| 1999-12-15T00:00:00.000Z | 17 өдөр | 17 өдрийн өмнө | 408 цаг |
+| 1999-12-01T00:00:00.000Z | 1 сар | 1 сарын өмнө | 744 цаг |
+| 1999-11-01T00:00:00.000Z | 2 сар | 2 сарын өмнө | 1464 цаг |
+| 1999-06-01T00:00:00.000Z | 7 сар | 7 сарын өмнө | 5136 цаг |
+| 1999-01-01T00:00:00.000Z | 1 жил | 1 жилийн өмнө | 8760 цаг |
+| 1998-12-01T00:00:00.000Z | 1 жил | 1 жилийн өмнө | 9504 цаг |
+| 1998-06-01T00:00:00.000Z | 2 жил | 2 жилийн өмнө | 13896 цаг |
+| 1998-01-01T00:00:00.000Z | 2 жил | 2 жилийн өмнө | 17520 цаг |
+| 1997-01-01T00:00:00.000Z | 3 жил | 3 жилийн өмнө | 26280 цаг |
+| 1996-01-01T00:00:00.000Z | 4 жил | 4 жилийн өмнө | 35064 цаг |
+| 1995-01-01T00:00:00.000Z | 5 жил | 5 жилийн өмнө | 43824 цаг |
+| 1994-01-01T00:00:00.000Z | 6 жил | 6 жилийн өмнө | 52584 цаг |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------------------- |
+| 2000-01-10T00:00:00.000Z | 2000.01.10 |
+| 2000-01-05T00:00:00.000Z | ирэх лхагва гарагийн 0:00 цагт |
+| 2000-01-02T00:00:00.000Z | маргааш 0:00 цагт |
+| 2000-01-01T00:00:00.000Z | өнөөдөр 0:00 цагт |
+| 1999-12-31T00:00:00.000Z | өчигдөр 0:00 цагт |
+| 1999-12-27T00:00:00.000Z | өнгөрсөн даваа гарагийн 0:00 цагт |
+| 1999-12-21T00:00:00.000Z | 1999.12.21 |
diff --git a/date-fns/src/locale/ms/_lib/formatDistance/index.js b/date-fns/src/locale/ms/_lib/formatDistance/index.js
new file mode 100644
index 0000000..f3e90e3
--- /dev/null
+++ b/date-fns/src/locale/ms/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'kurang dari 1 saat',
+ other: 'kurang dari {{count}} saat'
+ },
+
+ xSeconds: {
+ one: '1 saat',
+ other: '{{count}} saat'
+ },
+
+ halfAMinute: 'setengah minit',
+
+ lessThanXMinutes: {
+ one: 'kurang dari 1 minit',
+ other: 'kurang dari {{count}} minit'
+ },
+
+ xMinutes: {
+ one: '1 minit',
+ other: '{{count}} minit'
+ },
+
+ aboutXHours: {
+ one: 'sekitar 1 jam',
+ other: 'sekitar {{count}} jam'
+ },
+
+ xHours: {
+ one: '1 jam',
+ other: '{{count}} jam'
+ },
+
+ xDays: {
+ one: '1 hari',
+ other: '{{count}} hari'
+ },
+
+ aboutXWeeks: {
+ one: 'sekitar 1 minggu',
+ other: 'sekitar {{count}} minggu'
+ },
+
+ xWeeks: {
+ one: '1 minggu',
+ other: '{{count}} minggu'
+ },
+
+ aboutXMonths: {
+ one: 'sekitar 1 bulan',
+ other: 'sekitar {{count}} bulan'
+ },
+
+ xMonths: {
+ one: '1 bulan',
+ other: '{{count}} bulan'
+ },
+
+ aboutXYears: {
+ one: 'sekitar 1 tahun',
+ other: 'sekitar {{count}} tahun'
+ },
+
+ xYears: {
+ one: '1 tahun',
+ other: '{{count}} tahun'
+ },
+
+ overXYears: {
+ one: 'lebih dari 1 tahun',
+ other: 'lebih dari {{count}} tahun'
+ },
+
+ almostXYears: {
+ one: 'hampir 1 tahun',
+ other: 'hampir {{count}} tahun'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'dalam masa ' + result
+ } else {
+ return result + ' yang lalu'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ms/_lib/formatLong/index.js b/date-fns/src/locale/ms/_lib/formatLong/index.js
new file mode 100644
index 0000000..d8ea107
--- /dev/null
+++ b/date-fns/src/locale/ms/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'd/M/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH.mm.ss',
+ long: 'HH.mm.ss',
+ medium: 'HH.mm',
+ short: 'HH.mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'pukul' {{time}}",
+ long: "{{date}} 'pukul' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ms/_lib/formatRelative/index.js b/date-fns/src/locale/ms/_lib/formatRelative/index.js
new file mode 100644
index 0000000..60b6541
--- /dev/null
+++ b/date-fns/src/locale/ms/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'lepas pada jam' p",
+ yesterday: "'Semalam pada jam' p",
+ today: "'Hari ini pada jam' p",
+ tomorrow: "'Esok pada jam' p",
+ nextWeek: "eeee 'pada jam' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ms/_lib/localize/index.js b/date-fns/src/locale/ms/_lib/localize/index.js
new file mode 100644
index 0000000..038457a
--- /dev/null
+++ b/date-fns/src/locale/ms/_lib/localize/index.js
@@ -0,0 +1,169 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+// Most data for localization are taken from this page
+// https://www.unicode.org/cldr/charts/32/summary/ms.html
+var eraValues = {
+ narrow: ['SM', 'M'],
+ abbreviated: ['SM', 'M'],
+ wide: ['Sebelum Masihi', 'Masihi']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['S1', 'S2', 'S3', 'S4'],
+ wide: ['Suku pertama', 'Suku kedua', 'Suku ketiga', 'Suku keempat']
+}
+
+// Note: in Malay, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'O', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Feb',
+ 'Mac',
+ 'Apr',
+ 'Mei',
+ 'Jun',
+ 'Jul',
+ 'Ogo',
+ 'Sep',
+ 'Okt',
+ 'Nov',
+ 'Dis'
+ ],
+ wide: [
+ 'Januari',
+ 'Februari',
+ 'Mac',
+ 'April',
+ 'Mei',
+ 'Jun',
+ 'Julai',
+ 'Ogos',
+ 'September',
+ 'Oktober',
+ 'November',
+ 'Disember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['A', 'I', 'S', 'R', 'K', 'J', 'S'],
+ short: ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'],
+ abbreviated: ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'],
+ wide: ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'tgh malam',
+ noon: 'tgh hari',
+ morning: 'pagi',
+ afternoon: 'tengah hari',
+ evening: 'petang',
+ night: 'malam'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'tengah hari',
+ evening: 'petang',
+ night: 'malam'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'tengah hari',
+ evening: 'petang',
+ night: 'malam'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'tengah hari',
+ evening: 'petang',
+ night: 'malam'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'tengah hari',
+ evening: 'petang',
+ night: 'malam'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'tengah malam',
+ noon: 'tengah hari',
+ morning: 'pagi',
+ afternoon: 'tengah hari',
+ evening: 'petang',
+ night: 'malam'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // Can't use "pertama", "kedua" because can't be parsed
+ switch (number) {
+ default:
+ return 'ke-' + number
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ms/_lib/match/index.js b/date-fns/src/locale/ms/_lib/match/index.js
new file mode 100644
index 0000000..650e1de
--- /dev/null
+++ b/date-fns/src/locale/ms/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^ke-(\d+)?/i
+var parseOrdinalNumberPattern = /petama|\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(sm|m)/i,
+ abbreviated: /^(s\.?\s?m\.?|m\.?)/i,
+ wide: /^(sebelum masihi|masihi)/i
+}
+var parseEraPatterns = {
+ any: [/^s/i, /^(m)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^S[1234]/i,
+ wide: /Suku (pertama|kedua|ketiga|keempat)/i
+}
+var parseQuarterPatterns = {
+ any: [/pertama|1/i, /kedua|2/i, /ketiga|3/i, /keempat|4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mac|apr|mei|jun|jul|ogo|sep|okt|nov|dis)/i,
+ wide: /^(januari|februari|mac|april|mei|jun|julai|ogos|september|oktober|november|disember)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^o/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^ma/i,
+ /^ap/i,
+ /^me/i,
+ /^jun/i,
+ /^jul/i,
+ /^og/i,
+ /^s/i,
+ /^ok/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[aisrkj]/i,
+ short: /^(ahd|isn|sel|rab|kha|jum|sab)/i,
+ abbreviated: /^(ahd|isn|sel|rab|kha|jum|sab)/i,
+ wide: /^(ahad|isnin|selasa|rabu|khamis|jumaat|sabtu)/i
+}
+var parseDayPatterns = {
+ narrow: [/^a/i, /^i/i, /^s/i, /^r/i, /^k/i, /^j/i, /^s/i],
+ any: [/^a/i, /^i/i, /^se/i, /^r/i, /^k/i, /^j/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(am|pm|tengah malam|tengah hari|pagi|petang|malam)/i,
+ any: /^([ap]\.?\s?m\.?|tengah malam|tengah hari|pagi|petang|malam)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^pm/i,
+ midnight: /^tengah m/i,
+ noon: /^tengah h/i,
+ morning: /pa/i,
+ afternoon: /tengah h/i,
+ evening: /pe/i,
+ night: /m/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ms/index.d.ts b/date-fns/src/locale/ms/index.d.ts
new file mode 100644
index 0000000..d7450bd
--- /dev/null
+++ b/date-fns/src/locale/ms/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ms } from 'date-fns/locale'
+export default ms
diff --git a/date-fns/src/locale/ms/index.js b/date-fns/src/locale/ms/index.js
new file mode 100644
index 0000000..a143645
--- /dev/null
+++ b/date-fns/src/locale/ms/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Malay locale.
+ * @language Malay
+ * @iso-639-2 msa
+ * @author Ruban Selvarajah [@Zyten]{@link https://github.com/Zyten}
+ */
+var locale = {
+ code: 'ms',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ms/index.js.flow b/date-fns/src/locale/ms/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ms/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ms/snapshot.md b/date-fns/src/locale/ms/snapshot.md
new file mode 100644
index 0000000..dc85b8f
--- /dev/null
+++ b/date-fns/src/locale/ms/snapshot.md
@@ -0,0 +1,304 @@
+# Malay (ms) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | ke-1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | ke-5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | ke-1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | ke-5 | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | ke-1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ke-2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | S1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | S2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | Suku pertama | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Suku kedua | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | ke-1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | ke-2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | S1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | S2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | Suku pertama | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Suku kedua | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | ke-2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ke-7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Julai | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | ke-2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ke-7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Julai | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | ke-1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | ke-48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | ke-1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | ke-48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | ke-11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | ke-28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | ke-42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | ke-365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Isnin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumaat | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | I | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | ke-1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ke-5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Isnin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumaat | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | I | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | ke-1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ke-5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Isnin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumaat | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | I | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | ke-1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ke-5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Isnin | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jumaat | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | I | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Isn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | pagi | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | tengah hari | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | petang | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | malam | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | pagi | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | tengah hari | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | petang | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | malam | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | pagi | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | tengah hari | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | petang | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | malam | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | pagi | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | tengah hari | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | petang | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | malam | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | pagi | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | tengah hari | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | petang | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | malam | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | ke-11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | ke-23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | ke-1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | ke-55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | ke-1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | ke-55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/2/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Rabu, 11 Februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Ahad, 29 Mei 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59 | 1453-05-29T23:59:00.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59.59 | 1453-05-29T23:59:59.000Z |
+| | pppp | 1987-02-11T12:13:14.015Z | 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23.59.59 | 1453-05-29T23:59:59.000Z |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/2/1987, 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/1453, 23.59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Feb 1987, 12.13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453, 23.59 | 1453-05-29T23:59:00.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Februari 1987 pukul 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mei 1453 pukul 23.59.59 | 1453-05-29T23:59:59.000Z |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Rabu, 11 Februari 1987 pukul 12.13.14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | Ahad, 29 Mei 1453 pukul 23.59.59 | 1453-05-29T23:59:59.000Z |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------- | ---------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | sekitar 6 tahun | sekitar 6 tahun | dalam masa sekitar 6 tahun |
+| 2005-01-01T00:00:00.000Z | sekitar 5 tahun | sekitar 5 tahun | dalam masa sekitar 5 tahun |
+| 2004-01-01T00:00:00.000Z | sekitar 4 tahun | sekitar 4 tahun | dalam masa sekitar 4 tahun |
+| 2003-01-01T00:00:00.000Z | sekitar 3 tahun | sekitar 3 tahun | dalam masa sekitar 3 tahun |
+| 2002-01-01T00:00:00.000Z | sekitar 2 tahun | sekitar 2 tahun | dalam masa sekitar 2 tahun |
+| 2001-06-01T00:00:00.000Z | lebih dari 1 tahun | lebih dari 1 tahun | dalam masa lebih dari 1 tahun |
+| 2001-02-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | dalam masa sekitar 1 tahun |
+| 2001-01-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | dalam masa sekitar 1 tahun |
+| 2000-06-01T00:00:00.000Z | 5 bulan | 5 bulan | dalam masa 5 bulan |
+| 2000-03-01T00:00:00.000Z | 2 bulan | 2 bulan | dalam masa 2 bulan |
+| 2000-02-01T00:00:00.000Z | sekitar 1 bulan | sekitar 1 bulan | dalam masa sekitar 1 bulan |
+| 2000-01-15T00:00:00.000Z | 14 hari | 14 hari | dalam masa 14 hari |
+| 2000-01-02T00:00:00.000Z | 1 hari | 1 hari | dalam masa 1 hari |
+| 2000-01-01T06:00:00.000Z | sekitar 6 jam | sekitar 6 jam | dalam masa sekitar 6 jam |
+| 2000-01-01T01:00:00.000Z | sekitar 1 jam | sekitar 1 jam | dalam masa sekitar 1 jam |
+| 2000-01-01T00:45:00.000Z | sekitar 1 jam | sekitar 1 jam | dalam masa sekitar 1 jam |
+| 2000-01-01T00:30:00.000Z | 30 minit | 30 minit | dalam masa 30 minit |
+| 2000-01-01T00:15:00.000Z | 15 minit | 15 minit | dalam masa 15 minit |
+| 2000-01-01T00:01:00.000Z | 1 minit | 1 minit | dalam masa 1 minit |
+| 2000-01-01T00:00:25.000Z | kurang dari 1 minit | setengah minit | dalam masa kurang dari 1 minit |
+| 2000-01-01T00:00:15.000Z | kurang dari 1 minit | kurang dari 20 saat | dalam masa kurang dari 1 minit |
+| 2000-01-01T00:00:05.000Z | kurang dari 1 minit | kurang dari 10 saat | dalam masa kurang dari 1 minit |
+| 2000-01-01T00:00:00.000Z | kurang dari 1 minit | kurang dari 5 saat | kurang dari 1 minit yang lalu |
+| 1999-12-31T23:59:55.000Z | kurang dari 1 minit | kurang dari 10 saat | kurang dari 1 minit yang lalu |
+| 1999-12-31T23:59:45.000Z | kurang dari 1 minit | kurang dari 20 saat | kurang dari 1 minit yang lalu |
+| 1999-12-31T23:59:35.000Z | kurang dari 1 minit | setengah minit | kurang dari 1 minit yang lalu |
+| 1999-12-31T23:59:00.000Z | 1 minit | 1 minit | 1 minit yang lalu |
+| 1999-12-31T23:45:00.000Z | 15 minit | 15 minit | 15 minit yang lalu |
+| 1999-12-31T23:30:00.000Z | 30 minit | 30 minit | 30 minit yang lalu |
+| 1999-12-31T23:15:00.000Z | sekitar 1 jam | sekitar 1 jam | sekitar 1 jam yang lalu |
+| 1999-12-31T23:00:00.000Z | sekitar 1 jam | sekitar 1 jam | sekitar 1 jam yang lalu |
+| 1999-12-31T18:00:00.000Z | sekitar 6 jam | sekitar 6 jam | sekitar 6 jam yang lalu |
+| 1999-12-30T00:00:00.000Z | 2 hari | 2 hari | 2 hari yang lalu |
+| 1999-12-15T00:00:00.000Z | 17 hari | 17 hari | 17 hari yang lalu |
+| 1999-12-01T00:00:00.000Z | sekitar 1 bulan | sekitar 1 bulan | sekitar 1 bulan yang lalu |
+| 1999-11-01T00:00:00.000Z | 2 bulan | 2 bulan | 2 bulan yang lalu |
+| 1999-06-01T00:00:00.000Z | 7 bulan | 7 bulan | 7 bulan yang lalu |
+| 1999-01-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | sekitar 1 tahun yang lalu |
+| 1998-12-01T00:00:00.000Z | sekitar 1 tahun | sekitar 1 tahun | sekitar 1 tahun yang lalu |
+| 1998-06-01T00:00:00.000Z | lebih dari 1 tahun | lebih dari 1 tahun | lebih dari 1 tahun yang lalu |
+| 1998-01-01T00:00:00.000Z | sekitar 2 tahun | sekitar 2 tahun | sekitar 2 tahun yang lalu |
+| 1997-01-01T00:00:00.000Z | sekitar 3 tahun | sekitar 3 tahun | sekitar 3 tahun yang lalu |
+| 1996-01-01T00:00:00.000Z | sekitar 4 tahun | sekitar 4 tahun | sekitar 4 tahun yang lalu |
+| 1995-01-01T00:00:00.000Z | sekitar 5 tahun | sekitar 5 tahun | sekitar 5 tahun yang lalu |
+| 1994-01-01T00:00:00.000Z | sekitar 6 tahun | sekitar 6 tahun | sekitar 6 tahun yang lalu |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | -------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 tahun | dalam masa 6 tahun | 52608 jam |
+| 2005-01-01T00:00:00.000Z | 5 tahun | dalam masa 5 tahun | 43848 jam |
+| 2004-01-01T00:00:00.000Z | 4 tahun | dalam masa 4 tahun | 35064 jam |
+| 2003-01-01T00:00:00.000Z | 3 tahun | dalam masa 3 tahun | 26304 jam |
+| 2002-01-01T00:00:00.000Z | 2 tahun | dalam masa 2 tahun | 17544 jam |
+| 2001-06-01T00:00:00.000Z | 1 tahun | dalam masa 1 tahun | 12408 jam |
+| 2001-02-01T00:00:00.000Z | 1 tahun | dalam masa 1 tahun | 9528 jam |
+| 2001-01-01T00:00:00.000Z | 1 tahun | dalam masa 1 tahun | 8784 jam |
+| 2000-06-01T00:00:00.000Z | 5 bulan | dalam masa 5 bulan | 3648 jam |
+| 2000-03-01T00:00:00.000Z | 2 bulan | dalam masa 2 bulan | 1440 jam |
+| 2000-02-01T00:00:00.000Z | 1 bulan | dalam masa 1 bulan | 744 jam |
+| 2000-01-15T00:00:00.000Z | 14 hari | dalam masa 14 hari | 336 jam |
+| 2000-01-02T00:00:00.000Z | 1 hari | dalam masa 1 hari | 24 jam |
+| 2000-01-01T06:00:00.000Z | 6 jam | dalam masa 6 jam | 6 jam |
+| 2000-01-01T01:00:00.000Z | 1 jam | dalam masa 1 jam | 1 jam |
+| 2000-01-01T00:45:00.000Z | 45 minit | dalam masa 45 minit | 1 jam |
+| 2000-01-01T00:30:00.000Z | 30 minit | dalam masa 30 minit | 1 jam |
+| 2000-01-01T00:15:00.000Z | 15 minit | dalam masa 15 minit | 0 jam |
+| 2000-01-01T00:01:00.000Z | 1 minit | dalam masa 1 minit | 0 jam |
+| 2000-01-01T00:00:25.000Z | 25 saat | dalam masa 25 saat | 0 jam |
+| 2000-01-01T00:00:15.000Z | 15 saat | dalam masa 15 saat | 0 jam |
+| 2000-01-01T00:00:05.000Z | 5 saat | dalam masa 5 saat | 0 jam |
+| 2000-01-01T00:00:00.000Z | 0 saat | 0 saat yang lalu | 0 jam |
+| 1999-12-31T23:59:55.000Z | 5 saat | 5 saat yang lalu | 0 jam |
+| 1999-12-31T23:59:45.000Z | 15 saat | 15 saat yang lalu | 0 jam |
+| 1999-12-31T23:59:35.000Z | 25 saat | 25 saat yang lalu | 0 jam |
+| 1999-12-31T23:59:00.000Z | 1 minit | 1 minit yang lalu | 0 jam |
+| 1999-12-31T23:45:00.000Z | 15 minit | 15 minit yang lalu | 0 jam |
+| 1999-12-31T23:30:00.000Z | 30 minit | 30 minit yang lalu | 1 jam |
+| 1999-12-31T23:15:00.000Z | 45 minit | 45 minit yang lalu | 1 jam |
+| 1999-12-31T23:00:00.000Z | 1 jam | 1 jam yang lalu | 1 jam |
+| 1999-12-31T18:00:00.000Z | 6 jam | 6 jam yang lalu | 6 jam |
+| 1999-12-30T00:00:00.000Z | 2 hari | 2 hari yang lalu | 48 jam |
+| 1999-12-15T00:00:00.000Z | 17 hari | 17 hari yang lalu | 408 jam |
+| 1999-12-01T00:00:00.000Z | 1 bulan | 1 bulan yang lalu | 744 jam |
+| 1999-11-01T00:00:00.000Z | 2 bulan | 2 bulan yang lalu | 1464 jam |
+| 1999-06-01T00:00:00.000Z | 7 bulan | 7 bulan yang lalu | 5136 jam |
+| 1999-01-01T00:00:00.000Z | 1 tahun | 1 tahun yang lalu | 8760 jam |
+| 1998-12-01T00:00:00.000Z | 1 tahun | 1 tahun yang lalu | 9504 jam |
+| 1998-06-01T00:00:00.000Z | 2 tahun | 2 tahun yang lalu | 13896 jam |
+| 1998-01-01T00:00:00.000Z | 2 tahun | 2 tahun yang lalu | 17520 jam |
+| 1997-01-01T00:00:00.000Z | 3 tahun | 3 tahun yang lalu | 26280 jam |
+| 1996-01-01T00:00:00.000Z | 4 tahun | 4 tahun yang lalu | 35064 jam |
+| 1995-01-01T00:00:00.000Z | 5 tahun | 5 tahun yang lalu | 43824 jam |
+| 1994-01-01T00:00:00.000Z | 6 tahun | 6 tahun yang lalu | 52584 jam |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/1/2000 |
+| 2000-01-05T00:00:00.000Z | Rabu pada jam 00.00 |
+| 2000-01-02T00:00:00.000Z | Esok pada jam 00.00 |
+| 2000-01-01T00:00:00.000Z | Hari ini pada jam 00.00 |
+| 1999-12-31T00:00:00.000Z | Semalam pada jam 00.00 |
+| 1999-12-27T00:00:00.000Z | Isnin lepas pada jam 00.00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/mt/_lib/formatDistance/index.js b/date-fns/src/locale/mt/_lib/formatDistance/index.js
new file mode 100644
index 0000000..3fd8f18
--- /dev/null
+++ b/date-fns/src/locale/mt/_lib/formatDistance/index.js
@@ -0,0 +1,108 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'inqas minn sekonda',
+ other: 'inqas minn {{count}} sekondi'
+ },
+
+ xSeconds: {
+ one: 'sekonda',
+ other: '{{count}} sekondi'
+ },
+
+ halfAMinute: 'nofs minuta',
+
+ lessThanXMinutes: {
+ one: 'inqas minn minuta',
+ other: 'inqas minn {{count}} minuti'
+ },
+
+ xMinutes: {
+ one: 'minuta',
+ other: '{{count}} minuti'
+ },
+
+ aboutXHours: {
+ one: 'madwar siegħa',
+ other: 'madwar {{count}} siegħat'
+ },
+
+ xHours: {
+ one: 'siegħa',
+ other: '{{count}} siegħat'
+ },
+
+ xDays: {
+ one: 'ġurnata',
+ other: '{{count}} ġranet'
+ },
+
+ aboutXWeeks: {
+ one: 'madwar ġimgħa',
+ other: 'madwar {{count}} ġimgħat'
+ },
+
+ xWeeks: {
+ one: 'ġimgħa',
+ other: '{{count}} ġimgħat'
+ },
+
+ aboutXMonths: {
+ one: 'madwar xahar',
+ other: 'madwar {{count}} xhur'
+ },
+
+ xMonths: {
+ one: 'xahar',
+ other: '{{count}} xhur'
+ },
+
+ aboutXYears: {
+ one: 'madwar sena',
+ two: 'madwar sentejn',
+ other: 'madwar {{count}} snin'
+ },
+
+ xYears: {
+ one: 'sena',
+ two: 'sentejn',
+ other: '{{count}} snin'
+ },
+
+ overXYears: {
+ one: 'aktar minn sena',
+ two: 'aktar minn sentejn',
+ other: 'aktar minn {{count}} snin'
+ },
+
+ almostXYears: {
+ one: 'kważi sena',
+ two: 'kważi sentejn',
+ other: 'kważi {{count}} snin'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ var adverb = token.match(/years/i)
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else if (count === 2 && adverb) {
+ result = formatDistanceLocale[token].two
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return "f'" + result
+ } else {
+ return result + ' ilu'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/mt/_lib/formatLong/index.js b/date-fns/src/locale/mt/_lib/formatLong/index.js
new file mode 100644
index 0000000..4547713
--- /dev/null
+++ b/date-fns/src/locale/mt/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/mt/_lib/formatRelative/index.js b/date-fns/src/locale/mt/_lib/formatRelative/index.js
new file mode 100644
index 0000000..82f0aee
--- /dev/null
+++ b/date-fns/src/locale/mt/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'li għadda' 'fil-'p",
+ yesterday: "'Il-bieraħ fil-'p",
+ today: "'Illum fil-'p",
+ tomorrow: "'Għada fil-'p",
+ nextWeek: "eeee 'fil-'p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/mt/_lib/localize/index.js b/date-fns/src/locale/mt/_lib/localize/index.js
new file mode 100644
index 0000000..8b29870
--- /dev/null
+++ b/date-fns/src/locale/mt/_lib/localize/index.js
@@ -0,0 +1,167 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['Q', 'W'],
+ abbreviated: ['QK', 'WK'],
+ wide: ['qabel Kristu', 'wara Kristu']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['1. kwart', '2. kwart', '3. kwart', '4. kwart']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'Ġ', 'L', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Fra',
+ 'Mar',
+ 'Apr',
+ 'Mej',
+ 'Ġun',
+ 'Lul',
+ 'Aww',
+ 'Set',
+ 'Ott',
+ 'Nov',
+ 'Diċ'
+ ],
+ wide: [
+ 'Jannar',
+ 'Frar',
+ 'Marzu',
+ 'April',
+ 'Mejju',
+ 'Ġunju',
+ 'Lulju',
+ 'Awwissu',
+ 'Settembru',
+ 'Ottubru',
+ 'Novembru',
+ 'Diċembru'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Ħ', 'T', 'T', 'E', 'Ħ', 'Ġ', 'S'],
+ short: ['Ħa', 'Tn', 'Tl', 'Er', 'Ħa', 'Ġi', 'Si'],
+ abbreviated: ['Ħad', 'Tne', 'Tli', 'Erb', 'Ħam', 'Ġim', 'Sib'],
+ wide: [
+ 'Il-Ħadd',
+ 'It-Tnejn',
+ 'It-Tlieta',
+ 'L-Erbgħa',
+ 'Il-Ħamis',
+ 'Il-Ġimgħa',
+ 'Is-Sibt'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'nofsillejl',
+ noon: 'nofsinhar',
+ morning: 'għodwa',
+ afternoon: 'wara nofsinhar',
+ evening: 'filgħaxija',
+ night: 'lejl'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'nofsillejl',
+ noon: 'nofsinhar',
+ morning: 'għodwa',
+ afternoon: 'wara nofsinhar',
+ evening: 'filgħaxija',
+ night: 'lejl'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'nofsillejl',
+ noon: 'nofsinhar',
+ morning: 'għodwa',
+ afternoon: 'wara nofsinhar',
+ evening: 'filgħaxija',
+ night: 'lejl'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: "f'nofsillejl",
+ noon: "f'nofsinhar",
+ morning: 'filgħodu',
+ afternoon: 'wara nofsinhar',
+ evening: 'filgħaxija',
+ night: 'billejl'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: "f'nofsillejl",
+ noon: "f'nofsinhar",
+ morning: 'filgħodu',
+ afternoon: 'wara nofsinhar',
+ evening: 'filgħaxija',
+ night: 'billejl'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: "f'nofsillejl",
+ noon: "f'nofsinhar",
+ morning: 'filgħodu',
+ afternoon: 'wara nofsinhar',
+ evening: 'filgħaxija',
+ night: 'billejl'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + 'º'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/mt/_lib/match/index.js b/date-fns/src/locale/mt/_lib/match/index.js
new file mode 100644
index 0000000..5f5c881
--- /dev/null
+++ b/date-fns/src/locale/mt/_lib/match/index.js
@@ -0,0 +1,145 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(º)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(q|w)/i,
+ abbreviated: /^(q\.?\s?k\.?|b\.?\s?c\.?\s?e\.?|w\.?\s?k\.?)/i,
+ wide: /^(qabel kristu|before common era|wara kristu|common era)/i
+}
+var parseEraPatterns = {
+ any: [/^(q|b)/i, /^(w|c)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^k[1234]/i,
+ wide: /^[1234](\.)? kwart/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmaglsond]/i,
+ abbreviated: /^(jan|fra|mar|apr|mej|ġun|lul|aww|set|ott|nov|diċ)/i,
+ wide: /^(jannar|frar|marzu|april|mejju|ġunju|lulju|awwissu|settembru|ottubru|novembru|diċembru)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^ġ/i,
+ /^l/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^mej/i,
+ /^ġ/i,
+ /^l/i,
+ /^aw/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[ħteġs]/i,
+ short: /^(ħa|tn|tl|er|ħa|ġi|si)/i,
+ abbreviated: /^(ħad|tne|tli|erb|ħam|ġim|sib)/i,
+ wide: /^(il-ħadd|it-tnejn|it-tlieta|l-erbgħa|il-ħamis|il-ġimgħa|is-sibt)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ħ/i, /^t/i, /^t/i, /^e/i, /^ħ/i, /^ġ/i, /^s/i],
+ any: [
+ /^(il-)?ħad/i,
+ /^(it-)?tn/i,
+ /^(it-)?tl/i,
+ /^(l-)?er/i,
+ /^(il-)?ham/i,
+ /^(il-)?ġi/i,
+ /^(is-)?si/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|f'nofsillejl|f'nofsinhar|(ta') (għodwa|wara nofsinhar|filgħaxija|lejl))/i,
+ any: /^([ap]\.?\s?m\.?|f'nofsillejl|f'nofsinhar|(ta') (għodwa|wara nofsinhar|filgħaxija|lejl))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^f'nofsillejl/i,
+ noon: /^f'nofsinhar/i,
+ morning: /għodwa/i,
+ afternoon: /wara(\s.*)nofsinhar/i,
+ evening: /filgħaxija/i,
+ night: /lejl/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/mt/index.d.ts b/date-fns/src/locale/mt/index.d.ts
new file mode 100644
index 0000000..a845625
--- /dev/null
+++ b/date-fns/src/locale/mt/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { mt } from 'date-fns/locale'
+export default mt
diff --git a/date-fns/src/locale/mt/index.js b/date-fns/src/locale/mt/index.js
new file mode 100644
index 0000000..2a162d6
--- /dev/null
+++ b/date-fns/src/locale/mt/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Maltese locale.
+ * @language Maltese
+ * @iso-639-2 mlt
+ * @author Andras Matzon [@amatzon](@link https://github.com/amatzon)
+ * @author Bryan Borg [@bryanMt](@link https://github.com/bryanMt)
+ */
+var locale = {
+ code: 'mt',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/mt/index.js.flow b/date-fns/src/locale/mt/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/mt/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/mt/snapshot.md b/date-fns/src/locale/mt/snapshot.md
new file mode 100644
index 0000000..1055dc9
--- /dev/null
+++ b/date-fns/src/locale/mt/snapshot.md
@@ -0,0 +1,304 @@
+# Maltese (mt) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987º | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987º | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4º | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kwart | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kwart | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kwart | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kwart | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Fra | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Lul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Frar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Lulju | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | L | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Fra | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Lul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Frar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Lulju | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | L | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28º | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42º | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365º | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Tne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġim | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Tne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġim | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Tne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġim | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | It-Tnejn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Il-Ġimgħa | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | T | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġ | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Tn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġi | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Tne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġim | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | It-Tnejn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Il-Ġimgħa | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | T | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġ | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Tn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġi | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Tne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġim | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | It-Tnejn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Il-Ġimgħa | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | T | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġ | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Tn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġi | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Tne | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġim | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | It-Tnejn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Il-Ġimgħa | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | T | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġ | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Tn | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ġi | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | filgħodu | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | wara nofsinhar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | filgħaxija | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | billejl | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | filgħodu | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | wara nofsinhar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | filgħaxija | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | billejl | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | filgħodu | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | wara nofsinhar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | filgħaxija | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | billejl | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | filgħodu | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | wara nofsinhar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | filgħaxija | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | billejl | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | filgħodu | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | wara nofsinhar | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | filgħaxija | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | billejl | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1º | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55º | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1º | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55º | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Fra 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mej 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Frar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mejju 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | L-Erbgħa, 11 Frar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Il-Ħadd, 29 Mejju 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Fra 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mej 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Frar 1987 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 Mejju 1453 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | L-Erbgħa, 11 Frar 1987 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Il-Ħadd, 29 Mejju 1453 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | madwar 6 snin | madwar 6 snin | f'madwar 6 snin |
+| 2005-01-01T00:00:00.000Z | madwar 5 snin | madwar 5 snin | f'madwar 5 snin |
+| 2004-01-01T00:00:00.000Z | madwar 4 snin | madwar 4 snin | f'madwar 4 snin |
+| 2003-01-01T00:00:00.000Z | madwar 3 snin | madwar 3 snin | f'madwar 3 snin |
+| 2002-01-01T00:00:00.000Z | madwar sentejn | madwar sentejn | f'madwar sentejn |
+| 2001-06-01T00:00:00.000Z | aktar minn sena | aktar minn sena | f'aktar minn sena |
+| 2001-02-01T00:00:00.000Z | madwar sena | madwar sena | f'madwar sena |
+| 2001-01-01T00:00:00.000Z | madwar sena | madwar sena | f'madwar sena |
+| 2000-06-01T00:00:00.000Z | 5 xhur | 5 xhur | f'5 xhur |
+| 2000-03-01T00:00:00.000Z | 2 xhur | 2 xhur | f'2 xhur |
+| 2000-02-01T00:00:00.000Z | madwar xahar | madwar xahar | f'madwar xahar |
+| 2000-01-15T00:00:00.000Z | 14 ġranet | 14 ġranet | f'14 ġranet |
+| 2000-01-02T00:00:00.000Z | ġurnata | ġurnata | f'ġurnata |
+| 2000-01-01T06:00:00.000Z | madwar 6 siegħat | madwar 6 siegħat | f'madwar 6 siegħat |
+| 2000-01-01T01:00:00.000Z | madwar siegħa | madwar siegħa | f'madwar siegħa |
+| 2000-01-01T00:45:00.000Z | madwar siegħa | madwar siegħa | f'madwar siegħa |
+| 2000-01-01T00:30:00.000Z | 30 minuti | 30 minuti | f'30 minuti |
+| 2000-01-01T00:15:00.000Z | 15 minuti | 15 minuti | f'15 minuti |
+| 2000-01-01T00:01:00.000Z | minuta | minuta | f'minuta |
+| 2000-01-01T00:00:25.000Z | inqas minn minuta | nofs minuta | f'inqas minn minuta |
+| 2000-01-01T00:00:15.000Z | inqas minn minuta | inqas minn 20 sekondi | f'inqas minn minuta |
+| 2000-01-01T00:00:05.000Z | inqas minn minuta | inqas minn 10 sekondi | f'inqas minn minuta |
+| 2000-01-01T00:00:00.000Z | inqas minn minuta | inqas minn 5 sekondi | inqas minn minuta ilu |
+| 1999-12-31T23:59:55.000Z | inqas minn minuta | inqas minn 10 sekondi | inqas minn minuta ilu |
+| 1999-12-31T23:59:45.000Z | inqas minn minuta | inqas minn 20 sekondi | inqas minn minuta ilu |
+| 1999-12-31T23:59:35.000Z | inqas minn minuta | nofs minuta | inqas minn minuta ilu |
+| 1999-12-31T23:59:00.000Z | minuta | minuta | minuta ilu |
+| 1999-12-31T23:45:00.000Z | 15 minuti | 15 minuti | 15 minuti ilu |
+| 1999-12-31T23:30:00.000Z | 30 minuti | 30 minuti | 30 minuti ilu |
+| 1999-12-31T23:15:00.000Z | madwar siegħa | madwar siegħa | madwar siegħa ilu |
+| 1999-12-31T23:00:00.000Z | madwar siegħa | madwar siegħa | madwar siegħa ilu |
+| 1999-12-31T18:00:00.000Z | madwar 6 siegħat | madwar 6 siegħat | madwar 6 siegħat ilu |
+| 1999-12-30T00:00:00.000Z | 2 ġranet | 2 ġranet | 2 ġranet ilu |
+| 1999-12-15T00:00:00.000Z | 17 ġranet | 17 ġranet | 17 ġranet ilu |
+| 1999-12-01T00:00:00.000Z | madwar xahar | madwar xahar | madwar xahar ilu |
+| 1999-11-01T00:00:00.000Z | 2 xhur | 2 xhur | 2 xhur ilu |
+| 1999-06-01T00:00:00.000Z | 7 xhur | 7 xhur | 7 xhur ilu |
+| 1999-01-01T00:00:00.000Z | madwar sena | madwar sena | madwar sena ilu |
+| 1998-12-01T00:00:00.000Z | madwar sena | madwar sena | madwar sena ilu |
+| 1998-06-01T00:00:00.000Z | aktar minn sena | aktar minn sena | aktar minn sena ilu |
+| 1998-01-01T00:00:00.000Z | madwar sentejn | madwar sentejn | madwar sentejn ilu |
+| 1997-01-01T00:00:00.000Z | madwar 3 snin | madwar 3 snin | madwar 3 snin ilu |
+| 1996-01-01T00:00:00.000Z | madwar 4 snin | madwar 4 snin | madwar 4 snin ilu |
+| 1995-01-01T00:00:00.000Z | madwar 5 snin | madwar 5 snin | madwar 5 snin ilu |
+| 1994-01-01T00:00:00.000Z | madwar 6 snin | madwar 6 snin | madwar 6 snin ilu |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 snin | f'6 snin | 52608 siegħat |
+| 2005-01-01T00:00:00.000Z | 5 snin | f'5 snin | 43848 siegħat |
+| 2004-01-01T00:00:00.000Z | 4 snin | f'4 snin | 35064 siegħat |
+| 2003-01-01T00:00:00.000Z | 3 snin | f'3 snin | 26304 siegħat |
+| 2002-01-01T00:00:00.000Z | sentejn | f'sentejn | 17544 siegħat |
+| 2001-06-01T00:00:00.000Z | sena | f'sena | 12408 siegħat |
+| 2001-02-01T00:00:00.000Z | sena | f'sena | 9528 siegħat |
+| 2001-01-01T00:00:00.000Z | sena | f'sena | 8784 siegħat |
+| 2000-06-01T00:00:00.000Z | 5 xhur | f'5 xhur | 3648 siegħat |
+| 2000-03-01T00:00:00.000Z | 2 xhur | f'2 xhur | 1440 siegħat |
+| 2000-02-01T00:00:00.000Z | xahar | f'xahar | 744 siegħat |
+| 2000-01-15T00:00:00.000Z | 14 ġranet | f'14 ġranet | 336 siegħat |
+| 2000-01-02T00:00:00.000Z | ġurnata | f'ġurnata | 24 siegħat |
+| 2000-01-01T06:00:00.000Z | 6 siegħat | f'6 siegħat | 6 siegħat |
+| 2000-01-01T01:00:00.000Z | siegħa | f'siegħa | siegħa |
+| 2000-01-01T00:45:00.000Z | 45 minuti | f'45 minuti | siegħa |
+| 2000-01-01T00:30:00.000Z | 30 minuti | f'30 minuti | siegħa |
+| 2000-01-01T00:15:00.000Z | 15 minuti | f'15 minuti | 0 siegħat |
+| 2000-01-01T00:01:00.000Z | minuta | f'minuta | 0 siegħat |
+| 2000-01-01T00:00:25.000Z | 25 sekondi | f'25 sekondi | 0 siegħat |
+| 2000-01-01T00:00:15.000Z | 15 sekondi | f'15 sekondi | 0 siegħat |
+| 2000-01-01T00:00:05.000Z | 5 sekondi | f'5 sekondi | 0 siegħat |
+| 2000-01-01T00:00:00.000Z | 0 sekondi | 0 sekondi ilu | 0 siegħat |
+| 1999-12-31T23:59:55.000Z | 5 sekondi | 5 sekondi ilu | 0 siegħat |
+| 1999-12-31T23:59:45.000Z | 15 sekondi | 15 sekondi ilu | 0 siegħat |
+| 1999-12-31T23:59:35.000Z | 25 sekondi | 25 sekondi ilu | 0 siegħat |
+| 1999-12-31T23:59:00.000Z | minuta | minuta ilu | 0 siegħat |
+| 1999-12-31T23:45:00.000Z | 15 minuti | 15 minuti ilu | 0 siegħat |
+| 1999-12-31T23:30:00.000Z | 30 minuti | 30 minuti ilu | siegħa |
+| 1999-12-31T23:15:00.000Z | 45 minuti | 45 minuti ilu | siegħa |
+| 1999-12-31T23:00:00.000Z | siegħa | siegħa ilu | siegħa |
+| 1999-12-31T18:00:00.000Z | 6 siegħat | 6 siegħat ilu | 6 siegħat |
+| 1999-12-30T00:00:00.000Z | 2 ġranet | 2 ġranet ilu | 48 siegħat |
+| 1999-12-15T00:00:00.000Z | 17 ġranet | 17 ġranet ilu | 408 siegħat |
+| 1999-12-01T00:00:00.000Z | xahar | xahar ilu | 744 siegħat |
+| 1999-11-01T00:00:00.000Z | 2 xhur | 2 xhur ilu | 1464 siegħat |
+| 1999-06-01T00:00:00.000Z | 7 xhur | 7 xhur ilu | 5136 siegħat |
+| 1999-01-01T00:00:00.000Z | sena | sena ilu | 8760 siegħat |
+| 1998-12-01T00:00:00.000Z | sena | sena ilu | 9504 siegħat |
+| 1998-06-01T00:00:00.000Z | sentejn | sentejn ilu | 13896 siegħat |
+| 1998-01-01T00:00:00.000Z | sentejn | sentejn ilu | 17520 siegħat |
+| 1997-01-01T00:00:00.000Z | 3 snin | 3 snin ilu | 26280 siegħat |
+| 1996-01-01T00:00:00.000Z | 4 snin | 4 snin ilu | 35064 siegħat |
+| 1995-01-01T00:00:00.000Z | 5 snin | 5 snin ilu | 43824 siegħat |
+| 1994-01-01T00:00:00.000Z | 6 snin | 6 snin ilu | 52584 siegħat |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | L-Erbgħa fil-00:00 |
+| 2000-01-02T00:00:00.000Z | Għada fil-00:00 |
+| 2000-01-01T00:00:00.000Z | Illum fil-00:00 |
+| 1999-12-31T00:00:00.000Z | Il-bieraħ fil-00:00 |
+| 1999-12-27T00:00:00.000Z | It-Tnejn li għadda fil-00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/nb/_lib/formatDistance/index.js b/date-fns/src/locale/nb/_lib/formatDistance/index.js
new file mode 100644
index 0000000..79ef4f9
--- /dev/null
+++ b/date-fns/src/locale/nb/_lib/formatDistance/index.js
@@ -0,0 +1,127 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ singular: 'mindre enn ett sekund',
+ plural: 'mindre enn {{count}} sekunder'
+ },
+
+ xSeconds: {
+ singular: 'ett sekund',
+ plural: '{{count}} sekunder'
+ },
+
+ halfAMinute: 'et halvt minutt',
+
+ lessThanXMinutes: {
+ singular: 'mindre enn ett minutt',
+ plural: 'mindre enn {{count}} minutter'
+ },
+
+ xMinutes: {
+ singular: 'ett minutt',
+ plural: '{{count}} minutter'
+ },
+
+ aboutXHours: {
+ singular: 'omtrent en time',
+ plural: 'omtrent {{count}} timer'
+ },
+
+ xHours: {
+ singular: 'en time',
+ plural: '{{count}} timer'
+ },
+
+ xDays: {
+ singular: 'en dag',
+ plural: '{{count}} dager'
+ },
+
+ aboutXWeeks: {
+ singular: 'omtrent en uke',
+ plural: 'omtrent {{count}} uker'
+ },
+
+ xWeeks: {
+ singular: 'en uke',
+ plural: '{{count}} uker'
+ },
+
+ aboutXMonths: {
+ singular: 'omtrent en måned',
+ plural: 'omtrent {{count}} måneder'
+ },
+
+ xMonths: {
+ singular: 'en måned',
+ plural: '{{count}} måneder'
+ },
+
+ aboutXYears: {
+ singular: 'omtrent ett år',
+ plural: 'omtrent {{count}} år'
+ },
+
+ xYears: {
+ singular: 'ett år',
+ plural: '{{count}} år'
+ },
+
+ overXYears: {
+ singular: 'over ett år',
+ plural: 'over {{count}} år'
+ },
+
+ almostXYears: {
+ singular: 'nesten ett år',
+ plural: 'nesten {{count}} år'
+ }
+}
+
+var wordMapping = [
+ 'null',
+ 'en',
+ 'to',
+ 'tre',
+ 'fire',
+ 'fem',
+ 'seks',
+ 'sju',
+ 'åtte',
+ 'ni',
+ 'ti',
+ 'elleve',
+ 'tolv'
+]
+
+export default function formatDistance(token, count, options) {
+ options = options || {
+ onlyNumeric: false
+ }
+
+ var translation = formatDistanceLocale[token]
+ var result
+ if (typeof translation === 'string') {
+ result = translation
+ } else if (count === 0 || count > 1) {
+ if (options.onlyNumeric) {
+ result = translation.plural.replace('{{count}}', count)
+ } else {
+ result = translation.plural.replace(
+ '{{count}}',
+ count < 13 ? wordMapping[count] : count
+ )
+ }
+ } else {
+ result = translation.singular
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'om ' + result
+ } else {
+ return result + ' siden'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/nb/_lib/formatLong/index.js b/date-fns/src/locale/nb/_lib/formatLong/index.js
new file mode 100644
index 0000000..067f59e
--- /dev/null
+++ b/date-fns/src/locale/nb/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d. MMMM y',
+ long: 'd. MMMM y',
+ medium: 'd. MMM y',
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: "'kl'. HH:mm:ss zzzz",
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'kl.' {{time}}",
+ long: "{{date}} 'kl.' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/nb/_lib/formatRelative/index.js b/date-fns/src/locale/nb/_lib/formatRelative/index.js
new file mode 100644
index 0000000..3884132
--- /dev/null
+++ b/date-fns/src/locale/nb/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'forrige' eeee 'kl.' p",
+ yesterday: "'i går kl.' p",
+ today: "'i dag kl.' p",
+ tomorrow: "'i morgen kl.' p",
+ nextWeek: "EEEE 'kl.' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/nb/_lib/localize/index.js b/date-fns/src/locale/nb/_lib/localize/index.js
new file mode 100644
index 0000000..075f868
--- /dev/null
+++ b/date-fns/src/locale/nb/_lib/localize/index.js
@@ -0,0 +1,124 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['f.Kr.', 'e.Kr.'],
+ abbreviated: ['f.Kr.', 'e.Kr.'],
+ wide: ['før Kristus', 'etter Kristus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mars',
+ 'apr.',
+ 'mai',
+ 'juni',
+ 'juli',
+ 'aug.',
+ 'sep.',
+ 'okt.',
+ 'nov.',
+ 'des.'
+ ],
+ wide: [
+ 'januar',
+ 'februar',
+ 'mars',
+ 'april',
+ 'mai',
+ 'juni',
+ 'juli',
+ 'august',
+ 'september',
+ 'oktober',
+ 'november',
+ 'desember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'T', 'O', 'T', 'F', 'L'],
+ short: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'],
+ abbreviated: ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'],
+ wide: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morg.',
+ afternoon: 'på etterm.',
+ evening: 'på kvelden',
+ night: 'på natten'
+ },
+ abbreviated: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morg.',
+ afternoon: 'på etterm.',
+ evening: 'på kvelden',
+ night: 'på natten'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morgenen',
+ afternoon: 'på ettermiddagen',
+ evening: 'på kvelden',
+ night: 'på natten'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/nb/_lib/match/index.js b/date-fns/src/locale/nb/_lib/match/index.js
new file mode 100644
index 0000000..d0c00da
--- /dev/null
+++ b/date-fns/src/locale/nb/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\.?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
+ abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
+ wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i
+}
+var parseEraPatterns = {
+ any: [/^f/i, /^e/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](\.)? kvartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
+ wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^mai/i,
+ /^jun/i,
+ /^jul/i,
+ /^aug/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smtofl]/i,
+ short: /^(sø|ma|ti|on|to|fr|lø)/i,
+ abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
+ wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
+}
+var parseDayPatterns = {
+ any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,
+ any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a(\.?\s?m\.?)?$/i,
+ pm: /^p(\.?\s?m\.?)?$/i,
+ midnight: /^midn/i,
+ noon: /^midd/i,
+ morning: /morgen/i,
+ afternoon: /ettermiddag/i,
+ evening: /kveld/i,
+ night: /natt/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/nb/index.d.ts b/date-fns/src/locale/nb/index.d.ts
new file mode 100644
index 0000000..75c06bb
--- /dev/null
+++ b/date-fns/src/locale/nb/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nb } from 'date-fns/locale'
+export default nb
diff --git a/date-fns/src/locale/nb/index.js b/date-fns/src/locale/nb/index.js
new file mode 100644
index 0000000..2f6c68a
--- /dev/null
+++ b/date-fns/src/locale/nb/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Norwegian Bokmål locale.
+ * @language Norwegian Bokmål
+ * @iso-639-2 nob
+ * @author Hans-Kristian Koren [@Hanse]{@link https://github.com/Hanse}
+ * @author Mikolaj Grzyb [@mikolajgrzyb]{@link https://github.com/mikolajgrzyb}
+ * @author Dag Stuan [@dagstuan]{@link https://github.com/dagstuan}
+ */
+var locale = {
+ code: 'nb',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/nb/index.js.flow b/date-fns/src/locale/nb/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/nb/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/nb/snapshot.md b/date-fns/src/locale/nb/snapshot.md
new file mode 100644
index 0000000..09b0da9
--- /dev/null
+++ b/date-fns/src/locale/nb/snapshot.md
@@ -0,0 +1,304 @@
+# Norwegian Bokmål (nb) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | man | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | man | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | man | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | man | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | man | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | man | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | mandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | på morgenen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | på ettermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | onsdag 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | søndag 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | kl. 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. feb. 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. februar 1987 kl. 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 kl. 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | onsdag 11. februar 1987 kl. kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | søndag 29. mai 1453 kl. kl. 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------- | ----------------------- | --------------------------- |
+| 2006-01-01T00:00:00.000Z | omtrent seks år | omtrent seks år | om omtrent seks år |
+| 2005-01-01T00:00:00.000Z | omtrent fem år | omtrent fem år | om omtrent fem år |
+| 2004-01-01T00:00:00.000Z | omtrent fire år | omtrent fire år | om omtrent fire år |
+| 2003-01-01T00:00:00.000Z | omtrent tre år | omtrent tre år | om omtrent tre år |
+| 2002-01-01T00:00:00.000Z | omtrent to år | omtrent to år | om omtrent to år |
+| 2001-06-01T00:00:00.000Z | over ett år | over ett år | om over ett år |
+| 2001-02-01T00:00:00.000Z | omtrent ett år | omtrent ett år | om omtrent ett år |
+| 2001-01-01T00:00:00.000Z | omtrent ett år | omtrent ett år | om omtrent ett år |
+| 2000-06-01T00:00:00.000Z | fem måneder | fem måneder | om fem måneder |
+| 2000-03-01T00:00:00.000Z | to måneder | to måneder | om to måneder |
+| 2000-02-01T00:00:00.000Z | omtrent en måned | omtrent en måned | om omtrent en måned |
+| 2000-01-15T00:00:00.000Z | 14 dager | 14 dager | om 14 dager |
+| 2000-01-02T00:00:00.000Z | en dag | en dag | om en dag |
+| 2000-01-01T06:00:00.000Z | omtrent seks timer | omtrent seks timer | om omtrent seks timer |
+| 2000-01-01T01:00:00.000Z | omtrent en time | omtrent en time | om omtrent en time |
+| 2000-01-01T00:45:00.000Z | omtrent en time | omtrent en time | om omtrent en time |
+| 2000-01-01T00:30:00.000Z | 30 minutter | 30 minutter | om 30 minutter |
+| 2000-01-01T00:15:00.000Z | 15 minutter | 15 minutter | om 15 minutter |
+| 2000-01-01T00:01:00.000Z | ett minutt | ett minutt | om ett minutt |
+| 2000-01-01T00:00:25.000Z | mindre enn ett minutt | et halvt minutt | om mindre enn ett minutt |
+| 2000-01-01T00:00:15.000Z | mindre enn ett minutt | mindre enn 20 sekunder | om mindre enn ett minutt |
+| 2000-01-01T00:00:05.000Z | mindre enn ett minutt | mindre enn ti sekunder | om mindre enn ett minutt |
+| 2000-01-01T00:00:00.000Z | mindre enn ett minutt | mindre enn fem sekunder | mindre enn ett minutt siden |
+| 1999-12-31T23:59:55.000Z | mindre enn ett minutt | mindre enn ti sekunder | mindre enn ett minutt siden |
+| 1999-12-31T23:59:45.000Z | mindre enn ett minutt | mindre enn 20 sekunder | mindre enn ett minutt siden |
+| 1999-12-31T23:59:35.000Z | mindre enn ett minutt | et halvt minutt | mindre enn ett minutt siden |
+| 1999-12-31T23:59:00.000Z | ett minutt | ett minutt | ett minutt siden |
+| 1999-12-31T23:45:00.000Z | 15 minutter | 15 minutter | 15 minutter siden |
+| 1999-12-31T23:30:00.000Z | 30 minutter | 30 minutter | 30 minutter siden |
+| 1999-12-31T23:15:00.000Z | omtrent en time | omtrent en time | omtrent en time siden |
+| 1999-12-31T23:00:00.000Z | omtrent en time | omtrent en time | omtrent en time siden |
+| 1999-12-31T18:00:00.000Z | omtrent seks timer | omtrent seks timer | omtrent seks timer siden |
+| 1999-12-30T00:00:00.000Z | to dager | to dager | to dager siden |
+| 1999-12-15T00:00:00.000Z | 17 dager | 17 dager | 17 dager siden |
+| 1999-12-01T00:00:00.000Z | omtrent en måned | omtrent en måned | omtrent en måned siden |
+| 1999-11-01T00:00:00.000Z | to måneder | to måneder | to måneder siden |
+| 1999-06-01T00:00:00.000Z | sju måneder | sju måneder | sju måneder siden |
+| 1999-01-01T00:00:00.000Z | omtrent ett år | omtrent ett år | omtrent ett år siden |
+| 1998-12-01T00:00:00.000Z | omtrent ett år | omtrent ett år | omtrent ett år siden |
+| 1998-06-01T00:00:00.000Z | over ett år | over ett år | over ett år siden |
+| 1998-01-01T00:00:00.000Z | omtrent to år | omtrent to år | omtrent to år siden |
+| 1997-01-01T00:00:00.000Z | omtrent tre år | omtrent tre år | omtrent tre år siden |
+| 1996-01-01T00:00:00.000Z | omtrent fire år | omtrent fire år | omtrent fire år siden |
+| 1995-01-01T00:00:00.000Z | omtrent fem år | omtrent fem år | omtrent fem år siden |
+| 1994-01-01T00:00:00.000Z | omtrent seks år | omtrent seks år | omtrent seks år siden |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | seks år | om seks år | 52608 timer |
+| 2005-01-01T00:00:00.000Z | fem år | om fem år | 43848 timer |
+| 2004-01-01T00:00:00.000Z | fire år | om fire år | 35064 timer |
+| 2003-01-01T00:00:00.000Z | tre år | om tre år | 26304 timer |
+| 2002-01-01T00:00:00.000Z | to år | om to år | 17544 timer |
+| 2001-06-01T00:00:00.000Z | ett år | om ett år | 12408 timer |
+| 2001-02-01T00:00:00.000Z | ett år | om ett år | 9528 timer |
+| 2001-01-01T00:00:00.000Z | ett år | om ett år | 8784 timer |
+| 2000-06-01T00:00:00.000Z | fem måneder | om fem måneder | 3648 timer |
+| 2000-03-01T00:00:00.000Z | to måneder | om to måneder | 1440 timer |
+| 2000-02-01T00:00:00.000Z | en måned | om en måned | 744 timer |
+| 2000-01-15T00:00:00.000Z | 14 dager | om 14 dager | 336 timer |
+| 2000-01-02T00:00:00.000Z | en dag | om en dag | 24 timer |
+| 2000-01-01T06:00:00.000Z | seks timer | om seks timer | seks timer |
+| 2000-01-01T01:00:00.000Z | en time | om en time | en time |
+| 2000-01-01T00:45:00.000Z | 45 minutter | om 45 minutter | en time |
+| 2000-01-01T00:30:00.000Z | 30 minutter | om 30 minutter | en time |
+| 2000-01-01T00:15:00.000Z | 15 minutter | om 15 minutter | null timer |
+| 2000-01-01T00:01:00.000Z | ett minutt | om ett minutt | null timer |
+| 2000-01-01T00:00:25.000Z | 25 sekunder | om 25 sekunder | null timer |
+| 2000-01-01T00:00:15.000Z | 15 sekunder | om 15 sekunder | null timer |
+| 2000-01-01T00:00:05.000Z | fem sekunder | om fem sekunder | null timer |
+| 2000-01-01T00:00:00.000Z | null sekunder | null sekunder siden | null timer |
+| 1999-12-31T23:59:55.000Z | fem sekunder | fem sekunder siden | null timer |
+| 1999-12-31T23:59:45.000Z | 15 sekunder | 15 sekunder siden | null timer |
+| 1999-12-31T23:59:35.000Z | 25 sekunder | 25 sekunder siden | null timer |
+| 1999-12-31T23:59:00.000Z | ett minutt | ett minutt siden | null timer |
+| 1999-12-31T23:45:00.000Z | 15 minutter | 15 minutter siden | null timer |
+| 1999-12-31T23:30:00.000Z | 30 minutter | 30 minutter siden | en time |
+| 1999-12-31T23:15:00.000Z | 45 minutter | 45 minutter siden | en time |
+| 1999-12-31T23:00:00.000Z | en time | en time siden | en time |
+| 1999-12-31T18:00:00.000Z | seks timer | seks timer siden | seks timer |
+| 1999-12-30T00:00:00.000Z | to dager | to dager siden | 48 timer |
+| 1999-12-15T00:00:00.000Z | 17 dager | 17 dager siden | 408 timer |
+| 1999-12-01T00:00:00.000Z | en måned | en måned siden | 744 timer |
+| 1999-11-01T00:00:00.000Z | to måneder | to måneder siden | 1464 timer |
+| 1999-06-01T00:00:00.000Z | sju måneder | sju måneder siden | 5136 timer |
+| 1999-01-01T00:00:00.000Z | ett år | ett år siden | 8760 timer |
+| 1998-12-01T00:00:00.000Z | ett år | ett år siden | 9504 timer |
+| 1998-06-01T00:00:00.000Z | to år | to år siden | 13896 timer |
+| 1998-01-01T00:00:00.000Z | to år | to år siden | 17520 timer |
+| 1997-01-01T00:00:00.000Z | tre år | tre år siden | 26280 timer |
+| 1996-01-01T00:00:00.000Z | fire år | fire år siden | 35064 timer |
+| 1995-01-01T00:00:00.000Z | fem år | fem år siden | 43824 timer |
+| 1994-01-01T00:00:00.000Z | seks år | seks år siden | 52584 timer |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | onsdag kl. 00:00 |
+| 2000-01-02T00:00:00.000Z | i morgen kl. 00:00 |
+| 2000-01-01T00:00:00.000Z | i dag kl. 00:00 |
+| 1999-12-31T00:00:00.000Z | i går kl. 00:00 |
+| 1999-12-27T00:00:00.000Z | forrige mandag kl. 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/nl-BE/_lib/formatDistance/index.js b/date-fns/src/locale/nl-BE/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e5fafde
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/_lib/formatDistance/index.js
@@ -0,0 +1,86 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'minder dan een seconde',
+ other: 'minder dan {{count}} seconden'
+ },
+ xSeconds: {
+ one: '1 seconde',
+ other: '{{count}} seconden'
+ },
+ halfAMinute: 'een halve minuut',
+ lessThanXMinutes: {
+ one: 'minder dan een minuut',
+ other: 'minder dan {{count}} minuten'
+ },
+ xMinutes: {
+ one: 'een minuut',
+ other: '{{count}} minuten'
+ },
+ aboutXHours: {
+ one: 'ongeveer 1 uur',
+ other: 'ongeveer {{count}} uur'
+ },
+ xHours: {
+ one: '1 uur',
+ other: '{{count}} uur'
+ },
+ xDays: {
+ one: '1 dag',
+ other: '{{count}} dagen'
+ },
+ aboutXWeeks: {
+ one: 'ongeveer 1 week',
+ other: 'ongeveer {{count}} weken'
+ },
+ xWeeks: {
+ one: '1 week',
+ other: '{{count}} weken'
+ },
+ aboutXMonths: {
+ one: 'ongeveer 1 maand',
+ other: 'ongeveer {{count}} maanden'
+ },
+ xMonths: {
+ one: '1 maand',
+ other: '{{count}} maanden'
+ },
+ aboutXYears: {
+ one: 'ongeveer 1 jaar',
+ other: 'ongeveer {{count}} jaar'
+ },
+ xYears: {
+ one: '1 jaar',
+ other: '{{count}} jaar'
+ },
+ overXYears: {
+ one: 'meer dan 1 jaar',
+ other: 'meer dan {{count}} jaar'
+ },
+ almostXYears: {
+ one: 'bijna 1 jaar',
+ other: 'bijna {{count}} jaar'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'over ' + result
+ } else {
+ return result + ' geleden'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/nl-BE/_lib/formatLong/index.js b/date-fns/src/locale/nl-BE/_lib/formatLong/index.js
new file mode 100644
index 0000000..2b6cb47
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'dd-MM-y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'om' {{time}}",
+ long: "{{date}} 'om' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/nl-BE/_lib/formatRelative/index.js b/date-fns/src/locale/nl-BE/_lib/formatRelative/index.js
new file mode 100644
index 0000000..4b6db42
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'vorige' eeee 'om' p",
+ yesterday: "'gisteren om' p",
+ today: "'vandaag om' p",
+ tomorrow: "'morgen om' p",
+ nextWeek: "eeee 'om' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/nl-BE/_lib/localize/index.js b/date-fns/src/locale/nl-BE/_lib/localize/index.js
new file mode 100644
index 0000000..ce52b6e
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/_lib/localize/index.js
@@ -0,0 +1,132 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['v.C.', 'n.C.'],
+ abbreviated: ['v.Chr.', 'n.Chr.'],
+ wide: ['voor Christus', 'na Christus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['1e kwartaal', '2e kwartaal', '3e kwartaal', '4e kwartaal']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mrt.',
+ 'apr.',
+ 'mei',
+ 'jun.',
+ 'jul.',
+ 'aug.',
+ 'sep.',
+ 'okt.',
+ 'nov.',
+ 'dec.'
+ ],
+ wide: [
+ 'januari',
+ 'februari',
+ 'maart',
+ 'april',
+ 'mei',
+ 'juni',
+ 'juli',
+ 'augustus',
+ 'september',
+ 'oktober',
+ 'november',
+ 'december'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Z', 'M', 'D', 'W', 'D', 'V', 'Z'],
+ short: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
+ abbreviated: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
+ wide: [
+ 'zondag',
+ 'maandag',
+ 'dinsdag',
+ 'woensdag',
+ 'donderdag',
+ 'vrijdag',
+ 'zaterdag'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'middernacht',
+ noon: 'het middag',
+ morning: "'s ochtends",
+ afternoon: "'s namiddags",
+ evening: "'s avonds",
+ night: "'s nachts"
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'middernacht',
+ noon: 'het middag',
+ morning: "'s ochtends",
+ afternoon: "'s namiddags",
+ evening: "'s avonds",
+ night: "'s nachts"
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'middernacht',
+ noon: 'het middag',
+ morning: "'s ochtends",
+ afternoon: "'s namiddags",
+ evening: "'s avonds",
+ night: "'s nachts"
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + 'e'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/nl-BE/_lib/match/index.js b/date-fns/src/locale/nl-BE/_lib/match/index.js
new file mode 100644
index 0000000..cbc7bce
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)e?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^([vn]\.? ?C\.?)/,
+ abbreviated: /^([vn]\. ?Chr\.?)/,
+ wide: /^((voor|na) Christus)/
+}
+var parseEraPatterns = {
+ any: [/^v/, /^n/]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^K[1234]/i,
+ wide: /^[1234]e kwartaal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
+ wide: /^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^jan/i,
+ /^feb/i,
+ /^m(r|a)/i,
+ /^apr/i,
+ /^mei/i,
+ /^jun/i,
+ /^jul/i,
+ /^aug/i,
+ /^sep/i,
+ /^okt/i,
+ /^nov/i,
+ /^dec/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[zmdwv]/i,
+ short: /^(zo|ma|di|wo|do|vr|za)/i,
+ abbreviated: /^(zon|maa|din|woe|don|vri|zat)/i,
+ wide: /^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i
+}
+var parseDayPatterns = {
+ narrow: [/^z/i, /^m/i, /^d/i, /^w/i, /^d/i, /^v/i, /^z/i],
+ any: [/^zo/i, /^ma/i, /^di/i, /^wo/i, /^do/i, /^vr/i, /^za/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^am/i,
+ pm: /^pm/i,
+ midnight: /^middernacht/i,
+ noon: /^het middaguur/i,
+ morning: /ochtend/i,
+ afternoon: /middag/i,
+ evening: /avond/i,
+ night: /nacht/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/nl-BE/index.d.ts b/date-fns/src/locale/nl-BE/index.d.ts
new file mode 100644
index 0000000..c2970a4
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nlBE } from 'date-fns/locale'
+export default nlBE
diff --git a/date-fns/src/locale/nl-BE/index.js b/date-fns/src/locale/nl-BE/index.js
new file mode 100644
index 0000000..787115d
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/index.js
@@ -0,0 +1,31 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Dutch locale.
+ * @language Dutch
+ * @iso-639-2 nld
+ * @author Jorik Tangelder [@jtangelder]{@link https://github.com/jtangelder}
+ * @author Ruben Stolk [@rubenstolk]{@link https://github.com/rubenstolk}
+ * @author Lode Vanhove [@bitcrumb]{@link https://github.com/bitcrumb}
+ * @author Alex Hoeing [@dcbn]{@link https://github.com/dcbn}
+ */
+var locale = {
+ code: 'nl-BE',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/nl-BE/index.js.flow b/date-fns/src/locale/nl-BE/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/nl-BE/snapshot.md b/date-fns/src/locale/nl-BE/snapshot.md
new file mode 100644
index 0000000..83abbca
--- /dev/null
+++ b/date-fns/src/locale/nl-BE/snapshot.md
@@ -0,0 +1,304 @@
+# Dutch (nl-BE) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987e | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5e | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987e | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4e | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1e | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1e kwartaal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e kwartaal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1e | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1e kwartaal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e kwartaal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2e | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7e | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2e | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7e | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1e | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48e | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1e | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48e | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28e | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42e | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365e | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5e | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5e | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5e | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's namiddags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's namiddags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's namiddags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's namiddags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's namiddags | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11e | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23e | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11e | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23e | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1e | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55e | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1e | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55e | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11-02-1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-05-1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | woensdag 11 februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | zondag 29 mei 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11-02-1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-05-1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 feb. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 februari 1987 om 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453 om 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | woensdag 11 februari 1987 om 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | zondag 29 mei 1453 om 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------- | ---------------------- | ----------------------------- |
+| 2006-01-01T00:00:00.000Z | ongeveer 6 jaar | ongeveer 6 jaar | over ongeveer 6 jaar |
+| 2005-01-01T00:00:00.000Z | ongeveer 5 jaar | ongeveer 5 jaar | over ongeveer 5 jaar |
+| 2004-01-01T00:00:00.000Z | ongeveer 4 jaar | ongeveer 4 jaar | over ongeveer 4 jaar |
+| 2003-01-01T00:00:00.000Z | ongeveer 3 jaar | ongeveer 3 jaar | over ongeveer 3 jaar |
+| 2002-01-01T00:00:00.000Z | ongeveer 2 jaar | ongeveer 2 jaar | over ongeveer 2 jaar |
+| 2001-06-01T00:00:00.000Z | meer dan 1 jaar | meer dan 1 jaar | over meer dan 1 jaar |
+| 2001-02-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | over ongeveer 1 jaar |
+| 2001-01-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | over ongeveer 1 jaar |
+| 2000-06-01T00:00:00.000Z | 5 maanden | 5 maanden | over 5 maanden |
+| 2000-03-01T00:00:00.000Z | 2 maanden | 2 maanden | over 2 maanden |
+| 2000-02-01T00:00:00.000Z | ongeveer 1 maand | ongeveer 1 maand | over ongeveer 1 maand |
+| 2000-01-15T00:00:00.000Z | 14 dagen | 14 dagen | over 14 dagen |
+| 2000-01-02T00:00:00.000Z | 1 dag | 1 dag | over 1 dag |
+| 2000-01-01T06:00:00.000Z | ongeveer 6 uur | ongeveer 6 uur | over ongeveer 6 uur |
+| 2000-01-01T01:00:00.000Z | ongeveer 1 uur | ongeveer 1 uur | over ongeveer 1 uur |
+| 2000-01-01T00:45:00.000Z | ongeveer 1 uur | ongeveer 1 uur | over ongeveer 1 uur |
+| 2000-01-01T00:30:00.000Z | 30 minuten | 30 minuten | over 30 minuten |
+| 2000-01-01T00:15:00.000Z | 15 minuten | 15 minuten | over 15 minuten |
+| 2000-01-01T00:01:00.000Z | een minuut | een minuut | over een minuut |
+| 2000-01-01T00:00:25.000Z | minder dan een minuut | een halve minuut | over minder dan een minuut |
+| 2000-01-01T00:00:15.000Z | minder dan een minuut | minder dan 20 seconden | over minder dan een minuut |
+| 2000-01-01T00:00:05.000Z | minder dan een minuut | minder dan 10 seconden | over minder dan een minuut |
+| 2000-01-01T00:00:00.000Z | minder dan een minuut | minder dan 5 seconden | minder dan een minuut geleden |
+| 1999-12-31T23:59:55.000Z | minder dan een minuut | minder dan 10 seconden | minder dan een minuut geleden |
+| 1999-12-31T23:59:45.000Z | minder dan een minuut | minder dan 20 seconden | minder dan een minuut geleden |
+| 1999-12-31T23:59:35.000Z | minder dan een minuut | een halve minuut | minder dan een minuut geleden |
+| 1999-12-31T23:59:00.000Z | een minuut | een minuut | een minuut geleden |
+| 1999-12-31T23:45:00.000Z | 15 minuten | 15 minuten | 15 minuten geleden |
+| 1999-12-31T23:30:00.000Z | 30 minuten | 30 minuten | 30 minuten geleden |
+| 1999-12-31T23:15:00.000Z | ongeveer 1 uur | ongeveer 1 uur | ongeveer 1 uur geleden |
+| 1999-12-31T23:00:00.000Z | ongeveer 1 uur | ongeveer 1 uur | ongeveer 1 uur geleden |
+| 1999-12-31T18:00:00.000Z | ongeveer 6 uur | ongeveer 6 uur | ongeveer 6 uur geleden |
+| 1999-12-30T00:00:00.000Z | 2 dagen | 2 dagen | 2 dagen geleden |
+| 1999-12-15T00:00:00.000Z | 17 dagen | 17 dagen | 17 dagen geleden |
+| 1999-12-01T00:00:00.000Z | ongeveer 1 maand | ongeveer 1 maand | ongeveer 1 maand geleden |
+| 1999-11-01T00:00:00.000Z | 2 maanden | 2 maanden | 2 maanden geleden |
+| 1999-06-01T00:00:00.000Z | 7 maanden | 7 maanden | 7 maanden geleden |
+| 1999-01-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | ongeveer 1 jaar geleden |
+| 1998-12-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | ongeveer 1 jaar geleden |
+| 1998-06-01T00:00:00.000Z | meer dan 1 jaar | meer dan 1 jaar | meer dan 1 jaar geleden |
+| 1998-01-01T00:00:00.000Z | ongeveer 2 jaar | ongeveer 2 jaar | ongeveer 2 jaar geleden |
+| 1997-01-01T00:00:00.000Z | ongeveer 3 jaar | ongeveer 3 jaar | ongeveer 3 jaar geleden |
+| 1996-01-01T00:00:00.000Z | ongeveer 4 jaar | ongeveer 4 jaar | ongeveer 4 jaar geleden |
+| 1995-01-01T00:00:00.000Z | ongeveer 5 jaar | ongeveer 5 jaar | ongeveer 5 jaar geleden |
+| 1994-01-01T00:00:00.000Z | ongeveer 6 jaar | ongeveer 6 jaar | ongeveer 6 jaar geleden |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 jaar | over 6 jaar | 52608 uur |
+| 2005-01-01T00:00:00.000Z | 5 jaar | over 5 jaar | 43848 uur |
+| 2004-01-01T00:00:00.000Z | 4 jaar | over 4 jaar | 35064 uur |
+| 2003-01-01T00:00:00.000Z | 3 jaar | over 3 jaar | 26304 uur |
+| 2002-01-01T00:00:00.000Z | 2 jaar | over 2 jaar | 17544 uur |
+| 2001-06-01T00:00:00.000Z | 1 jaar | over 1 jaar | 12408 uur |
+| 2001-02-01T00:00:00.000Z | 1 jaar | over 1 jaar | 9528 uur |
+| 2001-01-01T00:00:00.000Z | 1 jaar | over 1 jaar | 8784 uur |
+| 2000-06-01T00:00:00.000Z | 5 maanden | over 5 maanden | 3648 uur |
+| 2000-03-01T00:00:00.000Z | 2 maanden | over 2 maanden | 1440 uur |
+| 2000-02-01T00:00:00.000Z | 1 maand | over 1 maand | 744 uur |
+| 2000-01-15T00:00:00.000Z | 14 dagen | over 14 dagen | 336 uur |
+| 2000-01-02T00:00:00.000Z | 1 dag | over 1 dag | 24 uur |
+| 2000-01-01T06:00:00.000Z | 6 uur | over 6 uur | 6 uur |
+| 2000-01-01T01:00:00.000Z | 1 uur | over 1 uur | 1 uur |
+| 2000-01-01T00:45:00.000Z | 45 minuten | over 45 minuten | 1 uur |
+| 2000-01-01T00:30:00.000Z | 30 minuten | over 30 minuten | 1 uur |
+| 2000-01-01T00:15:00.000Z | 15 minuten | over 15 minuten | 0 uur |
+| 2000-01-01T00:01:00.000Z | een minuut | over een minuut | 0 uur |
+| 2000-01-01T00:00:25.000Z | 25 seconden | over 25 seconden | 0 uur |
+| 2000-01-01T00:00:15.000Z | 15 seconden | over 15 seconden | 0 uur |
+| 2000-01-01T00:00:05.000Z | 5 seconden | over 5 seconden | 0 uur |
+| 2000-01-01T00:00:00.000Z | 0 seconden | 0 seconden geleden | 0 uur |
+| 1999-12-31T23:59:55.000Z | 5 seconden | 5 seconden geleden | 0 uur |
+| 1999-12-31T23:59:45.000Z | 15 seconden | 15 seconden geleden | 0 uur |
+| 1999-12-31T23:59:35.000Z | 25 seconden | 25 seconden geleden | 0 uur |
+| 1999-12-31T23:59:00.000Z | een minuut | een minuut geleden | 0 uur |
+| 1999-12-31T23:45:00.000Z | 15 minuten | 15 minuten geleden | 0 uur |
+| 1999-12-31T23:30:00.000Z | 30 minuten | 30 minuten geleden | 1 uur |
+| 1999-12-31T23:15:00.000Z | 45 minuten | 45 minuten geleden | 1 uur |
+| 1999-12-31T23:00:00.000Z | 1 uur | 1 uur geleden | 1 uur |
+| 1999-12-31T18:00:00.000Z | 6 uur | 6 uur geleden | 6 uur |
+| 1999-12-30T00:00:00.000Z | 2 dagen | 2 dagen geleden | 48 uur |
+| 1999-12-15T00:00:00.000Z | 17 dagen | 17 dagen geleden | 408 uur |
+| 1999-12-01T00:00:00.000Z | 1 maand | 1 maand geleden | 744 uur |
+| 1999-11-01T00:00:00.000Z | 2 maanden | 2 maanden geleden | 1464 uur |
+| 1999-06-01T00:00:00.000Z | 7 maanden | 7 maanden geleden | 5136 uur |
+| 1999-01-01T00:00:00.000Z | 1 jaar | 1 jaar geleden | 8760 uur |
+| 1998-12-01T00:00:00.000Z | 1 jaar | 1 jaar geleden | 9504 uur |
+| 1998-06-01T00:00:00.000Z | 2 jaar | 2 jaar geleden | 13896 uur |
+| 1998-01-01T00:00:00.000Z | 2 jaar | 2 jaar geleden | 17520 uur |
+| 1997-01-01T00:00:00.000Z | 3 jaar | 3 jaar geleden | 26280 uur |
+| 1996-01-01T00:00:00.000Z | 4 jaar | 4 jaar geleden | 35064 uur |
+| 1995-01-01T00:00:00.000Z | 5 jaar | 5 jaar geleden | 43824 uur |
+| 1994-01-01T00:00:00.000Z | 6 jaar | 6 jaar geleden | 52584 uur |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------- |
+| 2000-01-10T00:00:00.000Z | 10-01-2000 |
+| 2000-01-05T00:00:00.000Z | woensdag om 00:00 |
+| 2000-01-02T00:00:00.000Z | morgen om 00:00 |
+| 2000-01-01T00:00:00.000Z | vandaag om 00:00 |
+| 1999-12-31T00:00:00.000Z | gisteren om 00:00 |
+| 1999-12-27T00:00:00.000Z | vorige maandag om 00:00 |
+| 1999-12-21T00:00:00.000Z | 21-12-1999 |
diff --git a/date-fns/src/locale/nl/_lib/formatDistance/index.js b/date-fns/src/locale/nl/_lib/formatDistance/index.js
new file mode 100644
index 0000000..f1c2d88
--- /dev/null
+++ b/date-fns/src/locale/nl/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'minder dan een seconde',
+ other: 'minder dan {{count}} seconden'
+ },
+
+ xSeconds: {
+ one: '1 seconde',
+ other: '{{count}} seconden'
+ },
+
+ halfAMinute: 'een halve minuut',
+
+ lessThanXMinutes: {
+ one: 'minder dan een minuut',
+ other: 'minder dan {{count}} minuten'
+ },
+
+ xMinutes: {
+ one: 'een minuut',
+ other: '{{count}} minuten'
+ },
+
+ aboutXHours: {
+ one: 'ongeveer 1 uur',
+ other: 'ongeveer {{count}} uur'
+ },
+
+ xHours: {
+ one: '1 uur',
+ other: '{{count}} uur'
+ },
+
+ xDays: {
+ one: '1 dag',
+ other: '{{count}} dagen'
+ },
+
+ aboutXWeeks: {
+ one: 'ongeveer 1 week',
+ other: 'ongeveer {{count}} weken'
+ },
+
+ xWeeks: {
+ one: '1 week',
+ other: '{{count}} weken'
+ },
+
+ aboutXMonths: {
+ one: 'ongeveer 1 maand',
+ other: 'ongeveer {{count}} maanden'
+ },
+
+ xMonths: {
+ one: '1 maand',
+ other: '{{count}} maanden'
+ },
+
+ aboutXYears: {
+ one: 'ongeveer 1 jaar',
+ other: 'ongeveer {{count}} jaar'
+ },
+
+ xYears: {
+ one: '1 jaar',
+ other: '{{count}} jaar'
+ },
+
+ overXYears: {
+ one: 'meer dan 1 jaar',
+ other: 'meer dan {{count}} jaar'
+ },
+
+ almostXYears: {
+ one: 'bijna 1 jaar',
+ other: 'bijna {{count}} jaar'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'over ' + result
+ } else {
+ return result + ' geleden'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/nl/_lib/formatLong/index.js b/date-fns/src/locale/nl/_lib/formatLong/index.js
new file mode 100644
index 0000000..2b6cb47
--- /dev/null
+++ b/date-fns/src/locale/nl/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'dd-MM-y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'om' {{time}}",
+ long: "{{date}} 'om' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/nl/_lib/formatRelative/index.js b/date-fns/src/locale/nl/_lib/formatRelative/index.js
new file mode 100644
index 0000000..63473fa
--- /dev/null
+++ b/date-fns/src/locale/nl/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'afgelopen' eeee 'om' p",
+ yesterday: "'gisteren om' p",
+ today: "'vandaag om' p",
+ tomorrow: "'morgen om' p",
+ nextWeek: "eeee 'om' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/nl/_lib/localize/index.js b/date-fns/src/locale/nl/_lib/localize/index.js
new file mode 100644
index 0000000..e126041
--- /dev/null
+++ b/date-fns/src/locale/nl/_lib/localize/index.js
@@ -0,0 +1,132 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['v.C.', 'n.C.'],
+ abbreviated: ['v.Chr.', 'n.Chr.'],
+ wide: ['voor Christus', 'na Christus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['K1', 'K2', 'K3', 'K4'],
+ wide: ['1e kwartaal', '2e kwartaal', '3e kwartaal', '4e kwartaal']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mrt.',
+ 'apr.',
+ 'mei',
+ 'jun.',
+ 'jul.',
+ 'aug.',
+ 'sep.',
+ 'okt.',
+ 'nov.',
+ 'dec.'
+ ],
+ wide: [
+ 'januari',
+ 'februari',
+ 'maart',
+ 'april',
+ 'mei',
+ 'juni',
+ 'juli',
+ 'augustus',
+ 'september',
+ 'oktober',
+ 'november',
+ 'december'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Z', 'M', 'D', 'W', 'D', 'V', 'Z'],
+ short: ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'],
+ abbreviated: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
+ wide: [
+ 'zondag',
+ 'maandag',
+ 'dinsdag',
+ 'woensdag',
+ 'donderdag',
+ 'vrijdag',
+ 'zaterdag'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'middernacht',
+ noon: 'het middaguur',
+ morning: "'s ochtends",
+ afternoon: "'s middags",
+ evening: "'s avonds",
+ night: "'s nachts"
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'middernacht',
+ noon: 'het middaguur',
+ morning: "'s ochtends",
+ afternoon: "'s middags",
+ evening: "'s avonds",
+ night: "'s nachts"
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'middernacht',
+ noon: 'het middaguur',
+ morning: "'s ochtends",
+ afternoon: "'s middags",
+ evening: "'s avonds",
+ night: "'s nachts"
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + 'e'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/nl/_lib/match/index.js b/date-fns/src/locale/nl/_lib/match/index.js
new file mode 100644
index 0000000..cbc7bce
--- /dev/null
+++ b/date-fns/src/locale/nl/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)e?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^([vn]\.? ?C\.?)/,
+ abbreviated: /^([vn]\. ?Chr\.?)/,
+ wide: /^((voor|na) Christus)/
+}
+var parseEraPatterns = {
+ any: [/^v/, /^n/]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^K[1234]/i,
+ wide: /^[1234]e kwartaal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
+ wide: /^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^jan/i,
+ /^feb/i,
+ /^m(r|a)/i,
+ /^apr/i,
+ /^mei/i,
+ /^jun/i,
+ /^jul/i,
+ /^aug/i,
+ /^sep/i,
+ /^okt/i,
+ /^nov/i,
+ /^dec/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[zmdwv]/i,
+ short: /^(zo|ma|di|wo|do|vr|za)/i,
+ abbreviated: /^(zon|maa|din|woe|don|vri|zat)/i,
+ wide: /^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i
+}
+var parseDayPatterns = {
+ narrow: [/^z/i, /^m/i, /^d/i, /^w/i, /^d/i, /^v/i, /^z/i],
+ any: [/^zo/i, /^ma/i, /^di/i, /^wo/i, /^do/i, /^vr/i, /^za/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^am/i,
+ pm: /^pm/i,
+ midnight: /^middernacht/i,
+ noon: /^het middaguur/i,
+ morning: /ochtend/i,
+ afternoon: /middag/i,
+ evening: /avond/i,
+ night: /nacht/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/nl/index.d.ts b/date-fns/src/locale/nl/index.d.ts
new file mode 100644
index 0000000..eb92f4e
--- /dev/null
+++ b/date-fns/src/locale/nl/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nl } from 'date-fns/locale'
+export default nl
diff --git a/date-fns/src/locale/nl/index.js b/date-fns/src/locale/nl/index.js
new file mode 100644
index 0000000..1e0b931
--- /dev/null
+++ b/date-fns/src/locale/nl/index.js
@@ -0,0 +1,33 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Dutch locale.
+ * @language Dutch
+ * @iso-639-2 nld
+ * @author Jorik Tangelder [@jtangelder]{@link https://github.com/jtangelder}
+ * @author Ruben Stolk [@rubenstolk]{@link https://github.com/rubenstolk}
+ * @author Lode Vanhove [@bitcrumb]{@link https://github.com/bitcrumb}
+ * @author Edo Rivai [@edorivai]{@link https://github.com/edorivai}
+ * @author Niels Keurentjes [@curry684]{@link https://github.com/curry684}
+ * @author Stefan Vermaas [@stefanvermaas]{@link https://github.com/stefanvermaas}
+ */
+var locale = {
+ code: 'nl',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/nl/index.js.flow b/date-fns/src/locale/nl/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/nl/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/nl/snapshot.md b/date-fns/src/locale/nl/snapshot.md
new file mode 100644
index 0000000..18b8556
--- /dev/null
+++ b/date-fns/src/locale/nl/snapshot.md
@@ -0,0 +1,304 @@
+# Dutch (nl) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987e | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5e | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987e | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4e | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1e | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1e kwartaal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e kwartaal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1e | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | K1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | K2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1e kwartaal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2e kwartaal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2e | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7e | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2e | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7e | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1e | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48e | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1e | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48e | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28e | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42e | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365e | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5e | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5e | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5e | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | maa | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vri | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | maandag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vrijdag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | V | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | ma | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's middags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's middags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's middags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's middags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | 's ochtends | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 's middags | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 's avonds | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 's nachts | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11e | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23e | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11e | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23e | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1e | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55e | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1e | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55e | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11-02-1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-05-1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | woensdag 11 februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | zondag 29 mei 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11-02-1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-05-1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 feb. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 februari 1987 om 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 mei 1453 om 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | woensdag 11 februari 1987 om 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | zondag 29 mei 1453 om 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------- | ---------------------- | ----------------------------- |
+| 2006-01-01T00:00:00.000Z | ongeveer 6 jaar | ongeveer 6 jaar | over ongeveer 6 jaar |
+| 2005-01-01T00:00:00.000Z | ongeveer 5 jaar | ongeveer 5 jaar | over ongeveer 5 jaar |
+| 2004-01-01T00:00:00.000Z | ongeveer 4 jaar | ongeveer 4 jaar | over ongeveer 4 jaar |
+| 2003-01-01T00:00:00.000Z | ongeveer 3 jaar | ongeveer 3 jaar | over ongeveer 3 jaar |
+| 2002-01-01T00:00:00.000Z | ongeveer 2 jaar | ongeveer 2 jaar | over ongeveer 2 jaar |
+| 2001-06-01T00:00:00.000Z | meer dan 1 jaar | meer dan 1 jaar | over meer dan 1 jaar |
+| 2001-02-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | over ongeveer 1 jaar |
+| 2001-01-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | over ongeveer 1 jaar |
+| 2000-06-01T00:00:00.000Z | 5 maanden | 5 maanden | over 5 maanden |
+| 2000-03-01T00:00:00.000Z | 2 maanden | 2 maanden | over 2 maanden |
+| 2000-02-01T00:00:00.000Z | ongeveer 1 maand | ongeveer 1 maand | over ongeveer 1 maand |
+| 2000-01-15T00:00:00.000Z | 14 dagen | 14 dagen | over 14 dagen |
+| 2000-01-02T00:00:00.000Z | 1 dag | 1 dag | over 1 dag |
+| 2000-01-01T06:00:00.000Z | ongeveer 6 uur | ongeveer 6 uur | over ongeveer 6 uur |
+| 2000-01-01T01:00:00.000Z | ongeveer 1 uur | ongeveer 1 uur | over ongeveer 1 uur |
+| 2000-01-01T00:45:00.000Z | ongeveer 1 uur | ongeveer 1 uur | over ongeveer 1 uur |
+| 2000-01-01T00:30:00.000Z | 30 minuten | 30 minuten | over 30 minuten |
+| 2000-01-01T00:15:00.000Z | 15 minuten | 15 minuten | over 15 minuten |
+| 2000-01-01T00:01:00.000Z | een minuut | een minuut | over een minuut |
+| 2000-01-01T00:00:25.000Z | minder dan een minuut | een halve minuut | over minder dan een minuut |
+| 2000-01-01T00:00:15.000Z | minder dan een minuut | minder dan 20 seconden | over minder dan een minuut |
+| 2000-01-01T00:00:05.000Z | minder dan een minuut | minder dan 10 seconden | over minder dan een minuut |
+| 2000-01-01T00:00:00.000Z | minder dan een minuut | minder dan 5 seconden | minder dan een minuut geleden |
+| 1999-12-31T23:59:55.000Z | minder dan een minuut | minder dan 10 seconden | minder dan een minuut geleden |
+| 1999-12-31T23:59:45.000Z | minder dan een minuut | minder dan 20 seconden | minder dan een minuut geleden |
+| 1999-12-31T23:59:35.000Z | minder dan een minuut | een halve minuut | minder dan een minuut geleden |
+| 1999-12-31T23:59:00.000Z | een minuut | een minuut | een minuut geleden |
+| 1999-12-31T23:45:00.000Z | 15 minuten | 15 minuten | 15 minuten geleden |
+| 1999-12-31T23:30:00.000Z | 30 minuten | 30 minuten | 30 minuten geleden |
+| 1999-12-31T23:15:00.000Z | ongeveer 1 uur | ongeveer 1 uur | ongeveer 1 uur geleden |
+| 1999-12-31T23:00:00.000Z | ongeveer 1 uur | ongeveer 1 uur | ongeveer 1 uur geleden |
+| 1999-12-31T18:00:00.000Z | ongeveer 6 uur | ongeveer 6 uur | ongeveer 6 uur geleden |
+| 1999-12-30T00:00:00.000Z | 2 dagen | 2 dagen | 2 dagen geleden |
+| 1999-12-15T00:00:00.000Z | 17 dagen | 17 dagen | 17 dagen geleden |
+| 1999-12-01T00:00:00.000Z | ongeveer 1 maand | ongeveer 1 maand | ongeveer 1 maand geleden |
+| 1999-11-01T00:00:00.000Z | 2 maanden | 2 maanden | 2 maanden geleden |
+| 1999-06-01T00:00:00.000Z | 7 maanden | 7 maanden | 7 maanden geleden |
+| 1999-01-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | ongeveer 1 jaar geleden |
+| 1998-12-01T00:00:00.000Z | ongeveer 1 jaar | ongeveer 1 jaar | ongeveer 1 jaar geleden |
+| 1998-06-01T00:00:00.000Z | meer dan 1 jaar | meer dan 1 jaar | meer dan 1 jaar geleden |
+| 1998-01-01T00:00:00.000Z | ongeveer 2 jaar | ongeveer 2 jaar | ongeveer 2 jaar geleden |
+| 1997-01-01T00:00:00.000Z | ongeveer 3 jaar | ongeveer 3 jaar | ongeveer 3 jaar geleden |
+| 1996-01-01T00:00:00.000Z | ongeveer 4 jaar | ongeveer 4 jaar | ongeveer 4 jaar geleden |
+| 1995-01-01T00:00:00.000Z | ongeveer 5 jaar | ongeveer 5 jaar | ongeveer 5 jaar geleden |
+| 1994-01-01T00:00:00.000Z | ongeveer 6 jaar | ongeveer 6 jaar | ongeveer 6 jaar geleden |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 jaar | over 6 jaar | 52608 uur |
+| 2005-01-01T00:00:00.000Z | 5 jaar | over 5 jaar | 43848 uur |
+| 2004-01-01T00:00:00.000Z | 4 jaar | over 4 jaar | 35064 uur |
+| 2003-01-01T00:00:00.000Z | 3 jaar | over 3 jaar | 26304 uur |
+| 2002-01-01T00:00:00.000Z | 2 jaar | over 2 jaar | 17544 uur |
+| 2001-06-01T00:00:00.000Z | 1 jaar | over 1 jaar | 12408 uur |
+| 2001-02-01T00:00:00.000Z | 1 jaar | over 1 jaar | 9528 uur |
+| 2001-01-01T00:00:00.000Z | 1 jaar | over 1 jaar | 8784 uur |
+| 2000-06-01T00:00:00.000Z | 5 maanden | over 5 maanden | 3648 uur |
+| 2000-03-01T00:00:00.000Z | 2 maanden | over 2 maanden | 1440 uur |
+| 2000-02-01T00:00:00.000Z | 1 maand | over 1 maand | 744 uur |
+| 2000-01-15T00:00:00.000Z | 14 dagen | over 14 dagen | 336 uur |
+| 2000-01-02T00:00:00.000Z | 1 dag | over 1 dag | 24 uur |
+| 2000-01-01T06:00:00.000Z | 6 uur | over 6 uur | 6 uur |
+| 2000-01-01T01:00:00.000Z | 1 uur | over 1 uur | 1 uur |
+| 2000-01-01T00:45:00.000Z | 45 minuten | over 45 minuten | 1 uur |
+| 2000-01-01T00:30:00.000Z | 30 minuten | over 30 minuten | 1 uur |
+| 2000-01-01T00:15:00.000Z | 15 minuten | over 15 minuten | 0 uur |
+| 2000-01-01T00:01:00.000Z | een minuut | over een minuut | 0 uur |
+| 2000-01-01T00:00:25.000Z | 25 seconden | over 25 seconden | 0 uur |
+| 2000-01-01T00:00:15.000Z | 15 seconden | over 15 seconden | 0 uur |
+| 2000-01-01T00:00:05.000Z | 5 seconden | over 5 seconden | 0 uur |
+| 2000-01-01T00:00:00.000Z | 0 seconden | 0 seconden geleden | 0 uur |
+| 1999-12-31T23:59:55.000Z | 5 seconden | 5 seconden geleden | 0 uur |
+| 1999-12-31T23:59:45.000Z | 15 seconden | 15 seconden geleden | 0 uur |
+| 1999-12-31T23:59:35.000Z | 25 seconden | 25 seconden geleden | 0 uur |
+| 1999-12-31T23:59:00.000Z | een minuut | een minuut geleden | 0 uur |
+| 1999-12-31T23:45:00.000Z | 15 minuten | 15 minuten geleden | 0 uur |
+| 1999-12-31T23:30:00.000Z | 30 minuten | 30 minuten geleden | 1 uur |
+| 1999-12-31T23:15:00.000Z | 45 minuten | 45 minuten geleden | 1 uur |
+| 1999-12-31T23:00:00.000Z | 1 uur | 1 uur geleden | 1 uur |
+| 1999-12-31T18:00:00.000Z | 6 uur | 6 uur geleden | 6 uur |
+| 1999-12-30T00:00:00.000Z | 2 dagen | 2 dagen geleden | 48 uur |
+| 1999-12-15T00:00:00.000Z | 17 dagen | 17 dagen geleden | 408 uur |
+| 1999-12-01T00:00:00.000Z | 1 maand | 1 maand geleden | 744 uur |
+| 1999-11-01T00:00:00.000Z | 2 maanden | 2 maanden geleden | 1464 uur |
+| 1999-06-01T00:00:00.000Z | 7 maanden | 7 maanden geleden | 5136 uur |
+| 1999-01-01T00:00:00.000Z | 1 jaar | 1 jaar geleden | 8760 uur |
+| 1998-12-01T00:00:00.000Z | 1 jaar | 1 jaar geleden | 9504 uur |
+| 1998-06-01T00:00:00.000Z | 2 jaar | 2 jaar geleden | 13896 uur |
+| 1998-01-01T00:00:00.000Z | 2 jaar | 2 jaar geleden | 17520 uur |
+| 1997-01-01T00:00:00.000Z | 3 jaar | 3 jaar geleden | 26280 uur |
+| 1996-01-01T00:00:00.000Z | 4 jaar | 4 jaar geleden | 35064 uur |
+| 1995-01-01T00:00:00.000Z | 5 jaar | 5 jaar geleden | 43824 uur |
+| 1994-01-01T00:00:00.000Z | 6 jaar | 6 jaar geleden | 52584 uur |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------- |
+| 2000-01-10T00:00:00.000Z | 10-01-2000 |
+| 2000-01-05T00:00:00.000Z | woensdag om 00:00 |
+| 2000-01-02T00:00:00.000Z | morgen om 00:00 |
+| 2000-01-01T00:00:00.000Z | vandaag om 00:00 |
+| 1999-12-31T00:00:00.000Z | gisteren om 00:00 |
+| 1999-12-27T00:00:00.000Z | afgelopen maandag om 00:00 |
+| 1999-12-21T00:00:00.000Z | 21-12-1999 |
diff --git a/date-fns/src/locale/nn/_lib/formatDistance/index.js b/date-fns/src/locale/nn/_lib/formatDistance/index.js
new file mode 100644
index 0000000..cf716b6
--- /dev/null
+++ b/date-fns/src/locale/nn/_lib/formatDistance/index.js
@@ -0,0 +1,127 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ singular: 'mindre enn eitt sekund',
+ plural: 'mindre enn {{count}} sekund'
+ },
+
+ xSeconds: {
+ singular: 'eitt sekund',
+ plural: '{{count}} sekund'
+ },
+
+ halfAMinute: 'eit halvt minutt',
+
+ lessThanXMinutes: {
+ singular: 'mindre enn eitt minutt',
+ plural: 'mindre enn {{count}} minutt'
+ },
+
+ xMinutes: {
+ singular: 'eitt minutt',
+ plural: '{{count}} minutt'
+ },
+
+ aboutXHours: {
+ singular: 'omtrent ein time',
+ plural: 'omtrent {{count}} timar'
+ },
+
+ xHours: {
+ singular: 'ein time',
+ plural: '{{count}} timar'
+ },
+
+ xDays: {
+ singular: 'ein dag',
+ plural: '{{count}} dagar'
+ },
+
+ aboutXWeeks: {
+ singular: 'omtrent ei veke',
+ plural: 'omtrent {{count}} veker'
+ },
+
+ xWeeks: {
+ singular: 'ei veke',
+ plural: '{{count}} veker'
+ },
+
+ aboutXMonths: {
+ singular: 'omtrent ein månad',
+ plural: 'omtrent {{count}} månader'
+ },
+
+ xMonths: {
+ singular: 'ein månad',
+ plural: '{{count}} månader'
+ },
+
+ aboutXYears: {
+ singular: 'omtrent eitt år',
+ plural: 'omtrent {{count}} år'
+ },
+
+ xYears: {
+ singular: 'eitt år',
+ plural: '{{count}} år'
+ },
+
+ overXYears: {
+ singular: 'over eitt år',
+ plural: 'over {{count}} år'
+ },
+
+ almostXYears: {
+ singular: 'nesten eitt år',
+ plural: 'nesten {{count}} år'
+ }
+}
+
+var wordMapping = [
+ 'null',
+ 'ein',
+ 'to',
+ 'tre',
+ 'fire',
+ 'fem',
+ 'seks',
+ 'sju',
+ 'åtte',
+ 'ni',
+ 'ti',
+ 'elleve',
+ 'tolv'
+]
+
+export default function formatDistance(token, count, options) {
+ options = options || {
+ onlyNumeric: false
+ }
+
+ var translation = formatDistanceLocale[token]
+ var result
+ if (typeof translation === 'string') {
+ result = translation
+ } else if (count === 0 || count > 1) {
+ if (options.onlyNumeric) {
+ result = translation.plural.replace('{{count}}', count)
+ } else {
+ result = translation.plural.replace(
+ '{{count}}',
+ count < 13 ? wordMapping[count] : count
+ )
+ }
+ } else {
+ result = translation.singular
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'om ' + result
+ } else {
+ return result + ' sidan'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/nn/_lib/formatLong/index.js b/date-fns/src/locale/nn/_lib/formatLong/index.js
new file mode 100644
index 0000000..067f59e
--- /dev/null
+++ b/date-fns/src/locale/nn/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d. MMMM y',
+ long: 'd. MMMM y',
+ medium: 'd. MMM y',
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: "'kl'. HH:mm:ss zzzz",
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'kl.' {{time}}",
+ long: "{{date}} 'kl.' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/nn/_lib/formatRelative/index.js b/date-fns/src/locale/nn/_lib/formatRelative/index.js
new file mode 100644
index 0000000..895db62
--- /dev/null
+++ b/date-fns/src/locale/nn/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'førre' eeee 'kl.' p",
+ yesterday: "'i går kl.' p",
+ today: "'i dag kl.' p",
+ tomorrow: "'i morgon kl.' p",
+ nextWeek: "EEEE 'kl.' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/nn/_lib/localize/index.js b/date-fns/src/locale/nn/_lib/localize/index.js
new file mode 100644
index 0000000..4c3fbc8
--- /dev/null
+++ b/date-fns/src/locale/nn/_lib/localize/index.js
@@ -0,0 +1,124 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['f.Kr.', 'e.Kr.'],
+ abbreviated: ['f.Kr.', 'e.Kr.'],
+ wide: ['før Kristus', 'etter Kristus']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal']
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mars',
+ 'apr.',
+ 'mai',
+ 'juni',
+ 'juli',
+ 'aug.',
+ 'sep.',
+ 'okt.',
+ 'nov.',
+ 'des.'
+ ],
+ wide: [
+ 'januar',
+ 'februar',
+ 'mars',
+ 'april',
+ 'mai',
+ 'juni',
+ 'juli',
+ 'august',
+ 'september',
+ 'oktober',
+ 'november',
+ 'desember'
+ ]
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'T', 'O', 'T', 'F', 'L'],
+ short: ['su', 'må', 'ty', 'on', 'to', 'fr', 'lau'],
+ abbreviated: ['sun', 'mån', 'tys', 'ons', 'tor', 'fre', 'laur'],
+ wide: ['sundag', 'måndag', 'tysdag', 'onsdag', 'torsdag', 'fredag', 'laurdag']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morg.',
+ afternoon: 'på etterm.',
+ evening: 'på kvelden',
+ night: 'på natta'
+ },
+ abbreviated: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morg.',
+ afternoon: 'på etterm.',
+ evening: 'på kvelden',
+ night: 'på natta'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morgonen',
+ afternoon: 'på ettermiddagen',
+ evening: 'på kvelden',
+ night: 'på natta'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/nn/_lib/match/index.js b/date-fns/src/locale/nn/_lib/match/index.js
new file mode 100644
index 0000000..ff0c5f3
--- /dev/null
+++ b/date-fns/src/locale/nn/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\.?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
+ abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
+ wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i
+}
+var parseEraPatterns = {
+ any: [/^f/i, /^e/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](\.)? kvartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
+ wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^mai/i,
+ /^jun/i,
+ /^jul/i,
+ /^aug/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[smtofl]/i,
+ short: /^(su|må|ty|on|to|fr|la)/i,
+ abbreviated: /^(sun|mån|tys|ons|tor|fre|laur)/i,
+ wide: /^(sundag|måndag|tysdag|onsdag|torsdag|fredag|laurdag)/i
+}
+var parseDayPatterns = {
+ any: [/^s/i, /^m/i, /^ty/i, /^o/i, /^to/i, /^f/i, /^l/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta)|[ap])/i,
+ any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a(\.?\s?m\.?)?$/i,
+ pm: /^p(\.?\s?m\.?)?$/i,
+ midnight: /^midn/i,
+ noon: /^midd/i,
+ morning: /morgon/i,
+ afternoon: /ettermiddag/i,
+ evening: /kveld/i,
+ night: /natt/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/nn/index.d.ts b/date-fns/src/locale/nn/index.d.ts
new file mode 100644
index 0000000..08050ed
--- /dev/null
+++ b/date-fns/src/locale/nn/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nn } from 'date-fns/locale'
+export default nn
diff --git a/date-fns/src/locale/nn/index.js b/date-fns/src/locale/nn/index.js
new file mode 100644
index 0000000..4a6998f
--- /dev/null
+++ b/date-fns/src/locale/nn/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Norwegian Nynorsk locale.
+ * @language Norwegian Nynorsk
+ * @iso-639-2 nno
+ * @author Mats Byrkjeland [@draperunner]{@link https://github.com/draperunner}
+ */
+var locale = {
+ code: 'nn',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/nn/index.js.flow b/date-fns/src/locale/nn/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/nn/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/nn/snapshot.md b/date-fns/src/locale/nn/snapshot.md
new file mode 100644
index 0000000..05ce90b
--- /dev/null
+++ b/date-fns/src/locale/nn/snapshot.md
@@ -0,0 +1,304 @@
+# Norwegian Nynorsk (nn) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natta | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natta | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natta | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | på morgonen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | på ettermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natta | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på etterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvelden | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natta | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | onsdag 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | sundag 29. mai 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | kl. 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. feb. 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. februar 1987 kl. 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. mai 1453 kl. 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | onsdag 11. februar 1987 kl. kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | sundag 29. mai 1453 kl. kl. 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------------- | ---------------------- | ---------------------------- |
+| 2006-01-01T00:00:00.000Z | omtrent seks år | omtrent seks år | om omtrent seks år |
+| 2005-01-01T00:00:00.000Z | omtrent fem år | omtrent fem år | om omtrent fem år |
+| 2004-01-01T00:00:00.000Z | omtrent fire år | omtrent fire år | om omtrent fire år |
+| 2003-01-01T00:00:00.000Z | omtrent tre år | omtrent tre år | om omtrent tre år |
+| 2002-01-01T00:00:00.000Z | omtrent to år | omtrent to år | om omtrent to år |
+| 2001-06-01T00:00:00.000Z | over eitt år | over eitt år | om over eitt år |
+| 2001-02-01T00:00:00.000Z | omtrent eitt år | omtrent eitt år | om omtrent eitt år |
+| 2001-01-01T00:00:00.000Z | omtrent eitt år | omtrent eitt år | om omtrent eitt år |
+| 2000-06-01T00:00:00.000Z | fem månader | fem månader | om fem månader |
+| 2000-03-01T00:00:00.000Z | to månader | to månader | om to månader |
+| 2000-02-01T00:00:00.000Z | omtrent ein månad | omtrent ein månad | om omtrent ein månad |
+| 2000-01-15T00:00:00.000Z | 14 dagar | 14 dagar | om 14 dagar |
+| 2000-01-02T00:00:00.000Z | ein dag | ein dag | om ein dag |
+| 2000-01-01T06:00:00.000Z | omtrent seks timar | omtrent seks timar | om omtrent seks timar |
+| 2000-01-01T01:00:00.000Z | omtrent ein time | omtrent ein time | om omtrent ein time |
+| 2000-01-01T00:45:00.000Z | omtrent ein time | omtrent ein time | om omtrent ein time |
+| 2000-01-01T00:30:00.000Z | 30 minutt | 30 minutt | om 30 minutt |
+| 2000-01-01T00:15:00.000Z | 15 minutt | 15 minutt | om 15 minutt |
+| 2000-01-01T00:01:00.000Z | eitt minutt | eitt minutt | om eitt minutt |
+| 2000-01-01T00:00:25.000Z | mindre enn eitt minutt | eit halvt minutt | om mindre enn eitt minutt |
+| 2000-01-01T00:00:15.000Z | mindre enn eitt minutt | mindre enn 20 sekund | om mindre enn eitt minutt |
+| 2000-01-01T00:00:05.000Z | mindre enn eitt minutt | mindre enn ti sekund | om mindre enn eitt minutt |
+| 2000-01-01T00:00:00.000Z | mindre enn eitt minutt | mindre enn fem sekund | mindre enn eitt minutt sidan |
+| 1999-12-31T23:59:55.000Z | mindre enn eitt minutt | mindre enn ti sekund | mindre enn eitt minutt sidan |
+| 1999-12-31T23:59:45.000Z | mindre enn eitt minutt | mindre enn 20 sekund | mindre enn eitt minutt sidan |
+| 1999-12-31T23:59:35.000Z | mindre enn eitt minutt | eit halvt minutt | mindre enn eitt minutt sidan |
+| 1999-12-31T23:59:00.000Z | eitt minutt | eitt minutt | eitt minutt sidan |
+| 1999-12-31T23:45:00.000Z | 15 minutt | 15 minutt | 15 minutt sidan |
+| 1999-12-31T23:30:00.000Z | 30 minutt | 30 minutt | 30 minutt sidan |
+| 1999-12-31T23:15:00.000Z | omtrent ein time | omtrent ein time | omtrent ein time sidan |
+| 1999-12-31T23:00:00.000Z | omtrent ein time | omtrent ein time | omtrent ein time sidan |
+| 1999-12-31T18:00:00.000Z | omtrent seks timar | omtrent seks timar | omtrent seks timar sidan |
+| 1999-12-30T00:00:00.000Z | to dagar | to dagar | to dagar sidan |
+| 1999-12-15T00:00:00.000Z | 17 dagar | 17 dagar | 17 dagar sidan |
+| 1999-12-01T00:00:00.000Z | omtrent ein månad | omtrent ein månad | omtrent ein månad sidan |
+| 1999-11-01T00:00:00.000Z | to månader | to månader | to månader sidan |
+| 1999-06-01T00:00:00.000Z | sju månader | sju månader | sju månader sidan |
+| 1999-01-01T00:00:00.000Z | omtrent eitt år | omtrent eitt år | omtrent eitt år sidan |
+| 1998-12-01T00:00:00.000Z | omtrent eitt år | omtrent eitt år | omtrent eitt år sidan |
+| 1998-06-01T00:00:00.000Z | over eitt år | over eitt år | over eitt år sidan |
+| 1998-01-01T00:00:00.000Z | omtrent to år | omtrent to år | omtrent to år sidan |
+| 1997-01-01T00:00:00.000Z | omtrent tre år | omtrent tre år | omtrent tre år sidan |
+| 1996-01-01T00:00:00.000Z | omtrent fire år | omtrent fire år | omtrent fire år sidan |
+| 1995-01-01T00:00:00.000Z | omtrent fem år | omtrent fem år | omtrent fem år sidan |
+| 1994-01-01T00:00:00.000Z | omtrent seks år | omtrent seks år | omtrent seks år sidan |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | seks år | om seks år | 52608 timar |
+| 2005-01-01T00:00:00.000Z | fem år | om fem år | 43848 timar |
+| 2004-01-01T00:00:00.000Z | fire år | om fire år | 35064 timar |
+| 2003-01-01T00:00:00.000Z | tre år | om tre år | 26304 timar |
+| 2002-01-01T00:00:00.000Z | to år | om to år | 17544 timar |
+| 2001-06-01T00:00:00.000Z | eitt år | om eitt år | 12408 timar |
+| 2001-02-01T00:00:00.000Z | eitt år | om eitt år | 9528 timar |
+| 2001-01-01T00:00:00.000Z | eitt år | om eitt år | 8784 timar |
+| 2000-06-01T00:00:00.000Z | fem månader | om fem månader | 3648 timar |
+| 2000-03-01T00:00:00.000Z | to månader | om to månader | 1440 timar |
+| 2000-02-01T00:00:00.000Z | ein månad | om ein månad | 744 timar |
+| 2000-01-15T00:00:00.000Z | 14 dagar | om 14 dagar | 336 timar |
+| 2000-01-02T00:00:00.000Z | ein dag | om ein dag | 24 timar |
+| 2000-01-01T06:00:00.000Z | seks timar | om seks timar | seks timar |
+| 2000-01-01T01:00:00.000Z | ein time | om ein time | ein time |
+| 2000-01-01T00:45:00.000Z | 45 minutt | om 45 minutt | ein time |
+| 2000-01-01T00:30:00.000Z | 30 minutt | om 30 minutt | ein time |
+| 2000-01-01T00:15:00.000Z | 15 minutt | om 15 minutt | null timar |
+| 2000-01-01T00:01:00.000Z | eitt minutt | om eitt minutt | null timar |
+| 2000-01-01T00:00:25.000Z | 25 sekund | om 25 sekund | null timar |
+| 2000-01-01T00:00:15.000Z | 15 sekund | om 15 sekund | null timar |
+| 2000-01-01T00:00:05.000Z | fem sekund | om fem sekund | null timar |
+| 2000-01-01T00:00:00.000Z | null sekund | null sekund sidan | null timar |
+| 1999-12-31T23:59:55.000Z | fem sekund | fem sekund sidan | null timar |
+| 1999-12-31T23:59:45.000Z | 15 sekund | 15 sekund sidan | null timar |
+| 1999-12-31T23:59:35.000Z | 25 sekund | 25 sekund sidan | null timar |
+| 1999-12-31T23:59:00.000Z | eitt minutt | eitt minutt sidan | null timar |
+| 1999-12-31T23:45:00.000Z | 15 minutt | 15 minutt sidan | null timar |
+| 1999-12-31T23:30:00.000Z | 30 minutt | 30 minutt sidan | ein time |
+| 1999-12-31T23:15:00.000Z | 45 minutt | 45 minutt sidan | ein time |
+| 1999-12-31T23:00:00.000Z | ein time | ein time sidan | ein time |
+| 1999-12-31T18:00:00.000Z | seks timar | seks timar sidan | seks timar |
+| 1999-12-30T00:00:00.000Z | to dagar | to dagar sidan | 48 timar |
+| 1999-12-15T00:00:00.000Z | 17 dagar | 17 dagar sidan | 408 timar |
+| 1999-12-01T00:00:00.000Z | ein månad | ein månad sidan | 744 timar |
+| 1999-11-01T00:00:00.000Z | to månader | to månader sidan | 1464 timar |
+| 1999-06-01T00:00:00.000Z | sju månader | sju månader sidan | 5136 timar |
+| 1999-01-01T00:00:00.000Z | eitt år | eitt år sidan | 8760 timar |
+| 1998-12-01T00:00:00.000Z | eitt år | eitt år sidan | 9504 timar |
+| 1998-06-01T00:00:00.000Z | to år | to år sidan | 13896 timar |
+| 1998-01-01T00:00:00.000Z | to år | to år sidan | 17520 timar |
+| 1997-01-01T00:00:00.000Z | tre år | tre år sidan | 26280 timar |
+| 1996-01-01T00:00:00.000Z | fire år | fire år sidan | 35064 timar |
+| 1995-01-01T00:00:00.000Z | fem år | fem år sidan | 43824 timar |
+| 1994-01-01T00:00:00.000Z | seks år | seks år sidan | 52584 timar |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | onsdag kl. 00:00 |
+| 2000-01-02T00:00:00.000Z | i morgon kl. 00:00 |
+| 2000-01-01T00:00:00.000Z | i dag kl. 00:00 |
+| 1999-12-31T00:00:00.000Z | i går kl. 00:00 |
+| 1999-12-27T00:00:00.000Z | førre måndag kl. 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/pl/_lib/formatDistance/index.js b/date-fns/src/locale/pl/_lib/formatDistance/index.js
new file mode 100644
index 0000000..d3069db
--- /dev/null
+++ b/date-fns/src/locale/pl/_lib/formatDistance/index.js
@@ -0,0 +1,169 @@
+function declensionGroup(scheme, count) {
+ if (count === 1) {
+ return scheme.one
+ }
+
+ var rem100 = count % 100
+
+ // ends with 11-20
+ if (rem100 <= 20 && rem100 > 10) {
+ return scheme.other
+ }
+
+ var rem10 = rem100 % 10
+
+ // ends with 2, 3, 4
+ if (rem10 >= 2 && rem10 <= 4) {
+ return scheme.twoFour
+ }
+
+ return scheme.other
+}
+
+function declension(scheme, count, time) {
+ time = time || 'regular'
+ var group = declensionGroup(scheme, count)
+ var finalText = group[time] || group
+ return finalText.replace('{{count}}', count)
+}
+
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: {
+ regular: 'mniej niż sekunda',
+ past: 'mniej niż sekundę',
+ future: 'mniej niż sekundę'
+ },
+ twoFour: 'mniej niż {{count}} sekundy',
+ other: 'mniej niż {{count}} sekund'
+ },
+
+ xSeconds: {
+ one: {
+ regular: 'sekunda',
+ past: 'sekundę',
+ future: 'sekundę'
+ },
+ twoFour: '{{count}} sekundy',
+ other: '{{count}} sekund'
+ },
+
+ halfAMinute: {
+ one: 'pół minuty',
+ twoFour: 'pół minuty',
+ other: 'pół minuty'
+ },
+
+ lessThanXMinutes: {
+ one: {
+ regular: 'mniej niż minuta',
+ past: 'mniej niż minutę',
+ future: 'mniej niż minutę'
+ },
+ twoFour: 'mniej niż {{count}} minuty',
+ other: 'mniej niż {{count}} minut'
+ },
+
+ xMinutes: {
+ one: {
+ regular: 'minuta',
+ past: 'minutę',
+ future: 'minutę'
+ },
+ twoFour: '{{count}} minuty',
+ other: '{{count}} minut'
+ },
+
+ aboutXHours: {
+ one: {
+ regular: 'około godziny',
+ past: 'około godziny',
+ future: 'około godzinę'
+ },
+ twoFour: 'około {{count}} godziny',
+ other: 'około {{count}} godzin'
+ },
+
+ xHours: {
+ one: {
+ regular: 'godzina',
+ past: 'godzinę',
+ future: 'godzinę'
+ },
+ twoFour: '{{count}} godziny',
+ other: '{{count}} godzin'
+ },
+
+ xDays: {
+ one: {
+ regular: 'dzień',
+ past: 'dzień',
+ future: '1 dzień'
+ },
+ twoFour: '{{count}} dni',
+ other: '{{count}} dni'
+ },
+
+ aboutXWeeks: {
+ one: 'około tygodnia',
+ twoFour: 'około {{count}} tygodni',
+ other: 'około {{count}} tygodni'
+ },
+
+ xWeeks: {
+ one: 'tydzień',
+ twoFour: '{{count}} tygodnie',
+ other: '{{count}} tygodni'
+ },
+
+ aboutXMonths: {
+ one: 'około miesiąc',
+ twoFour: 'około {{count}} miesiące',
+ other: 'około {{count}} miesięcy'
+ },
+
+ xMonths: {
+ one: 'miesiąc',
+ twoFour: '{{count}} miesiące',
+ other: '{{count}} miesięcy'
+ },
+
+ aboutXYears: {
+ one: 'około rok',
+ twoFour: 'około {{count}} lata',
+ other: 'około {{count}} lat'
+ },
+
+ xYears: {
+ one: 'rok',
+ twoFour: '{{count}} lata',
+ other: '{{count}} lat'
+ },
+
+ overXYears: {
+ one: 'ponad rok',
+ twoFour: 'ponad {{count}} lata',
+ other: 'ponad {{count}} lat'
+ },
+
+ almostXYears: {
+ one: 'prawie rok',
+ twoFour: 'prawie {{count}} lata',
+ other: 'prawie {{count}} lat'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var scheme = formatDistanceLocale[token]
+ if (!options.addSuffix) {
+ return declension(scheme, count)
+ }
+
+ if (options.comparison > 0) {
+ return 'za ' + declension(scheme, count, 'future')
+ } else {
+ return declension(scheme, count, 'past') + ' temu'
+ }
+}
diff --git a/date-fns/src/locale/pl/_lib/formatLong/index.js b/date-fns/src/locale/pl/_lib/formatLong/index.js
new file mode 100644
index 0000000..4cb65a1
--- /dev/null
+++ b/date-fns/src/locale/pl/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, do MMMM y',
+ long: 'do MMMM y',
+ medium: 'do MMM y',
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/pl/_lib/formatRelative/index.js b/date-fns/src/locale/pl/_lib/formatRelative/index.js
new file mode 100644
index 0000000..22eb1e2
--- /dev/null
+++ b/date-fns/src/locale/pl/_lib/formatRelative/index.js
@@ -0,0 +1,69 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+var adjectivesLastWeek = {
+ masculine: 'ostatni',
+ feminine: 'ostatnia'
+}
+
+var adjectivesThisWeek = {
+ masculine: 'ten',
+ feminine: 'ta'
+}
+
+var adjectivesNextWeek = {
+ masculine: 'następny',
+ feminine: 'następna'
+}
+
+var dayGrammaticalGender = {
+ 0: 'feminine',
+ 1: 'masculine',
+ 2: 'masculine',
+ 3: 'feminine',
+ 4: 'masculine',
+ 5: 'masculine',
+ 6: 'feminine'
+}
+
+function getAdjectives(token, date, baseDate, options) {
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return adjectivesThisWeek
+ } else if (token === 'lastWeek') {
+ return adjectivesLastWeek
+ } else if (token === 'nextWeek') {
+ return adjectivesNextWeek
+ } else {
+ throw new Error(`Cannot determine adjectives for token ${token}`)
+ }
+}
+
+function getAdjective(token, date, baseDate, options) {
+ var day = date.getUTCDay()
+ var adjectives = getAdjectives(token, date, baseDate, options)
+ var grammaticalGender = dayGrammaticalGender[day]
+
+ return adjectives[grammaticalGender]
+}
+
+function dayAndTimeWithAdjective(token, date, baseDate, options) {
+ var adjective = getAdjective(token, date, baseDate, options)
+ return `'${adjective}' eeee 'o' p`
+}
+
+var formatRelativeLocale = {
+ lastWeek: dayAndTimeWithAdjective,
+ yesterday: "'wczoraj o' p",
+ today: "'dzisiaj o' p",
+ tomorrow: "'jutro o' p",
+ nextWeek: dayAndTimeWithAdjective,
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+ if (typeof format === 'function') {
+ return format(token, date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/pl/_lib/localize/index.js b/date-fns/src/locale/pl/_lib/localize/index.js
new file mode 100644
index 0000000..e348565
--- /dev/null
+++ b/date-fns/src/locale/pl/_lib/localize/index.js
@@ -0,0 +1,215 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return String(number)
+}
+
+var eraValues = {
+ narrow: ['p.n.e.', 'n.e.'],
+ abbreviated: ['p.n.e.', 'n.e.'],
+ wide: ['przed naszą erą', 'naszej ery']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['I kw.', 'II kw.', 'III kw.', 'IV kw.'],
+ wide: ['I kwartał', 'II kwartał', 'III kwartał', 'IV kwartał']
+}
+
+var monthValues = {
+ narrow: ['S', 'L', 'M', 'K', 'M', 'C', 'L', 'S', 'W', 'P', 'L', 'G'],
+ abbreviated: [
+ 'sty',
+ 'lut',
+ 'mar',
+ 'kwi',
+ 'maj',
+ 'cze',
+ 'lip',
+ 'sie',
+ 'wrz',
+ 'paź',
+ 'lis',
+ 'gru'
+ ],
+ wide: [
+ 'styczeń',
+ 'luty',
+ 'marzec',
+ 'kwiecień',
+ 'maj',
+ 'czerwiec',
+ 'lipiec',
+ 'sierpień',
+ 'wrzesień',
+ 'październik',
+ 'listopad',
+ 'grudzień'
+ ]
+}
+var monthFormattingValues = {
+ narrow: ['s', 'l', 'm', 'k', 'm', 'c', 'l', 's', 'w', 'p', 'l', 'g'],
+ abbreviated: [
+ 'sty',
+ 'lut',
+ 'mar',
+ 'kwi',
+ 'maj',
+ 'cze',
+ 'lip',
+ 'sie',
+ 'wrz',
+ 'paź',
+ 'lis',
+ 'gru'
+ ],
+ wide: [
+ 'stycznia',
+ 'lutego',
+ 'marca',
+ 'kwietnia',
+ 'maja',
+ 'czerwca',
+ 'lipca',
+ 'sierpnia',
+ 'września',
+ 'października',
+ 'listopada',
+ 'grudnia'
+ ]
+}
+
+var dayValues = {
+ narrow: ['N', 'P', 'W', 'Ś', 'C', 'P', 'S'],
+ short: ['nie', 'pon', 'wto', 'śro', 'czw', 'pią', 'sob'],
+ abbreviated: ['niedz.', 'pon.', 'wt.', 'śr.', 'czw.', 'pt.', 'sob.'],
+ wide: [
+ 'niedziela',
+ 'poniedziałek',
+ 'wtorek',
+ 'środa',
+ 'czwartek',
+ 'piątek',
+ 'sobota'
+ ]
+}
+var dayFormattingValues = {
+ narrow: ['n', 'p', 'w', 'ś', 'c', 'p', 's'],
+ short: ['nie', 'pon', 'wto', 'śro', 'czw', 'pią', 'sob'],
+ abbreviated: ['niedz.', 'pon.', 'wt.', 'śr.', 'czw.', 'pt.', 'sob.'],
+ wide: [
+ 'niedziela',
+ 'poniedziałek',
+ 'wtorek',
+ 'środa',
+ 'czwartek',
+ 'piątek',
+ 'sobota'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'półn.',
+ noon: 'poł',
+ morning: 'rano',
+ afternoon: 'popoł.',
+ evening: 'wiecz.',
+ night: 'noc'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'północ',
+ noon: 'południe',
+ morning: 'rano',
+ afternoon: 'popołudnie',
+ evening: 'wieczór',
+ night: 'noc'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'północ',
+ noon: 'południe',
+ morning: 'rano',
+ afternoon: 'popołudnie',
+ evening: 'wieczór',
+ night: 'noc'
+ }
+}
+var dayPeriodFormattingValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'o półn.',
+ noon: 'w poł.',
+ morning: 'rano',
+ afternoon: 'po poł.',
+ evening: 'wiecz.',
+ night: 'w nocy'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'o północy',
+ noon: 'w południe',
+ morning: 'rano',
+ afternoon: 'po południu',
+ evening: 'wieczorem',
+ night: 'w nocy'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'o północy',
+ noon: 'w południe',
+ morning: 'rano',
+ afternoon: 'po południu',
+ evening: 'wieczorem',
+ night: 'w nocy'
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: monthFormattingValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ formattingValues: dayFormattingValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: dayPeriodFormattingValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/pl/_lib/match/index.js b/date-fns/src/locale/pl/_lib/match/index.js
new file mode 100644
index 0000000..8d62792
--- /dev/null
+++ b/date-fns/src/locale/pl/_lib/match/index.js
@@ -0,0 +1,149 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,
+ abbreviated: /^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,
+ wide: /^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i
+}
+var parseEraPatterns = {
+ any: [/^p/i, /^n/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^(I|II|III|IV)\s*kw\.?/i,
+ wide: /^(I|II|III|IV)\s*kwarta(ł|l)/i
+}
+var parseQuarterPatterns = {
+ narrow: [/1/i, /2/i, /3/i, /4/i],
+ any: [/^I kw/i, /^II kw/i, /^III kw/i, /^IV kw/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[slmkcwpg]/i,
+ abbreviated: /^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,
+ wide: /^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^s/i,
+ /^l/i,
+ /^m/i,
+ /^k/i,
+ /^m/i,
+ /^c/i,
+ /^l/i,
+ /^s/i,
+ /^w/i,
+ /^p/i,
+ /^l/i,
+ /^g/i
+ ],
+ any: [
+ /^st/i,
+ /^lu/i,
+ /^mar/i,
+ /^k/i,
+ /^maj/i,
+ /^c/i,
+ /^lip/i,
+ /^si/i,
+ /^w/i,
+ /^p/i,
+ /^lis/i,
+ /^g/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[npwścs]/i,
+ short: /^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,
+ abbreviated: /^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,
+ wide: /^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i
+}
+var parseDayPatterns = {
+ narrow: [/^n/i, /^p/i, /^w/i, /^ś/i, /^c/i, /^p/i, /^s/i],
+ abbreviated: [/^n/i, /^po/i, /^w/i, /^(ś|s)r/i, /^c/i, /^pt/i, /^so/i],
+ any: [/^n/i, /^po/i, /^w/i, /^(ś|s)r/i, /^c/i, /^pi/i, /^so/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,
+ any: /^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i
+}
+var parseDayPeriodPatterns = {
+ narrow: {
+ am: /^a$/i,
+ pm: /^p$/i,
+ midnight: /pó(ł|l)n/i,
+ noon: /po(ł|l)/i,
+ morning: /rano/i,
+ afternoon: /po\s*po(ł|l)/i,
+ evening: /wiecz/i,
+ night: /noc/i
+ },
+ any: {
+ am: /^am/i,
+ pm: /^pm/i,
+ midnight: /pó(ł|l)n/i,
+ noon: /po(ł|l)/i,
+ morning: /rano/i,
+ afternoon: /po\s*po(ł|l)/i,
+ evening: /wiecz/i,
+ night: /noc/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/pl/index.d.ts b/date-fns/src/locale/pl/index.d.ts
new file mode 100644
index 0000000..1ff8b7d
--- /dev/null
+++ b/date-fns/src/locale/pl/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { pl } from 'date-fns/locale'
+export default pl
diff --git a/date-fns/src/locale/pl/index.js b/date-fns/src/locale/pl/index.js
new file mode 100644
index 0000000..2b74eae
--- /dev/null
+++ b/date-fns/src/locale/pl/index.js
@@ -0,0 +1,31 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Polish locale.
+ * @language Polish
+ * @iso-639-2 pol
+ * @author Mateusz Derks [@ertrzyiks]{@link https://github.com/ertrzyiks}
+ * @author Just RAG [@justrag]{@link https://github.com/justrag}
+ * @author Mikolaj Grzyb [@mikolajgrzyb]{@link https://github.com/mikolajgrzyb}
+ * @author Mateusz Tokarski [@mutisz]{@link https://github.com/mutisz}
+ */
+var locale = {
+ code: 'pl',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/pl/index.js.flow b/date-fns/src/locale/pl/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/pl/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/pl/snapshot.md b/date-fns/src/locale/pl/snapshot.md
new file mode 100644
index 0000000..f1fabe9
--- /dev/null
+++ b/date-fns/src/locale/pl/snapshot.md
@@ -0,0 +1,304 @@
+# Polish (pl) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4 | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | I kw. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | II kw. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | I kwartał | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | II kwartał | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | I kw. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | II kw. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | I kwartał | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | II kwartał | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | lut | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | lip | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | lutego | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | lipca | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | l | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | l | 2019-02-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | lut | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | lip | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | luty | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | lipiec | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | L | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | L | 2019-02-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pt. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pt. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pt. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | poniedziałek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piątek | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | pon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pią | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pt. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | poniedziałek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piątek | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | pon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pią | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pt. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | poniedziałek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piątek | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | pon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pią | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pt. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | poniedziałek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piątek | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | pon | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pią | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | rano | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | po południu | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | wieczorem | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | w nocy | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | rano | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | po południu | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | wieczorem | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | w nocy | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | rano | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | po południu | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | wieczorem | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | w nocy | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | rano | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | po południu | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | wieczorem | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | w nocy | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | rano | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | po poł. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | wiecz. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | w nocy | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 lut 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maj 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 lutego 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maja 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | środa, 11 lutego 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | niedziela, 29 maja 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 lut 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maj 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 lutego 1987 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 maja 1453 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | środa, 11 lutego 1987 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | niedziela, 29 maja 1453 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | około 6 lat | około 6 lat | za około 6 lat |
+| 2005-01-01T00:00:00.000Z | około 5 lat | około 5 lat | za około 5 lat |
+| 2004-01-01T00:00:00.000Z | około 4 lata | około 4 lata | za około 4 lata |
+| 2003-01-01T00:00:00.000Z | około 3 lata | około 3 lata | za około 3 lata |
+| 2002-01-01T00:00:00.000Z | około 2 lata | około 2 lata | za około 2 lata |
+| 2001-06-01T00:00:00.000Z | ponad rok | ponad rok | za ponad rok |
+| 2001-02-01T00:00:00.000Z | około rok | około rok | za około rok |
+| 2001-01-01T00:00:00.000Z | około rok | około rok | za około rok |
+| 2000-06-01T00:00:00.000Z | 5 miesięcy | 5 miesięcy | za 5 miesięcy |
+| 2000-03-01T00:00:00.000Z | 2 miesiące | 2 miesiące | za 2 miesiące |
+| 2000-02-01T00:00:00.000Z | około miesiąc | około miesiąc | za około miesiąc |
+| 2000-01-15T00:00:00.000Z | 14 dni | 14 dni | za 14 dni |
+| 2000-01-02T00:00:00.000Z | dzień | dzień | za 1 dzień |
+| 2000-01-01T06:00:00.000Z | około 6 godzin | około 6 godzin | za około 6 godzin |
+| 2000-01-01T01:00:00.000Z | około godziny | około godziny | za około godzinę |
+| 2000-01-01T00:45:00.000Z | około godziny | około godziny | za około godzinę |
+| 2000-01-01T00:30:00.000Z | 30 minut | 30 minut | za 30 minut |
+| 2000-01-01T00:15:00.000Z | 15 minut | 15 minut | za 15 minut |
+| 2000-01-01T00:01:00.000Z | minuta | minuta | za minutę |
+| 2000-01-01T00:00:25.000Z | mniej niż minuta | pół minuty | za mniej niż minutę |
+| 2000-01-01T00:00:15.000Z | mniej niż minuta | mniej niż 20 sekund | za mniej niż minutę |
+| 2000-01-01T00:00:05.000Z | mniej niż minuta | mniej niż 10 sekund | za mniej niż minutę |
+| 2000-01-01T00:00:00.000Z | mniej niż minuta | mniej niż 5 sekund | mniej niż minutę temu |
+| 1999-12-31T23:59:55.000Z | mniej niż minuta | mniej niż 10 sekund | mniej niż minutę temu |
+| 1999-12-31T23:59:45.000Z | mniej niż minuta | mniej niż 20 sekund | mniej niż minutę temu |
+| 1999-12-31T23:59:35.000Z | mniej niż minuta | pół minuty | mniej niż minutę temu |
+| 1999-12-31T23:59:00.000Z | minuta | minuta | minutę temu |
+| 1999-12-31T23:45:00.000Z | 15 minut | 15 minut | 15 minut temu |
+| 1999-12-31T23:30:00.000Z | 30 minut | 30 minut | 30 minut temu |
+| 1999-12-31T23:15:00.000Z | około godziny | około godziny | około godziny temu |
+| 1999-12-31T23:00:00.000Z | około godziny | około godziny | około godziny temu |
+| 1999-12-31T18:00:00.000Z | około 6 godzin | około 6 godzin | około 6 godzin temu |
+| 1999-12-30T00:00:00.000Z | 2 dni | 2 dni | 2 dni temu |
+| 1999-12-15T00:00:00.000Z | 17 dni | 17 dni | 17 dni temu |
+| 1999-12-01T00:00:00.000Z | około miesiąc | około miesiąc | około miesiąc temu |
+| 1999-11-01T00:00:00.000Z | 2 miesiące | 2 miesiące | 2 miesiące temu |
+| 1999-06-01T00:00:00.000Z | 7 miesięcy | 7 miesięcy | 7 miesięcy temu |
+| 1999-01-01T00:00:00.000Z | około rok | około rok | około rok temu |
+| 1998-12-01T00:00:00.000Z | około rok | około rok | około rok temu |
+| 1998-06-01T00:00:00.000Z | ponad rok | ponad rok | ponad rok temu |
+| 1998-01-01T00:00:00.000Z | około 2 lata | około 2 lata | około 2 lata temu |
+| 1997-01-01T00:00:00.000Z | około 3 lata | około 3 lata | około 3 lata temu |
+| 1996-01-01T00:00:00.000Z | około 4 lata | około 4 lata | około 4 lata temu |
+| 1995-01-01T00:00:00.000Z | około 5 lat | około 5 lat | około 5 lat temu |
+| 1994-01-01T00:00:00.000Z | około 6 lat | około 6 lat | około 6 lat temu |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 lat | za 6 lat | 52608 godzin |
+| 2005-01-01T00:00:00.000Z | 5 lat | za 5 lat | 43848 godzin |
+| 2004-01-01T00:00:00.000Z | 4 lata | za 4 lata | 35064 godziny |
+| 2003-01-01T00:00:00.000Z | 3 lata | za 3 lata | 26304 godziny |
+| 2002-01-01T00:00:00.000Z | 2 lata | za 2 lata | 17544 godziny |
+| 2001-06-01T00:00:00.000Z | rok | za rok | 12408 godzin |
+| 2001-02-01T00:00:00.000Z | rok | za rok | 9528 godzin |
+| 2001-01-01T00:00:00.000Z | rok | za rok | 8784 godziny |
+| 2000-06-01T00:00:00.000Z | 5 miesięcy | za 5 miesięcy | 3648 godzin |
+| 2000-03-01T00:00:00.000Z | 2 miesiące | za 2 miesiące | 1440 godzin |
+| 2000-02-01T00:00:00.000Z | miesiąc | za miesiąc | 744 godziny |
+| 2000-01-15T00:00:00.000Z | 14 dni | za 14 dni | 336 godzin |
+| 2000-01-02T00:00:00.000Z | dzień | za 1 dzień | 24 godziny |
+| 2000-01-01T06:00:00.000Z | 6 godzin | za 6 godzin | 6 godzin |
+| 2000-01-01T01:00:00.000Z | godzina | za godzinę | godzina |
+| 2000-01-01T00:45:00.000Z | 45 minut | za 45 minut | godzina |
+| 2000-01-01T00:30:00.000Z | 30 minut | za 30 minut | godzina |
+| 2000-01-01T00:15:00.000Z | 15 minut | za 15 minut | 0 godzin |
+| 2000-01-01T00:01:00.000Z | minuta | za minutę | 0 godzin |
+| 2000-01-01T00:00:25.000Z | 25 sekund | za 25 sekund | 0 godzin |
+| 2000-01-01T00:00:15.000Z | 15 sekund | za 15 sekund | 0 godzin |
+| 2000-01-01T00:00:05.000Z | 5 sekund | za 5 sekund | 0 godzin |
+| 2000-01-01T00:00:00.000Z | 0 sekund | 0 sekund temu | 0 godzin |
+| 1999-12-31T23:59:55.000Z | 5 sekund | 5 sekund temu | 0 godzin |
+| 1999-12-31T23:59:45.000Z | 15 sekund | 15 sekund temu | 0 godzin |
+| 1999-12-31T23:59:35.000Z | 25 sekund | 25 sekund temu | 0 godzin |
+| 1999-12-31T23:59:00.000Z | minuta | minutę temu | 0 godzin |
+| 1999-12-31T23:45:00.000Z | 15 minut | 15 minut temu | 0 godzin |
+| 1999-12-31T23:30:00.000Z | 30 minut | 30 minut temu | godzina |
+| 1999-12-31T23:15:00.000Z | 45 minut | 45 minut temu | godzina |
+| 1999-12-31T23:00:00.000Z | godzina | godzinę temu | godzina |
+| 1999-12-31T18:00:00.000Z | 6 godzin | 6 godzin temu | 6 godzin |
+| 1999-12-30T00:00:00.000Z | 2 dni | 2 dni temu | 48 godzin |
+| 1999-12-15T00:00:00.000Z | 17 dni | 17 dni temu | 408 godzin |
+| 1999-12-01T00:00:00.000Z | miesiąc | miesiąc temu | 744 godziny |
+| 1999-11-01T00:00:00.000Z | 2 miesiące | 2 miesiące temu | 1464 godziny |
+| 1999-06-01T00:00:00.000Z | 7 miesięcy | 7 miesięcy temu | 5136 godzin |
+| 1999-01-01T00:00:00.000Z | rok | rok temu | 8760 godzin |
+| 1998-12-01T00:00:00.000Z | rok | rok temu | 9504 godziny |
+| 1998-06-01T00:00:00.000Z | 2 lata | 2 lata temu | 13896 godzin |
+| 1998-01-01T00:00:00.000Z | 2 lata | 2 lata temu | 17520 godzin |
+| 1997-01-01T00:00:00.000Z | 3 lata | 3 lata temu | 26280 godzin |
+| 1996-01-01T00:00:00.000Z | 4 lata | 4 lata temu | 35064 godziny |
+| 1995-01-01T00:00:00.000Z | 5 lat | 5 lat temu | 43824 godziny |
+| 1994-01-01T00:00:00.000Z | 6 lat | 6 lat temu | 52584 godziny |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | następna środa o 00:00 |
+| 2000-01-02T00:00:00.000Z | jutro o 00:00 |
+| 2000-01-01T00:00:00.000Z | dzisiaj o 00:00 |
+| 1999-12-31T00:00:00.000Z | wczoraj o 00:00 |
+| 1999-12-27T00:00:00.000Z | ten poniedziałek o 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/pt-BR/_lib/formatDistance/index.js b/date-fns/src/locale/pt-BR/_lib/formatDistance/index.js
new file mode 100644
index 0000000..fb8c5e5
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'menos de um segundo',
+ other: 'menos de {{count}} segundos'
+ },
+
+ xSeconds: {
+ one: '1 segundo',
+ other: '{{count}} segundos'
+ },
+
+ halfAMinute: 'meio minuto',
+
+ lessThanXMinutes: {
+ one: 'menos de um minuto',
+ other: 'menos de {{count}} minutos'
+ },
+
+ xMinutes: {
+ one: '1 minuto',
+ other: '{{count}} minutos'
+ },
+
+ aboutXHours: {
+ one: 'cerca de 1 hora',
+ other: 'cerca de {{count}} horas'
+ },
+
+ xHours: {
+ one: '1 hora',
+ other: '{{count}} horas'
+ },
+
+ xDays: {
+ one: '1 dia',
+ other: '{{count}} dias'
+ },
+
+ aboutXWeeks: {
+ one: 'cerca de 1 semana',
+ other: 'cerca de {{count}} semanas'
+ },
+
+ xWeeks: {
+ one: '1 semana',
+ other: '{{count}} semanas'
+ },
+
+ aboutXMonths: {
+ one: 'cerca de 1 mês',
+ other: 'cerca de {{count}} meses'
+ },
+
+ xMonths: {
+ one: '1 mês',
+ other: '{{count}} meses'
+ },
+
+ aboutXYears: {
+ one: 'cerca de 1 ano',
+ other: 'cerca de {{count}} anos'
+ },
+
+ xYears: {
+ one: '1 ano',
+ other: '{{count}} anos'
+ },
+
+ overXYears: {
+ one: 'mais de 1 ano',
+ other: 'mais de {{count}} anos'
+ },
+
+ almostXYears: {
+ one: 'quase 1 ano',
+ other: 'quase {{count}} anos'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'em ' + result
+ } else {
+ return 'há ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/pt-BR/_lib/formatLong/index.js b/date-fns/src/locale/pt-BR/_lib/formatLong/index.js
new file mode 100644
index 0000000..96250f1
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, d 'de' MMMM 'de' y",
+ long: "d 'de' MMMM 'de' y",
+ medium: 'd MMM y',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'às' {{time}}",
+ long: "{{date}} 'às' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/pt-BR/_lib/formatRelative/index.js b/date-fns/src/locale/pt-BR/_lib/formatRelative/index.js
new file mode 100644
index 0000000..4ce6c4d
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/_lib/formatRelative/index.js
@@ -0,0 +1,22 @@
+var formatRelativeLocale = {
+ lastWeek: function(date, _baseDate, _options) {
+ var weekday = date.getUTCDay()
+ var last = weekday === 0 || weekday === 6 ? 'último' : 'última'
+ return "'" + last + "' eeee 'às' p"
+ },
+ yesterday: "'ontem às' p",
+ today: "'hoje às' p",
+ tomorrow: "'amanhã às' p",
+ nextWeek: "eeee 'às' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/pt-BR/_lib/localize/index.js b/date-fns/src/locale/pt-BR/_lib/localize/index.js
new file mode 100644
index 0000000..36c856e
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/_lib/localize/index.js
@@ -0,0 +1,164 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['AC', 'DC'],
+ abbreviated: ['AC', 'DC'],
+ wide: ['antes de cristo', 'depois de cristo']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
+ wide: ['1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre']
+}
+
+var monthValues = {
+ narrow: ['j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
+ abbreviated: [
+ 'jan',
+ 'fev',
+ 'mar',
+ 'abr',
+ 'mai',
+ 'jun',
+ 'jul',
+ 'ago',
+ 'set',
+ 'out',
+ 'nov',
+ 'dez'
+ ],
+ wide: [
+ 'janeiro',
+ 'fevereiro',
+ 'março',
+ 'abril',
+ 'maio',
+ 'junho',
+ 'julho',
+ 'agosto',
+ 'setembro',
+ 'outubro',
+ 'novembro',
+ 'dezembro'
+ ]
+}
+
+var dayValues = {
+ narrow: ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'],
+ short: ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sab'],
+ abbreviated: ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'],
+ wide: ['domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'md',
+ morning: 'manhã',
+ afternoon: 'tarde',
+ evening: 'tarde',
+ night: 'noite'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'manhã',
+ afternoon: 'tarde',
+ evening: 'tarde',
+ night: 'noite'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'manhã',
+ afternoon: 'tarde',
+ evening: 'tarde',
+ night: 'noite'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'md',
+ morning: 'da manhã',
+ afternoon: 'da tarde',
+ evening: 'da tarde',
+ night: 'da noite'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'da manhã',
+ afternoon: 'da tarde',
+ evening: 'da tarde',
+ night: 'da noite'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'da manhã',
+ afternoon: 'da tarde',
+ evening: 'da tarde',
+ night: 'da noite'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+
+ if (unit === 'week' || unit === 'isoWeek') {
+ return number + 'ª'
+ }
+ return number + 'º'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/pt-BR/_lib/match/index.js b/date-fns/src/locale/pt-BR/_lib/match/index.js
new file mode 100644
index 0000000..7da07dc
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/_lib/match/index.js
@@ -0,0 +1,139 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)[ºªo]?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ac|dc|a|d)/i,
+ abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
+ wide: /^(antes de cristo|depois de cristo)/i
+}
+var parseEraPatterns = {
+ any: [/^ac/i, /^dc/i],
+ wide: [/^antes de cristo/i, /^depois de cristo/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^T[1234]/i,
+ wide: /^[1234](º)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmajsond]/i,
+ abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
+ wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^fev/i,
+ /^mar/i,
+ /^abr/i,
+ /^mai/i,
+ /^jun/i,
+ /^jul/i,
+ /^ago/i,
+ /^set/i,
+ /^out/i,
+ /^nov/i,
+ /^dez/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(dom|[23456]ª?|s[aá]b)/i,
+ short: /^(dom|[23456]ª?|s[aá]b)/i,
+ abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
+ wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
+}
+var parseDayPatterns = {
+ short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
+ narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
+ any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
+ any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mn|^meia[-\s]noite/i,
+ noon: /^md|^meio[-\s]dia/i,
+ morning: /manhã/i,
+ afternoon: /tarde/i,
+ evening: /tarde/i,
+ night: /noite/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/pt-BR/index.d.ts b/date-fns/src/locale/pt-BR/index.d.ts
new file mode 100644
index 0000000..e50a0b1
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ptBR } from 'date-fns/locale'
+export default ptBR
diff --git a/date-fns/src/locale/pt-BR/index.js b/date-fns/src/locale/pt-BR/index.js
new file mode 100644
index 0000000..a4dd002
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Portuguese locale (Brazil).
+ * @language Portuguese
+ * @iso-639-2 por
+ * @author Lucas Duailibe [@duailibe]{@link https://github.com/duailibe}
+ * @author Yago Carballo [@yagocarballo]{@link https://github.com/YagoCarballo}
+ */
+var locale = {
+ code: 'pt-BR',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/pt-BR/index.js.flow b/date-fns/src/locale/pt-BR/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/pt-BR/snapshot.md b/date-fns/src/locale/pt-BR/snapshot.md
new file mode 100644
index 0000000..dcbffae
--- /dev/null
+++ b/date-fns/src/locale/pt-BR/snapshot.md
@@ -0,0 +1,304 @@
+# Portuguese (pt-BR) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987º | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987º | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | fevereiro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julho | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | fevereiro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julho | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1ª | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49ª | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1ª | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48ª | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28º | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42º | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365º | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | segunda | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sexta | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | segunda | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sexta | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | segunda | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sexta | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | S | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | S | Invalid Date |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | seg | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sex | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | segunda | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sexta | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | S | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | S | Invalid Date |
+| | iiiiii | 2019-02-11T12:13:14.015Z | seg | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sex | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6º | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | segunda | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sexta | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | S | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | S | Invalid Date |
+| | eeeeee | 2019-02-11T12:13:14.015Z | seg | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sex | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6º | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | segunda | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sexta | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | S | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | S | Invalid Date |
+| | cccccc | 2019-02-11T12:13:14.015Z | seg | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | sex | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da noite | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1º | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55º | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1º | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55º | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 fev 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 de fevereiro de 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 de maio de 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | quarta-feira, 11 de fevereiro de 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de maio de 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 fev 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 de fevereiro de 1987 às 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 de maio de 1453 às 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | quarta-feira, 11 de fevereiro de 1987 às 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de maio de 1453 às 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | cerca de 6 anos | cerca de 6 anos | em cerca de 6 anos |
+| 2005-01-01T00:00:00.000Z | cerca de 5 anos | cerca de 5 anos | em cerca de 5 anos |
+| 2004-01-01T00:00:00.000Z | cerca de 4 anos | cerca de 4 anos | em cerca de 4 anos |
+| 2003-01-01T00:00:00.000Z | cerca de 3 anos | cerca de 3 anos | em cerca de 3 anos |
+| 2002-01-01T00:00:00.000Z | cerca de 2 anos | cerca de 2 anos | em cerca de 2 anos |
+| 2001-06-01T00:00:00.000Z | mais de 1 ano | mais de 1 ano | em mais de 1 ano |
+| 2001-02-01T00:00:00.000Z | cerca de 1 ano | cerca de 1 ano | em cerca de 1 ano |
+| 2001-01-01T00:00:00.000Z | cerca de 1 ano | cerca de 1 ano | em cerca de 1 ano |
+| 2000-06-01T00:00:00.000Z | 5 meses | 5 meses | em 5 meses |
+| 2000-03-01T00:00:00.000Z | 2 meses | 2 meses | em 2 meses |
+| 2000-02-01T00:00:00.000Z | cerca de 1 mês | cerca de 1 mês | em cerca de 1 mês |
+| 2000-01-15T00:00:00.000Z | 14 dias | 14 dias | em 14 dias |
+| 2000-01-02T00:00:00.000Z | 1 dia | 1 dia | em 1 dia |
+| 2000-01-01T06:00:00.000Z | cerca de 6 horas | cerca de 6 horas | em cerca de 6 horas |
+| 2000-01-01T01:00:00.000Z | cerca de 1 hora | cerca de 1 hora | em cerca de 1 hora |
+| 2000-01-01T00:45:00.000Z | cerca de 1 hora | cerca de 1 hora | em cerca de 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | 30 minutos | em 30 minutos |
+| 2000-01-01T00:15:00.000Z | 15 minutos | 15 minutos | em 15 minutos |
+| 2000-01-01T00:01:00.000Z | 1 minuto | 1 minuto | em 1 minuto |
+| 2000-01-01T00:00:25.000Z | menos de um minuto | meio minuto | em menos de um minuto |
+| 2000-01-01T00:00:15.000Z | menos de um minuto | menos de 20 segundos | em menos de um minuto |
+| 2000-01-01T00:00:05.000Z | menos de um minuto | menos de 10 segundos | em menos de um minuto |
+| 2000-01-01T00:00:00.000Z | menos de um minuto | menos de 5 segundos | há menos de um minuto |
+| 1999-12-31T23:59:55.000Z | menos de um minuto | menos de 10 segundos | há menos de um minuto |
+| 1999-12-31T23:59:45.000Z | menos de um minuto | menos de 20 segundos | há menos de um minuto |
+| 1999-12-31T23:59:35.000Z | menos de um minuto | meio minuto | há menos de um minuto |
+| 1999-12-31T23:59:00.000Z | 1 minuto | 1 minuto | há 1 minuto |
+| 1999-12-31T23:45:00.000Z | 15 minutos | 15 minutos | há 15 minutos |
+| 1999-12-31T23:30:00.000Z | 30 minutos | 30 minutos | há 30 minutos |
+| 1999-12-31T23:15:00.000Z | cerca de 1 hora | cerca de 1 hora | há cerca de 1 hora |
+| 1999-12-31T23:00:00.000Z | cerca de 1 hora | cerca de 1 hora | há cerca de 1 hora |
+| 1999-12-31T18:00:00.000Z | cerca de 6 horas | cerca de 6 horas | há cerca de 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 dias | 2 dias | há 2 dias |
+| 1999-12-15T00:00:00.000Z | 17 dias | 17 dias | há 17 dias |
+| 1999-12-01T00:00:00.000Z | cerca de 1 mês | cerca de 1 mês | há cerca de 1 mês |
+| 1999-11-01T00:00:00.000Z | 2 meses | 2 meses | há 2 meses |
+| 1999-06-01T00:00:00.000Z | 7 meses | 7 meses | há 7 meses |
+| 1999-01-01T00:00:00.000Z | cerca de 1 ano | cerca de 1 ano | há cerca de 1 ano |
+| 1998-12-01T00:00:00.000Z | cerca de 1 ano | cerca de 1 ano | há cerca de 1 ano |
+| 1998-06-01T00:00:00.000Z | mais de 1 ano | mais de 1 ano | há mais de 1 ano |
+| 1998-01-01T00:00:00.000Z | cerca de 2 anos | cerca de 2 anos | há cerca de 2 anos |
+| 1997-01-01T00:00:00.000Z | cerca de 3 anos | cerca de 3 anos | há cerca de 3 anos |
+| 1996-01-01T00:00:00.000Z | cerca de 4 anos | cerca de 4 anos | há cerca de 4 anos |
+| 1995-01-01T00:00:00.000Z | cerca de 5 anos | cerca de 5 anos | há cerca de 5 anos |
+| 1994-01-01T00:00:00.000Z | cerca de 6 anos | cerca de 6 anos | há cerca de 6 anos |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 anos | em 6 anos | 52608 horas |
+| 2005-01-01T00:00:00.000Z | 5 anos | em 5 anos | 43848 horas |
+| 2004-01-01T00:00:00.000Z | 4 anos | em 4 anos | 35064 horas |
+| 2003-01-01T00:00:00.000Z | 3 anos | em 3 anos | 26304 horas |
+| 2002-01-01T00:00:00.000Z | 2 anos | em 2 anos | 17544 horas |
+| 2001-06-01T00:00:00.000Z | 1 ano | em 1 ano | 12408 horas |
+| 2001-02-01T00:00:00.000Z | 1 ano | em 1 ano | 9528 horas |
+| 2001-01-01T00:00:00.000Z | 1 ano | em 1 ano | 8784 horas |
+| 2000-06-01T00:00:00.000Z | 5 meses | em 5 meses | 3648 horas |
+| 2000-03-01T00:00:00.000Z | 2 meses | em 2 meses | 1440 horas |
+| 2000-02-01T00:00:00.000Z | 1 mês | em 1 mês | 744 horas |
+| 2000-01-15T00:00:00.000Z | 14 dias | em 14 dias | 336 horas |
+| 2000-01-02T00:00:00.000Z | 1 dia | em 1 dia | 24 horas |
+| 2000-01-01T06:00:00.000Z | 6 horas | em 6 horas | 6 horas |
+| 2000-01-01T01:00:00.000Z | 1 hora | em 1 hora | 1 hora |
+| 2000-01-01T00:45:00.000Z | 45 minutos | em 45 minutos | 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | em 30 minutos | 1 hora |
+| 2000-01-01T00:15:00.000Z | 15 minutos | em 15 minutos | 0 horas |
+| 2000-01-01T00:01:00.000Z | 1 minuto | em 1 minuto | 0 horas |
+| 2000-01-01T00:00:25.000Z | 25 segundos | em 25 segundos | 0 horas |
+| 2000-01-01T00:00:15.000Z | 15 segundos | em 15 segundos | 0 horas |
+| 2000-01-01T00:00:05.000Z | 5 segundos | em 5 segundos | 0 horas |
+| 2000-01-01T00:00:00.000Z | 0 segundos | há 0 segundos | 0 horas |
+| 1999-12-31T23:59:55.000Z | 5 segundos | há 5 segundos | 0 horas |
+| 1999-12-31T23:59:45.000Z | 15 segundos | há 15 segundos | 0 horas |
+| 1999-12-31T23:59:35.000Z | 25 segundos | há 25 segundos | 0 horas |
+| 1999-12-31T23:59:00.000Z | 1 minuto | há 1 minuto | 0 horas |
+| 1999-12-31T23:45:00.000Z | 15 minutos | há 15 minutos | 0 horas |
+| 1999-12-31T23:30:00.000Z | 30 minutos | há 30 minutos | 1 hora |
+| 1999-12-31T23:15:00.000Z | 45 minutos | há 45 minutos | 1 hora |
+| 1999-12-31T23:00:00.000Z | 1 hora | há 1 hora | 1 hora |
+| 1999-12-31T18:00:00.000Z | 6 horas | há 6 horas | 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 dias | há 2 dias | 48 horas |
+| 1999-12-15T00:00:00.000Z | 17 dias | há 17 dias | 408 horas |
+| 1999-12-01T00:00:00.000Z | 1 mês | há 1 mês | 744 horas |
+| 1999-11-01T00:00:00.000Z | 2 meses | há 2 meses | 1464 horas |
+| 1999-06-01T00:00:00.000Z | 7 meses | há 7 meses | 5136 horas |
+| 1999-01-01T00:00:00.000Z | 1 ano | há 1 ano | 8760 horas |
+| 1998-12-01T00:00:00.000Z | 1 ano | há 1 ano | 9504 horas |
+| 1998-06-01T00:00:00.000Z | 2 anos | há 2 anos | 13896 horas |
+| 1998-01-01T00:00:00.000Z | 2 anos | há 2 anos | 17520 horas |
+| 1997-01-01T00:00:00.000Z | 3 anos | há 3 anos | 26280 horas |
+| 1996-01-01T00:00:00.000Z | 4 anos | há 4 anos | 35064 horas |
+| 1995-01-01T00:00:00.000Z | 5 anos | há 5 anos | 43824 horas |
+| 1994-01-01T00:00:00.000Z | 6 anos | há 6 anos | 52584 horas |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ----------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | quarta-feira às 00:00 |
+| 2000-01-02T00:00:00.000Z | amanhã às 00:00 |
+| 2000-01-01T00:00:00.000Z | hoje às 00:00 |
+| 1999-12-31T00:00:00.000Z | ontem às 00:00 |
+| 1999-12-27T00:00:00.000Z | última segunda-feira às 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/pt/_lib/formatDistance/index.js b/date-fns/src/locale/pt/_lib/formatDistance/index.js
new file mode 100644
index 0000000..de03087
--- /dev/null
+++ b/date-fns/src/locale/pt/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'menos de um segundo',
+ other: 'menos de {{count}} segundos'
+ },
+
+ xSeconds: {
+ one: '1 segundo',
+ other: '{{count}} segundos'
+ },
+
+ halfAMinute: 'meio minuto',
+
+ lessThanXMinutes: {
+ one: 'menos de um minuto',
+ other: 'menos de {{count}} minutos'
+ },
+
+ xMinutes: {
+ one: '1 minuto',
+ other: '{{count}} minutos'
+ },
+
+ aboutXHours: {
+ one: 'aproximadamente 1 hora',
+ other: 'aproximadamente {{count}} horas'
+ },
+
+ xHours: {
+ one: '1 hora',
+ other: '{{count}} horas'
+ },
+
+ xDays: {
+ one: '1 dia',
+ other: '{{count}} dias'
+ },
+
+ aboutXWeeks: {
+ one: 'aproximadamente 1 semana',
+ other: 'aproximadamente {{count}} semanas'
+ },
+
+ xWeeks: {
+ one: '1 semana',
+ other: '{{count}} semanas'
+ },
+
+ aboutXMonths: {
+ one: 'aproximadamente 1 mês',
+ other: 'aproximadamente {{count}} meses'
+ },
+
+ xMonths: {
+ one: '1 mês',
+ other: '{{count}} meses'
+ },
+
+ aboutXYears: {
+ one: 'aproximadamente 1 ano',
+ other: 'aproximadamente {{count}} anos'
+ },
+
+ xYears: {
+ one: '1 ano',
+ other: '{{count}} anos'
+ },
+
+ overXYears: {
+ one: 'mais de 1 ano',
+ other: 'mais de {{count}} anos'
+ },
+
+ almostXYears: {
+ one: 'quase 1 ano',
+ other: 'quase {{count}} anos'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'daqui a ' + result
+ } else {
+ return 'há ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/pt/_lib/formatLong/index.js b/date-fns/src/locale/pt/_lib/formatLong/index.js
new file mode 100644
index 0000000..08af8e3
--- /dev/null
+++ b/date-fns/src/locale/pt/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, d 'de' MMMM 'de' y",
+ long: "d 'de' MMMM 'de' y",
+ medium: "d 'de' MMM 'de' y",
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'às' {{time}}",
+ long: "{{date}} 'às' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/pt/_lib/formatRelative/index.js b/date-fns/src/locale/pt/_lib/formatRelative/index.js
new file mode 100644
index 0000000..63d5c7f
--- /dev/null
+++ b/date-fns/src/locale/pt/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'na última' eeee 'às' p",
+ yesterday: "'ontem às' p",
+ today: "'hoje às' p",
+ tomorrow: "'amanhã às' p",
+ nextWeek: "eeee 'às' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/pt/_lib/localize/index.js b/date-fns/src/locale/pt/_lib/localize/index.js
new file mode 100644
index 0000000..0ef458c
--- /dev/null
+++ b/date-fns/src/locale/pt/_lib/localize/index.js
@@ -0,0 +1,166 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number + 'º'
+}
+
+var eraValues = {
+ narrow: ['aC', 'dC'],
+ abbreviated: ['a.C.', 'd.C.'],
+ wide: ['antes de Cristo', 'depois de Cristo']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
+ wide: ['1º trimestre', '2º trimestre', '3º trimestre', '4º trimestre']
+}
+
+var monthValues = {
+ narrow: ['j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
+ abbreviated: [
+ 'jan',
+ 'fev',
+ 'mar',
+ 'abr',
+ 'mai',
+ 'jun',
+ 'jul',
+ 'ago',
+ 'set',
+ 'out',
+ 'nov',
+ 'dez'
+ ],
+ wide: [
+ 'janeiro',
+ 'fevereiro',
+ 'março',
+ 'abril',
+ 'maio',
+ 'junho',
+ 'julho',
+ 'agosto',
+ 'setembro',
+ 'outubro',
+ 'novembro',
+ 'dezembro'
+ ]
+}
+
+var dayValues = {
+ narrow: ['d', 's', 't', 'q', 'q', 's', 's'],
+ short: ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'],
+ abbreviated: ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'],
+ wide: [
+ 'domingo',
+ 'segunda-feira',
+ 'terça-feira',
+ 'quarta-feira',
+ 'quinta-feira',
+ 'sexta-feira',
+ 'sábado'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'manhã',
+ afternoon: 'tarde',
+ evening: 'noite',
+ night: 'madrugada'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'manhã',
+ afternoon: 'tarde',
+ evening: 'noite',
+ night: 'madrugada'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'manhã',
+ afternoon: 'tarde',
+ evening: 'noite',
+ night: 'madrugada'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'da manhã',
+ afternoon: 'da tarde',
+ evening: 'da noite',
+ night: 'da madrugada'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'da manhã',
+ afternoon: 'da tarde',
+ evening: 'da noite',
+ night: 'da madrugada'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'meia-noite',
+ noon: 'meio-dia',
+ morning: 'da manhã',
+ afternoon: 'da tarde',
+ evening: 'da noite',
+ night: 'da madrugada'
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+export default localize
diff --git a/date-fns/src/locale/pt/_lib/match/index.js b/date-fns/src/locale/pt/_lib/match/index.js
new file mode 100644
index 0000000..3aea9de
--- /dev/null
+++ b/date-fns/src/locale/pt/_lib/match/index.js
@@ -0,0 +1,141 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(º|ª)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ac|dc|a|d)/i,
+ abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
+ wide: /^(antes de cristo|antes da era comum|depois de cristo|era comum)/i
+}
+var parseEraPatterns = {
+ any: [/^ac/i, /^dc/i],
+ wide: [
+ /^(antes de cristo|antes da era comum)/i,
+ /^(depois de cristo|era comum)/i
+ ]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^T[1234]/i,
+ wide: /^[1234](º|ª)? trimestre/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
+ wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ab/i,
+ /^mai/i,
+ /^jun/i,
+ /^jul/i,
+ /^ag/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dstq]/i,
+ short: /^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,
+ abbreviated: /^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,
+ wide: /^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^s/i, /^t/i, /^q/i, /^q/i, /^s/i, /^s/i],
+ any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[áa]/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,
+ any: /^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^meia/i,
+ noon: /^meio/i,
+ morning: /manh[ãa]/i,
+ afternoon: /tarde/i,
+ evening: /noite/i,
+ night: /madrugada/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/pt/index.d.ts b/date-fns/src/locale/pt/index.d.ts
new file mode 100644
index 0000000..b848c91
--- /dev/null
+++ b/date-fns/src/locale/pt/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { pt } from 'date-fns/locale'
+export default pt
diff --git a/date-fns/src/locale/pt/index.js b/date-fns/src/locale/pt/index.js
new file mode 100644
index 0000000..0505d72
--- /dev/null
+++ b/date-fns/src/locale/pt/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Portuguese locale.
+ * @language Portuguese
+ * @iso-639-2 por
+ * @author Dário Freire [@dfreire]{@link https://github.com/dfreire}
+ * @author Adrián de la Rosa [@adrm]{@link https://github.com/adrm}
+ */
+var locale = {
+ code: 'pt',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/pt/index.js.flow b/date-fns/src/locale/pt/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/pt/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/pt/snapshot.md b/date-fns/src/locale/pt/snapshot.md
new file mode 100644
index 0000000..75dfb30
--- /dev/null
+++ b/date-fns/src/locale/pt/snapshot.md
@@ -0,0 +1,304 @@
+# Portuguese (pt) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987º | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5º | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987º | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4º | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1º | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1º trimestre | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2º trimestre | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | fevereiro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julho | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2º | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7º | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | fevereiro | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julho | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1º | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48º | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28º | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42º | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365º | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1º | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5º | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | segunda-feira | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sexta-feira | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | s | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | seg | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | sex | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da noite | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da madrugada | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da noite | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da madrugada | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da noite | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da madrugada | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da noite | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da madrugada | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | da manhã | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | da tarde | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | da noite | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | da madrugada | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11º | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11º | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23º | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1º | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55º | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1º | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55º | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 de fev de 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 de mai de 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 de fevereiro de 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 de maio de 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | quarta-feira, 11 de fevereiro de 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de maio de 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 de fev de 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 de mai de 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 de fevereiro de 1987 às 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 de maio de 1453 às 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | quarta-feira, 11 de fevereiro de 1987 às 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | domingo, 29 de maio de 1453 às 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------------- | ----------------------- | ------------------------------- |
+| 2006-01-01T00:00:00.000Z | aproximadamente 6 anos | aproximadamente 6 anos | daqui a aproximadamente 6 anos |
+| 2005-01-01T00:00:00.000Z | aproximadamente 5 anos | aproximadamente 5 anos | daqui a aproximadamente 5 anos |
+| 2004-01-01T00:00:00.000Z | aproximadamente 4 anos | aproximadamente 4 anos | daqui a aproximadamente 4 anos |
+| 2003-01-01T00:00:00.000Z | aproximadamente 3 anos | aproximadamente 3 anos | daqui a aproximadamente 3 anos |
+| 2002-01-01T00:00:00.000Z | aproximadamente 2 anos | aproximadamente 2 anos | daqui a aproximadamente 2 anos |
+| 2001-06-01T00:00:00.000Z | mais de 1 ano | mais de 1 ano | daqui a mais de 1 ano |
+| 2001-02-01T00:00:00.000Z | aproximadamente 1 ano | aproximadamente 1 ano | daqui a aproximadamente 1 ano |
+| 2001-01-01T00:00:00.000Z | aproximadamente 1 ano | aproximadamente 1 ano | daqui a aproximadamente 1 ano |
+| 2000-06-01T00:00:00.000Z | 5 meses | 5 meses | daqui a 5 meses |
+| 2000-03-01T00:00:00.000Z | 2 meses | 2 meses | daqui a 2 meses |
+| 2000-02-01T00:00:00.000Z | aproximadamente 1 mês | aproximadamente 1 mês | daqui a aproximadamente 1 mês |
+| 2000-01-15T00:00:00.000Z | 14 dias | 14 dias | daqui a 14 dias |
+| 2000-01-02T00:00:00.000Z | 1 dia | 1 dia | daqui a 1 dia |
+| 2000-01-01T06:00:00.000Z | aproximadamente 6 horas | aproximadamente 6 horas | daqui a aproximadamente 6 horas |
+| 2000-01-01T01:00:00.000Z | aproximadamente 1 hora | aproximadamente 1 hora | daqui a aproximadamente 1 hora |
+| 2000-01-01T00:45:00.000Z | aproximadamente 1 hora | aproximadamente 1 hora | daqui a aproximadamente 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | 30 minutos | daqui a 30 minutos |
+| 2000-01-01T00:15:00.000Z | 15 minutos | 15 minutos | daqui a 15 minutos |
+| 2000-01-01T00:01:00.000Z | 1 minuto | 1 minuto | daqui a 1 minuto |
+| 2000-01-01T00:00:25.000Z | menos de um minuto | meio minuto | daqui a menos de um minuto |
+| 2000-01-01T00:00:15.000Z | menos de um minuto | menos de 20 segundos | daqui a menos de um minuto |
+| 2000-01-01T00:00:05.000Z | menos de um minuto | menos de 10 segundos | daqui a menos de um minuto |
+| 2000-01-01T00:00:00.000Z | menos de um minuto | menos de 5 segundos | há menos de um minuto |
+| 1999-12-31T23:59:55.000Z | menos de um minuto | menos de 10 segundos | há menos de um minuto |
+| 1999-12-31T23:59:45.000Z | menos de um minuto | menos de 20 segundos | há menos de um minuto |
+| 1999-12-31T23:59:35.000Z | menos de um minuto | meio minuto | há menos de um minuto |
+| 1999-12-31T23:59:00.000Z | 1 minuto | 1 minuto | há 1 minuto |
+| 1999-12-31T23:45:00.000Z | 15 minutos | 15 minutos | há 15 minutos |
+| 1999-12-31T23:30:00.000Z | 30 minutos | 30 minutos | há 30 minutos |
+| 1999-12-31T23:15:00.000Z | aproximadamente 1 hora | aproximadamente 1 hora | há aproximadamente 1 hora |
+| 1999-12-31T23:00:00.000Z | aproximadamente 1 hora | aproximadamente 1 hora | há aproximadamente 1 hora |
+| 1999-12-31T18:00:00.000Z | aproximadamente 6 horas | aproximadamente 6 horas | há aproximadamente 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 dias | 2 dias | há 2 dias |
+| 1999-12-15T00:00:00.000Z | 17 dias | 17 dias | há 17 dias |
+| 1999-12-01T00:00:00.000Z | aproximadamente 1 mês | aproximadamente 1 mês | há aproximadamente 1 mês |
+| 1999-11-01T00:00:00.000Z | 2 meses | 2 meses | há 2 meses |
+| 1999-06-01T00:00:00.000Z | 7 meses | 7 meses | há 7 meses |
+| 1999-01-01T00:00:00.000Z | aproximadamente 1 ano | aproximadamente 1 ano | há aproximadamente 1 ano |
+| 1998-12-01T00:00:00.000Z | aproximadamente 1 ano | aproximadamente 1 ano | há aproximadamente 1 ano |
+| 1998-06-01T00:00:00.000Z | mais de 1 ano | mais de 1 ano | há mais de 1 ano |
+| 1998-01-01T00:00:00.000Z | aproximadamente 2 anos | aproximadamente 2 anos | há aproximadamente 2 anos |
+| 1997-01-01T00:00:00.000Z | aproximadamente 3 anos | aproximadamente 3 anos | há aproximadamente 3 anos |
+| 1996-01-01T00:00:00.000Z | aproximadamente 4 anos | aproximadamente 4 anos | há aproximadamente 4 anos |
+| 1995-01-01T00:00:00.000Z | aproximadamente 5 anos | aproximadamente 5 anos | há aproximadamente 5 anos |
+| 1994-01-01T00:00:00.000Z | aproximadamente 6 anos | aproximadamente 6 anos | há aproximadamente 6 anos |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ----------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 anos | daqui a 6 anos | 52608 horas |
+| 2005-01-01T00:00:00.000Z | 5 anos | daqui a 5 anos | 43848 horas |
+| 2004-01-01T00:00:00.000Z | 4 anos | daqui a 4 anos | 35064 horas |
+| 2003-01-01T00:00:00.000Z | 3 anos | daqui a 3 anos | 26304 horas |
+| 2002-01-01T00:00:00.000Z | 2 anos | daqui a 2 anos | 17544 horas |
+| 2001-06-01T00:00:00.000Z | 1 ano | daqui a 1 ano | 12408 horas |
+| 2001-02-01T00:00:00.000Z | 1 ano | daqui a 1 ano | 9528 horas |
+| 2001-01-01T00:00:00.000Z | 1 ano | daqui a 1 ano | 8784 horas |
+| 2000-06-01T00:00:00.000Z | 5 meses | daqui a 5 meses | 3648 horas |
+| 2000-03-01T00:00:00.000Z | 2 meses | daqui a 2 meses | 1440 horas |
+| 2000-02-01T00:00:00.000Z | 1 mês | daqui a 1 mês | 744 horas |
+| 2000-01-15T00:00:00.000Z | 14 dias | daqui a 14 dias | 336 horas |
+| 2000-01-02T00:00:00.000Z | 1 dia | daqui a 1 dia | 24 horas |
+| 2000-01-01T06:00:00.000Z | 6 horas | daqui a 6 horas | 6 horas |
+| 2000-01-01T01:00:00.000Z | 1 hora | daqui a 1 hora | 1 hora |
+| 2000-01-01T00:45:00.000Z | 45 minutos | daqui a 45 minutos | 1 hora |
+| 2000-01-01T00:30:00.000Z | 30 minutos | daqui a 30 minutos | 1 hora |
+| 2000-01-01T00:15:00.000Z | 15 minutos | daqui a 15 minutos | 0 horas |
+| 2000-01-01T00:01:00.000Z | 1 minuto | daqui a 1 minuto | 0 horas |
+| 2000-01-01T00:00:25.000Z | 25 segundos | daqui a 25 segundos | 0 horas |
+| 2000-01-01T00:00:15.000Z | 15 segundos | daqui a 15 segundos | 0 horas |
+| 2000-01-01T00:00:05.000Z | 5 segundos | daqui a 5 segundos | 0 horas |
+| 2000-01-01T00:00:00.000Z | 0 segundos | há 0 segundos | 0 horas |
+| 1999-12-31T23:59:55.000Z | 5 segundos | há 5 segundos | 0 horas |
+| 1999-12-31T23:59:45.000Z | 15 segundos | há 15 segundos | 0 horas |
+| 1999-12-31T23:59:35.000Z | 25 segundos | há 25 segundos | 0 horas |
+| 1999-12-31T23:59:00.000Z | 1 minuto | há 1 minuto | 0 horas |
+| 1999-12-31T23:45:00.000Z | 15 minutos | há 15 minutos | 0 horas |
+| 1999-12-31T23:30:00.000Z | 30 minutos | há 30 minutos | 1 hora |
+| 1999-12-31T23:15:00.000Z | 45 minutos | há 45 minutos | 1 hora |
+| 1999-12-31T23:00:00.000Z | 1 hora | há 1 hora | 1 hora |
+| 1999-12-31T18:00:00.000Z | 6 horas | há 6 horas | 6 horas |
+| 1999-12-30T00:00:00.000Z | 2 dias | há 2 dias | 48 horas |
+| 1999-12-15T00:00:00.000Z | 17 dias | há 17 dias | 408 horas |
+| 1999-12-01T00:00:00.000Z | 1 mês | há 1 mês | 744 horas |
+| 1999-11-01T00:00:00.000Z | 2 meses | há 2 meses | 1464 horas |
+| 1999-06-01T00:00:00.000Z | 7 meses | há 7 meses | 5136 horas |
+| 1999-01-01T00:00:00.000Z | 1 ano | há 1 ano | 8760 horas |
+| 1998-12-01T00:00:00.000Z | 1 ano | há 1 ano | 9504 horas |
+| 1998-06-01T00:00:00.000Z | 2 anos | há 2 anos | 13896 horas |
+| 1998-01-01T00:00:00.000Z | 2 anos | há 2 anos | 17520 horas |
+| 1997-01-01T00:00:00.000Z | 3 anos | há 3 anos | 26280 horas |
+| 1996-01-01T00:00:00.000Z | 4 anos | há 4 anos | 35064 horas |
+| 1995-01-01T00:00:00.000Z | 5 anos | há 5 anos | 43824 horas |
+| 1994-01-01T00:00:00.000Z | 6 anos | há 6 anos | 52584 horas |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | quarta-feira às 00:00 |
+| 2000-01-02T00:00:00.000Z | amanhã às 00:00 |
+| 2000-01-01T00:00:00.000Z | hoje às 00:00 |
+| 1999-12-31T00:00:00.000Z | ontem às 00:00 |
+| 1999-12-27T00:00:00.000Z | na última segunda-feira às 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/ro/_lib/formatDistance/index.js b/date-fns/src/locale/ro/_lib/formatDistance/index.js
new file mode 100644
index 0000000..6fb15f5
--- /dev/null
+++ b/date-fns/src/locale/ro/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'mai puțin de o secundă',
+ other: 'mai puțin de {{count}} secunde'
+ },
+
+ xSeconds: {
+ one: '1 secundă',
+ other: '{{count}} secunde'
+ },
+
+ halfAMinute: 'jumătate de minut',
+
+ lessThanXMinutes: {
+ one: 'mai puțin de un minut',
+ other: 'mai puțin de {{count}} minute'
+ },
+
+ xMinutes: {
+ one: '1 minut',
+ other: '{{count}} minute'
+ },
+
+ aboutXHours: {
+ one: 'circa 1 oră',
+ other: 'circa {{count}} ore'
+ },
+
+ xHours: {
+ one: '1 oră',
+ other: '{{count}} ore'
+ },
+
+ xDays: {
+ one: '1 zi',
+ other: '{{count}} zile'
+ },
+
+ aboutXWeeks: {
+ one: 'circa o săptămână',
+ other: 'circa {{count}} săptămâni'
+ },
+
+ xWeeks: {
+ one: '1 săptămână',
+ other: '{{count}} săptămâni'
+ },
+
+ aboutXMonths: {
+ one: 'circa 1 lună',
+ other: 'circa {{count}} luni'
+ },
+
+ xMonths: {
+ one: '1 lună',
+ other: '{{count}} luni'
+ },
+
+ aboutXYears: {
+ one: 'circa 1 an',
+ other: 'circa {{count}} ani'
+ },
+
+ xYears: {
+ one: '1 an',
+ other: '{{count}} ani'
+ },
+
+ overXYears: {
+ one: 'peste 1 an',
+ other: 'peste {{count}} ani'
+ },
+
+ almostXYears: {
+ one: 'aproape 1 an',
+ other: 'aproape {{count}} ani'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'în ' + result
+ } else {
+ return result + ' în urmă'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ro/_lib/formatLong/index.js b/date-fns/src/locale/ro/_lib/formatLong/index.js
new file mode 100644
index 0000000..e3bc404
--- /dev/null
+++ b/date-fns/src/locale/ro/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d MMMM yyyy',
+ long: 'd MMMM yyyy',
+ medium: 'd MMM yyyy',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'la' {{time}}",
+ long: "{{date}} 'la' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ro/_lib/formatRelative/index.js b/date-fns/src/locale/ro/_lib/formatRelative/index.js
new file mode 100644
index 0000000..435ef8b
--- /dev/null
+++ b/date-fns/src/locale/ro/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'trecută la' p",
+ yesterday: "'ieri la' p",
+ today: "'astăzi la' p",
+ tomorrow: "'mâine la' p",
+ nextWeek: "eeee 'viitoare la' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ro/_lib/localize/index.js b/date-fns/src/locale/ro/_lib/localize/index.js
new file mode 100644
index 0000000..f345da6
--- /dev/null
+++ b/date-fns/src/locale/ro/_lib/localize/index.js
@@ -0,0 +1,164 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['Î', 'D'],
+ abbreviated: ['Î.d.C.', 'D.C.'],
+ wide: ['Înainte de Cristos', 'După Cristos']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['T1', 'T2', 'T3', 'T4'],
+ wide: [
+ 'primul trimestru',
+ 'al doilea trimestru',
+ 'al treilea trimestru',
+ 'al patrulea trimestru'
+ ]
+}
+
+var monthValues = {
+ narrow: ['I', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'ian',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'mai',
+ 'iun',
+ 'iul',
+ 'aug',
+ 'sep',
+ 'oct',
+ 'noi',
+ 'dec'
+ ],
+ wide: [
+ 'ianuarie',
+ 'februarie',
+ 'martie',
+ 'aprilie',
+ 'mai',
+ 'iunie',
+ 'iulie',
+ 'august',
+ 'septembrie',
+ 'octombrie',
+ 'noiembrie',
+ 'decembrie'
+ ]
+}
+
+var dayValues = {
+ narrow: ['d', 'l', 'm', 'm', 'j', 'v', 's'],
+ short: ['du', 'lu', 'ma', 'mi', 'jo', 'vi', 'sâ'],
+ abbreviated: ['dum', 'lun', 'mar', 'mie', 'joi', 'vin', 'sâm'],
+ wide: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'ami',
+ morning: 'dim',
+ afternoon: 'da',
+ evening: 's',
+ night: 'n'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'miezul nopții',
+ noon: 'amiază',
+ morning: 'dimineață',
+ afternoon: 'după-amiază',
+ evening: 'seară',
+ night: 'noapte'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'miezul nopții',
+ noon: 'amiază',
+ morning: 'dimineață',
+ afternoon: 'după-amiază',
+ evening: 'seară',
+ night: 'noapte'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'mn',
+ noon: 'amiază',
+ morning: 'dimineață',
+ afternoon: 'după-amiază',
+ evening: 'seară',
+ night: 'noapte'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'miezul nopții',
+ noon: 'amiază',
+ morning: 'dimineață',
+ afternoon: 'după-amiază',
+ evening: 'seară',
+ night: 'noapte'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'miezul nopții',
+ noon: 'amiază',
+ morning: 'dimineață',
+ afternoon: 'după-amiază',
+ evening: 'seară',
+ night: 'noapte'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return String(number)
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ro/_lib/match/index.js b/date-fns/src/locale/ro/_lib/match/index.js
new file mode 100644
index 0000000..87048eb
--- /dev/null
+++ b/date-fns/src/locale/ro/_lib/match/index.js
@@ -0,0 +1,146 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(Î|D)/i,
+ abbreviated: /^(Î\.?\s?d\.?\s?C\.?|Î\.?\s?e\.?\s?n\.?|D\.?\s?C\.?|e\.?\s?n\.?)/i,
+ wide: /^(Înainte de Cristos|Înaintea erei noastre|După Cristos|Era noastră)/i
+}
+
+var parseEraPatterns = {
+ any: [/^ÎC/i, /^DC/i],
+ wide: [
+ /^(Înainte de Cristos|Înaintea erei noastre)/i,
+ /^(După Cristos|Era noastră)/i
+ ]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^T[1234]/i,
+ wide: /^trimestrul [1234]/i
+}
+
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[ifmaasond]/i,
+ abbreviated: /^(ian|feb|mar|apr|mai|iun|iul|aug|sep|oct|noi|dec)/i,
+ wide: /^(ianuarie|februarie|martie|aprilie|mai|iunie|iulie|august|septembrie|octombrie|noiembrie|decembrie)/i
+}
+
+var parseMonthPatterns = {
+ narrow: [
+ /^i/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^i/i,
+ /^i/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ia/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^mai/i,
+ /^iun/i,
+ /^iul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dlmjvs]/i,
+ short: /^(d|l|ma|mi|j|v|s)/i,
+ abbreviated: /^(dum|lun|mar|mie|jo|vi|sâ)/i,
+ wide: /^(duminica|luni|marţi|miercuri|joi|vineri|sâmbătă)/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
+ any: [/^d/i, /^l/i, /^ma/i, /^mi/i, /^j/i, /^v/i, /^s/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|mn|a|(dimineaţa|după-amiaza|seara|noaptea))/i,
+ any: /^([ap]\.?\s?m\.?|miezul nopții|amiaza|(dimineaţa|după-amiaza|seara|noaptea))/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^mn/i,
+ noon: /amiaza/i,
+ morning: /dimineaţa/i,
+ afternoon: /după-amiaza/i,
+ evening: /seara/i,
+ night: /noaptea/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ro/index.d.ts b/date-fns/src/locale/ro/index.d.ts
new file mode 100644
index 0000000..c19fdec
--- /dev/null
+++ b/date-fns/src/locale/ro/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ro } from 'date-fns/locale'
+export default ro
diff --git a/date-fns/src/locale/ro/index.js b/date-fns/src/locale/ro/index.js
new file mode 100644
index 0000000..f22968c
--- /dev/null
+++ b/date-fns/src/locale/ro/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Romanian locale.
+ * @language Romanian
+ * @iso-639-2 ron
+ * @author Sergiu Munteanu [@jsergiu]{@link https://github.com/jsergiu}
+ * @author Adrian Ocneanu [@aocneanu]{@link https://github.com/aocneanu}
+ * @author Mihai Ocneanu [@gandesc]{@link https://github.com/gandesc}
+ */
+var locale = {
+ code: 'ro',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ro/index.js.flow b/date-fns/src/locale/ro/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ro/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ro/snapshot.md b/date-fns/src/locale/ro/snapshot.md
new file mode 100644
index 0000000..fc91c79
--- /dev/null
+++ b/date-fns/src/locale/ro/snapshot.md
@@ -0,0 +1,304 @@
+# Romanian (ro) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | primul trimestru | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | al doilea trimestru | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | T1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | T2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | primul trimestru | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | al doilea trimestru | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | iul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februarie | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | iulie | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | iul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februarie | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | iulie | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vin | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vin | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vin | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | luni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vineri | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | lu | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | vi | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vin | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | luni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vineri | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | lu | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | vi | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vin | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | luni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vineri | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | lu | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | vi | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | lun | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vin | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | luni | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | vineri | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | l | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | v | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | lu | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | vi | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | dimineață | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | după-amiază | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | seară | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | noapte | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | dimineață | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | după-amiază | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | seară | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | noapte | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | dimineață | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | după-amiază | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | seară | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | noapte | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | dimineață | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | după-amiază | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | seară | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | noapte | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | dimineață | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | după-amiază | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | seară | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | noapte | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 feb 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 februarie 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | miercuri, 11 februarie 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | duminică, 29 mai 1453 | Invalid Date |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 feb 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 februarie 1987 la 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 mai 1453 la 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | miercuri, 11 februarie 1987 la 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | duminică, 29 mai 1453 la 23:59:59 GMT+00:00 | Invalid Date |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------- | ----------------------- | ----------------------------- |
+| 2006-01-01T00:00:00.000Z | circa 6 ani | circa 6 ani | în circa 6 ani |
+| 2005-01-01T00:00:00.000Z | circa 5 ani | circa 5 ani | în circa 5 ani |
+| 2004-01-01T00:00:00.000Z | circa 4 ani | circa 4 ani | în circa 4 ani |
+| 2003-01-01T00:00:00.000Z | circa 3 ani | circa 3 ani | în circa 3 ani |
+| 2002-01-01T00:00:00.000Z | circa 2 ani | circa 2 ani | în circa 2 ani |
+| 2001-06-01T00:00:00.000Z | peste 1 an | peste 1 an | în peste 1 an |
+| 2001-02-01T00:00:00.000Z | circa 1 an | circa 1 an | în circa 1 an |
+| 2001-01-01T00:00:00.000Z | circa 1 an | circa 1 an | în circa 1 an |
+| 2000-06-01T00:00:00.000Z | 5 luni | 5 luni | în 5 luni |
+| 2000-03-01T00:00:00.000Z | 2 luni | 2 luni | în 2 luni |
+| 2000-02-01T00:00:00.000Z | circa 1 lună | circa 1 lună | în circa 1 lună |
+| 2000-01-15T00:00:00.000Z | 14 zile | 14 zile | în 14 zile |
+| 2000-01-02T00:00:00.000Z | 1 zi | 1 zi | în 1 zi |
+| 2000-01-01T06:00:00.000Z | circa 6 ore | circa 6 ore | în circa 6 ore |
+| 2000-01-01T01:00:00.000Z | circa 1 oră | circa 1 oră | în circa 1 oră |
+| 2000-01-01T00:45:00.000Z | circa 1 oră | circa 1 oră | în circa 1 oră |
+| 2000-01-01T00:30:00.000Z | 30 minute | 30 minute | în 30 minute |
+| 2000-01-01T00:15:00.000Z | 15 minute | 15 minute | în 15 minute |
+| 2000-01-01T00:01:00.000Z | 1 minut | 1 minut | în 1 minut |
+| 2000-01-01T00:00:25.000Z | mai puțin de un minut | jumătate de minut | în mai puțin de un minut |
+| 2000-01-01T00:00:15.000Z | mai puțin de un minut | mai puțin de 20 secunde | în mai puțin de un minut |
+| 2000-01-01T00:00:05.000Z | mai puțin de un minut | mai puțin de 10 secunde | în mai puțin de un minut |
+| 2000-01-01T00:00:00.000Z | mai puțin de un minut | mai puțin de 5 secunde | mai puțin de un minut în urmă |
+| 1999-12-31T23:59:55.000Z | mai puțin de un minut | mai puțin de 10 secunde | mai puțin de un minut în urmă |
+| 1999-12-31T23:59:45.000Z | mai puțin de un minut | mai puțin de 20 secunde | mai puțin de un minut în urmă |
+| 1999-12-31T23:59:35.000Z | mai puțin de un minut | jumătate de minut | mai puțin de un minut în urmă |
+| 1999-12-31T23:59:00.000Z | 1 minut | 1 minut | 1 minut în urmă |
+| 1999-12-31T23:45:00.000Z | 15 minute | 15 minute | 15 minute în urmă |
+| 1999-12-31T23:30:00.000Z | 30 minute | 30 minute | 30 minute în urmă |
+| 1999-12-31T23:15:00.000Z | circa 1 oră | circa 1 oră | circa 1 oră în urmă |
+| 1999-12-31T23:00:00.000Z | circa 1 oră | circa 1 oră | circa 1 oră în urmă |
+| 1999-12-31T18:00:00.000Z | circa 6 ore | circa 6 ore | circa 6 ore în urmă |
+| 1999-12-30T00:00:00.000Z | 2 zile | 2 zile | 2 zile în urmă |
+| 1999-12-15T00:00:00.000Z | 17 zile | 17 zile | 17 zile în urmă |
+| 1999-12-01T00:00:00.000Z | circa 1 lună | circa 1 lună | circa 1 lună în urmă |
+| 1999-11-01T00:00:00.000Z | 2 luni | 2 luni | 2 luni în urmă |
+| 1999-06-01T00:00:00.000Z | 7 luni | 7 luni | 7 luni în urmă |
+| 1999-01-01T00:00:00.000Z | circa 1 an | circa 1 an | circa 1 an în urmă |
+| 1998-12-01T00:00:00.000Z | circa 1 an | circa 1 an | circa 1 an în urmă |
+| 1998-06-01T00:00:00.000Z | peste 1 an | peste 1 an | peste 1 an în urmă |
+| 1998-01-01T00:00:00.000Z | circa 2 ani | circa 2 ani | circa 2 ani în urmă |
+| 1997-01-01T00:00:00.000Z | circa 3 ani | circa 3 ani | circa 3 ani în urmă |
+| 1996-01-01T00:00:00.000Z | circa 4 ani | circa 4 ani | circa 4 ani în urmă |
+| 1995-01-01T00:00:00.000Z | circa 5 ani | circa 5 ani | circa 5 ani în urmă |
+| 1994-01-01T00:00:00.000Z | circa 6 ani | circa 6 ani | circa 6 ani în urmă |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ani | în 6 ani | 52608 ore |
+| 2005-01-01T00:00:00.000Z | 5 ani | în 5 ani | 43848 ore |
+| 2004-01-01T00:00:00.000Z | 4 ani | în 4 ani | 35064 ore |
+| 2003-01-01T00:00:00.000Z | 3 ani | în 3 ani | 26304 ore |
+| 2002-01-01T00:00:00.000Z | 2 ani | în 2 ani | 17544 ore |
+| 2001-06-01T00:00:00.000Z | 1 an | în 1 an | 12408 ore |
+| 2001-02-01T00:00:00.000Z | 1 an | în 1 an | 9528 ore |
+| 2001-01-01T00:00:00.000Z | 1 an | în 1 an | 8784 ore |
+| 2000-06-01T00:00:00.000Z | 5 luni | în 5 luni | 3648 ore |
+| 2000-03-01T00:00:00.000Z | 2 luni | în 2 luni | 1440 ore |
+| 2000-02-01T00:00:00.000Z | 1 lună | în 1 lună | 744 ore |
+| 2000-01-15T00:00:00.000Z | 14 zile | în 14 zile | 336 ore |
+| 2000-01-02T00:00:00.000Z | 1 zi | în 1 zi | 24 ore |
+| 2000-01-01T06:00:00.000Z | 6 ore | în 6 ore | 6 ore |
+| 2000-01-01T01:00:00.000Z | 1 oră | în 1 oră | 1 oră |
+| 2000-01-01T00:45:00.000Z | 45 minute | în 45 minute | 1 oră |
+| 2000-01-01T00:30:00.000Z | 30 minute | în 30 minute | 1 oră |
+| 2000-01-01T00:15:00.000Z | 15 minute | în 15 minute | 0 ore |
+| 2000-01-01T00:01:00.000Z | 1 minut | în 1 minut | 0 ore |
+| 2000-01-01T00:00:25.000Z | 25 secunde | în 25 secunde | 0 ore |
+| 2000-01-01T00:00:15.000Z | 15 secunde | în 15 secunde | 0 ore |
+| 2000-01-01T00:00:05.000Z | 5 secunde | în 5 secunde | 0 ore |
+| 2000-01-01T00:00:00.000Z | 0 secunde | 0 secunde în urmă | 0 ore |
+| 1999-12-31T23:59:55.000Z | 5 secunde | 5 secunde în urmă | 0 ore |
+| 1999-12-31T23:59:45.000Z | 15 secunde | 15 secunde în urmă | 0 ore |
+| 1999-12-31T23:59:35.000Z | 25 secunde | 25 secunde în urmă | 0 ore |
+| 1999-12-31T23:59:00.000Z | 1 minut | 1 minut în urmă | 0 ore |
+| 1999-12-31T23:45:00.000Z | 15 minute | 15 minute în urmă | 0 ore |
+| 1999-12-31T23:30:00.000Z | 30 minute | 30 minute în urmă | 1 oră |
+| 1999-12-31T23:15:00.000Z | 45 minute | 45 minute în urmă | 1 oră |
+| 1999-12-31T23:00:00.000Z | 1 oră | 1 oră în urmă | 1 oră |
+| 1999-12-31T18:00:00.000Z | 6 ore | 6 ore în urmă | 6 ore |
+| 1999-12-30T00:00:00.000Z | 2 zile | 2 zile în urmă | 48 ore |
+| 1999-12-15T00:00:00.000Z | 17 zile | 17 zile în urmă | 408 ore |
+| 1999-12-01T00:00:00.000Z | 1 lună | 1 lună în urmă | 744 ore |
+| 1999-11-01T00:00:00.000Z | 2 luni | 2 luni în urmă | 1464 ore |
+| 1999-06-01T00:00:00.000Z | 7 luni | 7 luni în urmă | 5136 ore |
+| 1999-01-01T00:00:00.000Z | 1 an | 1 an în urmă | 8760 ore |
+| 1998-12-01T00:00:00.000Z | 1 an | 1 an în urmă | 9504 ore |
+| 1998-06-01T00:00:00.000Z | 2 ani | 2 ani în urmă | 13896 ore |
+| 1998-01-01T00:00:00.000Z | 2 ani | 2 ani în urmă | 17520 ore |
+| 1997-01-01T00:00:00.000Z | 3 ani | 3 ani în urmă | 26280 ore |
+| 1996-01-01T00:00:00.000Z | 4 ani | 4 ani în urmă | 35064 ore |
+| 1995-01-01T00:00:00.000Z | 5 ani | 5 ani în urmă | 43824 ore |
+| 1994-01-01T00:00:00.000Z | 6 ani | 6 ani în urmă | 52584 ore |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | miercuri viitoare la 00:00 |
+| 2000-01-02T00:00:00.000Z | mâine la 00:00 |
+| 2000-01-01T00:00:00.000Z | astăzi la 00:00 |
+| 1999-12-31T00:00:00.000Z | ieri la 00:00 |
+| 1999-12-27T00:00:00.000Z | luni trecută la 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/ru/_lib/formatDistance/index.js b/date-fns/src/locale/ru/_lib/formatDistance/index.js
new file mode 100644
index 0000000..686777d
--- /dev/null
+++ b/date-fns/src/locale/ru/_lib/formatDistance/index.js
@@ -0,0 +1,247 @@
+function declension(scheme, count) {
+ // scheme for count=1 exists
+ if (scheme.one !== undefined && count === 1) {
+ return scheme.one
+ }
+
+ var rem10 = count % 10
+ var rem100 = count % 100
+
+ // 1, 21, 31, ...
+ if (rem10 === 1 && rem100 !== 11) {
+ return scheme.singularNominative.replace('{{count}}', count)
+
+ // 2, 3, 4, 22, 23, 24, 32 ...
+ } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
+ return scheme.singularGenitive.replace('{{count}}', count)
+
+ // 5, 6, 7, 8, 9, 10, 11, ...
+ } else {
+ return scheme.pluralGenitive.replace('{{count}}', count)
+ }
+}
+
+function buildLocalizeTokenFn(scheme) {
+ return function(count, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ if (scheme.future) {
+ return declension(scheme.future, count)
+ } else {
+ return 'через ' + declension(scheme.regular, count)
+ }
+ } else {
+ if (scheme.past) {
+ return declension(scheme.past, count)
+ } else {
+ return declension(scheme.regular, count) + ' назад'
+ }
+ }
+ } else {
+ return declension(scheme.regular, count)
+ }
+ }
+}
+
+var formatDistanceLocale = {
+ lessThanXSeconds: buildLocalizeTokenFn({
+ regular: {
+ one: 'меньше секунды',
+ singularNominative: 'меньше {{count}} секунды',
+ singularGenitive: 'меньше {{count}} секунд',
+ pluralGenitive: 'меньше {{count}} секунд'
+ },
+ future: {
+ one: 'меньше, чем через секунду',
+ singularNominative: 'меньше, чем через {{count}} секунду',
+ singularGenitive: 'меньше, чем через {{count}} секунды',
+ pluralGenitive: 'меньше, чем через {{count}} секунд'
+ }
+ }),
+
+ xSeconds: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} секунда',
+ singularGenitive: '{{count}} секунды',
+ pluralGenitive: '{{count}} секунд'
+ },
+ past: {
+ singularNominative: '{{count}} секунду назад',
+ singularGenitive: '{{count}} секунды назад',
+ pluralGenitive: '{{count}} секунд назад'
+ },
+ future: {
+ singularNominative: 'через {{count}} секунду',
+ singularGenitive: 'через {{count}} секунды',
+ pluralGenitive: 'через {{count}} секунд'
+ }
+ }),
+
+ halfAMinute: function(_, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'через полминуты'
+ } else {
+ return 'полминуты назад'
+ }
+ }
+
+ return 'полминуты'
+ },
+
+ lessThanXMinutes: buildLocalizeTokenFn({
+ regular: {
+ one: 'меньше минуты',
+ singularNominative: 'меньше {{count}} минуты',
+ singularGenitive: 'меньше {{count}} минут',
+ pluralGenitive: 'меньше {{count}} минут'
+ },
+ future: {
+ one: 'меньше, чем через минуту',
+ singularNominative: 'меньше, чем через {{count}} минуту',
+ singularGenitive: 'меньше, чем через {{count}} минуты',
+ pluralGenitive: 'меньше, чем через {{count}} минут'
+ }
+ }),
+
+ xMinutes: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} минута',
+ singularGenitive: '{{count}} минуты',
+ pluralGenitive: '{{count}} минут'
+ },
+ past: {
+ singularNominative: '{{count}} минуту назад',
+ singularGenitive: '{{count}} минуты назад',
+ pluralGenitive: '{{count}} минут назад'
+ },
+ future: {
+ singularNominative: 'через {{count}} минуту',
+ singularGenitive: 'через {{count}} минуты',
+ pluralGenitive: 'через {{count}} минут'
+ }
+ }),
+
+ aboutXHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'около {{count}} часа',
+ singularGenitive: 'около {{count}} часов',
+ pluralGenitive: 'около {{count}} часов'
+ },
+ future: {
+ singularNominative: 'приблизительно через {{count}} час',
+ singularGenitive: 'приблизительно через {{count}} часа',
+ pluralGenitive: 'приблизительно через {{count}} часов'
+ }
+ }),
+
+ xHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} час',
+ singularGenitive: '{{count}} часа',
+ pluralGenitive: '{{count}} часов'
+ }
+ }),
+
+ xDays: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} день',
+ singularGenitive: '{{count}} дня',
+ pluralGenitive: '{{count}} дней'
+ }
+ }),
+
+ aboutXWeeks: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'около {{count}} недели',
+ singularGenitive: 'около {{count}} недель',
+ pluralGenitive: 'около {{count}} недель'
+ },
+ future: {
+ singularNominative: 'приблизительно через {{count}} неделю',
+ singularGenitive: 'приблизительно через {{count}} недели',
+ pluralGenitive: 'приблизительно через {{count}} недель'
+ }
+ }),
+
+ xWeeks: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} неделя',
+ singularGenitive: '{{count}} недели',
+ pluralGenitive: '{{count}} недель'
+ }
+ }),
+
+ aboutXMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'около {{count}} месяца',
+ singularGenitive: 'около {{count}} месяцев',
+ pluralGenitive: 'около {{count}} месяцев'
+ },
+ future: {
+ singularNominative: 'приблизительно через {{count}} месяц',
+ singularGenitive: 'приблизительно через {{count}} месяца',
+ pluralGenitive: 'приблизительно через {{count}} месяцев'
+ }
+ }),
+
+ xMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} месяц',
+ singularGenitive: '{{count}} месяца',
+ pluralGenitive: '{{count}} месяцев'
+ }
+ }),
+
+ aboutXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'около {{count}} года',
+ singularGenitive: 'около {{count}} лет',
+ pluralGenitive: 'около {{count}} лет'
+ },
+ future: {
+ singularNominative: 'приблизительно через {{count}} год',
+ singularGenitive: 'приблизительно через {{count}} года',
+ pluralGenitive: 'приблизительно через {{count}} лет'
+ }
+ }),
+
+ xYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} год',
+ singularGenitive: '{{count}} года',
+ pluralGenitive: '{{count}} лет'
+ }
+ }),
+
+ overXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'больше {{count}} года',
+ singularGenitive: 'больше {{count}} лет',
+ pluralGenitive: 'больше {{count}} лет'
+ },
+ future: {
+ singularNominative: 'больше, чем через {{count}} год',
+ singularGenitive: 'больше, чем через {{count}} года',
+ pluralGenitive: 'больше, чем через {{count}} лет'
+ }
+ }),
+
+ almostXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'почти {{count}} год',
+ singularGenitive: 'почти {{count}} года',
+ pluralGenitive: 'почти {{count}} лет'
+ },
+ future: {
+ singularNominative: 'почти через {{count}} год',
+ singularGenitive: 'почти через {{count}} года',
+ pluralGenitive: 'почти через {{count}} лет'
+ }
+ })
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ return formatDistanceLocale[token](count, options)
+}
diff --git a/date-fns/src/locale/ru/_lib/formatLong/index.js b/date-fns/src/locale/ru/_lib/formatLong/index.js
new file mode 100644
index 0000000..e3ac8dd
--- /dev/null
+++ b/date-fns/src/locale/ru/_lib/formatLong/index.js
@@ -0,0 +1,38 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, d MMMM y 'г.'",
+ long: "d MMMM y 'г.'",
+ medium: "d MMM y 'г.'",
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ any: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'any'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ru/_lib/formatRelative/index.js b/date-fns/src/locale/ru/_lib/formatRelative/index.js
new file mode 100644
index 0000000..ad4dbcf
--- /dev/null
+++ b/date-fns/src/locale/ru/_lib/formatRelative/index.js
@@ -0,0 +1,88 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+var accusativeWeekdays = [
+ 'воскресенье',
+ 'понедельник',
+ 'вторник',
+ 'среду',
+ 'четверг',
+ 'пятницу',
+ 'субботу'
+]
+
+function lastWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0:
+ return "'в прошлое " + weekday + " в' p"
+ case 1:
+ case 2:
+ case 4:
+ return "'в прошлый " + weekday + " в' p"
+ case 3:
+ case 5:
+ case 6:
+ return "'в прошлую " + weekday + " в' p"
+ }
+}
+
+function thisWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ if (day === 2 /* Tue */) {
+ return "'во " + weekday + " в' p"
+ } else {
+ return "'в " + weekday + " в' p"
+ }
+}
+
+function nextWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0:
+ return "'в следующее " + weekday + " в' p"
+ case 1:
+ case 2:
+ case 4:
+ return "'в следующий " + weekday + " в' p"
+ case 3:
+ case 5:
+ case 6:
+ return "'в следующую " + weekday + " в' p"
+ }
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'вчера в' p",
+ today: "'сегодня в' p",
+ tomorrow: "'завтра в' p",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/ru/_lib/localize/index.js b/date-fns/src/locale/ru/_lib/localize/index.js
new file mode 100644
index 0000000..86ef3b0
--- /dev/null
+++ b/date-fns/src/locale/ru/_lib/localize/index.js
@@ -0,0 +1,210 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['до н.э.', 'н.э.'],
+ abbreviated: ['до н. э.', 'н. э.'],
+ wide: ['до нашей эры', 'нашей эры']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1-й кв.', '2-й кв.', '3-й кв.', '4-й кв.'],
+ wide: ['1-й квартал', '2-й квартал', '3-й квартал', '4-й квартал']
+}
+
+var monthValues = {
+ narrow: ['Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д'],
+ abbreviated: [
+ 'янв.',
+ 'фев.',
+ 'март',
+ 'апр.',
+ 'май',
+ 'июнь',
+ 'июль',
+ 'авг.',
+ 'сент.',
+ 'окт.',
+ 'нояб.',
+ 'дек.'
+ ],
+ wide: [
+ 'январь',
+ 'февраль',
+ 'март',
+ 'апрель',
+ 'май',
+ 'июнь',
+ 'июль',
+ 'август',
+ 'сентябрь',
+ 'октябрь',
+ 'ноябрь',
+ 'декабрь'
+ ]
+}
+var formattingMonthValues = {
+ narrow: ['Я', 'Ф', 'М', 'А', 'М', 'И', 'И', 'А', 'С', 'О', 'Н', 'Д'],
+ abbreviated: [
+ 'янв.',
+ 'фев.',
+ 'мар.',
+ 'апр.',
+ 'мая',
+ 'июн.',
+ 'июл.',
+ 'авг.',
+ 'сент.',
+ 'окт.',
+ 'нояб.',
+ 'дек.'
+ ],
+ wide: [
+ 'января',
+ 'февраля',
+ 'марта',
+ 'апреля',
+ 'мая',
+ 'июня',
+ 'июля',
+ 'августа',
+ 'сентября',
+ 'октября',
+ 'ноября',
+ 'декабря'
+ ]
+}
+
+var dayValues = {
+ narrow: ['В', 'П', 'В', 'С', 'Ч', 'П', 'С'],
+ short: ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
+ abbreviated: ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'суб'],
+ wide: [
+ 'воскресенье',
+ 'понедельник',
+ 'вторник',
+ 'среда',
+ 'четверг',
+ 'пятница',
+ 'суббота'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'полн.',
+ noon: 'полд.',
+ morning: 'утро',
+ afternoon: 'день',
+ evening: 'веч.',
+ night: 'ночь'
+ },
+ abbreviated: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'полн.',
+ noon: 'полд.',
+ morning: 'утро',
+ afternoon: 'день',
+ evening: 'веч.',
+ night: 'ночь'
+ },
+ wide: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'полночь',
+ noon: 'полдень',
+ morning: 'утро',
+ afternoon: 'день',
+ evening: 'вечер',
+ night: 'ночь'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'полн.',
+ noon: 'полд.',
+ morning: 'утра',
+ afternoon: 'дня',
+ evening: 'веч.',
+ night: 'ночи'
+ },
+ abbreviated: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'полн.',
+ noon: 'полд.',
+ morning: 'утра',
+ afternoon: 'дня',
+ evening: 'веч.',
+ night: 'ночи'
+ },
+ wide: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'полночь',
+ noon: 'полдень',
+ morning: 'утра',
+ afternoon: 'дня',
+ evening: 'вечера',
+ night: 'ночи'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var suffix
+
+ if (unit === 'date') {
+ suffix = '-е'
+ } else if (unit === 'week' || unit === 'minute' || unit === 'second') {
+ suffix = '-я'
+ } else {
+ suffix = '-й'
+ }
+
+ return dirtyNumber + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'any',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ru/_lib/match/index.js b/date-fns/src/locale/ru/_lib/match/index.js
new file mode 100644
index 0000000..3b7425a
--- /dev/null
+++ b/date-fns/src/locale/ru/_lib/match/index.js
@@ -0,0 +1,138 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^((до )?н\.?\s?э\.?)/i,
+ abbreviated: /^((до )?н\.?\s?э\.?)/i,
+ wide: /^(до нашей эры|нашей эры|наша эра)/i
+}
+var parseEraPatterns = {
+ any: [/^д/i, /^н/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234](-?[ыои]?й?)? кв.?/i,
+ wide: /^[1234](-?[ыои]?й?)? квартал/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[яфмаисонд]/i,
+ abbreviated: /^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,
+ wide: /^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^я/i,
+ /^ф/i,
+ /^м/i,
+ /^а/i,
+ /^м/i,
+ /^и/i,
+ /^и/i,
+ /^а/i,
+ /^с/i,
+ /^о/i,
+ /^н/i,
+ /^я/i
+ ],
+ any: [
+ /^я/i,
+ /^ф/i,
+ /^мар/i,
+ /^ап/i,
+ /^ма[йя]/i,
+ /^июн/i,
+ /^июл/i,
+ /^ав/i,
+ /^с/i,
+ /^о/i,
+ /^н/i,
+ /^д/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[впсч]/i,
+ short: /^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,
+ abbreviated: /^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,
+ wide: /^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i
+}
+var parseDayPatterns = {
+ narrow: [/^в/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
+ any: [/^в[ос]/i, /^п[он]/i, /^в/i, /^ср/i, /^ч/i, /^п[ят]/i, /^с[уб]/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
+ abbreviated: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
+ wide: /^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^дп/i,
+ pm: /^пп/i,
+ midnight: /^полн/i,
+ noon: /^полд/i,
+ morning: /^у/i,
+ afternoon: /^д[ен]/i,
+ evening: /^в/i,
+ night: /^н/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ru/index.d.ts b/date-fns/src/locale/ru/index.d.ts
new file mode 100644
index 0000000..1a7f74f
--- /dev/null
+++ b/date-fns/src/locale/ru/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ru } from 'date-fns/locale'
+export default ru
diff --git a/date-fns/src/locale/ru/index.js b/date-fns/src/locale/ru/index.js
new file mode 100644
index 0000000..7271c7b
--- /dev/null
+++ b/date-fns/src/locale/ru/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Russian locale.
+ * @language Russian
+ * @iso-639-2 rus
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
+ */
+var locale = {
+ code: 'ru',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ru/index.js.flow b/date-fns/src/locale/ru/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ru/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ru/snapshot.md b/date-fns/src/locale/ru/snapshot.md
new file mode 100644
index 0000000..496d151
--- /dev/null
+++ b/date-fns/src/locale/ru/snapshot.md
@@ -0,0 +1,304 @@
+# Russian (ru) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-й | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-й | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-й | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-й | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-й | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1-й кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й кв. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-й квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й квартал | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-й | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1-й кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й кв. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-й квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й квартал | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-й | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-й | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | фев. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | июл. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | февраля | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | июля | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Ф | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | И | 2019-06-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-й | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-й | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | фев. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | июль | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | февраль | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | июль | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Ф | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | И | 2019-06-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-я | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-я | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-я | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-я | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-е | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-е | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-й | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | пнд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | пнд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | пнд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | понедельник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятница | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-й | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | пнд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | понедельник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятница | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-й | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | пнд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | понедельник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятница | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-й | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | пнд | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | понедельник | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пятница | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | утра | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночи | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | утра | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночи | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | утра | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночи | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | утра | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | вечера | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночи | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | утра | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночи | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-й | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-й | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-й | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-й | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-й | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-й | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-й | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-й | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-я | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-я | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-я | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-я | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 фев. 1987 г. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 февраля 1987 г. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | среда, 11 февраля 1987 г. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | воскресенье, 29 мая 1453 г. | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 фев. 1987 г., 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г., 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 февраля 1987 г., 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 мая 1453 г., 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | среда, 11 февраля 1987 г., 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | воскресенье, 29 мая 1453 г., 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------- | ---------------------- | ---------------------------- |
+| 2006-01-01T00:00:00.000Z | около 6 лет | около 6 лет | приблизительно через 6 лет |
+| 2005-01-01T00:00:00.000Z | около 5 лет | около 5 лет | приблизительно через 5 лет |
+| 2004-01-01T00:00:00.000Z | около 4 лет | около 4 лет | приблизительно через 4 года |
+| 2003-01-01T00:00:00.000Z | около 3 лет | около 3 лет | приблизительно через 3 года |
+| 2002-01-01T00:00:00.000Z | около 2 лет | около 2 лет | приблизительно через 2 года |
+| 2001-06-01T00:00:00.000Z | больше 1 года | больше 1 года | больше, чем через 1 год |
+| 2001-02-01T00:00:00.000Z | около 1 года | около 1 года | приблизительно через 1 год |
+| 2001-01-01T00:00:00.000Z | около 1 года | около 1 года | приблизительно через 1 год |
+| 2000-06-01T00:00:00.000Z | 5 месяцев | 5 месяцев | через 5 месяцев |
+| 2000-03-01T00:00:00.000Z | 2 месяца | 2 месяца | через 2 месяца |
+| 2000-02-01T00:00:00.000Z | около 1 месяца | около 1 месяца | приблизительно через 1 месяц |
+| 2000-01-15T00:00:00.000Z | 14 дней | 14 дней | через 14 дней |
+| 2000-01-02T00:00:00.000Z | 1 день | 1 день | через 1 день |
+| 2000-01-01T06:00:00.000Z | около 6 часов | около 6 часов | приблизительно через 6 часов |
+| 2000-01-01T01:00:00.000Z | около 1 часа | около 1 часа | приблизительно через 1 час |
+| 2000-01-01T00:45:00.000Z | около 1 часа | около 1 часа | приблизительно через 1 час |
+| 2000-01-01T00:30:00.000Z | 30 минут | 30 минут | через 30 минут |
+| 2000-01-01T00:15:00.000Z | 15 минут | 15 минут | через 15 минут |
+| 2000-01-01T00:01:00.000Z | 1 минута | 1 минута | через 1 минуту |
+| 2000-01-01T00:00:25.000Z | меньше минуты | полминуты | меньше, чем через минуту |
+| 2000-01-01T00:00:15.000Z | меньше минуты | меньше 20 секунд | меньше, чем через минуту |
+| 2000-01-01T00:00:05.000Z | меньше минуты | меньше 10 секунд | меньше, чем через минуту |
+| 2000-01-01T00:00:00.000Z | меньше минуты | меньше 5 секунд | меньше минуты назад |
+| 1999-12-31T23:59:55.000Z | меньше минуты | меньше 10 секунд | меньше минуты назад |
+| 1999-12-31T23:59:45.000Z | меньше минуты | меньше 20 секунд | меньше минуты назад |
+| 1999-12-31T23:59:35.000Z | меньше минуты | полминуты | меньше минуты назад |
+| 1999-12-31T23:59:00.000Z | 1 минута | 1 минута | 1 минуту назад |
+| 1999-12-31T23:45:00.000Z | 15 минут | 15 минут | 15 минут назад |
+| 1999-12-31T23:30:00.000Z | 30 минут | 30 минут | 30 минут назад |
+| 1999-12-31T23:15:00.000Z | около 1 часа | около 1 часа | около 1 часа назад |
+| 1999-12-31T23:00:00.000Z | около 1 часа | около 1 часа | около 1 часа назад |
+| 1999-12-31T18:00:00.000Z | около 6 часов | около 6 часов | около 6 часов назад |
+| 1999-12-30T00:00:00.000Z | 2 дня | 2 дня | 2 дня назад |
+| 1999-12-15T00:00:00.000Z | 17 дней | 17 дней | 17 дней назад |
+| 1999-12-01T00:00:00.000Z | около 1 месяца | около 1 месяца | около 1 месяца назад |
+| 1999-11-01T00:00:00.000Z | 2 месяца | 2 месяца | 2 месяца назад |
+| 1999-06-01T00:00:00.000Z | 7 месяцев | 7 месяцев | 7 месяцев назад |
+| 1999-01-01T00:00:00.000Z | около 1 года | около 1 года | около 1 года назад |
+| 1998-12-01T00:00:00.000Z | около 1 года | около 1 года | около 1 года назад |
+| 1998-06-01T00:00:00.000Z | больше 1 года | больше 1 года | больше 1 года назад |
+| 1998-01-01T00:00:00.000Z | около 2 лет | около 2 лет | около 2 лет назад |
+| 1997-01-01T00:00:00.000Z | около 3 лет | около 3 лет | около 3 лет назад |
+| 1996-01-01T00:00:00.000Z | около 4 лет | около 4 лет | около 4 лет назад |
+| 1995-01-01T00:00:00.000Z | около 5 лет | около 5 лет | около 5 лет назад |
+| 1994-01-01T00:00:00.000Z | около 6 лет | около 6 лет | около 6 лет назад |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 лет | через 6 лет | 52608 часов |
+| 2005-01-01T00:00:00.000Z | 5 лет | через 5 лет | 43848 часов |
+| 2004-01-01T00:00:00.000Z | 4 года | через 4 года | 35064 часа |
+| 2003-01-01T00:00:00.000Z | 3 года | через 3 года | 26304 часа |
+| 2002-01-01T00:00:00.000Z | 2 года | через 2 года | 17544 часа |
+| 2001-06-01T00:00:00.000Z | 1 год | через 1 год | 12408 часов |
+| 2001-02-01T00:00:00.000Z | 1 год | через 1 год | 9528 часов |
+| 2001-01-01T00:00:00.000Z | 1 год | через 1 год | 8784 часа |
+| 2000-06-01T00:00:00.000Z | 5 месяцев | через 5 месяцев | 3648 часов |
+| 2000-03-01T00:00:00.000Z | 2 месяца | через 2 месяца | 1440 часов |
+| 2000-02-01T00:00:00.000Z | 1 месяц | через 1 месяц | 744 часа |
+| 2000-01-15T00:00:00.000Z | 14 дней | через 14 дней | 336 часов |
+| 2000-01-02T00:00:00.000Z | 1 день | через 1 день | 24 часа |
+| 2000-01-01T06:00:00.000Z | 6 часов | через 6 часов | 6 часов |
+| 2000-01-01T01:00:00.000Z | 1 час | через 1 час | 1 час |
+| 2000-01-01T00:45:00.000Z | 45 минут | через 45 минут | 1 час |
+| 2000-01-01T00:30:00.000Z | 30 минут | через 30 минут | 1 час |
+| 2000-01-01T00:15:00.000Z | 15 минут | через 15 минут | 0 часов |
+| 2000-01-01T00:01:00.000Z | 1 минута | через 1 минуту | 0 часов |
+| 2000-01-01T00:00:25.000Z | 25 секунд | через 25 секунд | 0 часов |
+| 2000-01-01T00:00:15.000Z | 15 секунд | через 15 секунд | 0 часов |
+| 2000-01-01T00:00:05.000Z | 5 секунд | через 5 секунд | 0 часов |
+| 2000-01-01T00:00:00.000Z | 0 секунд | 0 секунд назад | 0 часов |
+| 1999-12-31T23:59:55.000Z | 5 секунд | 5 секунд назад | 0 часов |
+| 1999-12-31T23:59:45.000Z | 15 секунд | 15 секунд назад | 0 часов |
+| 1999-12-31T23:59:35.000Z | 25 секунд | 25 секунд назад | 0 часов |
+| 1999-12-31T23:59:00.000Z | 1 минута | 1 минуту назад | 0 часов |
+| 1999-12-31T23:45:00.000Z | 15 минут | 15 минут назад | 0 часов |
+| 1999-12-31T23:30:00.000Z | 30 минут | 30 минут назад | 1 час |
+| 1999-12-31T23:15:00.000Z | 45 минут | 45 минут назад | 1 час |
+| 1999-12-31T23:00:00.000Z | 1 час | 1 час назад | 1 час |
+| 1999-12-31T18:00:00.000Z | 6 часов | 6 часов назад | 6 часов |
+| 1999-12-30T00:00:00.000Z | 2 дня | 2 дня назад | 48 часов |
+| 1999-12-15T00:00:00.000Z | 17 дней | 17 дней назад | 408 часов |
+| 1999-12-01T00:00:00.000Z | 1 месяц | 1 месяц назад | 744 часа |
+| 1999-11-01T00:00:00.000Z | 2 месяца | 2 месяца назад | 1464 часа |
+| 1999-06-01T00:00:00.000Z | 7 месяцев | 7 месяцев назад | 5136 часов |
+| 1999-01-01T00:00:00.000Z | 1 год | 1 год назад | 8760 часов |
+| 1998-12-01T00:00:00.000Z | 1 год | 1 год назад | 9504 часа |
+| 1998-06-01T00:00:00.000Z | 2 года | 2 года назад | 13896 часов |
+| 1998-01-01T00:00:00.000Z | 2 года | 2 года назад | 17520 часов |
+| 1997-01-01T00:00:00.000Z | 3 года | 3 года назад | 26280 часов |
+| 1996-01-01T00:00:00.000Z | 4 года | 4 года назад | 35064 часа |
+| 1995-01-01T00:00:00.000Z | 5 лет | 5 лет назад | 43824 часа |
+| 1994-01-01T00:00:00.000Z | 6 лет | 6 лет назад | 52584 часа |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | в следующую среду в 0:00 |
+| 2000-01-02T00:00:00.000Z | завтра в 0:00 |
+| 2000-01-01T00:00:00.000Z | сегодня в 0:00 |
+| 1999-12-31T00:00:00.000Z | вчера в 0:00 |
+| 1999-12-27T00:00:00.000Z | в понедельник в 0:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/sk/_lib/formatDistance/index.js b/date-fns/src/locale/sk/_lib/formatDistance/index.js
new file mode 100644
index 0000000..cacb5b4
--- /dev/null
+++ b/date-fns/src/locale/sk/_lib/formatDistance/index.js
@@ -0,0 +1,231 @@
+// NOTE: should prolly be improved
+// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#1308
+
+function declensionGroup(scheme, count) {
+ if (count === 1) {
+ return scheme.one
+ }
+
+ if (count >= 2 && count <= 4) {
+ return scheme.twoFour
+ }
+
+ // if count === null || count === 0 || count >= 5
+ return scheme.other
+}
+
+function declension(scheme, count, time) {
+ var group = declensionGroup(scheme, count)
+ var finalText = group[time] || group
+ return finalText.replace('{{count}}', count)
+}
+
+function extractPreposition(token) {
+ var result = ['lessThan', 'about', 'over', 'almost'].filter(function(
+ preposition
+ ) {
+ return !!token.match(new RegExp('^' + preposition))
+ })
+
+ return result[0]
+}
+
+function prefixPreposition(preposition) {
+ var translation = ''
+
+ if (preposition === 'almost') {
+ translation = 'takmer'
+ }
+
+ if (preposition === 'about') {
+ translation = 'približne'
+ }
+
+ return translation.length > 0 ? translation + ' ' : ''
+}
+
+function suffixPreposition(preposition) {
+ var translation = ''
+
+ if (preposition === 'lessThan') {
+ translation = 'menej než'
+ }
+
+ if (preposition === 'over') {
+ translation = 'viac než'
+ }
+
+ return translation.length > 0 ? translation + ' ' : ''
+}
+
+function lowercaseFirstLetter(string) {
+ return string.charAt(0).toLowerCase() + string.slice(1)
+}
+
+var formatDistanceLocale = {
+ xSeconds: {
+ one: {
+ regular: 'sekunda',
+ past: 'sekundou',
+ future: 'sekundu'
+ },
+ twoFour: {
+ regular: '{{count}} sekundy',
+ past: '{{count}} sekundami',
+ future: '{{count}} sekundy'
+ },
+ other: {
+ regular: '{{count}} sekúnd',
+ past: '{{count}} sekundami',
+ future: '{{count}} sekúnd'
+ }
+ },
+
+ halfAMinute: {
+ other: {
+ regular: 'pol minúty',
+ past: 'pol minútou',
+ future: 'pol minúty'
+ }
+ },
+
+ xMinutes: {
+ one: {
+ regular: 'minúta',
+ past: 'minútou',
+ future: 'minútu'
+ },
+ twoFour: {
+ regular: '{{count}} minúty',
+ past: '{{count}} minútami',
+ future: '{{count}} minúty'
+ },
+ other: {
+ regular: '{{count}} minút',
+ past: '{{count}} minútami',
+ future: '{{count}} minút'
+ }
+ },
+
+ xHours: {
+ one: {
+ regular: 'hodina',
+ past: 'hodinou',
+ future: 'hodinu'
+ },
+ twoFour: {
+ regular: '{{count}} hodiny',
+ past: '{{count}} hodinami',
+ future: '{{count}} hodiny'
+ },
+ other: {
+ regular: '{{count}} hodín',
+ past: '{{count}} hodinami',
+ future: '{{count}} hodín'
+ }
+ },
+
+ xDays: {
+ one: {
+ regular: 'deň',
+ past: 'dňom',
+ future: 'deň'
+ },
+ twoFour: {
+ regular: '{{count}} dni',
+ past: '{{count}} dňami',
+ future: '{{count}} dni'
+ },
+ other: {
+ regular: '{{count}} dní',
+ past: '{{count}} dňami',
+ future: '{{count}} dní'
+ }
+ },
+
+ xWeeks: {
+ one: {
+ regular: 'mesiac', // TODO
+ past: 'mesiacom', // TODO
+ future: 'mesiac' // TODO
+ },
+ twoFour: {
+ regular: '{{count}} mesiace', // TODO
+ past: '{{count}} mesiacmi', // TODO
+ future: '{{count}} mesiace' // TODO
+ },
+ other: {
+ regular: '{{count}} mesiacov', // TODO
+ past: '{{count}} mesiacmi', // TODO
+ future: '{{count}} mesiacov' // TODO
+ }
+ },
+
+ xMonths: {
+ one: {
+ regular: 'mesiac',
+ past: 'mesiacom',
+ future: 'mesiac'
+ },
+ twoFour: {
+ regular: '{{count}} mesiace',
+ past: '{{count}} mesiacmi',
+ future: '{{count}} mesiace'
+ },
+ other: {
+ regular: '{{count}} mesiacov',
+ past: '{{count}} mesiacmi',
+ future: '{{count}} mesiacov'
+ }
+ },
+
+ xYears: {
+ one: {
+ regular: 'rok',
+ past: 'rokom',
+ future: 'rok'
+ },
+ twoFour: {
+ regular: '{{count}} roky',
+ past: '{{count}} rokmi',
+ future: '{{count}} roky'
+ },
+ other: {
+ regular: '{{count}} rokov',
+ past: '{{count}} rokmi',
+ future: '{{count}} rokov'
+ }
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var preposition = extractPreposition(token) || ''
+ var key = lowercaseFirstLetter(token.substring(preposition.length))
+ var scheme = formatDistanceLocale[key]
+
+ if (!options.addSuffix) {
+ return (
+ prefixPreposition(preposition) +
+ suffixPreposition(preposition) +
+ declension(scheme, count, 'regular')
+ )
+ }
+
+ if (options.comparison > 0) {
+ return (
+ prefixPreposition(preposition) +
+ 'o ' +
+ suffixPreposition(preposition) +
+ declension(scheme, count, 'future')
+ )
+ } else {
+ return (
+ prefixPreposition(preposition) +
+ 'pred ' +
+ suffixPreposition(preposition) +
+ declension(scheme, count, 'past')
+ )
+ }
+}
diff --git a/date-fns/src/locale/sk/_lib/formatLong/index.js b/date-fns/src/locale/sk/_lib/formatLong/index.js
new file mode 100644
index 0000000..bca7361
--- /dev/null
+++ b/date-fns/src/locale/sk/_lib/formatLong/index.js
@@ -0,0 +1,44 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#1986
+var dateFormats = {
+ full: 'EEEE d. MMMM y',
+ long: 'd. MMMM y',
+ medium: 'd. M. y',
+ short: 'd. M. y'
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#2149
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#1994
+var dateTimeFormats = {
+ full: '{{date}}, {{time}}',
+ long: '{{date}}, {{time}}',
+ medium: '{{date}}, {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/sk/_lib/formatRelative/index.js b/date-fns/src/locale/sk/_lib/formatRelative/index.js
new file mode 100644
index 0000000..cbe159e
--- /dev/null
+++ b/date-fns/src/locale/sk/_lib/formatRelative/index.js
@@ -0,0 +1,81 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html?hide#1308
+var accusativeWeekdays = [
+ 'nedeľu',
+ 'pondelok',
+ 'utorok',
+ 'stredu',
+ 'štvrtok',
+ 'piatok',
+ 'sobotu'
+]
+
+function lastWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0: /* Sun */
+ case 3: /* Wed */
+ case 6 /* Sat */:
+ return "'minulú " + weekday + " o' p"
+ default:
+ return "'minulý' eeee 'o' p"
+ }
+}
+
+function thisWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ if (day === 4 /* Thu */) {
+ return "'vo' eeee 'o' p"
+ } else {
+ return "'v " + weekday + " o' p"
+ }
+}
+
+function nextWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0: /* Sun */
+ case 4: /* Wed */
+ case 6 /* Sat */:
+ return "'budúcu' " + weekday + " 'o' p"
+ default:
+ return "'budúci' eeee 'o' p"
+ }
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'včera o' p",
+ today: "'dnes o' p",
+ tomorrow: "'zajtra o' p",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/sk/_lib/localize/index.js b/date-fns/src/locale/sk/_lib/localize/index.js
new file mode 100644
index 0000000..3fbbe0b
--- /dev/null
+++ b/date-fns/src/locale/sk/_lib/localize/index.js
@@ -0,0 +1,204 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html#1772
+var eraValues = {
+ narrow: ['pred Kr.', 'po Kr.'],
+ abbreviated: ['pred Kr.', 'po Kr.'],
+ wide: ['pred Kristom', 'po Kristovi']
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html#1780
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1. štvrťrok', '2. štvrťrok', '3. štvrťrok', '4. štvrťrok']
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html#1804
+var monthValues = {
+ narrow: ['j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
+ abbreviated: [
+ 'jan',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'máj',
+ 'jún',
+ 'júl',
+ 'aug',
+ 'sep',
+ 'okt',
+ 'nov',
+ 'dec'
+ ],
+ wide: [
+ 'január',
+ 'február',
+ 'marec',
+ 'apríl',
+ 'máj',
+ 'jún',
+ 'júl',
+ 'august',
+ 'september',
+ 'október',
+ 'november',
+ 'december'
+ ]
+}
+var formattingMonthValues = {
+ narrow: ['j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
+ abbreviated: [
+ 'jan',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'máj',
+ 'jún',
+ 'júl',
+ 'aug',
+ 'sep',
+ 'okt',
+ 'nov',
+ 'dec'
+ ],
+ wide: [
+ 'januára',
+ 'februára',
+ 'marca',
+ 'apríla',
+ 'mája',
+ 'júna',
+ 'júla',
+ 'augusta',
+ 'septembra',
+ 'októbra',
+ 'novembra',
+ 'decembra'
+ ]
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html#1876
+var dayValues = {
+ narrow: ['n', 'p', 'u', 's', 'š', 'p', 's'],
+ short: ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'],
+ abbreviated: ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'],
+ wide: [
+ 'nedeľa',
+ 'pondelok',
+ 'utorok',
+ 'streda',
+ 'štvrtok',
+ 'piatok',
+ 'sobota'
+ ]
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/sk.html#1932
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'poln.',
+ noon: 'pol.',
+ morning: 'ráno',
+ afternoon: 'pop.',
+ evening: 'več.',
+ night: 'noc'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'poln.',
+ noon: 'pol.',
+ morning: 'ráno',
+ afternoon: 'popol.',
+ evening: 'večer',
+ night: 'noc'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'polnoc',
+ noon: 'poludnie',
+ morning: 'ráno',
+ afternoon: 'popoludnie',
+ evening: 'večer',
+ night: 'noc'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'o poln.',
+ noon: 'nap.',
+ morning: 'ráno',
+ afternoon: 'pop.',
+ evening: 'več.',
+ night: 'v n.'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'o poln.',
+ noon: 'napol.',
+ morning: 'ráno',
+ afternoon: 'popol.',
+ evening: 'večer',
+ night: 'v noci'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'o polnoci',
+ noon: 'napoludnie',
+ morning: 'ráno',
+ afternoon: 'popoludní',
+ evening: 'večer',
+ night: 'v noci'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues
+ // defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/sk/_lib/match/index.js b/date-fns/src/locale/sk/_lib/match/index.js
new file mode 100644
index 0000000..366c5a4
--- /dev/null
+++ b/date-fns/src/locale/sk/_lib/match/index.js
@@ -0,0 +1,138 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\.?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(pred Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,
+ abbreviated: /^(pred Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,
+ wide: /^(pred Kristom|pred na[šs][íi]m letopo[čc]tom|po Kristovi|n[áa][šs]ho letopo[čc]tu)/i
+}
+var parseEraPatterns = {
+ any: [/^pr/i, /^(po|n)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234]\. [šs]tvr[ťt]rok/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mar|apr|m[áa]j|j[úu]n|j[úu]l|aug|sep|okt|nov|dec)/i,
+ wide: /^(janu[áa]ra?|febru[áa]ra?|(marec|marca)|apr[íi]la?|m[áa]ja?|j[úu]na?|j[úu]la?|augusta?|(september|septembra)|(okt[óo]ber|okt[óo]bra)|(november|novembra)|(december|decembra))/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^m[áa]j/i,
+ /^j[úu]n/i,
+ /^j[úu]l/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[npusšp]/i,
+ short: /^(ne|po|ut|st|št|pi|so)/i,
+ abbreviated: /^(ne|po|ut|st|št|pi|so)/i,
+ wide: /^(nede[ľl]a|pondelok|utorok|streda|[šs]tvrtok|piatok|sobota])/i
+}
+var parseDayPatterns = {
+ narrow: [/^n/i, /^p/i, /^u/i, /^s/i, /^š/i, /^p/i, /^s/i],
+ any: [/^n/i, /^po/i, /^u/i, /^st/i, /^(št|stv)/i, /^pi/i, /^so/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(am|pm|(o )?poln\.?|(nap\.?|pol\.?)|r[áa]no|pop\.?|ve[čc]\.?|(v n\.?|noc))/i,
+ abbreviated: /^(am|pm|(o )?poln\.?|(napol\.?|pol\.?)|r[áa]no|pop\.?|ve[čc]er|(v )?noci?)/i,
+ any: /^(am|pm|(o )?polnoci?|(na)?poludnie|r[áa]no|popoludn(ie|í|i)|ve[čc]er|(v )?noci?)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^am/i,
+ pm: /^pm/i,
+ midnight: /poln/i,
+ noon: /^(nap|(na)?pol(\.|u))/i,
+ morning: /^r[áa]no/i,
+ afternoon: /^pop/i,
+ evening: /^ve[čc]/i,
+ night: /^(noc|v n\.)/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/sk/index.d.ts b/date-fns/src/locale/sk/index.d.ts
new file mode 100644
index 0000000..362dd32
--- /dev/null
+++ b/date-fns/src/locale/sk/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { sk } from 'date-fns/locale'
+export default sk
diff --git a/date-fns/src/locale/sk/index.js b/date-fns/src/locale/sk/index.js
new file mode 100644
index 0000000..547902f
--- /dev/null
+++ b/date-fns/src/locale/sk/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Slovak locale.
+ * @language Slovak
+ * @iso-639-2 slk
+ * @author Marek Suscak [@mareksuscak]{@link https://github.com/mareksuscak}
+ */
+var locale = {
+ code: 'sk',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/sk/index.js.flow b/date-fns/src/locale/sk/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/sk/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/sk/snapshot.md b/date-fns/src/locale/sk/snapshot.md
new file mode 100644
index 0000000..889aec0
--- /dev/null
+++ b/date-fns/src/locale/sk/snapshot.md
@@ -0,0 +1,304 @@
+# Slovak (sk) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4. | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. štvrťrok | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. štvrťrok | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. štvrťrok | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. štvrťrok | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júl | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februára | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júla | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júl | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | február | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | júl | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | pondelok | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piatok | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | pondelok | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piatok | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | pondelok | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piatok | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | pondelok | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | piatok | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | po | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pi | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popol. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | v noci | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popol. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | v noci | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popol. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | v noci | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popoludní | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | večer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | v noci | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ráno | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | več. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | v n. | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11. 2. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 5. 1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. 2. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 5. 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. februára 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. mája 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | streda 11. februára 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | nedeľa 29. mája 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11. 2. 1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 5. 1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. 2. 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 5. 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. februára 1987, 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. mája 1453, 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | streda 11. februára 1987, 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | nedeľa 29. mája 1453, 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | približne 6 rokov | približne 6 rokov | približne o 6 rokov |
+| 2005-01-01T00:00:00.000Z | približne 5 rokov | približne 5 rokov | približne o 5 rokov |
+| 2004-01-01T00:00:00.000Z | približne 4 roky | približne 4 roky | približne o 4 roky |
+| 2003-01-01T00:00:00.000Z | približne 3 roky | približne 3 roky | približne o 3 roky |
+| 2002-01-01T00:00:00.000Z | približne 2 roky | približne 2 roky | približne o 2 roky |
+| 2001-06-01T00:00:00.000Z | viac než rok | viac než rok | o viac než rok |
+| 2001-02-01T00:00:00.000Z | približne rok | približne rok | približne o rok |
+| 2001-01-01T00:00:00.000Z | približne rok | približne rok | približne o rok |
+| 2000-06-01T00:00:00.000Z | 5 mesiacov | 5 mesiacov | o 5 mesiacov |
+| 2000-03-01T00:00:00.000Z | 2 mesiace | 2 mesiace | o 2 mesiace |
+| 2000-02-01T00:00:00.000Z | približne mesiac | približne mesiac | približne o mesiac |
+| 2000-01-15T00:00:00.000Z | 14 dní | 14 dní | o 14 dní |
+| 2000-01-02T00:00:00.000Z | deň | deň | o deň |
+| 2000-01-01T06:00:00.000Z | približne 6 hodín | približne 6 hodín | približne o 6 hodín |
+| 2000-01-01T01:00:00.000Z | približne hodina | približne hodina | približne o hodinu |
+| 2000-01-01T00:45:00.000Z | približne hodina | približne hodina | približne o hodinu |
+| 2000-01-01T00:30:00.000Z | 30 minút | 30 minút | o 30 minút |
+| 2000-01-01T00:15:00.000Z | 15 minút | 15 minút | o 15 minút |
+| 2000-01-01T00:01:00.000Z | minúta | minúta | o minútu |
+| 2000-01-01T00:00:25.000Z | menej než minúta | pol minúty | o menej než minútu |
+| 2000-01-01T00:00:15.000Z | menej než minúta | menej než 20 sekúnd | o menej než minútu |
+| 2000-01-01T00:00:05.000Z | menej než minúta | menej než 10 sekúnd | o menej než minútu |
+| 2000-01-01T00:00:00.000Z | menej než minúta | menej než 5 sekúnd | pred menej než minútou |
+| 1999-12-31T23:59:55.000Z | menej než minúta | menej než 10 sekúnd | pred menej než minútou |
+| 1999-12-31T23:59:45.000Z | menej než minúta | menej než 20 sekúnd | pred menej než minútou |
+| 1999-12-31T23:59:35.000Z | menej než minúta | pol minúty | pred menej než minútou |
+| 1999-12-31T23:59:00.000Z | minúta | minúta | pred minútou |
+| 1999-12-31T23:45:00.000Z | 15 minút | 15 minút | pred 15 minútami |
+| 1999-12-31T23:30:00.000Z | 30 minút | 30 minút | pred 30 minútami |
+| 1999-12-31T23:15:00.000Z | približne hodina | približne hodina | približne pred hodinou |
+| 1999-12-31T23:00:00.000Z | približne hodina | približne hodina | približne pred hodinou |
+| 1999-12-31T18:00:00.000Z | približne 6 hodín | približne 6 hodín | približne pred 6 hodinami |
+| 1999-12-30T00:00:00.000Z | 2 dni | 2 dni | pred 2 dňami |
+| 1999-12-15T00:00:00.000Z | 17 dní | 17 dní | pred 17 dňami |
+| 1999-12-01T00:00:00.000Z | približne mesiac | približne mesiac | približne pred mesiacom |
+| 1999-11-01T00:00:00.000Z | 2 mesiace | 2 mesiace | pred 2 mesiacmi |
+| 1999-06-01T00:00:00.000Z | 7 mesiacov | 7 mesiacov | pred 7 mesiacmi |
+| 1999-01-01T00:00:00.000Z | približne rok | približne rok | približne pred rokom |
+| 1998-12-01T00:00:00.000Z | približne rok | približne rok | približne pred rokom |
+| 1998-06-01T00:00:00.000Z | viac než rok | viac než rok | pred viac než rokom |
+| 1998-01-01T00:00:00.000Z | približne 2 roky | približne 2 roky | približne pred 2 rokmi |
+| 1997-01-01T00:00:00.000Z | približne 3 roky | približne 3 roky | približne pred 3 rokmi |
+| 1996-01-01T00:00:00.000Z | približne 4 roky | približne 4 roky | približne pred 4 rokmi |
+| 1995-01-01T00:00:00.000Z | približne 5 rokov | približne 5 rokov | približne pred 5 rokmi |
+| 1994-01-01T00:00:00.000Z | približne 6 rokov | približne 6 rokov | približne pred 6 rokmi |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 rokov | o 6 rokov | 52608 hodín |
+| 2005-01-01T00:00:00.000Z | 5 rokov | o 5 rokov | 43848 hodín |
+| 2004-01-01T00:00:00.000Z | 4 roky | o 4 roky | 35064 hodín |
+| 2003-01-01T00:00:00.000Z | 3 roky | o 3 roky | 26304 hodín |
+| 2002-01-01T00:00:00.000Z | 2 roky | o 2 roky | 17544 hodín |
+| 2001-06-01T00:00:00.000Z | rok | o rok | 12408 hodín |
+| 2001-02-01T00:00:00.000Z | rok | o rok | 9528 hodín |
+| 2001-01-01T00:00:00.000Z | rok | o rok | 8784 hodín |
+| 2000-06-01T00:00:00.000Z | 5 mesiacov | o 5 mesiacov | 3648 hodín |
+| 2000-03-01T00:00:00.000Z | 2 mesiace | o 2 mesiace | 1440 hodín |
+| 2000-02-01T00:00:00.000Z | mesiac | o mesiac | 744 hodín |
+| 2000-01-15T00:00:00.000Z | 14 dní | o 14 dní | 336 hodín |
+| 2000-01-02T00:00:00.000Z | deň | o deň | 24 hodín |
+| 2000-01-01T06:00:00.000Z | 6 hodín | o 6 hodín | 6 hodín |
+| 2000-01-01T01:00:00.000Z | hodina | o hodinu | hodina |
+| 2000-01-01T00:45:00.000Z | 45 minút | o 45 minút | hodina |
+| 2000-01-01T00:30:00.000Z | 30 minút | o 30 minút | hodina |
+| 2000-01-01T00:15:00.000Z | 15 minút | o 15 minút | 0 hodín |
+| 2000-01-01T00:01:00.000Z | minúta | o minútu | 0 hodín |
+| 2000-01-01T00:00:25.000Z | 25 sekúnd | o 25 sekúnd | 0 hodín |
+| 2000-01-01T00:00:15.000Z | 15 sekúnd | o 15 sekúnd | 0 hodín |
+| 2000-01-01T00:00:05.000Z | 5 sekúnd | o 5 sekúnd | 0 hodín |
+| 2000-01-01T00:00:00.000Z | 0 sekúnd | pred 0 sekundami | 0 hodín |
+| 1999-12-31T23:59:55.000Z | 5 sekúnd | pred 5 sekundami | 0 hodín |
+| 1999-12-31T23:59:45.000Z | 15 sekúnd | pred 15 sekundami | 0 hodín |
+| 1999-12-31T23:59:35.000Z | 25 sekúnd | pred 25 sekundami | 0 hodín |
+| 1999-12-31T23:59:00.000Z | minúta | pred minútou | 0 hodín |
+| 1999-12-31T23:45:00.000Z | 15 minút | pred 15 minútami | 0 hodín |
+| 1999-12-31T23:30:00.000Z | 30 minút | pred 30 minútami | hodina |
+| 1999-12-31T23:15:00.000Z | 45 minút | pred 45 minútami | hodina |
+| 1999-12-31T23:00:00.000Z | hodina | pred hodinou | hodina |
+| 1999-12-31T18:00:00.000Z | 6 hodín | pred 6 hodinami | 6 hodín |
+| 1999-12-30T00:00:00.000Z | 2 dni | pred 2 dňami | 48 hodín |
+| 1999-12-15T00:00:00.000Z | 17 dní | pred 17 dňami | 408 hodín |
+| 1999-12-01T00:00:00.000Z | mesiac | pred mesiacom | 744 hodín |
+| 1999-11-01T00:00:00.000Z | 2 mesiace | pred 2 mesiacmi | 1464 hodín |
+| 1999-06-01T00:00:00.000Z | 7 mesiacov | pred 7 mesiacmi | 5136 hodín |
+| 1999-01-01T00:00:00.000Z | rok | pred rokom | 8760 hodín |
+| 1998-12-01T00:00:00.000Z | rok | pred rokom | 9504 hodín |
+| 1998-06-01T00:00:00.000Z | 2 roky | pred 2 rokmi | 13896 hodín |
+| 1998-01-01T00:00:00.000Z | 2 roky | pred 2 rokmi | 17520 hodín |
+| 1997-01-01T00:00:00.000Z | 3 roky | pred 3 rokmi | 26280 hodín |
+| 1996-01-01T00:00:00.000Z | 4 roky | pred 4 rokmi | 35064 hodín |
+| 1995-01-01T00:00:00.000Z | 5 rokov | pred 5 rokmi | 43824 hodín |
+| 1994-01-01T00:00:00.000Z | 6 rokov | pred 6 rokmi | 52584 hodín |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------- |
+| 2000-01-10T00:00:00.000Z | 10. 1. 2000 |
+| 2000-01-05T00:00:00.000Z | budúci streda o 0:00 |
+| 2000-01-02T00:00:00.000Z | zajtra o 0:00 |
+| 2000-01-01T00:00:00.000Z | dnes o 0:00 |
+| 1999-12-31T00:00:00.000Z | včera o 0:00 |
+| 1999-12-27T00:00:00.000Z | v pondelok o 0:00 |
+| 1999-12-21T00:00:00.000Z | 21. 12. 1999 |
diff --git a/date-fns/src/locale/sl/_lib/formatDistance/index.js b/date-fns/src/locale/sl/_lib/formatDistance/index.js
new file mode 100644
index 0000000..d21c359
--- /dev/null
+++ b/date-fns/src/locale/sl/_lib/formatDistance/index.js
@@ -0,0 +1,338 @@
+var distanceInWordsLocale = {
+ lessThanXSeconds: {
+ one: 'manj kot {{count}} sekunda',
+ two: 'manj kot {{count}} sekundi',
+ few: 'manj kot {{count}} sekunde',
+ other: 'manj kot {{count}} sekund'
+ },
+
+ xSeconds: {
+ one: '{{count}} sekunda',
+ two: '{{count}} sekundi',
+ few: '{{count}} sekunde',
+ other: '{{count}} sekund'
+ },
+
+ halfAMinute: 'pol minute',
+
+ lessThanXMinutes: {
+ one: 'manj kot {{count}} minuta',
+ two: 'manj kot {{count}} minuti',
+ few: 'manj kot {{count}} minute',
+ other: 'manj kot {{count}} minut'
+ },
+
+ xMinutes: {
+ one: '{{count}} minuta',
+ two: '{{count}} minuti',
+ few: '{{count}} minute',
+ other: '{{count}} minut'
+ },
+
+ aboutXHours: {
+ one: 'približno {{count}} ura',
+ two: 'približno {{count}} uri',
+ few: 'približno {{count}} ure',
+ other: 'približno {{count}} ur'
+ },
+
+ xHours: {
+ one: '{{count}} ura',
+ two: '{{count}} uri',
+ few: '{{count}} ure',
+ other: '{{count}} ur'
+ },
+
+ xDays: {
+ one: '{{count}} dan',
+ two: '{{count}} dni',
+ few: '{{count}} dni',
+ other: '{{count}} dni'
+ },
+
+ aboutXWeeks: {
+ one: 'približno {{count}} teden',
+ two: 'približno {{count}} tedna',
+ few: 'približno {{count}} tedne',
+ other: 'približno {{count}} tednov'
+ },
+
+ xWeeks: {
+ one: '{{count}} teden',
+ two: '{{count}} tedna',
+ few: '{{count}} tedne',
+ other: '{{count}} tednov'
+ },
+
+ aboutXMonths: {
+ one: 'približno {{count}} mesec',
+ two: 'približno {{count}} meseca',
+ few: 'približno {{count}} mesece',
+ other: 'približno {{count}} mesecev'
+ },
+
+ xMonths: {
+ one: '{{count}} mesec',
+ two: '{{count}} meseca',
+ few: '{{count}} meseci',
+ other: '{{count}} mesecev'
+ },
+
+ aboutXYears: {
+ one: 'približno {{count}} leto',
+ two: 'približno {{count}} leti',
+ few: 'približno {{count}} leta',
+ other: 'približno {{count}} let'
+ },
+
+ xYears: {
+ one: '{{count}} leto',
+ two: '{{count}} leti',
+ few: '{{count}} leta',
+ other: '{{count}} let'
+ },
+
+ overXYears: {
+ one: 'več kot {{count}} leto',
+ two: 'več kot {{count}} leti',
+ few: 'več kot {{count}} leta',
+ other: 'več kot {{count}} let'
+ },
+
+ almostXYears: {
+ one: 'skoraj {{count}} leto',
+ two: 'skoraj {{count}} leti',
+ few: 'skoraj {{count}} leta',
+ other: 'skoraj {{count}} let'
+ }
+}
+
+var distanceInWordsLocalePast = {
+ lessThanXSeconds: {
+ one: 'manj kot {{count}} sekundo',
+ two: 'manj kot {{count}} sekundama',
+ few: 'manj kot {{count}} sekundami',
+ other: 'manj kot {{count}} sekundami'
+ },
+
+ xSeconds: {
+ one: '{{count}} sekundo',
+ two: '{{count}} sekundama',
+ few: '{{count}} sekundami',
+ other: '{{count}} sekundami'
+ },
+
+ halfAMinute: 'pol minute',
+
+ lessThanXMinutes: {
+ one: 'manj kot {{count}} minuto',
+ two: 'manj kot {{count}} minutama',
+ few: 'manj kot {{count}} minutami',
+ other: 'manj kot {{count}} minutami'
+ },
+
+ xMinutes: {
+ one: '{{count}} minuto',
+ two: '{{count}} minutama',
+ few: '{{count}} minutami',
+ other: '{{count}} minutami'
+ },
+
+ aboutXHours: {
+ one: 'približno {{count}} uro',
+ two: 'približno {{count}} urama',
+ few: 'približno {{count}} urami',
+ other: 'približno {{count}} urami'
+ },
+
+ xHours: {
+ one: '{{count}} uro',
+ two: '{{count}} urama',
+ few: '{{count}} urami',
+ other: '{{count}} urami'
+ },
+
+ xDays: {
+ one: '{{count}} dnem',
+ two: '{{count}} dnevoma',
+ few: '{{count}} dnevi',
+ other: '{{count}} dnevi'
+ },
+
+ aboutXMonths: {
+ one: 'približno {{count}} mesecem',
+ two: 'približno {{count}} mesecema',
+ few: 'približno {{count}} meseci',
+ other: 'približno {{count}} meseci'
+ },
+
+ xMonths: {
+ one: '{{count}} mesecem',
+ two: '{{count}} mesecema',
+ few: '{{count}} meseci',
+ other: '{{count}} meseci'
+ },
+
+ aboutXYears: {
+ one: 'približno {{count}} letom',
+ two: 'približno {{count}} letoma',
+ few: 'približno {{count}} leti',
+ other: 'približno {{count}} leti'
+ },
+
+ xYears: {
+ one: '{{count}} letom',
+ two: '{{count}} letoma',
+ few: '{{count}} leti',
+ other: '{{count}} leti'
+ },
+
+ overXYears: {
+ one: 'več kot {{count}} letom',
+ two: 'več kot {{count}} letoma',
+ few: 'več kot {{count}} leti',
+ other: 'več kot {{count}} leti'
+ },
+
+ almostXYears: {
+ one: 'skoraj {{count}} letom',
+ two: 'skoraj {{count}} letoma',
+ few: 'skoraj {{count}} leti',
+ other: 'skoraj {{count}} leti'
+ }
+}
+
+var distanceInWordsLocaleFuture = {
+ lessThanXSeconds: {
+ one: 'manj kot {{count}} sekundo',
+ two: 'manj kot {{count}} sekundi',
+ few: 'manj kot {{count}} sekunde',
+ other: 'manj kot {{count}} sekund'
+ },
+
+ xSeconds: {
+ one: '{{count}} sekundo',
+ two: '{{count}} sekundi',
+ few: '{{count}} sekunde',
+ other: '{{count}} sekund'
+ },
+
+ halfAMinute: 'pol minute',
+
+ lessThanXMinutes: {
+ one: 'manj kot {{count}} minuto',
+ two: 'manj kot {{count}} minuti',
+ few: 'manj kot {{count}} minute',
+ other: 'manj kot {{count}} minut'
+ },
+
+ xMinutes: {
+ one: '{{count}} minuto',
+ two: '{{count}} minuti',
+ few: '{{count}} minute',
+ other: '{{count}} minut'
+ },
+
+ aboutXHours: {
+ one: 'približno {{count}} uro',
+ two: 'približno {{count}} uri',
+ few: 'približno {{count}} ure',
+ other: 'približno {{count}} ur'
+ },
+
+ xHours: {
+ one: '{{count}} uro',
+ two: '{{count}} uri',
+ few: '{{count}} ure',
+ other: '{{count}} ur'
+ },
+
+ xDays: {
+ one: '{{count}} dan',
+ two: '{{count}} dni',
+ few: '{{count}} dni',
+ other: '{{count}} dni'
+ },
+
+ aboutXMonths: {
+ one: 'približno {{count}} mesec',
+ two: 'približno {{count}} meseca',
+ few: 'približno {{count}} mesece',
+ other: 'približno {{count}} mesecev'
+ },
+
+ xMonths: {
+ one: '{{count}} mesec',
+ two: '{{count}} meseca',
+ few: '{{count}} mesece',
+ other: '{{count}} mesecev'
+ },
+
+ aboutXYears: {
+ one: 'približno {{count}} leto',
+ two: 'približno {{count}} leti',
+ few: 'približno {{count}} leta',
+ other: 'približno {{count}} let'
+ },
+
+ xYears: {
+ one: '{{count}} leto',
+ two: '{{count}} leti',
+ few: '{{count}} leta',
+ other: '{{count}} let'
+ },
+
+ overXYears: {
+ one: 'več kot {{count}} leto',
+ two: 'več kot {{count}} leti',
+ few: 'več kot {{count}} leta',
+ other: 'več kot {{count}} let'
+ },
+
+ almostXYears: {
+ one: 'skoraj {{count}} leto',
+ two: 'skoraj {{count}} leti',
+ few: 'skoraj {{count}} leta',
+ other: 'skoraj {{count}} let'
+ }
+}
+
+function getFormFromCount(count) {
+ switch (count % 100) {
+ case 1:
+ return 'one'
+ case 2:
+ return 'two'
+ case 3:
+ case 4:
+ return 'few'
+ default:
+ return 'other'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var localeObject = distanceInWordsLocale
+ var result = ''
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ localeObject = distanceInWordsLocaleFuture
+ result += 'čez '
+ } else {
+ localeObject = distanceInWordsLocalePast
+ result += 'pred '
+ }
+ }
+
+ if (typeof localeObject[token] === 'string') {
+ result += localeObject[token]
+ } else {
+ var form = getFormFromCount(count)
+ result += localeObject[token][form].replace('{{count}}', count)
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/sl/_lib/formatLong/index.js b/date-fns/src/locale/sl/_lib/formatLong/index.js
new file mode 100644
index 0000000..eff948a
--- /dev/null
+++ b/date-fns/src/locale/sl/_lib/formatLong/index.js
@@ -0,0 +1,39 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, dd. MMMM y',
+ long: 'dd. MMMM y',
+ medium: 'd. MMM y',
+ short: 'd. MM. yy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/sl/_lib/formatRelative/index.js b/date-fns/src/locale/sl/_lib/formatRelative/index.js
new file mode 100644
index 0000000..2d25a1b
--- /dev/null
+++ b/date-fns/src/locale/sl/_lib/formatRelative/index.js
@@ -0,0 +1,44 @@
+var formatRelativeLocale = {
+ lastWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'prejšnjo nedeljo ob' p"
+ case 3:
+ return "'prejšnjo sredo ob' p"
+ case 6:
+ return "'prejšnjo soboto ob' p"
+ default:
+ return "'prejšnji' EEEE 'ob' p"
+ }
+ },
+ yesterday: "'včeraj ob' p",
+ today: "'danes ob' p",
+ tomorrow: "'jutri ob' p",
+ nextWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'naslednjo nedeljo ob' p"
+ case 3:
+ return "'naslednjo sredo ob' p"
+ case 6:
+ return "'naslednjo soboto ob' p"
+ default:
+ return "'naslednji' EEEE 'ob' p"
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/sl/_lib/localize/index.js b/date-fns/src/locale/sl/_lib/localize/index.js
new file mode 100644
index 0000000..e4d42c8
--- /dev/null
+++ b/date-fns/src/locale/sl/_lib/localize/index.js
@@ -0,0 +1,162 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return String(number).concat('.')
+}
+
+var eraValues = {
+ narrow: ['pr. n. št.', 'po n. št.'],
+ abbreviated: ['pr. n. št.', 'po n. št.'],
+ wide: ['pred našim štetjem', 'po našem štetju']
+}
+
+var monthValues = {
+ narrow: ['j', 'f', 'm', 'a', 'm', 'j', 'j', 'a', 's', 'o', 'n', 'd'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mar.',
+ 'apr.',
+ 'maj',
+ 'jun.',
+ 'jul.',
+ 'avg.',
+ 'sep.',
+ 'okt.',
+ 'nov.',
+ 'dec.'
+ ],
+ wide: [
+ 'januar',
+ 'februar',
+ 'marec',
+ 'april',
+ 'maj',
+ 'junij',
+ 'julij',
+ 'avgust',
+ 'september',
+ 'oktober',
+ 'november',
+ 'december'
+ ]
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1. čet.', '2. čet.', '3. čet.', '4. čet.'],
+ wide: ['1. četrtletje', '2. četrtletje', '3. četrtletje', '4. četrtletje']
+}
+
+var dayValues = {
+ narrow: ['n', 'p', 't', 's', 'č', 'p', 's'],
+ short: ['ned.', 'pon.', 'tor.', 'sre.', 'čet.', 'pet.', 'sob.'],
+ abbreviated: ['ned.', 'pon.', 'tor.', 'sre.', 'čet.', 'pet.', 'sob.'],
+ wide: [
+ 'nedelja',
+ 'ponedeljek',
+ 'torek',
+ 'sreda',
+ 'četrtek',
+ 'petek',
+ 'sobota'
+ ]
+}
+
+var dayPeriodValuesStandalone = {
+ narrow: {
+ am: 'd',
+ pm: 'p',
+ midnight: '24.00',
+ noon: '12.00',
+ morning: 'j',
+ afternoon: 'p',
+ evening: 'v',
+ night: 'n'
+ },
+ abbreviated: {
+ am: 'dop.',
+ pm: 'pop.',
+ midnight: 'poln.',
+ noon: 'pold.',
+ morning: 'jut.',
+ afternoon: 'pop.',
+ evening: 'več.',
+ night: 'noč'
+ },
+ wide: {
+ am: 'dop.',
+ pm: 'pop.',
+ midnight: 'polnoč',
+ noon: 'poldne',
+ morning: 'jutro',
+ afternoon: 'popoldne',
+ evening: 'večer',
+ night: 'noč'
+ }
+}
+
+var dayPeriodValuesFormatting = {
+ narrow: {
+ am: 'd',
+ pm: 'p',
+ midnight: '24.00',
+ noon: '12.00',
+ morning: 'zj',
+ afternoon: 'p',
+ evening: 'zv',
+ night: 'po'
+ },
+ abbreviated: {
+ am: 'dop.',
+ pm: 'pop.',
+ midnight: 'opoln.',
+ noon: 'opold.',
+ morning: 'zjut.',
+ afternoon: 'pop.',
+ evening: 'zveč.',
+ night: 'ponoči'
+ },
+ wide: {
+ am: 'dop.',
+ pm: 'pop.',
+ midnight: 'opolnoči',
+ noon: 'opoldne',
+ morning: 'zjutraj',
+ afternoon: 'popoldan',
+ evening: 'zvečer',
+ night: 'ponoči'
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValuesStandalone,
+ defaultWidth: 'wide',
+ formattingValues: dayPeriodValuesFormatting,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/sl/_lib/match/index.js b/date-fns/src/locale/sl/_lib/match/index.js
new file mode 100644
index 0000000..f83308a
--- /dev/null
+++ b/date-fns/src/locale/sl/_lib/match/index.js
@@ -0,0 +1,155 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\./i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ abbreviated: /^(pr\. n\. št\.|po n\. št\.)/i,
+ wide: /^(pred Kristusom|pred na[sš]im [sš]tetjem|po Kristusu|po na[sš]em [sš]tetju|na[sš]ega [sš]tetja)/i
+}
+var parseEraPatterns = {
+ any: [/^pr/i, /^(po|na[sš]em)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]\.\s?[čc]et\.?/i,
+ wide: /^[1234]\. [čc]etrtletje/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan\.|feb\.|mar\.|apr\.|maj|jun\.|jul\.|avg\.|sep\.|okt\.|nov\.|dec\.)/i,
+ wide: /^(januar|februar|marec|april|maj|junij|julij|avgust|september|oktober|november|december)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ abbreviated: [
+ /^ja/i,
+ /^fe/i,
+ /^mar/i,
+ /^ap/i,
+ /^maj/i,
+ /^jun/i,
+ /^jul/i,
+ /^av/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ wide: [
+ /^ja/i,
+ /^fe/i,
+ /^mar/i,
+ /^ap/i,
+ /^maj/i,
+ /^jun/i,
+ /^jul/i,
+ /^av/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[nptsčc]/i,
+ short: /^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,
+ abbreviated: /^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,
+ wide: /^(nedelja|ponedeljek|torek|sreda|[cč]etrtek|petek|sobota)/i
+}
+var parseDayPatterns = {
+ narrow: [/^n/i, /^p/i, /^t/i, /^s/i, /^[cč]/i, /^p/i, /^s/i],
+ any: [/^n/i, /^po/i, /^t/i, /^sr/i, /^[cč]/i, /^pe/i, /^so/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(d|po?|z?v|n|z?j|24\.00|12\.00)/i,
+ any: /^(dop\.|pop\.|o?poln(\.|o[cč]i?)|o?pold(\.|ne)|z?ve[cč](\.|er)|(po)?no[cč]i?|popold(ne|an)|jut(\.|ro)|zjut(\.|raj))/i
+}
+var parseDayPeriodPatterns = {
+ narrow: {
+ am: /^d/i,
+ pm: /^p/i,
+ midnight: /^24/i,
+ noon: /^12/i,
+ morning: /^(z?j)/i,
+ afternoon: /^p/i,
+ evening: /^(z?v)/i,
+ night: /^(n|po)/i
+ },
+ any: {
+ am: /^dop\./i,
+ pm: /^pop\./i,
+ midnight: /^o?poln/i,
+ noon: /^o?pold/i,
+ morning: /j/i,
+ afternoon: /^pop\./i,
+ evening: /^z?ve/i,
+ night: /(po)?no/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'wide'
+ }),
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/sl/index.d.ts b/date-fns/src/locale/sl/index.d.ts
new file mode 100644
index 0000000..fbe964a
--- /dev/null
+++ b/date-fns/src/locale/sl/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { sl } from 'date-fns/locale'
+export default sl
diff --git a/date-fns/src/locale/sl/index.js b/date-fns/src/locale/sl/index.js
new file mode 100644
index 0000000..61ed2a7
--- /dev/null
+++ b/date-fns/src/locale/sl/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Slovenian locale.
+ * @language Slovenian
+ * @iso-639-2 slv
+ * @author Adam Stradovnik [@Neoglyph]{@link https://github.com/Neoglyph}
+ * @author Mato Žgajner [@mzgajner]{@link https://github.com/mzgajner}
+ */
+var locale = {
+ code: 'sl',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/sl/index.js.flow b/date-fns/src/locale/sl/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/sl/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/sl/snapshot.md b/date-fns/src/locale/sl/snapshot.md
new file mode 100644
index 0000000..495f479
--- /dev/null
+++ b/date-fns/src/locale/sl/snapshot.md
@@ -0,0 +1,304 @@
+# Slovenian (sl) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1. čet. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. čet. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. četrtletje | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. četrtletje | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. čet. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. čet. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. četrtletje | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. četrtletje | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julij | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | julij | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | f | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | j | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | ponedeljek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | petek | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | ponedeljek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | petek | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | ponedeljek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | petek | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | ponedeljek | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | petek | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | pon. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | pet. | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | d | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | d | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | dop. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | d | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | d | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | zjut. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | zveč. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ponoči | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | zjut. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | zveč. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ponoči | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | zjut. | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pop. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | zveč. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ponoči | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | zjutraj | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popoldan | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | zvečer | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ponoči | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | zj | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | zv | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | po | 2019-02-11T12:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11. 02. 87 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 53 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | sreda, 11. februar 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | nedelja, 29. maj 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11. 02. 87 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 53 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. feb. 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. februar 1987 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | sreda, 11. februar 1987 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | nedelja, 29. maj 1453 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | ------------------------ |
+| 2006-01-01T00:00:00.000Z | približno 6 let | približno 6 let | čez približno 6 let |
+| 2005-01-01T00:00:00.000Z | približno 5 let | približno 5 let | čez približno 5 let |
+| 2004-01-01T00:00:00.000Z | približno 4 leta | približno 4 leta | čez približno 4 leta |
+| 2003-01-01T00:00:00.000Z | približno 3 leta | približno 3 leta | čez približno 3 leta |
+| 2002-01-01T00:00:00.000Z | približno 2 leti | približno 2 leti | čez približno 2 leti |
+| 2001-06-01T00:00:00.000Z | več kot 1 leto | več kot 1 leto | čez več kot 1 leto |
+| 2001-02-01T00:00:00.000Z | približno 1 leto | približno 1 leto | čez približno 1 leto |
+| 2001-01-01T00:00:00.000Z | približno 1 leto | približno 1 leto | čez približno 1 leto |
+| 2000-06-01T00:00:00.000Z | 5 mesecev | 5 mesecev | čez 5 mesecev |
+| 2000-03-01T00:00:00.000Z | 2 meseca | 2 meseca | čez 2 meseca |
+| 2000-02-01T00:00:00.000Z | približno 1 mesec | približno 1 mesec | čez približno 1 mesec |
+| 2000-01-15T00:00:00.000Z | 14 dni | 14 dni | čez 14 dni |
+| 2000-01-02T00:00:00.000Z | 1 dan | 1 dan | čez 1 dan |
+| 2000-01-01T06:00:00.000Z | približno 6 ur | približno 6 ur | čez približno 6 ur |
+| 2000-01-01T01:00:00.000Z | približno 1 ura | približno 1 ura | čez približno 1 uro |
+| 2000-01-01T00:45:00.000Z | približno 1 ura | približno 1 ura | čez približno 1 uro |
+| 2000-01-01T00:30:00.000Z | 30 minut | 30 minut | čez 30 minut |
+| 2000-01-01T00:15:00.000Z | 15 minut | 15 minut | čez 15 minut |
+| 2000-01-01T00:01:00.000Z | 1 minuta | 1 minuta | čez 1 minuto |
+| 2000-01-01T00:00:25.000Z | manj kot 1 minuta | pol minute | čez manj kot 1 minuto |
+| 2000-01-01T00:00:15.000Z | manj kot 1 minuta | manj kot 20 sekund | čez manj kot 1 minuto |
+| 2000-01-01T00:00:05.000Z | manj kot 1 minuta | manj kot 10 sekund | čez manj kot 1 minuto |
+| 2000-01-01T00:00:00.000Z | manj kot 1 minuta | manj kot 5 sekund | pred manj kot 1 minuto |
+| 1999-12-31T23:59:55.000Z | manj kot 1 minuta | manj kot 10 sekund | pred manj kot 1 minuto |
+| 1999-12-31T23:59:45.000Z | manj kot 1 minuta | manj kot 20 sekund | pred manj kot 1 minuto |
+| 1999-12-31T23:59:35.000Z | manj kot 1 minuta | pol minute | pred manj kot 1 minuto |
+| 1999-12-31T23:59:00.000Z | 1 minuta | 1 minuta | pred 1 minuto |
+| 1999-12-31T23:45:00.000Z | 15 minut | 15 minut | pred 15 minutami |
+| 1999-12-31T23:30:00.000Z | 30 minut | 30 minut | pred 30 minutami |
+| 1999-12-31T23:15:00.000Z | približno 1 ura | približno 1 ura | pred približno 1 uro |
+| 1999-12-31T23:00:00.000Z | približno 1 ura | približno 1 ura | pred približno 1 uro |
+| 1999-12-31T18:00:00.000Z | približno 6 ur | približno 6 ur | pred približno 6 urami |
+| 1999-12-30T00:00:00.000Z | 2 dni | 2 dni | pred 2 dnevoma |
+| 1999-12-15T00:00:00.000Z | 17 dni | 17 dni | pred 17 dnevi |
+| 1999-12-01T00:00:00.000Z | približno 1 mesec | približno 1 mesec | pred približno 1 mesecem |
+| 1999-11-01T00:00:00.000Z | 2 meseca | 2 meseca | pred 2 mesecema |
+| 1999-06-01T00:00:00.000Z | 7 mesecev | 7 mesecev | pred 7 meseci |
+| 1999-01-01T00:00:00.000Z | približno 1 leto | približno 1 leto | pred približno 1 letom |
+| 1998-12-01T00:00:00.000Z | približno 1 leto | približno 1 leto | pred približno 1 letom |
+| 1998-06-01T00:00:00.000Z | več kot 1 leto | več kot 1 leto | pred več kot 1 letom |
+| 1998-01-01T00:00:00.000Z | približno 2 leti | približno 2 leti | pred približno 2 letoma |
+| 1997-01-01T00:00:00.000Z | približno 3 leta | približno 3 leta | pred približno 3 leti |
+| 1996-01-01T00:00:00.000Z | približno 4 leta | približno 4 leta | pred približno 4 leti |
+| 1995-01-01T00:00:00.000Z | približno 5 let | približno 5 let | pred približno 5 leti |
+| 1994-01-01T00:00:00.000Z | približno 6 let | približno 6 let | pred približno 6 leti |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 let | čez 6 let | 52608 ur |
+| 2005-01-01T00:00:00.000Z | 5 let | čez 5 let | 43848 ur |
+| 2004-01-01T00:00:00.000Z | 4 leta | čez 4 leta | 35064 ur |
+| 2003-01-01T00:00:00.000Z | 3 leta | čez 3 leta | 26304 ure |
+| 2002-01-01T00:00:00.000Z | 2 leti | čez 2 leti | 17544 ur |
+| 2001-06-01T00:00:00.000Z | 1 leto | čez 1 leto | 12408 ur |
+| 2001-02-01T00:00:00.000Z | 1 leto | čez 1 leto | 9528 ur |
+| 2001-01-01T00:00:00.000Z | 1 leto | čez 1 leto | 8784 ur |
+| 2000-06-01T00:00:00.000Z | 5 mesecev | čez 5 mesecev | 3648 ur |
+| 2000-03-01T00:00:00.000Z | 2 meseca | čez 2 meseca | 1440 ur |
+| 2000-02-01T00:00:00.000Z | 1 mesec | čez 1 mesec | 744 ur |
+| 2000-01-15T00:00:00.000Z | 14 dni | čez 14 dni | 336 ur |
+| 2000-01-02T00:00:00.000Z | 1 dan | čez 1 dan | 24 ur |
+| 2000-01-01T06:00:00.000Z | 6 ur | čez 6 ur | 6 ur |
+| 2000-01-01T01:00:00.000Z | 1 ura | čez 1 uro | 1 ura |
+| 2000-01-01T00:45:00.000Z | 45 minut | čez 45 minut | 1 ura |
+| 2000-01-01T00:30:00.000Z | 30 minut | čez 30 minut | 1 ura |
+| 2000-01-01T00:15:00.000Z | 15 minut | čez 15 minut | 0 ur |
+| 2000-01-01T00:01:00.000Z | 1 minuta | čez 1 minuto | 0 ur |
+| 2000-01-01T00:00:25.000Z | 25 sekund | čez 25 sekund | 0 ur |
+| 2000-01-01T00:00:15.000Z | 15 sekund | čez 15 sekund | 0 ur |
+| 2000-01-01T00:00:05.000Z | 5 sekund | čez 5 sekund | 0 ur |
+| 2000-01-01T00:00:00.000Z | 0 sekund | pred 0 sekundami | 0 ur |
+| 1999-12-31T23:59:55.000Z | 5 sekund | pred 5 sekundami | 0 ur |
+| 1999-12-31T23:59:45.000Z | 15 sekund | pred 15 sekundami | 0 ur |
+| 1999-12-31T23:59:35.000Z | 25 sekund | pred 25 sekundami | 0 ur |
+| 1999-12-31T23:59:00.000Z | 1 minuta | pred 1 minuto | 0 ur |
+| 1999-12-31T23:45:00.000Z | 15 minut | pred 15 minutami | 0 ur |
+| 1999-12-31T23:30:00.000Z | 30 minut | pred 30 minutami | 1 ura |
+| 1999-12-31T23:15:00.000Z | 45 minut | pred 45 minutami | 1 ura |
+| 1999-12-31T23:00:00.000Z | 1 ura | pred 1 uro | 1 ura |
+| 1999-12-31T18:00:00.000Z | 6 ur | pred 6 urami | 6 ur |
+| 1999-12-30T00:00:00.000Z | 2 dni | pred 2 dnevoma | 48 ur |
+| 1999-12-15T00:00:00.000Z | 17 dni | pred 17 dnevi | 408 ur |
+| 1999-12-01T00:00:00.000Z | 1 mesec | pred 1 mesecem | 744 ur |
+| 1999-11-01T00:00:00.000Z | 2 meseca | pred 2 mesecema | 1464 ur |
+| 1999-06-01T00:00:00.000Z | 7 mesecev | pred 7 meseci | 5136 ur |
+| 1999-01-01T00:00:00.000Z | 1 leto | pred 1 letom | 8760 ur |
+| 1998-12-01T00:00:00.000Z | 1 leto | pred 1 letom | 9504 ure |
+| 1998-06-01T00:00:00.000Z | 2 leti | pred 2 letoma | 13896 ur |
+| 1998-01-01T00:00:00.000Z | 2 leti | pred 2 letoma | 17520 ur |
+| 1997-01-01T00:00:00.000Z | 3 leta | pred 3 leti | 26280 ur |
+| 1996-01-01T00:00:00.000Z | 4 leta | pred 4 leti | 35064 ur |
+| 1995-01-01T00:00:00.000Z | 5 let | pred 5 leti | 43824 ur |
+| 1994-01-01T00:00:00.000Z | 6 let | pred 6 leti | 52584 ur |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------------- |
+| 2000-01-10T00:00:00.000Z | 10. 01. 00 |
+| 2000-01-05T00:00:00.000Z | naslednjo sredo ob 00:00 |
+| 2000-01-02T00:00:00.000Z | jutri ob 00:00 |
+| 2000-01-01T00:00:00.000Z | danes ob 00:00 |
+| 1999-12-31T00:00:00.000Z | včeraj ob 00:00 |
+| 1999-12-27T00:00:00.000Z | prejšnji ponedeljek ob 00:00 |
+| 1999-12-21T00:00:00.000Z | 21. 12. 99 |
diff --git a/date-fns/src/locale/sq/_lib/formatDistance/index.js b/date-fns/src/locale/sq/_lib/formatDistance/index.js
new file mode 100644
index 0000000..ecd01ff
--- /dev/null
+++ b/date-fns/src/locale/sq/_lib/formatDistance/index.js
@@ -0,0 +1,86 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'më pak se një sekondë',
+ other: 'më pak se {{count}} sekonda'
+ },
+ xSeconds: {
+ one: '1 sekondë',
+ other: '{{count}} sekonda'
+ },
+ halfAMinute: 'gjysëm minuti',
+ lessThanXMinutes: {
+ one: 'më pak se një minute',
+ other: 'më pak se {{count}} minuta'
+ },
+ xMinutes: {
+ one: '1 minutë',
+ other: '{{count}} minuta'
+ },
+ aboutXHours: {
+ one: 'rreth 1 orë',
+ other: 'rreth {{count}} orë'
+ },
+ xHours: {
+ one: '1 orë',
+ other: '{{count}} orë'
+ },
+ xDays: {
+ one: '1 ditë',
+ other: '{{count}} ditë'
+ },
+ aboutXWeeks: {
+ one: 'rreth 1 javë',
+ other: 'rreth {{count}} javë'
+ },
+ xWeeks: {
+ one: '1 javë',
+ other: '{{count}} javë'
+ },
+ aboutXMonths: {
+ one: 'rreth 1 muaj',
+ other: 'rreth {{count}} muaj'
+ },
+ xMonths: {
+ one: '1 muaj',
+ other: '{{count}} muaj'
+ },
+ aboutXYears: {
+ one: 'rreth 1 vit',
+ other: 'rreth {{count}} vite'
+ },
+ xYears: {
+ one: '1 vit',
+ other: '{{count}} vite'
+ },
+ overXYears: {
+ one: 'mbi 1 vit',
+ other: 'mbi {{count}} vite'
+ },
+ almostXYears: {
+ one: 'pothuajse 1 vit',
+ other: 'pothuajse {{count}} vite'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'në ' + result
+ } else {
+ return result + ' më parë'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/sq/_lib/formatLong/index.js b/date-fns/src/locale/sq/_lib/formatLong/index.js
new file mode 100644
index 0000000..c83c5f6
--- /dev/null
+++ b/date-fns/src/locale/sq/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'në' {{time}}",
+ long: "{{date}} 'në' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/sq/_lib/formatRelative/index.js b/date-fns/src/locale/sq/_lib/formatRelative/index.js
new file mode 100644
index 0000000..1a5792b
--- /dev/null
+++ b/date-fns/src/locale/sq/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'të' eeee 'e shkuar në' p",
+ yesterday: "'dje në' p",
+ today: "'sot në' p",
+ tomorrow: "'nesër në' p",
+ nextWeek: "eeee 'at' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/sq/_lib/localize/index.js b/date-fns/src/locale/sq/_lib/localize/index.js
new file mode 100644
index 0000000..f182f29
--- /dev/null
+++ b/date-fns/src/locale/sq/_lib/localize/index.js
@@ -0,0 +1,181 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['P', 'M'],
+ abbreviated: ['PK', 'MK'],
+ wide: ['Para Krishtit', 'Mbas Krishtit']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['4-mujori I', '4-mujori II', '4-mujori III', '4-mujori IV']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['J', 'S', 'M', 'P', 'M', 'Q', 'K', 'G', 'S', 'T', 'N', 'D'],
+ abbreviated: [
+ 'Jan',
+ 'Shk',
+ 'Mar',
+ 'Pri',
+ 'Maj',
+ 'Qer',
+ 'Kor',
+ 'Gus',
+ 'Sht',
+ 'Tet',
+ 'Nën',
+ 'Dhj'
+ ],
+ wide: [
+ 'Janar',
+ 'Shkurt',
+ 'Mars',
+ 'Prill',
+ 'Maj',
+ 'Qershor',
+ 'Korrik',
+ 'Gusht',
+ 'Shtator',
+ 'Tetor',
+ 'Nëntor',
+ 'Dhjetor'
+ ]
+}
+
+var dayValues = {
+ narrow: ['D', 'H', 'M', 'M', 'E', 'P', 'S'],
+ short: ['Di', 'Hë', 'Ma', 'Më', 'En', 'Pr', 'Sh'],
+ abbreviated: ['Die', 'Hën', 'Mar', 'Mër', 'Enj', 'Pre', 'Sht'],
+ wide: ['Dielë', 'Hënë', 'Martë', 'Mërkurë', 'Enjte', 'Premte', 'Shtunë']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'p',
+ pm: 'm',
+ midnight: 'm',
+ noon: 'd',
+ morning: 'mëngjes',
+ afternoon: 'dite',
+ evening: 'mbrëmje',
+ night: 'natë'
+ },
+ abbreviated: {
+ am: 'PD',
+ pm: 'MD',
+ midnight: 'mesnëtë',
+ noon: 'drek',
+ morning: 'mëngjes',
+ afternoon: 'mbasdite',
+ evening: 'mbrëmje',
+ night: 'natë'
+ },
+ wide: {
+ am: 'p.d.',
+ pm: 'm.d.',
+ midnight: 'mesnëtë',
+ noon: 'drek',
+ morning: 'mëngjes',
+ afternoon: 'mbasdite',
+ evening: 'mbrëmje',
+ night: 'natë'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'p',
+ pm: 'm',
+ midnight: 'm',
+ noon: 'd',
+ morning: 'në mëngjes',
+ afternoon: 'në mbasdite',
+ evening: 'në mbrëmje',
+ night: 'në mesnatë'
+ },
+ abbreviated: {
+ am: 'PD',
+ pm: 'MD',
+ midnight: 'mesnatë',
+ noon: 'drek',
+ morning: 'në mëngjes',
+ afternoon: 'në mbasdite',
+ evening: 'në mbrëmje',
+ night: 'në mesnatë'
+ },
+ wide: {
+ am: 'p.d.',
+ pm: 'm.d.',
+ midnight: 'mesnatë',
+ noon: 'drek',
+ morning: 'në mëngjes',
+ afternoon: 'në mbasdite',
+ evening: 'në mbrëmje',
+ night: 'në mesnatë'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ var options = _dirtyOptions || {}
+ var unit = String(options.unit)
+
+ if (unit === 'hour') return number
+
+ if (number === 1) return number + '-rë'
+ if (number === 4) return number + 't'
+
+ return number + '-të'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/sq/_lib/match/index.js b/date-fns/src/locale/sq/_lib/match/index.js
new file mode 100644
index 0000000..85f28e8
--- /dev/null
+++ b/date-fns/src/locale/sq/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-rë|-të|t|)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(p|m)/i,
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
+ wide: /^(para krishtit|mbas krishtit)/i
+}
+var parseEraPatterns = {
+ any: [/^b/i, /^(p|m)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234]-mujori (i{1,3}|iv)/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jsmpqkftnd]/i,
+ abbreviated: /^(jan|shk|mar|pri|maj|qer|kor|gus|sht|tet|nën|dhj)/i,
+ wide: /^(janar|shkurt|mars|prill|maj|qershor|korrik|gusht|shtator|tetor|nëntor|dhjetor)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^s/i,
+ /^m/i,
+ /^p/i,
+ /^m/i,
+ /^q/i,
+ /^k/i,
+ /^g/i,
+ /^s/i,
+ /^t/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ja/i,
+ /^shk/i,
+ /^mar/i,
+ /^pri/i,
+ /^maj/i,
+ /^qer/i,
+ /^kor/i,
+ /^gu/i,
+ /^sht/i,
+ /^tet/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[dhmeps]/i,
+ short: /^(di|hë|ma|më|en|pr|sh)/i,
+ abbreviated: /^(die|hën|mar|mër|enj|pre|sht)/i,
+ wide: /^(dielë|hënë|martë|mërkurë|enjte|premte|shtunë)/i
+}
+var parseDayPatterns = {
+ narrow: [/^d/i, /^h/i, /^m/i, /^m/i, /^e/i, /^p/i, /^s/i],
+ any: [/^d/i, /^h/i, /^ma/i, /^më/i, /^e/i, /^p/i, /^s/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(p|m|me|në (mëngjes|mbasdite|mbrëmje|mesnatë))/i,
+ any: /^([pm]\.?\s?d\.?|drek|në (mëngjes|mbasdite|mbrëmje|mesnatë))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^p/i,
+ pm: /^m/i,
+ midnight: /^me/i,
+ noon: /^dr/i,
+ morning: /mëngjes/i,
+ afternoon: /mbasdite/i,
+ evening: /mbrëmje/i,
+ night: /natë/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/sq/index.d.ts b/date-fns/src/locale/sq/index.d.ts
new file mode 100644
index 0000000..d361e22
--- /dev/null
+++ b/date-fns/src/locale/sq/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { sq } from 'date-fns/locale'
+export default sq
diff --git a/date-fns/src/locale/sq/index.js b/date-fns/src/locale/sq/index.js
new file mode 100644
index 0000000..7e777ea
--- /dev/null
+++ b/date-fns/src/locale/sq/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Albanian locale.
+ * @language Shqip
+ * @iso-639-2 sqi
+ * @author Ardit Dine [@arditdine]{@link https://github.com/arditdine}
+ */
+var locale = {
+ code: 'sq',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1,
+ },
+}
+
+export default locale
diff --git a/date-fns/src/locale/sq/index.js.flow b/date-fns/src/locale/sq/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/sq/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/sq/snapshot.md b/date-fns/src/locale/sq/snapshot.md
new file mode 100644
index 0000000..722d0c6
--- /dev/null
+++ b/date-fns/src/locale/sq/snapshot.md
@@ -0,0 +1,304 @@
+# Shqip (sq) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-të | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-të | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-të | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-të | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-rë | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-të | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 4-mujori I | 2019-10-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 4-mujori II | 2019-10-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-rë | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-të | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 4-mujori I | 2019-10-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 4-mujori II | 2019-10-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-të | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-të | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Shk | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Kor | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Shkurt | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Korrik | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | S | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | K | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-të | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-të | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Shk | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Kor | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Shkurt | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Korrik | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | S | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | K | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-rë | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-të | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-rë | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-të | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-të | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-të | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-të | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-të | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Hën | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pre | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Hën | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pre | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Hën | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pre | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Hënë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Premte | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Hë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-rë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-të | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Hën | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pre | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Hënë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Premte | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Hë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-rë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-të | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Hën | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pre | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Hënë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Premte | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Hë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-rë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-të | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Hën | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pre | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Hënë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Premte | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | H | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | P | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Hë | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Pr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | pd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | md | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | md | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | pd | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | p.d. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | m.d. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | m.d. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | p.d. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | m | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | m | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | MD | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | PD | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | pd | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | md | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | md | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | pd | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | p.d. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | m.d. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | m.d. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | p.d. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | m | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | m | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | p | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | në mëngjes | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | në mbasdite | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | në mbrëmje | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | në mesnatë | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | në mëngjes | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | në mbasdite | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | në mbrëmje | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | në mesnatë | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | në mëngjes | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | në mbasdite | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | në mbrëmje | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | në mesnatë | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | në mëngjes | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | në mbasdite | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | në mbrëmje | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | në mesnatë | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | në mëngjes | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | në mbasdite | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | në mbrëmje | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | në mesnatë | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-rë | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-të | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-rë | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-të | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | Shk 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Maj 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | Shkurt 11-të, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Maj 29-të, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Mërkurë, Shkurt 11-të, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Dielë, Maj 29-të, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 MD | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 MD | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 MD | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 MD | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 MD GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 MD GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 MD GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 MD GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 MD | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 MD | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | Shk 11, 1987, 12:13:14 MD | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | Maj 29, 1453, 11:59:59 MD | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | Shkurt 11-të, 1987 në 12:13:14 MD GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Maj 29-të, 1453 në 11:59:59 MD GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Mërkurë, Shkurt 11-të, 1987 në 12:13:14 MD GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Dielë, Maj 29-të, 1453 në 11:59:59 MD GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------------- | ---------------------- | ---------------------------- |
+| 2006-01-01T00:00:00.000Z | rreth 6 vite | rreth 6 vite | në rreth 6 vite |
+| 2005-01-01T00:00:00.000Z | rreth 5 vite | rreth 5 vite | në rreth 5 vite |
+| 2004-01-01T00:00:00.000Z | rreth 4 vite | rreth 4 vite | në rreth 4 vite |
+| 2003-01-01T00:00:00.000Z | rreth 3 vite | rreth 3 vite | në rreth 3 vite |
+| 2002-01-01T00:00:00.000Z | rreth 2 vite | rreth 2 vite | në rreth 2 vite |
+| 2001-06-01T00:00:00.000Z | mbi 1 vit | mbi 1 vit | në mbi 1 vit |
+| 2001-02-01T00:00:00.000Z | rreth 1 vit | rreth 1 vit | në rreth 1 vit |
+| 2001-01-01T00:00:00.000Z | rreth 1 vit | rreth 1 vit | në rreth 1 vit |
+| 2000-06-01T00:00:00.000Z | 5 muaj | 5 muaj | në 5 muaj |
+| 2000-03-01T00:00:00.000Z | 2 muaj | 2 muaj | në 2 muaj |
+| 2000-02-01T00:00:00.000Z | rreth 1 muaj | rreth 1 muaj | në rreth 1 muaj |
+| 2000-01-15T00:00:00.000Z | 14 ditë | 14 ditë | në 14 ditë |
+| 2000-01-02T00:00:00.000Z | 1 ditë | 1 ditë | në 1 ditë |
+| 2000-01-01T06:00:00.000Z | rreth 6 orë | rreth 6 orë | në rreth 6 orë |
+| 2000-01-01T01:00:00.000Z | rreth 1 orë | rreth 1 orë | në rreth 1 orë |
+| 2000-01-01T00:45:00.000Z | rreth 1 orë | rreth 1 orë | në rreth 1 orë |
+| 2000-01-01T00:30:00.000Z | 30 minuta | 30 minuta | në 30 minuta |
+| 2000-01-01T00:15:00.000Z | 15 minuta | 15 minuta | në 15 minuta |
+| 2000-01-01T00:01:00.000Z | 1 minutë | 1 minutë | në 1 minutë |
+| 2000-01-01T00:00:25.000Z | më pak se një minute | gjysëm minuti | në më pak se një minute |
+| 2000-01-01T00:00:15.000Z | më pak se një minute | më pak se 20 sekonda | në më pak se një minute |
+| 2000-01-01T00:00:05.000Z | më pak se një minute | më pak se 10 sekonda | në më pak se një minute |
+| 2000-01-01T00:00:00.000Z | më pak se një minute | më pak se 5 sekonda | më pak se një minute më parë |
+| 1999-12-31T23:59:55.000Z | më pak se një minute | më pak se 10 sekonda | më pak se një minute më parë |
+| 1999-12-31T23:59:45.000Z | më pak se një minute | më pak se 20 sekonda | më pak se një minute më parë |
+| 1999-12-31T23:59:35.000Z | më pak se një minute | gjysëm minuti | më pak se një minute më parë |
+| 1999-12-31T23:59:00.000Z | 1 minutë | 1 minutë | 1 minutë më parë |
+| 1999-12-31T23:45:00.000Z | 15 minuta | 15 minuta | 15 minuta më parë |
+| 1999-12-31T23:30:00.000Z | 30 minuta | 30 minuta | 30 minuta më parë |
+| 1999-12-31T23:15:00.000Z | rreth 1 orë | rreth 1 orë | rreth 1 orë më parë |
+| 1999-12-31T23:00:00.000Z | rreth 1 orë | rreth 1 orë | rreth 1 orë më parë |
+| 1999-12-31T18:00:00.000Z | rreth 6 orë | rreth 6 orë | rreth 6 orë më parë |
+| 1999-12-30T00:00:00.000Z | 2 ditë | 2 ditë | 2 ditë më parë |
+| 1999-12-15T00:00:00.000Z | 17 ditë | 17 ditë | 17 ditë më parë |
+| 1999-12-01T00:00:00.000Z | rreth 1 muaj | rreth 1 muaj | rreth 1 muaj më parë |
+| 1999-11-01T00:00:00.000Z | 2 muaj | 2 muaj | 2 muaj më parë |
+| 1999-06-01T00:00:00.000Z | 7 muaj | 7 muaj | 7 muaj më parë |
+| 1999-01-01T00:00:00.000Z | rreth 1 vit | rreth 1 vit | rreth 1 vit më parë |
+| 1998-12-01T00:00:00.000Z | rreth 1 vit | rreth 1 vit | rreth 1 vit më parë |
+| 1998-06-01T00:00:00.000Z | mbi 1 vit | mbi 1 vit | mbi 1 vit më parë |
+| 1998-01-01T00:00:00.000Z | rreth 2 vite | rreth 2 vite | rreth 2 vite më parë |
+| 1997-01-01T00:00:00.000Z | rreth 3 vite | rreth 3 vite | rreth 3 vite më parë |
+| 1996-01-01T00:00:00.000Z | rreth 4 vite | rreth 4 vite | rreth 4 vite më parë |
+| 1995-01-01T00:00:00.000Z | rreth 5 vite | rreth 5 vite | rreth 5 vite më parë |
+| 1994-01-01T00:00:00.000Z | rreth 6 vite | rreth 6 vite | rreth 6 vite më parë |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 vite | në 6 vite | 52608 orë |
+| 2005-01-01T00:00:00.000Z | 5 vite | në 5 vite | 43848 orë |
+| 2004-01-01T00:00:00.000Z | 4 vite | në 4 vite | 35064 orë |
+| 2003-01-01T00:00:00.000Z | 3 vite | në 3 vite | 26304 orë |
+| 2002-01-01T00:00:00.000Z | 2 vite | në 2 vite | 17544 orë |
+| 2001-06-01T00:00:00.000Z | 1 vit | në 1 vit | 12408 orë |
+| 2001-02-01T00:00:00.000Z | 1 vit | në 1 vit | 9528 orë |
+| 2001-01-01T00:00:00.000Z | 1 vit | në 1 vit | 8784 orë |
+| 2000-06-01T00:00:00.000Z | 5 muaj | në 5 muaj | 3648 orë |
+| 2000-03-01T00:00:00.000Z | 2 muaj | në 2 muaj | 1440 orë |
+| 2000-02-01T00:00:00.000Z | 1 muaj | në 1 muaj | 744 orë |
+| 2000-01-15T00:00:00.000Z | 14 ditë | në 14 ditë | 336 orë |
+| 2000-01-02T00:00:00.000Z | 1 ditë | në 1 ditë | 24 orë |
+| 2000-01-01T06:00:00.000Z | 6 orë | në 6 orë | 6 orë |
+| 2000-01-01T01:00:00.000Z | 1 orë | në 1 orë | 1 orë |
+| 2000-01-01T00:45:00.000Z | 45 minuta | në 45 minuta | 1 orë |
+| 2000-01-01T00:30:00.000Z | 30 minuta | në 30 minuta | 1 orë |
+| 2000-01-01T00:15:00.000Z | 15 minuta | në 15 minuta | 0 orë |
+| 2000-01-01T00:01:00.000Z | 1 minutë | në 1 minutë | 0 orë |
+| 2000-01-01T00:00:25.000Z | 25 sekonda | në 25 sekonda | 0 orë |
+| 2000-01-01T00:00:15.000Z | 15 sekonda | në 15 sekonda | 0 orë |
+| 2000-01-01T00:00:05.000Z | 5 sekonda | në 5 sekonda | 0 orë |
+| 2000-01-01T00:00:00.000Z | 0 sekonda | 0 sekonda më parë | 0 orë |
+| 1999-12-31T23:59:55.000Z | 5 sekonda | 5 sekonda më parë | 0 orë |
+| 1999-12-31T23:59:45.000Z | 15 sekonda | 15 sekonda më parë | 0 orë |
+| 1999-12-31T23:59:35.000Z | 25 sekonda | 25 sekonda më parë | 0 orë |
+| 1999-12-31T23:59:00.000Z | 1 minutë | 1 minutë më parë | 0 orë |
+| 1999-12-31T23:45:00.000Z | 15 minuta | 15 minuta më parë | 0 orë |
+| 1999-12-31T23:30:00.000Z | 30 minuta | 30 minuta më parë | 1 orë |
+| 1999-12-31T23:15:00.000Z | 45 minuta | 45 minuta më parë | 1 orë |
+| 1999-12-31T23:00:00.000Z | 1 orë | 1 orë më parë | 1 orë |
+| 1999-12-31T18:00:00.000Z | 6 orë | 6 orë më parë | 6 orë |
+| 1999-12-30T00:00:00.000Z | 2 ditë | 2 ditë më parë | 48 orë |
+| 1999-12-15T00:00:00.000Z | 17 ditë | 17 ditë më parë | 408 orë |
+| 1999-12-01T00:00:00.000Z | 1 muaj | 1 muaj më parë | 744 orë |
+| 1999-11-01T00:00:00.000Z | 2 muaj | 2 muaj më parë | 1464 orë |
+| 1999-06-01T00:00:00.000Z | 7 muaj | 7 muaj më parë | 5136 orë |
+| 1999-01-01T00:00:00.000Z | 1 vit | 1 vit më parë | 8760 orë |
+| 1998-12-01T00:00:00.000Z | 1 vit | 1 vit më parë | 9504 orë |
+| 1998-06-01T00:00:00.000Z | 2 vite | 2 vite më parë | 13896 orë |
+| 1998-01-01T00:00:00.000Z | 2 vite | 2 vite më parë | 17520 orë |
+| 1997-01-01T00:00:00.000Z | 3 vite | 3 vite më parë | 26280 orë |
+| 1996-01-01T00:00:00.000Z | 4 vite | 4 vite më parë | 35064 orë |
+| 1995-01-01T00:00:00.000Z | 5 vite | 5 vite më parë | 43824 orë |
+| 1994-01-01T00:00:00.000Z | 6 vite | 6 vite më parë | 52584 orë |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ---------------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | Mërkurë at 12:00 PD |
+| 2000-01-02T00:00:00.000Z | nesër në 12:00 PD |
+| 2000-01-01T00:00:00.000Z | sot në 12:00 PD |
+| 1999-12-31T00:00:00.000Z | dje në 12:00 PD |
+| 1999-12-27T00:00:00.000Z | të Hënë e shkuar në 12:00 PD |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/sr-Latn/_lib/formatDistance/index.js b/date-fns/src/locale/sr-Latn/_lib/formatDistance/index.js
new file mode 100644
index 0000000..e27c19d
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/_lib/formatDistance/index.js
@@ -0,0 +1,191 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: {
+ standalone: 'manje od 1 sekunde',
+ withPrepositionAgo: 'manje od 1 sekunde',
+ withPrepositionIn: 'manje od 1 sekundu'
+ },
+ dual: 'manje od {{count}} sekunde',
+ other: 'manje od {{count}} sekundi'
+ },
+
+ xSeconds: {
+ one: {
+ standalone: '1 sekunda',
+ withPrepositionAgo: '1 sekunde',
+ withPrepositionIn: '1 sekundu'
+ },
+ dual: '{{count}} sekunde',
+ other: '{{count}} sekundi'
+ },
+
+ halfAMinute: 'pola minute',
+
+ lessThanXMinutes: {
+ one: {
+ standalone: 'manje od 1 minute',
+ withPrepositionAgo: 'manje od 1 minute',
+ withPrepositionIn: 'manje od 1 minutu'
+ },
+ dual: 'manje od {{count}} minute',
+ other: 'manje od {{count}} minuta'
+ },
+
+ xMinutes: {
+ one: {
+ standalone: '1 minuta',
+ withPrepositionAgo: '1 minute',
+ withPrepositionIn: '1 minutu'
+ },
+ dual: '{{count}} minute',
+ other: '{{count}} minuta'
+ },
+
+ aboutXHours: {
+ one: {
+ standalone: 'oko 1 sat',
+ withPrepositionAgo: 'oko 1 sat',
+ withPrepositionIn: 'oko 1 sat'
+ },
+ dual: 'oko {{count}} sata',
+ other: 'oko {{count}} sati'
+ },
+
+ xHours: {
+ one: {
+ standalone: '1 sat',
+ withPrepositionAgo: '1 sat',
+ withPrepositionIn: '1 sat'
+ },
+ dual: '{{count}} sata',
+ other: '{{count}} sati'
+ },
+
+ xDays: {
+ one: {
+ standalone: '1 dan',
+ withPrepositionAgo: '1 dan',
+ withPrepositionIn: '1 dan'
+ },
+ dual: '{{count}} dana',
+ other: '{{count}} dana'
+ },
+
+ aboutXWeeks: {
+ one: {
+ standalone: 'oko 1 nedelju',
+ withPrepositionAgo: 'oko 1 nedelju',
+ withPrepositionIn: 'oko 1 nedelju'
+ },
+ dual: 'oko {{count}} nedelje',
+ other: 'oko {{count}} nedelje'
+ },
+
+ xWeeks: {
+ one: {
+ standalone: '1 nedelju',
+ withPrepositionAgo: '1 nedelju',
+ withPrepositionIn: '1 nedelju'
+ },
+ dual: '{{count}} nedelje',
+ other: '{{count}} nedelje'
+ },
+
+ aboutXMonths: {
+ one: {
+ standalone: 'oko 1 mesec',
+ withPrepositionAgo: 'oko 1 mesec',
+ withPrepositionIn: 'oko 1 mesec'
+ },
+ dual: 'oko {{count}} meseca',
+ other: 'oko {{count}} meseci'
+ },
+
+ xMonths: {
+ one: {
+ standalone: '1 mesec',
+ withPrepositionAgo: '1 mesec',
+ withPrepositionIn: '1 mesec'
+ },
+ dual: '{{count}} meseca',
+ other: '{{count}} meseci'
+ },
+
+ aboutXYears: {
+ one: {
+ standalone: 'oko 1 godinu',
+ withPrepositionAgo: 'oko 1 godinu',
+ withPrepositionIn: 'oko 1 godinu'
+ },
+ dual: 'oko {{count}} godine',
+ other: 'oko {{count}} godina'
+ },
+
+ xYears: {
+ one: {
+ standalone: '1 godina',
+ withPrepositionAgo: '1 godine',
+ withPrepositionIn: '1 godinu'
+ },
+ dual: '{{count}} godine',
+ other: '{{count}} godina'
+ },
+
+ overXYears: {
+ one: {
+ standalone: 'preko 1 godinu',
+ withPrepositionAgo: 'preko 1 godinu',
+ withPrepositionIn: 'preko 1 godinu'
+ },
+ dual: 'preko {{count}} godine',
+ other: 'preko {{count}} godina'
+ },
+
+ almostXYears: {
+ one: {
+ standalone: 'gotovo 1 godinu',
+ withPrepositionAgo: 'gotovo 1 godinu',
+ withPrepositionIn: 'gotovo 1 godinu'
+ },
+ dual: 'gotovo {{count}} godine',
+ other: 'gotovo {{count}} godina'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ result = formatDistanceLocale[token].one.withPrepositionIn
+ } else {
+ result = formatDistanceLocale[token].one.withPrepositionAgo
+ }
+ } else {
+ result = formatDistanceLocale[token].one.standalone
+ }
+ } else if (
+ count % 10 > 1 &&
+ count % 10 < 5 && // if last digit is between 2 and 4
+ String(count).substr(-2, 1) !== '1' // unless the 2nd to last digit is "1"
+ ) {
+ result = formatDistanceLocale[token].dual.replace('{{count}}', count)
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'za ' + result
+ } else {
+ return 'pre ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/sr-Latn/_lib/formatLong/index.js b/date-fns/src/locale/sr-Latn/_lib/formatLong/index.js
new file mode 100644
index 0000000..52631f4
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/_lib/formatLong/index.js
@@ -0,0 +1,39 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d. MMMM yyyy.',
+ long: 'd. MMMM yyyy.',
+ medium: 'd. MMM yy.',
+ short: 'dd. MM. yy.'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss (zzzz)',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'u' {{time}}",
+ long: "{{date}} 'u' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/sr-Latn/_lib/formatRelative/index.js b/date-fns/src/locale/sr-Latn/_lib/formatRelative/index.js
new file mode 100644
index 0000000..2d717cd
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/_lib/formatRelative/index.js
@@ -0,0 +1,44 @@
+var formatRelativeLocale = {
+ lastWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'prošle nedelje u' p"
+ case 3:
+ return "'prošle srede u' p"
+ case 6:
+ return "'prošle subote u' p"
+ default:
+ return "'prošli' EEEE 'u' p"
+ }
+ },
+ yesterday: "'juče u' p",
+ today: "'danas u' p",
+ tomorrow: "'sutra u' p",
+ nextWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'sledeće nedelje u' p"
+ case 3:
+ return "'sledeću sredu u' p"
+ case 6:
+ return "'sledeću subotu u' p"
+ default:
+ return "'sledeći' EEEE 'u' p"
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/sr-Latn/_lib/localize/index.js b/date-fns/src/locale/sr-Latn/_lib/localize/index.js
new file mode 100644
index 0000000..ea01814
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/_lib/localize/index.js
@@ -0,0 +1,222 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return String(number).concat('.')
+}
+
+var eraValues = {
+ narrow: ['pr.n.e.', 'AD'],
+ abbreviated: ['pr. Hr.', 'po. Hr.'],
+ wide: ['Pre Hrista', 'Posle Hrista']
+}
+
+var monthValues = {
+ narrow: [
+ '1.',
+ '2.',
+ '3.',
+ '4.',
+ '5.',
+ '6.',
+ '7.',
+ '8.',
+ '9.',
+ '10.',
+ '11.',
+ '12.'
+ ],
+ abbreviated: [
+ 'jan',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'maj',
+ 'jun',
+ 'jul',
+ 'avg',
+ 'sep',
+ 'okt',
+ 'nov',
+ 'dec'
+ ],
+ wide: [
+ 'januar',
+ 'februar',
+ 'mart',
+ 'april',
+ 'maj',
+ 'jun',
+ 'jul',
+ 'avgust',
+ 'septembar',
+ 'oktobar',
+ 'novembar',
+ 'decembar'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: [
+ '1.',
+ '2.',
+ '3.',
+ '4.',
+ '5.',
+ '6.',
+ '7.',
+ '8.',
+ '9.',
+ '10.',
+ '11.',
+ '12.'
+ ],
+ abbreviated: [
+ 'jan',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'maj',
+ 'jun',
+ 'jul',
+ 'avg',
+ 'sep',
+ 'okt',
+ 'nov',
+ 'dec'
+ ],
+ wide: [
+ 'januar',
+ 'februar',
+ 'mart',
+ 'april',
+ 'maj',
+ 'jun',
+ 'jul',
+ 'avgust',
+ 'septembar',
+ 'oktobar',
+ 'novembar',
+ 'decembar'
+ ]
+}
+
+var quarterValues = {
+ narrow: ['1.', '2.', '3.', '4.'],
+ abbreviated: ['1. kv.', '2. kv.', '3. kv.', '4. kv.'],
+ wide: ['1. kvartal', '2. kvartal', '3. kvartal', '4. kvartal']
+}
+
+var dayValues = {
+ narrow: ['N', 'P', 'U', 'S', 'Č', 'P', 'S'],
+ short: ['ned', 'pon', 'uto', 'sre', 'čet', 'pet', 'sub'],
+ abbreviated: ['ned', 'pon', 'uto', 'sre', 'čet', 'pet', 'sub'],
+ wide: [
+ 'nedelja',
+ 'ponedeljak',
+ 'utorak',
+ 'sreda',
+ 'četvrtak',
+ 'petak',
+ 'subota'
+ ]
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutru',
+ afternoon: 'popodne',
+ evening: 'uveče',
+ night: 'noću'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutru',
+ afternoon: 'popodne',
+ evening: 'uveče',
+ night: 'noću'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutru',
+ afternoon: 'posle podne',
+ evening: 'uveče',
+ night: 'noću'
+ }
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutru',
+ afternoon: 'popodne',
+ evening: 'uveče',
+ night: 'noću'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutru',
+ afternoon: 'popodne',
+ evening: 'uveče',
+ night: 'noću'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'ponoć',
+ noon: 'podne',
+ morning: 'ujutru',
+ afternoon: 'posle podne',
+ evening: 'uveče',
+ night: 'noću'
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/sr-Latn/_lib/match/index.js b/date-fns/src/locale/sr-Latn/_lib/match/index.js
new file mode 100644
index 0000000..86ffce0
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/_lib/match/index.js
@@ -0,0 +1,118 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\./i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(pr\.n\.e\.|AD)/i,
+ abbreviated: /^(pr\.\s?Hr\.|po\.\s?Hr\.)/i,
+ wide: /^(Pre Hrista|pre nove ere|Posle Hrista|nova era)/i
+}
+var parseEraPatterns = {
+ any: [/^pr/i, /^(po|nova)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]\.\s?kv\.?/i,
+ wide: /^[1234]\. kvartal/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(10|11|12|[123456789])\./i,
+ abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|avg|sep|okt|nov|dec)/i,
+ wide: /^((januar|januara)|(februar|februara)|(mart|marta)|(april|aprila)|(maj|maja)|(jun|juna)|(jul|jula)|(avgust|avgusta)|(septembar|septembra)|(oktobar|oktobra)|(novembar|novembra)|(decembar|decembra))/i
+}
+var parseMonthPatterns = {
+ narrow: [/(10|11|12|[123456789])/i],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^maj/i,
+ /^jun/i,
+ /^jul/i,
+ /^avg/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[npusčc]/i,
+ short: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
+ abbreviated: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
+ wide: /^(nedelja|ponedeljak|utorak|sreda|(četvrtak|cetvrtak)|petak|subota)/i
+}
+var parseDayPatterns = {
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(am|pm|ponoc|ponoć|(po)?podne|uvece|uveče|noću|posle podne|ujutru)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^pono/i,
+ noon: /^pod/i,
+ morning: /jutro/i,
+ afternoon: /(posle\s|po)+podne/i,
+ evening: /(uvece|uveče)/i,
+ night: /(nocu|noću)/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/sr-Latn/index.d.ts b/date-fns/src/locale/sr-Latn/index.d.ts
new file mode 100644
index 0000000..f6313cc
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { srLatn } from 'date-fns/locale'
+export default srLatn
diff --git a/date-fns/src/locale/sr-Latn/index.js b/date-fns/src/locale/sr-Latn/index.js
new file mode 100644
index 0000000..63231eb
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Serbian latin locale.
+ * @language Serbian
+ * @iso-639-2 srp
+ * @author Igor Radivojević [@rogyvoje]{@link https://github.com/rogyvoje}
+ */
+var locale = {
+ code: 'sr-Latn',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/sr-Latn/index.js.flow b/date-fns/src/locale/sr-Latn/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/sr-Latn/snapshot.md b/date-fns/src/locale/sr-Latn/snapshot.md
new file mode 100644
index 0000000..4b87903
--- /dev/null
+++ b/date-fns/src/locale/sr-Latn/snapshot.md
@@ -0,0 +1,304 @@
+# Serbian (sr-Latn) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1. kv. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kv. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2. | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. kv. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kv. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. kvartal | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. kvartal | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 2. | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | februar | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | jul | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 2. | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | ponedeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | EEEEE | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | ponedeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | iiiii | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | iiiiii | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | ponedeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | eeeee | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | eeeeee | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | ponedeljak | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | petak | Invalid Date |
+| | ccccc | 2019-02-11T12:13:14.015Z | P | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | P | Invalid Date |
+| | cccccc | 2019-02-11T12:13:14.015Z | pon | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | pet | Invalid Date |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ujutru | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uveče | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ujutru | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uveče | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ujutru | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uveče | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ujutru | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | posle podne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uveče | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ujutru | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | popodne | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | uveče | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | noću | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11. 02. 87. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 53. | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. feb 87. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 53. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. februar 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | sreda, 11. februar 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | nedelja, 29. maj 1453. | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 (GMT+00:00) | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 (GMT+00:00) | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11. 02. 87. 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 53. 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. feb 87. 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 53. 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. februar 1987. u 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. maj 1453. u 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | sreda, 11. februar 1987. u 12:13:14 (GMT+00:00) | Errored |
+| | | 1453-05-29T23:59:59.999Z | nedelja, 29. maj 1453. u 23:59:59 (GMT+00:00) | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------------- | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | oko 6 godina | oko 6 godina | za oko 6 godina |
+| 2005-01-01T00:00:00.000Z | oko 5 godina | oko 5 godina | za oko 5 godina |
+| 2004-01-01T00:00:00.000Z | oko 4 godine | oko 4 godine | za oko 4 godine |
+| 2003-01-01T00:00:00.000Z | oko 3 godine | oko 3 godine | za oko 3 godine |
+| 2002-01-01T00:00:00.000Z | oko 2 godine | oko 2 godine | za oko 2 godine |
+| 2001-06-01T00:00:00.000Z | preko 1 godinu | preko 1 godinu | za preko 1 godinu |
+| 2001-02-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | za oko 1 godinu |
+| 2001-01-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | za oko 1 godinu |
+| 2000-06-01T00:00:00.000Z | 5 meseci | 5 meseci | za 5 meseci |
+| 2000-03-01T00:00:00.000Z | 2 meseca | 2 meseca | za 2 meseca |
+| 2000-02-01T00:00:00.000Z | oko 1 mesec | oko 1 mesec | za oko 1 mesec |
+| 2000-01-15T00:00:00.000Z | 14 dana | 14 dana | za 14 dana |
+| 2000-01-02T00:00:00.000Z | 1 dan | 1 dan | za 1 dan |
+| 2000-01-01T06:00:00.000Z | oko 6 sati | oko 6 sati | za oko 6 sati |
+| 2000-01-01T01:00:00.000Z | oko 1 sat | oko 1 sat | za oko 1 sat |
+| 2000-01-01T00:45:00.000Z | oko 1 sat | oko 1 sat | za oko 1 sat |
+| 2000-01-01T00:30:00.000Z | 30 minuta | 30 minuta | za 30 minuta |
+| 2000-01-01T00:15:00.000Z | 15 minuta | 15 minuta | za 15 minuta |
+| 2000-01-01T00:01:00.000Z | 1 minuta | 1 minuta | za 1 minutu |
+| 2000-01-01T00:00:25.000Z | manje od 1 minute | pola minute | za manje od 1 minutu |
+| 2000-01-01T00:00:15.000Z | manje od 1 minute | manje od 20 sekundi | za manje od 1 minutu |
+| 2000-01-01T00:00:05.000Z | manje od 1 minute | manje od 10 sekundi | za manje od 1 minutu |
+| 2000-01-01T00:00:00.000Z | manje od 1 minute | manje od 5 sekundi | pre manje od 1 minute |
+| 1999-12-31T23:59:55.000Z | manje od 1 minute | manje od 10 sekundi | pre manje od 1 minute |
+| 1999-12-31T23:59:45.000Z | manje od 1 minute | manje od 20 sekundi | pre manje od 1 minute |
+| 1999-12-31T23:59:35.000Z | manje od 1 minute | pola minute | pre manje od 1 minute |
+| 1999-12-31T23:59:00.000Z | 1 minuta | 1 minuta | pre 1 minute |
+| 1999-12-31T23:45:00.000Z | 15 minuta | 15 minuta | pre 15 minuta |
+| 1999-12-31T23:30:00.000Z | 30 minuta | 30 minuta | pre 30 minuta |
+| 1999-12-31T23:15:00.000Z | oko 1 sat | oko 1 sat | pre oko 1 sat |
+| 1999-12-31T23:00:00.000Z | oko 1 sat | oko 1 sat | pre oko 1 sat |
+| 1999-12-31T18:00:00.000Z | oko 6 sati | oko 6 sati | pre oko 6 sati |
+| 1999-12-30T00:00:00.000Z | 2 dana | 2 dana | pre 2 dana |
+| 1999-12-15T00:00:00.000Z | 17 dana | 17 dana | pre 17 dana |
+| 1999-12-01T00:00:00.000Z | oko 1 mesec | oko 1 mesec | pre oko 1 mesec |
+| 1999-11-01T00:00:00.000Z | 2 meseca | 2 meseca | pre 2 meseca |
+| 1999-06-01T00:00:00.000Z | 7 meseci | 7 meseci | pre 7 meseci |
+| 1999-01-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | pre oko 1 godinu |
+| 1998-12-01T00:00:00.000Z | oko 1 godinu | oko 1 godinu | pre oko 1 godinu |
+| 1998-06-01T00:00:00.000Z | preko 1 godinu | preko 1 godinu | pre preko 1 godinu |
+| 1998-01-01T00:00:00.000Z | oko 2 godine | oko 2 godine | pre oko 2 godine |
+| 1997-01-01T00:00:00.000Z | oko 3 godine | oko 3 godine | pre oko 3 godine |
+| 1996-01-01T00:00:00.000Z | oko 4 godine | oko 4 godine | pre oko 4 godine |
+| 1995-01-01T00:00:00.000Z | oko 5 godina | oko 5 godina | pre oko 5 godina |
+| 1994-01-01T00:00:00.000Z | oko 6 godina | oko 6 godina | pre oko 6 godina |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 godina | za 6 godina | 52608 sati |
+| 2005-01-01T00:00:00.000Z | 5 godina | za 5 godina | 43848 sati |
+| 2004-01-01T00:00:00.000Z | 4 godine | za 4 godine | 35064 sata |
+| 2003-01-01T00:00:00.000Z | 3 godine | za 3 godine | 26304 sata |
+| 2002-01-01T00:00:00.000Z | 2 godine | za 2 godine | 17544 sata |
+| 2001-06-01T00:00:00.000Z | 1 godina | za 1 godinu | 12408 sati |
+| 2001-02-01T00:00:00.000Z | 1 godina | za 1 godinu | 9528 sati |
+| 2001-01-01T00:00:00.000Z | 1 godina | za 1 godinu | 8784 sata |
+| 2000-06-01T00:00:00.000Z | 5 meseci | za 5 meseci | 3648 sati |
+| 2000-03-01T00:00:00.000Z | 2 meseca | za 2 meseca | 1440 sati |
+| 2000-02-01T00:00:00.000Z | 1 mesec | za 1 mesec | 744 sata |
+| 2000-01-15T00:00:00.000Z | 14 dana | za 14 dana | 336 sati |
+| 2000-01-02T00:00:00.000Z | 1 dan | za 1 dan | 24 sata |
+| 2000-01-01T06:00:00.000Z | 6 sati | za 6 sati | 6 sati |
+| 2000-01-01T01:00:00.000Z | 1 sat | za 1 sat | 1 sat |
+| 2000-01-01T00:45:00.000Z | 45 minuta | za 45 minuta | 1 sat |
+| 2000-01-01T00:30:00.000Z | 30 minuta | za 30 minuta | 1 sat |
+| 2000-01-01T00:15:00.000Z | 15 minuta | za 15 minuta | 0 sati |
+| 2000-01-01T00:01:00.000Z | 1 minuta | za 1 minutu | 0 sati |
+| 2000-01-01T00:00:25.000Z | 25 sekundi | za 25 sekundi | 0 sati |
+| 2000-01-01T00:00:15.000Z | 15 sekundi | za 15 sekundi | 0 sati |
+| 2000-01-01T00:00:05.000Z | 5 sekundi | za 5 sekundi | 0 sati |
+| 2000-01-01T00:00:00.000Z | 0 sekundi | pre 0 sekundi | 0 sati |
+| 1999-12-31T23:59:55.000Z | 5 sekundi | pre 5 sekundi | 0 sati |
+| 1999-12-31T23:59:45.000Z | 15 sekundi | pre 15 sekundi | 0 sati |
+| 1999-12-31T23:59:35.000Z | 25 sekundi | pre 25 sekundi | 0 sati |
+| 1999-12-31T23:59:00.000Z | 1 minuta | pre 1 minute | 0 sati |
+| 1999-12-31T23:45:00.000Z | 15 minuta | pre 15 minuta | 0 sati |
+| 1999-12-31T23:30:00.000Z | 30 minuta | pre 30 minuta | 1 sat |
+| 1999-12-31T23:15:00.000Z | 45 minuta | pre 45 minuta | 1 sat |
+| 1999-12-31T23:00:00.000Z | 1 sat | pre 1 sat | 1 sat |
+| 1999-12-31T18:00:00.000Z | 6 sati | pre 6 sati | 6 sati |
+| 1999-12-30T00:00:00.000Z | 2 dana | pre 2 dana | 48 sati |
+| 1999-12-15T00:00:00.000Z | 17 dana | pre 17 dana | 408 sati |
+| 1999-12-01T00:00:00.000Z | 1 mesec | pre 1 mesec | 744 sata |
+| 1999-11-01T00:00:00.000Z | 2 meseca | pre 2 meseca | 1464 sata |
+| 1999-06-01T00:00:00.000Z | 7 meseci | pre 7 meseci | 5136 sati |
+| 1999-01-01T00:00:00.000Z | 1 godina | pre 1 godine | 8760 sati |
+| 1998-12-01T00:00:00.000Z | 1 godina | pre 1 godine | 9504 sata |
+| 1998-06-01T00:00:00.000Z | 2 godine | pre 2 godine | 13896 sati |
+| 1998-01-01T00:00:00.000Z | 2 godine | pre 2 godine | 17520 sati |
+| 1997-01-01T00:00:00.000Z | 3 godine | pre 3 godine | 26280 sati |
+| 1996-01-01T00:00:00.000Z | 4 godine | pre 4 godine | 35064 sata |
+| 1995-01-01T00:00:00.000Z | 5 godina | pre 5 godina | 43824 sata |
+| 1994-01-01T00:00:00.000Z | 6 godina | pre 6 godina | 52584 sata |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------- |
+| 2000-01-10T00:00:00.000Z | 10. 01. 00. |
+| 2000-01-05T00:00:00.000Z | sledeću sredu u 00:00 |
+| 2000-01-02T00:00:00.000Z | sutra u 00:00 |
+| 2000-01-01T00:00:00.000Z | danas u 00:00 |
+| 1999-12-31T00:00:00.000Z | juče u 00:00 |
+| 1999-12-27T00:00:00.000Z | prošli ponedeljak u 00:00 |
+| 1999-12-21T00:00:00.000Z | 21. 12. 99. |
diff --git a/date-fns/src/locale/sr/_lib/formatDistance/index.js b/date-fns/src/locale/sr/_lib/formatDistance/index.js
new file mode 100644
index 0000000..5cab16d
--- /dev/null
+++ b/date-fns/src/locale/sr/_lib/formatDistance/index.js
@@ -0,0 +1,191 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: {
+ standalone: 'мање од 1 секунде',
+ withPrepositionAgo: 'мање од 1 секунде',
+ withPrepositionIn: 'мање од 1 секунду'
+ },
+ dual: 'мање од {{count}} секунде',
+ other: 'мање од {{count}} секунди'
+ },
+
+ xSeconds: {
+ one: {
+ standalone: '1 секунда',
+ withPrepositionAgo: '1 секунде',
+ withPrepositionIn: '1 секунду'
+ },
+ dual: '{{count}} секунде',
+ other: '{{count}} секунди'
+ },
+
+ halfAMinute: 'пола минуте',
+
+ lessThanXMinutes: {
+ one: {
+ standalone: 'мање од 1 минуте',
+ withPrepositionAgo: 'мање од 1 минуте',
+ withPrepositionIn: 'мање од 1 минуту'
+ },
+ dual: 'мање од {{count}} минуте',
+ other: 'мање од {{count}} минута'
+ },
+
+ xMinutes: {
+ one: {
+ standalone: '1 минута',
+ withPrepositionAgo: '1 минуте',
+ withPrepositionIn: '1 минуту'
+ },
+ dual: '{{count}} минуте',
+ other: '{{count}} минута'
+ },
+
+ aboutXHours: {
+ one: {
+ standalone: 'око 1 сат',
+ withPrepositionAgo: 'око 1 сат',
+ withPrepositionIn: 'око 1 сат'
+ },
+ dual: 'око {{count}} сата',
+ other: 'око {{count}} сати'
+ },
+
+ xHours: {
+ one: {
+ standalone: '1 сат',
+ withPrepositionAgo: '1 сат',
+ withPrepositionIn: '1 сат'
+ },
+ dual: '{{count}} сата',
+ other: '{{count}} сати'
+ },
+
+ xDays: {
+ one: {
+ standalone: '1 дан',
+ withPrepositionAgo: '1 дан',
+ withPrepositionIn: '1 дан'
+ },
+ dual: '{{count}} дана',
+ other: '{{count}} дана'
+ },
+
+ aboutXWeeks: {
+ one: {
+ standalone: 'око 1 недељу',
+ withPrepositionAgo: 'око 1 недељу',
+ withPrepositionIn: 'око 1 недељу'
+ },
+ dual: 'око {{count}} недеље',
+ other: 'око {{count}} недеље'
+ },
+
+ xWeeks: {
+ one: {
+ standalone: '1 недељу',
+ withPrepositionAgo: '1 недељу',
+ withPrepositionIn: '1 недељу'
+ },
+ dual: '{{count}} недеље',
+ other: '{{count}} недеље'
+ },
+
+ aboutXMonths: {
+ one: {
+ standalone: 'око 1 месец',
+ withPrepositionAgo: 'око 1 месец',
+ withPrepositionIn: 'око 1 месец'
+ },
+ dual: 'око {{count}} месеца',
+ other: 'око {{count}} месеци'
+ },
+
+ xMonths: {
+ one: {
+ standalone: '1 месец',
+ withPrepositionAgo: '1 месец',
+ withPrepositionIn: '1 месец'
+ },
+ dual: '{{count}} месеца',
+ other: '{{count}} месеци'
+ },
+
+ aboutXYears: {
+ one: {
+ standalone: 'око 1 годину',
+ withPrepositionAgo: 'око 1 годину',
+ withPrepositionIn: 'око 1 годину'
+ },
+ dual: 'око {{count}} године',
+ other: 'око {{count}} година'
+ },
+
+ xYears: {
+ one: {
+ standalone: '1 година',
+ withPrepositionAgo: '1 године',
+ withPrepositionIn: '1 годину'
+ },
+ dual: '{{count}} године',
+ other: '{{count}} година'
+ },
+
+ overXYears: {
+ one: {
+ standalone: 'преко 1 годину',
+ withPrepositionAgo: 'преко 1 годину',
+ withPrepositionIn: 'преко 1 годину'
+ },
+ dual: 'преко {{count}} године',
+ other: 'преко {{count}} година'
+ },
+
+ almostXYears: {
+ one: {
+ standalone: 'готово 1 годину',
+ withPrepositionAgo: 'готово 1 годину',
+ withPrepositionIn: 'готово 1 годину'
+ },
+ dual: 'готово {{count}} године',
+ other: 'готово {{count}} година'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ result = formatDistanceLocale[token].one.withPrepositionIn
+ } else {
+ result = formatDistanceLocale[token].one.withPrepositionAgo
+ }
+ } else {
+ result = formatDistanceLocale[token].one.standalone
+ }
+ } else if (
+ count % 10 > 1 &&
+ count % 10 < 5 && // if last digit is between 2 and 4
+ String(count).substr(-2, 1) !== '1' // unless the 2nd to last digit is "1"
+ ) {
+ result = formatDistanceLocale[token].dual.replace('{{count}}', count)
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'за ' + result
+ } else {
+ return 'пре ' + result
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/sr/_lib/formatLong/index.js b/date-fns/src/locale/sr/_lib/formatLong/index.js
new file mode 100644
index 0000000..c833b99
--- /dev/null
+++ b/date-fns/src/locale/sr/_lib/formatLong/index.js
@@ -0,0 +1,39 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, d. MMMM yyyy.',
+ long: 'd. MMMM yyyy.',
+ medium: 'd. MMM yy.',
+ short: 'dd. MM. yy.'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss (zzzz)',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'у' {{time}}",
+ long: "{{date}} 'у' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/sr/_lib/formatRelative/index.js b/date-fns/src/locale/sr/_lib/formatRelative/index.js
new file mode 100644
index 0000000..3f44d8f
--- /dev/null
+++ b/date-fns/src/locale/sr/_lib/formatRelative/index.js
@@ -0,0 +1,44 @@
+var formatRelativeLocale = {
+ lastWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'прошле недеље у' p"
+ case 3:
+ return "'прошле среде у' p"
+ case 6:
+ return "'прошле суботе у' p"
+ default:
+ return "'прошли' EEEE 'у' p"
+ }
+ },
+ yesterday: "'јуче у' p",
+ today: "'данас у' p",
+ tomorrow: "'сутра у' p",
+ nextWeek: function(date) {
+ var day = date.getUTCDay()
+
+ switch (day) {
+ case 0:
+ return "'следеће недеље у' p"
+ case 3:
+ return "'следећу среду у' p"
+ case 6:
+ return "'следећу суботу у' p"
+ default:
+ return "'следећи' EEEE 'у' p"
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, _baseDate, _options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/sr/_lib/localize/index.js b/date-fns/src/locale/sr/_lib/localize/index.js
new file mode 100644
index 0000000..538ca16
--- /dev/null
+++ b/date-fns/src/locale/sr/_lib/localize/index.js
@@ -0,0 +1,222 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return String(number).concat('.')
+}
+
+var eraValues = {
+ narrow: ['пр.н.е.', 'АД'],
+ abbreviated: ['пр. Хр.', 'по. Хр.'],
+ wide: ['Пре Христа', 'После Христа']
+}
+
+var monthValues = {
+ narrow: [
+ '1.',
+ '2.',
+ '3.',
+ '4.',
+ '5.',
+ '6.',
+ '7.',
+ '8.',
+ '9.',
+ '10.',
+ '11.',
+ '12.'
+ ],
+ abbreviated: [
+ 'јан',
+ 'феб',
+ 'мар',
+ 'апр',
+ 'мај',
+ 'јун',
+ 'јул',
+ 'авг',
+ 'сеп',
+ 'окт',
+ 'нов',
+ 'дец'
+ ],
+ wide: [
+ 'јануар',
+ 'фебруар',
+ 'март',
+ 'април',
+ 'мај',
+ 'јун',
+ 'јул',
+ 'август',
+ 'септембар',
+ 'октобар',
+ 'новембар',
+ 'децембар'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: [
+ '1.',
+ '2.',
+ '3.',
+ '4.',
+ '5.',
+ '6.',
+ '7.',
+ '8.',
+ '9.',
+ '10.',
+ '11.',
+ '12.'
+ ],
+ abbreviated: [
+ 'јан',
+ 'феб',
+ 'мар',
+ 'апр',
+ 'мај',
+ 'јун',
+ 'јул',
+ 'авг',
+ 'сеп',
+ 'окт',
+ 'нов',
+ 'дец'
+ ],
+ wide: [
+ 'јануар',
+ 'фебруар',
+ 'март',
+ 'април',
+ 'мај',
+ 'јун',
+ 'јул',
+ 'август',
+ 'септембар',
+ 'октобар',
+ 'новембар',
+ 'децембар'
+ ]
+}
+
+var quarterValues = {
+ narrow: ['1.', '2.', '3.', '4.'],
+ abbreviated: ['1. кв.', '2. кв.', '3. кв.', '4. кв.'],
+ wide: ['1. квартал', '2. квартал', '3. квартал', '4. квартал']
+}
+
+var dayValues = {
+ narrow: ['Н', 'П', 'У', 'С', 'Ч', 'П', 'С'],
+ short: ['нед', 'пон', 'уто', 'сре', 'чет', 'пет', 'суб'],
+ abbreviated: ['нед', 'пон', 'уто', 'сре', 'чет', 'пет', 'суб'],
+ wide: [
+ 'недеља',
+ 'понедељак',
+ 'уторак',
+ 'среда',
+ 'четвртак',
+ 'петак',
+ 'субота'
+ ]
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'АМ',
+ pm: 'ПМ',
+ midnight: 'поноћ',
+ noon: 'подне',
+ morning: 'ујутру',
+ afternoon: 'поподне',
+ evening: 'увече',
+ night: 'ноћу'
+ },
+ abbreviated: {
+ am: 'АМ',
+ pm: 'ПМ',
+ midnight: 'поноћ',
+ noon: 'подне',
+ morning: 'ујутру',
+ afternoon: 'поподне',
+ evening: 'увече',
+ night: 'ноћу'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'поноћ',
+ noon: 'подне',
+ morning: 'ујутру',
+ afternoon: 'после подне',
+ evening: 'увече',
+ night: 'ноћу'
+ }
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'поноћ',
+ noon: 'подне',
+ morning: 'ујутру',
+ afternoon: 'поподне',
+ evening: 'увече',
+ night: 'ноћу'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'поноћ',
+ noon: 'подне',
+ morning: 'ујутру',
+ afternoon: 'поподне',
+ evening: 'увече',
+ night: 'ноћу'
+ },
+ wide: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'поноћ',
+ noon: 'подне',
+ morning: 'ујутру',
+ afternoon: 'после подне',
+ evening: 'увече',
+ night: 'ноћу'
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/sr/_lib/match/index.js b/date-fns/src/locale/sr/_lib/match/index.js
new file mode 100644
index 0000000..45da68e
--- /dev/null
+++ b/date-fns/src/locale/sr/_lib/match/index.js
@@ -0,0 +1,118 @@
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)\./i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(пр\.н\.е\.|АД)/i,
+ abbreviated: /^(пр\.\s?Хр\.|по\.\s?Хр\.)/i,
+ wide: /^(Пре Христа|пре нове ере|После Христа|нова ера)/i
+}
+var parseEraPatterns = {
+ any: [/^пр/i, /^(по|нова)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]\.\s?кв\.?/i,
+ wide: /^[1234]\. квартал/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(10|11|12|[123456789])\./i,
+ abbreviated: /^(јан|феб|мар|апр|мај|јун|јул|авг|сеп|окт|нов|дец)/i,
+ wide: /^((јануар|јануара)|(фебруар|фебруара)|(март|марта)|(април|априла)|(мја|маја)|(јун|јуна)|(јул|јула)|(август|августа)|(септембар|септембра)|(октобар|октобра)|(новембар|новембра)|(децембар|децембра))/i
+}
+var parseMonthPatterns = {
+ narrow: [/(10|11|12|[123456789])/i],
+ any: [
+ /^ја/i,
+ /^ф/i,
+ /^мар/i,
+ /^ап/i,
+ /^мај/i,
+ /^јун/i,
+ /^јул/i,
+ /^авг/i,
+ /^с/i,
+ /^о/i,
+ /^н/i,
+ /^д/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[пусчн]/i,
+ short: /^(нед|пон|уто|сре|чет|пет|суб)/i,
+ abbreviated: /^(нед|пон|уто|сре|чет|пет|суб)/i,
+ wide: /^(недеља|понедељак|уторак|среда|четвртак|петак|субота)/i
+}
+var parseDayPatterns = {
+ narrow: [/^п/i, /^у/i, /^с/i, /^ч/i, /^н/i],
+ any: [/^нед/i, /^пон/i, /^уто/i, /^сре/i, /^чет/i, /^пет/i, /^суб/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(ам|пм|поноћ|(по)?подне|увече|ноћу|после подне|ујутру)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^поно/i,
+ noon: /^под/i,
+ morning: /ујутру/i,
+ afternoon: /(после\s|по)+подне/i,
+ evening: /(увече)/i,
+ night: /(ноћу)/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/sr/index.d.ts b/date-fns/src/locale/sr/index.d.ts
new file mode 100644
index 0000000..aaede59
--- /dev/null
+++ b/date-fns/src/locale/sr/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { sr } from 'date-fns/locale'
+export default sr
diff --git a/date-fns/src/locale/sr/index.js b/date-fns/src/locale/sr/index.js
new file mode 100644
index 0000000..f8c1408
--- /dev/null
+++ b/date-fns/src/locale/sr/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Serbian cyrillic locale.
+ * @language Serbian
+ * @iso-639-2 srp
+ * @author Igor Radivojević [@rogyvoje]{@link https://github.com/rogyvoje}
+ */
+var locale = {
+ code: 'sr',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/sr/index.js.flow b/date-fns/src/locale/sr/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/sr/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/sr/snapshot.md b/date-fns/src/locale/sr/snapshot.md
new file mode 100644
index 0000000..98da3c4
--- /dev/null
+++ b/date-fns/src/locale/sr/snapshot.md
@@ -0,0 +1,304 @@
+# Serbian (sr) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1. кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. кв. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1. квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. квартал | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1. | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2. | Invalid Date |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1. кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. кв. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1. квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. квартал | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | феб | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јул | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | фебруар | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јул | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 2. | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | феб | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јул | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | фебруар | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | јул | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 2. | 2019-01-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | понедељак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петак | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | понедељак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петак | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | понедељак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петак | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | понедељак | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | петак | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-17T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пет | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | ам | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пм | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пм | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ам | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | aaaaa | 2019-02-11T11:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | ам | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пм | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пм | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ам | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | AM | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | PM | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | AM | Invalid Date |
+| | bbbbb | 2019-02-11T11:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПМ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | АМ | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ујутру | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | поподне | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | увече | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ноћу | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ујутру | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | поподне | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | увече | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ноћу | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ујутру | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | поподне | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | увече | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ноћу | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ујутру | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | после подне | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | увече | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ноћу | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ујутру | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | поподне | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | увече | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ноћу | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11. 02. 87. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 53. | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11. феб 87. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. мај 53. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11. фебруар 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. мај 1453. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | среда, 11. фебруар 1987. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | недеља, 29. мај 1453. | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 (GMT+00:00) | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 (GMT+00:00) | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11. 02. 87. 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. 05. 53. 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11. феб 87. 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29. мај 53. 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11. фебруар 1987. у 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29. мај 1453. у 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | среда, 11. фебруар 1987. у 12:13:14 (GMT+00:00) | Errored |
+| | | 1453-05-29T23:59:59.999Z | недеља, 29. мај 1453. у 23:59:59 (GMT+00:00) | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | -------------------- |
+| 2006-01-01T00:00:00.000Z | око 6 година | око 6 година | за око 6 година |
+| 2005-01-01T00:00:00.000Z | око 5 година | око 5 година | за око 5 година |
+| 2004-01-01T00:00:00.000Z | око 4 године | око 4 године | за око 4 године |
+| 2003-01-01T00:00:00.000Z | око 3 године | око 3 године | за око 3 године |
+| 2002-01-01T00:00:00.000Z | око 2 године | око 2 године | за око 2 године |
+| 2001-06-01T00:00:00.000Z | преко 1 годину | преко 1 годину | за преко 1 годину |
+| 2001-02-01T00:00:00.000Z | око 1 годину | око 1 годину | за око 1 годину |
+| 2001-01-01T00:00:00.000Z | око 1 годину | око 1 годину | за око 1 годину |
+| 2000-06-01T00:00:00.000Z | 5 месеци | 5 месеци | за 5 месеци |
+| 2000-03-01T00:00:00.000Z | 2 месеца | 2 месеца | за 2 месеца |
+| 2000-02-01T00:00:00.000Z | око 1 месец | око 1 месец | за око 1 месец |
+| 2000-01-15T00:00:00.000Z | 14 дана | 14 дана | за 14 дана |
+| 2000-01-02T00:00:00.000Z | 1 дан | 1 дан | за 1 дан |
+| 2000-01-01T06:00:00.000Z | око 6 сати | око 6 сати | за око 6 сати |
+| 2000-01-01T01:00:00.000Z | око 1 сат | око 1 сат | за око 1 сат |
+| 2000-01-01T00:45:00.000Z | око 1 сат | око 1 сат | за око 1 сат |
+| 2000-01-01T00:30:00.000Z | 30 минута | 30 минута | за 30 минута |
+| 2000-01-01T00:15:00.000Z | 15 минута | 15 минута | за 15 минута |
+| 2000-01-01T00:01:00.000Z | 1 минута | 1 минута | за 1 минуту |
+| 2000-01-01T00:00:25.000Z | мање од 1 минуте | пола минуте | за мање од 1 минуту |
+| 2000-01-01T00:00:15.000Z | мање од 1 минуте | мање од 20 секунди | за мање од 1 минуту |
+| 2000-01-01T00:00:05.000Z | мање од 1 минуте | мање од 10 секунди | за мање од 1 минуту |
+| 2000-01-01T00:00:00.000Z | мање од 1 минуте | мање од 5 секунди | пре мање од 1 минуте |
+| 1999-12-31T23:59:55.000Z | мање од 1 минуте | мање од 10 секунди | пре мање од 1 минуте |
+| 1999-12-31T23:59:45.000Z | мање од 1 минуте | мање од 20 секунди | пре мање од 1 минуте |
+| 1999-12-31T23:59:35.000Z | мање од 1 минуте | пола минуте | пре мање од 1 минуте |
+| 1999-12-31T23:59:00.000Z | 1 минута | 1 минута | пре 1 минуте |
+| 1999-12-31T23:45:00.000Z | 15 минута | 15 минута | пре 15 минута |
+| 1999-12-31T23:30:00.000Z | 30 минута | 30 минута | пре 30 минута |
+| 1999-12-31T23:15:00.000Z | око 1 сат | око 1 сат | пре око 1 сат |
+| 1999-12-31T23:00:00.000Z | око 1 сат | око 1 сат | пре око 1 сат |
+| 1999-12-31T18:00:00.000Z | око 6 сати | око 6 сати | пре око 6 сати |
+| 1999-12-30T00:00:00.000Z | 2 дана | 2 дана | пре 2 дана |
+| 1999-12-15T00:00:00.000Z | 17 дана | 17 дана | пре 17 дана |
+| 1999-12-01T00:00:00.000Z | око 1 месец | око 1 месец | пре око 1 месец |
+| 1999-11-01T00:00:00.000Z | 2 месеца | 2 месеца | пре 2 месеца |
+| 1999-06-01T00:00:00.000Z | 7 месеци | 7 месеци | пре 7 месеци |
+| 1999-01-01T00:00:00.000Z | око 1 годину | око 1 годину | пре око 1 годину |
+| 1998-12-01T00:00:00.000Z | око 1 годину | око 1 годину | пре око 1 годину |
+| 1998-06-01T00:00:00.000Z | преко 1 годину | преко 1 годину | пре преко 1 годину |
+| 1998-01-01T00:00:00.000Z | око 2 године | око 2 године | пре око 2 године |
+| 1997-01-01T00:00:00.000Z | око 3 године | око 3 године | пре око 3 године |
+| 1996-01-01T00:00:00.000Z | око 4 године | око 4 године | пре око 4 године |
+| 1995-01-01T00:00:00.000Z | око 5 година | око 5 година | пре око 5 година |
+| 1994-01-01T00:00:00.000Z | око 6 година | око 6 година | пре око 6 година |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ---------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 година | за 6 година | 52608 сати |
+| 2005-01-01T00:00:00.000Z | 5 година | за 5 година | 43848 сати |
+| 2004-01-01T00:00:00.000Z | 4 године | за 4 године | 35064 сата |
+| 2003-01-01T00:00:00.000Z | 3 године | за 3 године | 26304 сата |
+| 2002-01-01T00:00:00.000Z | 2 године | за 2 године | 17544 сата |
+| 2001-06-01T00:00:00.000Z | 1 година | за 1 годину | 12408 сати |
+| 2001-02-01T00:00:00.000Z | 1 година | за 1 годину | 9528 сати |
+| 2001-01-01T00:00:00.000Z | 1 година | за 1 годину | 8784 сата |
+| 2000-06-01T00:00:00.000Z | 5 месеци | за 5 месеци | 3648 сати |
+| 2000-03-01T00:00:00.000Z | 2 месеца | за 2 месеца | 1440 сати |
+| 2000-02-01T00:00:00.000Z | 1 месец | за 1 месец | 744 сата |
+| 2000-01-15T00:00:00.000Z | 14 дана | за 14 дана | 336 сати |
+| 2000-01-02T00:00:00.000Z | 1 дан | за 1 дан | 24 сата |
+| 2000-01-01T06:00:00.000Z | 6 сати | за 6 сати | 6 сати |
+| 2000-01-01T01:00:00.000Z | 1 сат | за 1 сат | 1 сат |
+| 2000-01-01T00:45:00.000Z | 45 минута | за 45 минута | 1 сат |
+| 2000-01-01T00:30:00.000Z | 30 минута | за 30 минута | 1 сат |
+| 2000-01-01T00:15:00.000Z | 15 минута | за 15 минута | 0 сати |
+| 2000-01-01T00:01:00.000Z | 1 минута | за 1 минуту | 0 сати |
+| 2000-01-01T00:00:25.000Z | 25 секунди | за 25 секунди | 0 сати |
+| 2000-01-01T00:00:15.000Z | 15 секунди | за 15 секунди | 0 сати |
+| 2000-01-01T00:00:05.000Z | 5 секунди | за 5 секунди | 0 сати |
+| 2000-01-01T00:00:00.000Z | 0 секунди | пре 0 секунди | 0 сати |
+| 1999-12-31T23:59:55.000Z | 5 секунди | пре 5 секунди | 0 сати |
+| 1999-12-31T23:59:45.000Z | 15 секунди | пре 15 секунди | 0 сати |
+| 1999-12-31T23:59:35.000Z | 25 секунди | пре 25 секунди | 0 сати |
+| 1999-12-31T23:59:00.000Z | 1 минута | пре 1 минуте | 0 сати |
+| 1999-12-31T23:45:00.000Z | 15 минута | пре 15 минута | 0 сати |
+| 1999-12-31T23:30:00.000Z | 30 минута | пре 30 минута | 1 сат |
+| 1999-12-31T23:15:00.000Z | 45 минута | пре 45 минута | 1 сат |
+| 1999-12-31T23:00:00.000Z | 1 сат | пре 1 сат | 1 сат |
+| 1999-12-31T18:00:00.000Z | 6 сати | пре 6 сати | 6 сати |
+| 1999-12-30T00:00:00.000Z | 2 дана | пре 2 дана | 48 сати |
+| 1999-12-15T00:00:00.000Z | 17 дана | пре 17 дана | 408 сати |
+| 1999-12-01T00:00:00.000Z | 1 месец | пре 1 месец | 744 сата |
+| 1999-11-01T00:00:00.000Z | 2 месеца | пре 2 месеца | 1464 сата |
+| 1999-06-01T00:00:00.000Z | 7 месеци | пре 7 месеци | 5136 сати |
+| 1999-01-01T00:00:00.000Z | 1 година | пре 1 године | 8760 сати |
+| 1998-12-01T00:00:00.000Z | 1 година | пре 1 године | 9504 сата |
+| 1998-06-01T00:00:00.000Z | 2 године | пре 2 године | 13896 сати |
+| 1998-01-01T00:00:00.000Z | 2 године | пре 2 године | 17520 сати |
+| 1997-01-01T00:00:00.000Z | 3 године | пре 3 године | 26280 сати |
+| 1996-01-01T00:00:00.000Z | 4 године | пре 4 године | 35064 сата |
+| 1995-01-01T00:00:00.000Z | 5 година | пре 5 година | 43824 сата |
+| 1994-01-01T00:00:00.000Z | 6 година | пре 6 година | 52584 сата |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 10. 01. 00. |
+| 2000-01-05T00:00:00.000Z | следећу среду у 00:00 |
+| 2000-01-02T00:00:00.000Z | сутра у 00:00 |
+| 2000-01-01T00:00:00.000Z | данас у 00:00 |
+| 1999-12-31T00:00:00.000Z | јуче у 00:00 |
+| 1999-12-27T00:00:00.000Z | прошли понедељак у 00:00 |
+| 1999-12-21T00:00:00.000Z | 21. 12. 99. |
diff --git a/date-fns/src/locale/sv/_lib/formatDistance/index.js b/date-fns/src/locale/sv/_lib/formatDistance/index.js
new file mode 100644
index 0000000..3c8f8d0
--- /dev/null
+++ b/date-fns/src/locale/sv/_lib/formatDistance/index.js
@@ -0,0 +1,127 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ singular: 'mindre än en sekund',
+ plural: 'mindre än {{count}} sekunder'
+ },
+
+ xSeconds: {
+ singular: 'en sekund',
+ plural: '{{count}} sekunder'
+ },
+
+ halfAMinute: 'en halv minut',
+
+ lessThanXMinutes: {
+ singular: 'mindre än en minut',
+ plural: 'mindre än {{count}} minuter'
+ },
+
+ xMinutes: {
+ singular: 'en minut',
+ plural: '{{count}} minuter'
+ },
+
+ aboutXHours: {
+ singular: 'ungefär en timme',
+ plural: 'ungefär {{count}} timmar'
+ },
+
+ xHours: {
+ singular: 'en timme',
+ plural: '{{count}} timmar'
+ },
+
+ xDays: {
+ singular: 'en dag',
+ plural: '{{count}} dagar'
+ },
+
+ aboutXWeeks: {
+ singular: 'ungefär en vecka',
+ plural: 'ungefär {{count}} vecka'
+ },
+
+ xWeeks: {
+ singular: 'en vecka',
+ plural: '{{count}} vecka'
+ },
+
+ aboutXMonths: {
+ singular: 'ungefär en månad',
+ plural: 'ungefär {{count}} månader'
+ },
+
+ xMonths: {
+ singular: 'en månad',
+ plural: '{{count}} månader'
+ },
+
+ aboutXYears: {
+ singular: 'ungefär ett år',
+ plural: 'ungefär {{count}} år'
+ },
+
+ xYears: {
+ singular: 'ett år',
+ plural: '{{count}} år'
+ },
+
+ overXYears: {
+ singular: 'över ett år',
+ plural: 'över {{count}} år'
+ },
+
+ almostXYears: {
+ singular: 'nästan ett år',
+ plural: 'nästan {{count}} år'
+ }
+}
+
+var wordMapping = [
+ 'noll',
+ 'en',
+ 'två',
+ 'tre',
+ 'fyra',
+ 'fem',
+ 'sex',
+ 'sju',
+ 'åtta',
+ 'nio',
+ 'tio',
+ 'elva',
+ 'tolv'
+]
+
+export default function formatDistance(token, count, options) {
+ options = options || {
+ onlyNumeric: false
+ }
+
+ var translation = formatDistanceLocale[token]
+ var result
+ if (typeof translation === 'string') {
+ result = translation
+ } else if (count === 0 || count > 1) {
+ if (options.onlyNumeric) {
+ result = translation.plural.replace('{{count}}', count)
+ } else {
+ result = translation.plural.replace(
+ '{{count}}',
+ count < 13 ? wordMapping[count] : count
+ )
+ }
+ } else {
+ result = translation.singular
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'om ' + result
+ } else {
+ return result + ' sedan'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/sv/_lib/formatLong/index.js b/date-fns/src/locale/sv/_lib/formatLong/index.js
new file mode 100644
index 0000000..ccb4ea9
--- /dev/null
+++ b/date-fns/src/locale/sv/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE d MMMM y',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'y-MM-dd'
+}
+
+var timeFormats = {
+ full: "'kl'. HH:mm:ss zzzz",
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'kl.' {{time}}",
+ long: "{{date}} 'kl.' {{time}}",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/sv/_lib/formatRelative/index.js b/date-fns/src/locale/sv/_lib/formatRelative/index.js
new file mode 100644
index 0000000..b967215
--- /dev/null
+++ b/date-fns/src/locale/sv/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'i' EEEE's kl.' p",
+ yesterday: "'igår kl.' p",
+ today: "'idag kl.' p",
+ tomorrow: "'imorgon kl.' p",
+ nextWeek: "EEEE 'kl.' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/sv/_lib/localize/index.js b/date-fns/src/locale/sv/_lib/localize/index.js
new file mode 100644
index 0000000..1717757
--- /dev/null
+++ b/date-fns/src/locale/sv/_lib/localize/index.js
@@ -0,0 +1,168 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['f.Kr.', 'e.Kr.'],
+ abbreviated: ['f.Kr.', 'e.Kr.'],
+ wide: ['före Kristus', 'efter Kristus'],
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['1:a kvartalet', '2:a kvartalet', '3:e kvartalet', '4:e kvartalet'],
+}
+
+var monthValues = {
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'jan.',
+ 'feb.',
+ 'mars',
+ 'apr.',
+ 'maj',
+ 'juni',
+ 'juli',
+ 'aug.',
+ 'sep.',
+ 'okt.',
+ 'nov.',
+ 'dec.',
+ ],
+ wide: [
+ 'januari',
+ 'februari',
+ 'mars',
+ 'april',
+ 'maj',
+ 'juni',
+ 'juli',
+ 'augusti',
+ 'september',
+ 'oktober',
+ 'november',
+ 'december',
+ ],
+}
+
+var dayValues = {
+ narrow: ['S', 'M', 'T', 'O', 'T', 'F', 'L'],
+ short: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'],
+ abbreviated: ['sön', 'mån', 'tis', 'ons', 'tors', 'fre', 'lör'],
+ wide: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'],
+}
+
+// https://www.unicode.org/cldr/charts/32/summary/sv.html#1888
+var dayPeriodValues = {
+ narrow: {
+ am: 'fm',
+ pm: 'em',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'morg.',
+ afternoon: 'efterm.',
+ evening: 'kväll',
+ night: 'natt',
+ },
+ abbreviated: {
+ am: 'f.m.',
+ pm: 'e.m.',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'morgon',
+ afternoon: 'efterm.',
+ evening: 'kväll',
+ night: 'natt',
+ },
+ wide: {
+ am: 'förmiddag',
+ pm: 'eftermiddag',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'morgon',
+ afternoon: 'eftermiddag',
+ evening: 'kväll',
+ night: 'natt',
+ },
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'fm',
+ pm: 'em',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morg.',
+ afternoon: 'på efterm.',
+ evening: 'på kvällen',
+ night: 'på natten',
+ },
+ abbreviated: {
+ am: 'fm',
+ pm: 'em',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morg.',
+ afternoon: 'på efterm.',
+ evening: 'på kvällen',
+ night: 'på natten',
+ },
+ wide: {
+ am: 'fm',
+ pm: 'em',
+ midnight: 'midnatt',
+ noon: 'middag',
+ morning: 'på morgonen',
+ afternoon: 'på eftermiddagen',
+ evening: 'på kvällen',
+ night: 'på natten',
+ },
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+
+ var rem100 = number % 100
+ if (rem100 > 20 || rem100 < 10) {
+ switch (rem100 % 10) {
+ case 1:
+ case 2:
+ return number + ':a'
+ }
+ }
+ return number + ':e'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide',
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function (quarter) {
+ return Number(quarter) - 1
+ },
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide',
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide',
+ }),
+}
+
+export default localize
diff --git a/date-fns/src/locale/sv/_lib/match/index.js b/date-fns/src/locale/sv/_lib/match/index.js
new file mode 100644
index 0000000..c54150f
--- /dev/null
+++ b/date-fns/src/locale/sv/_lib/match/index.js
@@ -0,0 +1,135 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(:a|:e)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,
+ abbreviated: /^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,
+ wide: /^(före Kristus|före vår tid|efter Kristus|vår tid)/i,
+}
+var parseEraPatterns = {
+ any: [/^f/i, /^[ev]/i],
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](:a|:e)? kvartalet/i,
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i],
+}
+
+var matchMonthPatterns = {
+ narrow: /^[jfmasond]/i,
+ abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|aug|sep|okt|nov|dec)\.?/i,
+ wide: /^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|november|december)/i,
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^j/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^j/i,
+ /^j/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i,
+ ],
+ any: [
+ /^ja/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^maj/i,
+ /^jun/i,
+ /^jul/i,
+ /^au/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i,
+ ],
+}
+
+var matchDayPatterns = {
+ narrow: /^[smtofl]/i,
+ short: /^(sö|må|ti|on|to|fr|lö)/i,
+ abbreviated: /^(sön|mån|tis|ons|tors|fre|lör)/i,
+ wide: /^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i,
+}
+var parseDayPatterns = {
+ any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i],
+}
+
+var matchDayPeriodPatterns = {
+ any: /^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i,
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^f/i,
+ pm: /^e/i,
+ midnight: /^midn/i,
+ noon: /^midd/i,
+ morning: /morgon/i,
+ afternoon: /eftermiddag/i,
+ evening: /kväll/i,
+ night: /natt/i,
+ },
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function (value) {
+ return parseInt(value, 10)
+ },
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function (index) {
+ return index + 1
+ },
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any',
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any',
+ }),
+}
+
+export default match
diff --git a/date-fns/src/locale/sv/index.d.ts b/date-fns/src/locale/sv/index.d.ts
new file mode 100644
index 0000000..2a7405b
--- /dev/null
+++ b/date-fns/src/locale/sv/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { sv } from 'date-fns/locale'
+export default sv
diff --git a/date-fns/src/locale/sv/index.js b/date-fns/src/locale/sv/index.js
new file mode 100644
index 0000000..f1fb736
--- /dev/null
+++ b/date-fns/src/locale/sv/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Swedish locale.
+ * @language Swedish
+ * @iso-639-2 swe
+ * @author Johannes Ulén [@ejulen]{@link https://github.com/ejulen}
+ * @author Alexander Nanberg [@alexandernanberg]{@link https://github.com/alexandernanberg}
+ * @author Henrik Andersson [@limelights]{@link https://github.com/limelights}
+ */
+var locale = {
+ code: 'sv',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/sv/index.js.flow b/date-fns/src/locale/sv/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/sv/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/sv/snapshot.md b/date-fns/src/locale/sv/snapshot.md
new file mode 100644
index 0000000..c73a7ea
--- /dev/null
+++ b/date-fns/src/locale/sv/snapshot.md
@@ -0,0 +1,304 @@
+# Swedish (sv) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987:e | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5:e | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987:e | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4:e | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1:a | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2:a | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1:a kvartalet | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2:a kvartalet | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1:a | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2:a | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1:a kvartalet | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2:a kvartalet | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2:a | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7:e | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | Invalid Date |
+| | MMMM | 2019-02-11T12:13:14.015Z | februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2:a | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7:e | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | feb. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | Invalid Date |
+| | LLLL | 2019-02-11T12:13:14.015Z | februari | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | juli | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | J | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1:a | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48:e | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1:a | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48:e | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11:e | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28:e | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42:a | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365:e | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1:a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5:e | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1:a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5:e | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1:a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5:e | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | mån | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fre | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | måndag | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fredag | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | M | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | F | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | må | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | fr | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | em | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | fm | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på efterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvällen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på efterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvällen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på efterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvällen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | på morgonen | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | på eftermiddagen | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | på kvällen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | på morg. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | på efterm. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | på kvällen | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | på natten | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11:e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11:e | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11:e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23:e | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11:e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11:e | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11:e | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23:e | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1:a | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55:e | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1:a | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55:e | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 1987-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 feb. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maj 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maj 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | onsdag 11 februari 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | söndag 29 maj 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | kl. 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 1987-02-11 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 feb. 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 maj 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 februari 1987 kl. 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 maj 1453 kl. 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | onsdag 11 februari 1987 kl. kl. 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | söndag 29 maj 1453 kl. kl. 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------ |
+| 2006-01-01T00:00:00.000Z | ungefär sex år | ungefär sex år | om ungefär sex år |
+| 2005-01-01T00:00:00.000Z | ungefär fem år | ungefär fem år | om ungefär fem år |
+| 2004-01-01T00:00:00.000Z | ungefär fyra år | ungefär fyra år | om ungefär fyra år |
+| 2003-01-01T00:00:00.000Z | ungefär tre år | ungefär tre år | om ungefär tre år |
+| 2002-01-01T00:00:00.000Z | ungefär två år | ungefär två år | om ungefär två år |
+| 2001-06-01T00:00:00.000Z | över ett år | över ett år | om över ett år |
+| 2001-02-01T00:00:00.000Z | ungefär ett år | ungefär ett år | om ungefär ett år |
+| 2001-01-01T00:00:00.000Z | ungefär ett år | ungefär ett år | om ungefär ett år |
+| 2000-06-01T00:00:00.000Z | fem månader | fem månader | om fem månader |
+| 2000-03-01T00:00:00.000Z | två månader | två månader | om två månader |
+| 2000-02-01T00:00:00.000Z | ungefär en månad | ungefär en månad | om ungefär en månad |
+| 2000-01-15T00:00:00.000Z | 14 dagar | 14 dagar | om 14 dagar |
+| 2000-01-02T00:00:00.000Z | en dag | en dag | om en dag |
+| 2000-01-01T06:00:00.000Z | ungefär sex timmar | ungefär sex timmar | om ungefär sex timmar |
+| 2000-01-01T01:00:00.000Z | ungefär en timme | ungefär en timme | om ungefär en timme |
+| 2000-01-01T00:45:00.000Z | ungefär en timme | ungefär en timme | om ungefär en timme |
+| 2000-01-01T00:30:00.000Z | 30 minuter | 30 minuter | om 30 minuter |
+| 2000-01-01T00:15:00.000Z | 15 minuter | 15 minuter | om 15 minuter |
+| 2000-01-01T00:01:00.000Z | en minut | en minut | om en minut |
+| 2000-01-01T00:00:25.000Z | mindre än en minut | en halv minut | om mindre än en minut |
+| 2000-01-01T00:00:15.000Z | mindre än en minut | mindre än 20 sekunder | om mindre än en minut |
+| 2000-01-01T00:00:05.000Z | mindre än en minut | mindre än tio sekunder | om mindre än en minut |
+| 2000-01-01T00:00:00.000Z | mindre än en minut | mindre än fem sekunder | mindre än en minut sedan |
+| 1999-12-31T23:59:55.000Z | mindre än en minut | mindre än tio sekunder | mindre än en minut sedan |
+| 1999-12-31T23:59:45.000Z | mindre än en minut | mindre än 20 sekunder | mindre än en minut sedan |
+| 1999-12-31T23:59:35.000Z | mindre än en minut | en halv minut | mindre än en minut sedan |
+| 1999-12-31T23:59:00.000Z | en minut | en minut | en minut sedan |
+| 1999-12-31T23:45:00.000Z | 15 minuter | 15 minuter | 15 minuter sedan |
+| 1999-12-31T23:30:00.000Z | 30 minuter | 30 minuter | 30 minuter sedan |
+| 1999-12-31T23:15:00.000Z | ungefär en timme | ungefär en timme | ungefär en timme sedan |
+| 1999-12-31T23:00:00.000Z | ungefär en timme | ungefär en timme | ungefär en timme sedan |
+| 1999-12-31T18:00:00.000Z | ungefär sex timmar | ungefär sex timmar | ungefär sex timmar sedan |
+| 1999-12-30T00:00:00.000Z | två dagar | två dagar | två dagar sedan |
+| 1999-12-15T00:00:00.000Z | 17 dagar | 17 dagar | 17 dagar sedan |
+| 1999-12-01T00:00:00.000Z | ungefär en månad | ungefär en månad | ungefär en månad sedan |
+| 1999-11-01T00:00:00.000Z | två månader | två månader | två månader sedan |
+| 1999-06-01T00:00:00.000Z | sju månader | sju månader | sju månader sedan |
+| 1999-01-01T00:00:00.000Z | ungefär ett år | ungefär ett år | ungefär ett år sedan |
+| 1998-12-01T00:00:00.000Z | ungefär ett år | ungefär ett år | ungefär ett år sedan |
+| 1998-06-01T00:00:00.000Z | över ett år | över ett år | över ett år sedan |
+| 1998-01-01T00:00:00.000Z | ungefär två år | ungefär två år | ungefär två år sedan |
+| 1997-01-01T00:00:00.000Z | ungefär tre år | ungefär tre år | ungefär tre år sedan |
+| 1996-01-01T00:00:00.000Z | ungefär fyra år | ungefär fyra år | ungefär fyra år sedan |
+| 1995-01-01T00:00:00.000Z | ungefär fem år | ungefär fem år | ungefär fem år sedan |
+| 1994-01-01T00:00:00.000Z | ungefär sex år | ungefär sex år | ungefär sex år sedan |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | sex år | om sex år | 52608 timmar |
+| 2005-01-01T00:00:00.000Z | fem år | om fem år | 43848 timmar |
+| 2004-01-01T00:00:00.000Z | fyra år | om fyra år | 35064 timmar |
+| 2003-01-01T00:00:00.000Z | tre år | om tre år | 26304 timmar |
+| 2002-01-01T00:00:00.000Z | två år | om två år | 17544 timmar |
+| 2001-06-01T00:00:00.000Z | ett år | om ett år | 12408 timmar |
+| 2001-02-01T00:00:00.000Z | ett år | om ett år | 9528 timmar |
+| 2001-01-01T00:00:00.000Z | ett år | om ett år | 8784 timmar |
+| 2000-06-01T00:00:00.000Z | fem månader | om fem månader | 3648 timmar |
+| 2000-03-01T00:00:00.000Z | två månader | om två månader | 1440 timmar |
+| 2000-02-01T00:00:00.000Z | en månad | om en månad | 744 timmar |
+| 2000-01-15T00:00:00.000Z | 14 dagar | om 14 dagar | 336 timmar |
+| 2000-01-02T00:00:00.000Z | en dag | om en dag | 24 timmar |
+| 2000-01-01T06:00:00.000Z | sex timmar | om sex timmar | sex timmar |
+| 2000-01-01T01:00:00.000Z | en timme | om en timme | en timme |
+| 2000-01-01T00:45:00.000Z | 45 minuter | om 45 minuter | en timme |
+| 2000-01-01T00:30:00.000Z | 30 minuter | om 30 minuter | en timme |
+| 2000-01-01T00:15:00.000Z | 15 minuter | om 15 minuter | noll timmar |
+| 2000-01-01T00:01:00.000Z | en minut | om en minut | noll timmar |
+| 2000-01-01T00:00:25.000Z | 25 sekunder | om 25 sekunder | noll timmar |
+| 2000-01-01T00:00:15.000Z | 15 sekunder | om 15 sekunder | noll timmar |
+| 2000-01-01T00:00:05.000Z | fem sekunder | om fem sekunder | noll timmar |
+| 2000-01-01T00:00:00.000Z | noll sekunder | noll sekunder sedan | noll timmar |
+| 1999-12-31T23:59:55.000Z | fem sekunder | fem sekunder sedan | noll timmar |
+| 1999-12-31T23:59:45.000Z | 15 sekunder | 15 sekunder sedan | noll timmar |
+| 1999-12-31T23:59:35.000Z | 25 sekunder | 25 sekunder sedan | noll timmar |
+| 1999-12-31T23:59:00.000Z | en minut | en minut sedan | noll timmar |
+| 1999-12-31T23:45:00.000Z | 15 minuter | 15 minuter sedan | noll timmar |
+| 1999-12-31T23:30:00.000Z | 30 minuter | 30 minuter sedan | en timme |
+| 1999-12-31T23:15:00.000Z | 45 minuter | 45 minuter sedan | en timme |
+| 1999-12-31T23:00:00.000Z | en timme | en timme sedan | en timme |
+| 1999-12-31T18:00:00.000Z | sex timmar | sex timmar sedan | sex timmar |
+| 1999-12-30T00:00:00.000Z | två dagar | två dagar sedan | 48 timmar |
+| 1999-12-15T00:00:00.000Z | 17 dagar | 17 dagar sedan | 408 timmar |
+| 1999-12-01T00:00:00.000Z | en månad | en månad sedan | 744 timmar |
+| 1999-11-01T00:00:00.000Z | två månader | två månader sedan | 1464 timmar |
+| 1999-06-01T00:00:00.000Z | sju månader | sju månader sedan | 5136 timmar |
+| 1999-01-01T00:00:00.000Z | ett år | ett år sedan | 8760 timmar |
+| 1998-12-01T00:00:00.000Z | ett år | ett år sedan | 9504 timmar |
+| 1998-06-01T00:00:00.000Z | två år | två år sedan | 13896 timmar |
+| 1998-01-01T00:00:00.000Z | två år | två år sedan | 17520 timmar |
+| 1997-01-01T00:00:00.000Z | tre år | tre år sedan | 26280 timmar |
+| 1996-01-01T00:00:00.000Z | fyra år | fyra år sedan | 35064 timmar |
+| 1995-01-01T00:00:00.000Z | fem år | fem år sedan | 43824 timmar |
+| 1994-01-01T00:00:00.000Z | sex år | sex år sedan | 52584 timmar |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------- |
+| 2000-01-10T00:00:00.000Z | 2000-01-10 |
+| 2000-01-05T00:00:00.000Z | onsdag kl. 00:00 |
+| 2000-01-02T00:00:00.000Z | imorgon kl. 00:00 |
+| 2000-01-01T00:00:00.000Z | idag kl. 00:00 |
+| 1999-12-31T00:00:00.000Z | igår kl. 00:00 |
+| 1999-12-27T00:00:00.000Z | i måndags kl. 00:00 |
+| 1999-12-21T00:00:00.000Z | 1999-12-21 |
diff --git a/date-fns/src/locale/ta/_lib/formatDistance/index.js b/date-fns/src/locale/ta/_lib/formatDistance/index.js
new file mode 100644
index 0000000..20c905b
--- /dev/null
+++ b/date-fns/src/locale/ta/_lib/formatDistance/index.js
@@ -0,0 +1,236 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: {
+ default: 'ஒரு வினாடிக்கு குறைவாக',
+ in: 'ஒரு வினாடிக்குள்',
+ ago: 'ஒரு வினாடிக்கு முன்பு'
+ },
+ other: {
+ default: '{{count}} வினாடிகளுக்கு குறைவாக',
+ in: '{{count}} வினாடிகளுக்குள்',
+ ago: '{{count}} வினாடிகளுக்கு முன்பு'
+ }
+ },
+
+ xSeconds: {
+ one: {
+ default: '1 வினாடி',
+ in: '1 வினாடியில்',
+ ago: '1 வினாடி முன்பு'
+ },
+ other: {
+ default: '{{count}} விநாடிகள்',
+ in: '{{count}} வினாடிகளில்',
+ ago: '{{count}} விநாடிகளுக்கு முன்பு'
+ }
+ },
+
+ halfAMinute: {
+ default: 'அரை நிமிடம்',
+ in: 'அரை நிமிடத்தில்',
+ ago: 'அரை நிமிடம் முன்பு'
+ },
+
+ lessThanXMinutes: {
+ one: {
+ default: 'ஒரு நிமிடத்திற்கும் குறைவாக',
+ in: 'ஒரு நிமிடத்திற்குள்',
+ ago: 'ஒரு நிமிடத்திற்கு முன்பு'
+ },
+ other: {
+ default: '{{count}} நிமிடங்களுக்கும் குறைவாக',
+ in: '{{count}} நிமிடங்களுக்குள்',
+ ago: '{{count}} நிமிடங்களுக்கு முன்பு'
+ }
+ },
+
+ xMinutes: {
+ one: {
+ default: '1 நிமிடம்',
+ in: '1 நிமிடத்தில்',
+ ago: '1 நிமிடம் முன்பு'
+ },
+ other: {
+ default: '{{count}} நிமிடங்கள்',
+ in: '{{count}} நிமிடங்களில்',
+ ago: '{{count}} நிமிடங்களுக்கு முன்பு'
+ }
+ },
+
+ aboutXHours: {
+ one: {
+ default: 'சுமார் 1 மணி நேரம்',
+ in: 'சுமார் 1 மணி நேரத்தில்',
+ ago: 'சுமார் 1 மணி நேரத்திற்கு முன்பு'
+ },
+ other: {
+ default: 'சுமார் {{count}} மணி நேரம்',
+ in: 'சுமார் {{count}} மணி நேரத்திற்கு முன்பு',
+ ago: 'சுமார் {{count}} மணி நேரத்தில்'
+ }
+ },
+
+ xHours: {
+ one: {
+ default: '1 மணி நேரம்',
+ in: '1 மணி நேரத்தில்',
+ ago: '1 மணி நேரத்திற்கு முன்பு'
+ },
+ other: {
+ default: '{{count}} மணி நேரம்',
+ in: '{{count}} மணி நேரத்தில்',
+ ago: '{{count}} மணி நேரத்திற்கு முன்பு'
+ }
+ },
+
+ xDays: {
+ one: {
+ default: '1 நாள்',
+ in: '1 நாளில்',
+ ago: '1 நாள் முன்பு'
+ },
+ other: {
+ default: '{{count}} நாட்கள்',
+ in: '{{count}} நாட்களில்',
+ ago: '{{count}} நாட்களுக்கு முன்பு'
+ }
+ },
+
+ aboutXWeeks: {
+ one: {
+ default: 'சுமார் 1 வாரம்',
+ in: 'சுமார் 1 வாரத்தில்',
+ ago: 'சுமார் 1 வாரம் முன்பு'
+ },
+ other: {
+ default: 'சுமார் {{count}} வாரங்கள்',
+ in: 'சுமார் {{count}} வாரங்களில்',
+ ago: 'சுமார் {{count}} வாரங்களுக்கு முன்பு'
+ }
+ },
+
+ xWeeks: {
+ one: {
+ default: '1 வாரம்',
+ in: '1 வாரத்தில்',
+ ago: '1 வாரம் முன்பு'
+ },
+ other: {
+ default: '{{count}} வாரங்கள்',
+ in: '{{count}} வாரங்களில்',
+ ago: '{{count}} வாரங்களுக்கு முன்பு'
+ }
+ },
+
+ aboutXMonths: {
+ one: {
+ default: 'சுமார் 1 மாதம்',
+ in: 'சுமார் 1 மாதத்தில்',
+ ago: 'சுமார் 1 மாதத்திற்கு முன்பு'
+ },
+ other: {
+ default: 'சுமார் {{count}} மாதங்கள்',
+ in: 'சுமார் {{count}} மாதங்களில்',
+ ago: 'சுமார் {{count}} மாதங்களுக்கு முன்பு'
+ }
+ },
+
+ xMonths: {
+ one: {
+ default: '1 மாதம்',
+ in: '1 மாதத்தில்',
+ ago: '1 மாதம் முன்பு'
+ },
+ other: {
+ default: '{{count}} மாதங்கள்',
+ in: '{{count}} மாதங்களில்',
+ ago: '{{count}} மாதங்களுக்கு முன்பு'
+ }
+ },
+
+ aboutXYears: {
+ one: {
+ default: 'சுமார் 1 வருடம்',
+ in: 'சுமார் 1 ஆண்டில்',
+ ago: 'சுமார் 1 வருடம் முன்பு'
+ },
+ other: {
+ default: 'சுமார் {{count}} ஆண்டுகள்',
+ in: 'சுமார் {{count}} ஆண்டுகளில்',
+ ago: 'சுமார் {{count}} ஆண்டுகளுக்கு முன்பு'
+ }
+ },
+
+ xYears: {
+ one: {
+ default: '1 வருடம்',
+ in: '1 ஆண்டில்',
+ ago: '1 வருடம் முன்பு'
+ },
+ other: {
+ default: '{{count}} ஆண்டுகள்',
+ in: '{{count}} ஆண்டுகளில்',
+ ago: '{{count}} ஆண்டுகளுக்கு முன்பு'
+ }
+ },
+
+ overXYears: {
+ one: {
+ default: '1 வருடத்திற்கு மேல்',
+ in: '1 வருடத்திற்கும் மேலாக',
+ ago: '1 வருடம் முன்பு'
+ },
+ other: {
+ default: '{{count}} ஆண்டுகளுக்கும் மேலாக',
+ in: '{{count}} ஆண்டுகளில்',
+ ago: '{{count}} ஆண்டுகளுக்கு முன்பு'
+ }
+ },
+
+ almostXYears: {
+ one: {
+ default: 'கிட்டத்தட்ட 1 வருடம்',
+ in: 'கிட்டத்தட்ட 1 ஆண்டில்',
+ ago: 'கிட்டத்தட்ட 1 வருடம் முன்பு'
+ },
+ other: {
+ default: 'கிட்டத்தட்ட {{count}} ஆண்டுகள்',
+ in: 'கிட்டத்தட்ட {{count}} ஆண்டுகளில்',
+ ago: 'கிட்டத்தட்ட {{count}} ஆண்டுகளுக்கு முன்பு'
+ }
+ }
+}
+
+function getFormatDistanceLocaleWithSuffix(resultObj, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return resultObj.in
+ } else {
+ return resultObj.ago
+ }
+ }
+
+ return resultObj.default
+}
+
+export default function formatDistance(token, count, options = {}) {
+ var result
+ if (formatDistanceLocale[token].default) {
+ result = getFormatDistanceLocaleWithSuffix(
+ formatDistanceLocale[token],
+ options
+ )
+ } else if (count === 1) {
+ result = getFormatDistanceLocaleWithSuffix(
+ formatDistanceLocale[token].one,
+ options
+ )
+ } else {
+ result = getFormatDistanceLocaleWithSuffix(
+ formatDistanceLocale[token].other,
+ options
+ )
+ }
+
+ return result.replace('{{count}}', count)
+}
diff --git a/date-fns/src/locale/ta/_lib/formatLong/index.js b/date-fns/src/locale/ta/_lib/formatLong/index.js
new file mode 100644
index 0000000..3524908
--- /dev/null
+++ b/date-fns/src/locale/ta/_lib/formatLong/index.js
@@ -0,0 +1,45 @@
+// Ref: https://www.unicode.org/cldr/charts/32/summary/ta.html
+
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+// CLDR #1846 - #1849
+var dateFormats = {
+ full: 'EEEE, d MMMM, y',
+ long: 'd MMMM, y',
+ medium: 'd MMM, y',
+ short: 'd/M/yy'
+}
+
+// CLDR #1850 - #1853
+var timeFormats = {
+ full: 'a h:mm:ss zzzz',
+ long: 'a h:mm:ss z',
+ medium: 'a h:mm:ss',
+ short: 'a h:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ta/_lib/formatRelative/index.js b/date-fns/src/locale/ta/_lib/formatRelative/index.js
new file mode 100644
index 0000000..280b830
--- /dev/null
+++ b/date-fns/src/locale/ta/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'கடந்த' eeee p 'மணிக்கு'",
+ yesterday: "'நேற்று ' p 'மணிக்கு'",
+ today: "'இன்று ' p 'மணிக்கு'",
+ tomorrow: "'நாளை ' p 'மணிக்கு'",
+ nextWeek: "eeee p 'மணிக்கு'",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ta/_lib/localize/index.js b/date-fns/src/locale/ta/_lib/localize/index.js
new file mode 100644
index 0000000..c5e88f8
--- /dev/null
+++ b/date-fns/src/locale/ta/_lib/localize/index.js
@@ -0,0 +1,209 @@
+// Ref: https://www.unicode.org/cldr/charts/32/summary/ta.html
+
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['கி.மு.', 'கி.பி.'],
+ abbreviated: ['கி.மு.', 'கி.பி.'], // CLDR #1624, #1626
+ wide: ['கிறிஸ்துவுக்கு முன்', 'அன்னோ டோமினி'] // CLDR #1620, #1622
+}
+
+var quarterValues = {
+ // CLDR #1644 - #1647
+ narrow: ['1', '2', '3', '4'],
+ // CLDR #1636 - #1639
+ abbreviated: ['காலா.1', 'காலா.2', 'காலா.3', 'காலா.4'],
+ // CLDR #1628 - #1631
+ wide: [
+ 'ஒன்றாம் காலாண்டு',
+ 'இரண்டாம் காலாண்டு',
+ 'மூன்றாம் காலாண்டு',
+ 'நான்காம் காலாண்டு'
+ ]
+}
+
+var monthValues = {
+ // CLDR #700 - #711
+ narrow: ['ஜ', 'பி', 'மா', 'ஏ', 'மே', 'ஜூ', 'ஜூ', 'ஆ', 'செ', 'அ', 'ந', 'டி'],
+ // CLDR #1676 - #1687
+ abbreviated: [
+ 'ஜன.',
+ 'பிப்.',
+ 'மார்.',
+ 'ஏப்.',
+ 'மே',
+ 'ஜூன்',
+ 'ஜூலை',
+ 'ஆக.',
+ 'செப்.',
+ 'அக்.',
+ 'நவ.',
+ 'டிச.'
+ ],
+ // CLDR #1652 - #1663
+ wide: [
+ 'ஜனவரி', // January
+ 'பிப்ரவரி', // February
+ 'மார்ச்', // March
+ 'ஏப்ரல்', // April
+ 'மே', // May
+ 'ஜூன்', // June
+ 'ஜூலை', // July
+ 'ஆகஸ்ட்', // August
+ 'செப்டம்பர்', // September
+ 'அக்டோபர்', // October
+ 'நவம்பர்', // November
+ 'டிசம்பர்' // December
+ ]
+}
+
+var dayValues = {
+ // CLDR #1766 - #1772
+ narrow: ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'],
+ // CLDR #1752 - #1758
+ short: ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'],
+ // CLDR #1738 - #1744
+ abbreviated: ['ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி'],
+ // CLDR #1724 - #1730
+ wide: [
+ 'ஞாயிறு', // Sunday
+ 'திங்கள்', // Monday
+ 'செவ்வாய்', // Tuesday
+ 'புதன்', // Wednesday
+ 'வியாழன்', // Thursday
+ 'வெள்ளி', // Friday
+ 'சனி' // Saturday
+ ]
+}
+
+// CLDR #1780 - #1845
+var dayPeriodValues = {
+ narrow: {
+ am: 'மு.ப',
+ pm: 'பி.ப',
+ midnight: 'நள்.',
+ noon: 'நண்.',
+ morning: 'கா.',
+ afternoon: 'மதி.',
+ evening: 'மா.',
+ night: 'இர.'
+ },
+ abbreviated: {
+ am: 'முற்பகல்',
+ pm: 'பிற்பகல்',
+ midnight: 'நள்ளிரவு',
+ noon: 'நண்பகல்',
+ morning: 'காலை',
+ afternoon: 'மதியம்',
+ evening: 'மாலை',
+ night: 'இரவு'
+ },
+ wide: {
+ am: 'முற்பகல்',
+ pm: 'பிற்பகல்',
+ midnight: 'நள்ளிரவு',
+ noon: 'நண்பகல்',
+ morning: 'காலை',
+ afternoon: 'மதியம்',
+ evening: 'மாலை',
+ night: 'இரவு'
+ }
+}
+
+// CLDR #1780 - #1845
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'மு.ப',
+ pm: 'பி.ப',
+ midnight: 'நள்.',
+ noon: 'நண்.',
+ morning: 'கா.',
+ afternoon: 'மதி.',
+ evening: 'மா.',
+ night: 'இர.'
+ },
+ abbreviated: {
+ am: 'முற்பகல்',
+ pm: 'பிற்பகல்',
+ midnight: 'நள்ளிரவு',
+ noon: 'நண்பகல்',
+ morning: 'காலை',
+ afternoon: 'மதியம்',
+ evening: 'மாலை',
+ night: 'இரவு'
+ },
+ wide: {
+ am: 'முற்பகல்',
+ pm: 'பிற்பகல்',
+ midnight: 'நள்ளிரவு',
+ noon: 'நண்பகல்',
+ morning: 'காலை',
+ afternoon: 'மதியம்',
+ evening: 'மாலை',
+ night: 'இரவு'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ // var rem100 = number % 100
+ // if (rem100 > 20 || rem100 < 10) {
+ // switch (rem100 % 10) {
+ // case 1:
+ // return number + 'st'
+ // case 2:
+ // return number + 'nd'
+ // case 3:
+ // return number + 'rd'
+ // }
+ // }
+ // return number + 'th'
+ return number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ta/_lib/match/index.js b/date-fns/src/locale/ta/_lib/match/index.js
new file mode 100644
index 0000000..f548f7f
--- /dev/null
+++ b/date-fns/src/locale/ta/_lib/match/index.js
@@ -0,0 +1,148 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(வது)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(கி.மு.|கி.பி.)/i,
+ abbreviated: /^(கி\.?\s?மு\.?|கி\.?\s?பி\.?)/,
+ wide: /^(கிறிஸ்துவுக்கு\sமுன்|அன்னோ\sடோமினி)/i
+}
+
+var parseEraPatterns = {
+ any: [/கி\.?\s?மு\.?/, /கி\.?\s?பி\.?/]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^காலா.[1234]/i,
+ wide: /^(ஒன்றாம்|இரண்டாம்|மூன்றாம்|நான்காம்) காலாண்டு/i
+}
+
+var parseQuarterPatterns = {
+ narrow: [/1/i, /2/i, /3/i, /4/i],
+ any: [
+ /(1|காலா.1|ஒன்றாம்)/i,
+ /(2|காலா.2|இரண்டாம்)/i,
+ /(3|காலா.3|மூன்றாம்)/i,
+ /(4|காலா.4|நான்காம்)/i
+ ]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(ஜ|பி|மா|ஏ|மே|ஜூ|ஆ|செ|அ|ந|டி)$/i,
+ abbreviated: /^(ஜன.|பிப்.|மார்.|ஏப்.|மே|ஜூன்|ஜூலை|ஆக.|செப்.|அக்.|நவ.|டிச.)/i,
+ wide: /^(ஜனவரி|பிப்ரவரி|மார்ச்|ஏப்ரல்|மே|ஜூன்|ஜூலை|ஆகஸ்ட்|செப்டம்பர்|அக்டோபர்|நவம்பர்|டிசம்பர்)/i
+}
+
+var parseMonthPatterns = {
+ narrow: [
+ /^ஜ$/i,
+ /^பி/i,
+ /^மா/i,
+ /^ஏ/i,
+ /^மே/i,
+ /^ஜூ/i,
+ /^ஜூ/i,
+ /^ஆ/i,
+ /^செ/i,
+ /^அ/i,
+ /^ந/i,
+ /^டி/i
+ ],
+ any: [
+ /^ஜன/i,
+ /^பி/i,
+ /^மா/i,
+ /^ஏ/i,
+ /^மே/i,
+ /^ஜூன்/i,
+ /^ஜூலை/i,
+ /^ஆ/i,
+ /^செ/i,
+ /^அ/i,
+ /^ந/i,
+ /^டி/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
+ short: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
+ abbreviated: /^(ஞாயி.|திங்.|செவ்.|புத.|வியா.|வெள்.|சனி)/i,
+ wide: /^(ஞாயிறு|திங்கள்|செவ்வாய்|புதன்|வியாழன்|வெள்ளி|சனி)/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^ஞா/i, /^தி/i, /^செ/i, /^பு/i, /^வி/i, /^வெ/i, /^ச/i],
+ any: [/^ஞா/i, /^தி/i, /^செ/i, /^பு/i, /^வி/i, /^வெ/i, /^ச/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(மு.ப|பி.ப|நள்|நண்|காலை|மதியம்|மாலை|இரவு)/i,
+ any: /^(மு.ப|பி.ப|முற்பகல்|பிற்பகல்|நள்ளிரவு|நண்பகல்|காலை|மதியம்|மாலை|இரவு)/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^மு/i,
+ pm: /^பி/i,
+ midnight: /^நள்/i,
+ noon: /^நண்/i,
+ morning: /காலை/i,
+ afternoon: /மதியம்/i,
+ evening: /மாலை/i,
+ night: /இரவு/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ta/index.d.ts b/date-fns/src/locale/ta/index.d.ts
new file mode 100644
index 0000000..fb9a06a
--- /dev/null
+++ b/date-fns/src/locale/ta/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ta } from 'date-fns/locale'
+export default ta
diff --git a/date-fns/src/locale/ta/index.js b/date-fns/src/locale/ta/index.js
new file mode 100644
index 0000000..a2d289a
--- /dev/null
+++ b/date-fns/src/locale/ta/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Tamil locale (India).
+ * @language Tamil
+ * @iso-639-2 tam
+ * @author Sibiraj [@sibiraj-s]{@link https://github.com/sibiraj-s}
+ */
+var locale = {
+ code: 'ta',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ta/index.js.flow b/date-fns/src/locale/ta/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ta/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ta/snapshot.md b/date-fns/src/locale/ta/snapshot.md
new file mode 100644
index 0000000..5b005fb
--- /dev/null
+++ b/date-fns/src/locale/ta/snapshot.md
@@ -0,0 +1,304 @@
+# Tamil (ta) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 4 | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | காலா.1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | காலா.2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | ஒன்றாம் காலாண்டு | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | இரண்டாம் காலாண்டு | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | காலா.1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | காலா.2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | ஒன்றாம் காலாண்டு | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | இரண்டாம் காலாண்டு | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | பிப். | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ஜூலை | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | பிப்ரவரி | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ஜூலை | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | பி | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ஜூ | 2019-06-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | பிப். | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ஜூலை | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | பிப்ரவரி | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ஜூலை | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | பி | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ஜூ | 2019-06-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | திங். | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள். | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | திங். | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள். | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | திங். | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள். | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | திங்கள் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள்ளி | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | திங். | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள். | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | திங்கள் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள்ளி | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | திங். | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள். | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | திங்கள் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள்ளி | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | திங். | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள். | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | திங்கள் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெள்ளி | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | தி | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | வெ | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | மு.ப | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பி.ப | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பி.ப | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | மு.ப | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பிற்பகல் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | முற்பகல் | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | மு.ப | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | பி.ப | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | பி.ப | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | மு.ப | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | காலை | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | மதியம் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | மாலை | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | இரவு | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | காலை | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | மதியம் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | மாலை | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | இரவு | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | காலை | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | மதியம் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | மாலை | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | இரவு | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | காலை | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | மதியம் | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | மாலை | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | இரவு | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | கா. | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | மதி. | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | மா. | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | இர. | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/2/87 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 பிப்., 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 மே, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 பிப்ரவரி, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 மே, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | புதன், 11 பிப்ரவரி, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ஞாயிறு, 29 மே, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | பிற்பகல் 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | பிற்பகல் 11:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | பிற்பகல் 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | பிற்பகல் 11:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | பிற்பகல் 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | பிற்பகல் 11:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | பிற்பகல் 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | பிற்பகல் 11:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/2/87, பிற்பகல் 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/5/53, பிற்பகல் 11:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 பிப்., 1987, பிற்பகல் 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 மே, 1453, பிற்பகல் 11:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 பிப்ரவரி, 1987 பிற்பகல் 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 மே, 1453 பிற்பகல் 11:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | புதன், 11 பிப்ரவரி, 1987 பிற்பகல் 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | ஞாயிறு, 29 மே, 1453 பிற்பகல் 11:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | --------------------------- | ------------------------ | ------------------------------- |
+| 2006-01-01T00:00:00.000Z | சுமார் 6 ஆண்டுகள் | சுமார் 6 ஆண்டுகள் | சுமார் 6 ஆண்டுகளில் |
+| 2005-01-01T00:00:00.000Z | சுமார் 5 ஆண்டுகள் | சுமார் 5 ஆண்டுகள் | சுமார் 5 ஆண்டுகளில் |
+| 2004-01-01T00:00:00.000Z | சுமார் 4 ஆண்டுகள் | சுமார் 4 ஆண்டுகள் | சுமார் 4 ஆண்டுகளில் |
+| 2003-01-01T00:00:00.000Z | சுமார் 3 ஆண்டுகள் | சுமார் 3 ஆண்டுகள் | சுமார் 3 ஆண்டுகளில் |
+| 2002-01-01T00:00:00.000Z | சுமார் 2 ஆண்டுகள் | சுமார் 2 ஆண்டுகள் | சுமார் 2 ஆண்டுகளில் |
+| 2001-06-01T00:00:00.000Z | 1 வருடத்திற்கு மேல் | 1 வருடத்திற்கு மேல் | 1 வருடத்திற்கும் மேலாக |
+| 2001-02-01T00:00:00.000Z | சுமார் 1 வருடம் | சுமார் 1 வருடம் | சுமார் 1 ஆண்டில் |
+| 2001-01-01T00:00:00.000Z | சுமார் 1 வருடம் | சுமார் 1 வருடம் | சுமார் 1 ஆண்டில் |
+| 2000-06-01T00:00:00.000Z | 5 மாதங்கள் | 5 மாதங்கள் | 5 மாதங்களில் |
+| 2000-03-01T00:00:00.000Z | 2 மாதங்கள் | 2 மாதங்கள் | 2 மாதங்களில் |
+| 2000-02-01T00:00:00.000Z | சுமார் 1 மாதம் | சுமார் 1 மாதம் | சுமார் 1 மாதத்தில் |
+| 2000-01-15T00:00:00.000Z | 14 நாட்கள் | 14 நாட்கள் | 14 நாட்களில் |
+| 2000-01-02T00:00:00.000Z | 1 நாள் | 1 நாள் | 1 நாளில் |
+| 2000-01-01T06:00:00.000Z | சுமார் 6 மணி நேரம் | சுமார் 6 மணி நேரம் | சுமார் 6 மணி நேரத்திற்கு முன்பு |
+| 2000-01-01T01:00:00.000Z | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரத்தில் |
+| 2000-01-01T00:45:00.000Z | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரத்தில் |
+| 2000-01-01T00:30:00.000Z | 30 நிமிடங்கள் | 30 நிமிடங்கள் | 30 நிமிடங்களில் |
+| 2000-01-01T00:15:00.000Z | 15 நிமிடங்கள் | 15 நிமிடங்கள் | 15 நிமிடங்களில் |
+| 2000-01-01T00:01:00.000Z | 1 நிமிடம் | 1 நிமிடம் | 1 நிமிடத்தில் |
+| 2000-01-01T00:00:25.000Z | ஒரு நிமிடத்திற்கும் குறைவாக | அரை நிமிடம் | ஒரு நிமிடத்திற்குள் |
+| 2000-01-01T00:00:15.000Z | ஒரு நிமிடத்திற்கும் குறைவாக | 20 வினாடிகளுக்கு குறைவாக | ஒரு நிமிடத்திற்குள் |
+| 2000-01-01T00:00:05.000Z | ஒரு நிமிடத்திற்கும் குறைவாக | 10 வினாடிகளுக்கு குறைவாக | ஒரு நிமிடத்திற்குள் |
+| 2000-01-01T00:00:00.000Z | ஒரு நிமிடத்திற்கும் குறைவாக | 5 வினாடிகளுக்கு குறைவாக | ஒரு நிமிடத்திற்கு முன்பு |
+| 1999-12-31T23:59:55.000Z | ஒரு நிமிடத்திற்கும் குறைவாக | 10 வினாடிகளுக்கு குறைவாக | ஒரு நிமிடத்திற்கு முன்பு |
+| 1999-12-31T23:59:45.000Z | ஒரு நிமிடத்திற்கும் குறைவாக | 20 வினாடிகளுக்கு குறைவாக | ஒரு நிமிடத்திற்கு முன்பு |
+| 1999-12-31T23:59:35.000Z | ஒரு நிமிடத்திற்கும் குறைவாக | அரை நிமிடம் | ஒரு நிமிடத்திற்கு முன்பு |
+| 1999-12-31T23:59:00.000Z | 1 நிமிடம் | 1 நிமிடம் | 1 நிமிடம் முன்பு |
+| 1999-12-31T23:45:00.000Z | 15 நிமிடங்கள் | 15 நிமிடங்கள் | 15 நிமிடங்களுக்கு முன்பு |
+| 1999-12-31T23:30:00.000Z | 30 நிமிடங்கள் | 30 நிமிடங்கள் | 30 நிமிடங்களுக்கு முன்பு |
+| 1999-12-31T23:15:00.000Z | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரத்திற்கு முன்பு |
+| 1999-12-31T23:00:00.000Z | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரம் | சுமார் 1 மணி நேரத்திற்கு முன்பு |
+| 1999-12-31T18:00:00.000Z | சுமார் 6 மணி நேரம் | சுமார் 6 மணி நேரம் | சுமார் 6 மணி நேரத்தில் |
+| 1999-12-30T00:00:00.000Z | 2 நாட்கள் | 2 நாட்கள் | 2 நாட்களுக்கு முன்பு |
+| 1999-12-15T00:00:00.000Z | 17 நாட்கள் | 17 நாட்கள் | 17 நாட்களுக்கு முன்பு |
+| 1999-12-01T00:00:00.000Z | சுமார் 1 மாதம் | சுமார் 1 மாதம் | சுமார் 1 மாதத்திற்கு முன்பு |
+| 1999-11-01T00:00:00.000Z | 2 மாதங்கள் | 2 மாதங்கள் | 2 மாதங்களுக்கு முன்பு |
+| 1999-06-01T00:00:00.000Z | 7 மாதங்கள் | 7 மாதங்கள் | 7 மாதங்களுக்கு முன்பு |
+| 1999-01-01T00:00:00.000Z | சுமார் 1 வருடம் | சுமார் 1 வருடம் | சுமார் 1 வருடம் முன்பு |
+| 1998-12-01T00:00:00.000Z | சுமார் 1 வருடம் | சுமார் 1 வருடம் | சுமார் 1 வருடம் முன்பு |
+| 1998-06-01T00:00:00.000Z | 1 வருடத்திற்கு மேல் | 1 வருடத்திற்கு மேல் | 1 வருடம் முன்பு |
+| 1998-01-01T00:00:00.000Z | சுமார் 2 ஆண்டுகள் | சுமார் 2 ஆண்டுகள் | சுமார் 2 ஆண்டுகளுக்கு முன்பு |
+| 1997-01-01T00:00:00.000Z | சுமார் 3 ஆண்டுகள் | சுமார் 3 ஆண்டுகள் | சுமார் 3 ஆண்டுகளுக்கு முன்பு |
+| 1996-01-01T00:00:00.000Z | சுமார் 4 ஆண்டுகள் | சுமார் 4 ஆண்டுகள் | சுமார் 4 ஆண்டுகளுக்கு முன்பு |
+| 1995-01-01T00:00:00.000Z | சுமார் 5 ஆண்டுகள் | சுமார் 5 ஆண்டுகள் | சுமார் 5 ஆண்டுகளுக்கு முன்பு |
+| 1994-01-01T00:00:00.000Z | சுமார் 6 ஆண்டுகள் | சுமார் 6 ஆண்டுகள் | சுமார் 6 ஆண்டுகளுக்கு முன்பு |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------- | ------------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ஆண்டுகள் | 6 ஆண்டுகளில் | 52608 மணி நேரம் |
+| 2005-01-01T00:00:00.000Z | 5 ஆண்டுகள் | 5 ஆண்டுகளில் | 43848 மணி நேரம் |
+| 2004-01-01T00:00:00.000Z | 4 ஆண்டுகள் | 4 ஆண்டுகளில் | 35064 மணி நேரம் |
+| 2003-01-01T00:00:00.000Z | 3 ஆண்டுகள் | 3 ஆண்டுகளில் | 26304 மணி நேரம் |
+| 2002-01-01T00:00:00.000Z | 2 ஆண்டுகள் | 2 ஆண்டுகளில் | 17544 மணி நேரம் |
+| 2001-06-01T00:00:00.000Z | 1 வருடம் | 1 ஆண்டில் | 12408 மணி நேரம் |
+| 2001-02-01T00:00:00.000Z | 1 வருடம் | 1 ஆண்டில் | 9528 மணி நேரம் |
+| 2001-01-01T00:00:00.000Z | 1 வருடம் | 1 ஆண்டில் | 8784 மணி நேரம் |
+| 2000-06-01T00:00:00.000Z | 5 மாதங்கள் | 5 மாதங்களில் | 3648 மணி நேரம் |
+| 2000-03-01T00:00:00.000Z | 2 மாதங்கள் | 2 மாதங்களில் | 1440 மணி நேரம் |
+| 2000-02-01T00:00:00.000Z | 1 மாதம் | 1 மாதத்தில் | 744 மணி நேரம் |
+| 2000-01-15T00:00:00.000Z | 14 நாட்கள் | 14 நாட்களில் | 336 மணி நேரம் |
+| 2000-01-02T00:00:00.000Z | 1 நாள் | 1 நாளில் | 24 மணி நேரம் |
+| 2000-01-01T06:00:00.000Z | 6 மணி நேரம் | 6 மணி நேரத்தில் | 6 மணி நேரம் |
+| 2000-01-01T01:00:00.000Z | 1 மணி நேரம் | 1 மணி நேரத்தில் | 1 மணி நேரம் |
+| 2000-01-01T00:45:00.000Z | 45 நிமிடங்கள் | 45 நிமிடங்களில் | 1 மணி நேரம் |
+| 2000-01-01T00:30:00.000Z | 30 நிமிடங்கள் | 30 நிமிடங்களில் | 1 மணி நேரம் |
+| 2000-01-01T00:15:00.000Z | 15 நிமிடங்கள் | 15 நிமிடங்களில் | 0 மணி நேரம் |
+| 2000-01-01T00:01:00.000Z | 1 நிமிடம் | 1 நிமிடத்தில் | 0 மணி நேரம் |
+| 2000-01-01T00:00:25.000Z | 25 விநாடிகள் | 25 வினாடிகளில் | 0 மணி நேரம் |
+| 2000-01-01T00:00:15.000Z | 15 விநாடிகள் | 15 வினாடிகளில் | 0 மணி நேரம் |
+| 2000-01-01T00:00:05.000Z | 5 விநாடிகள் | 5 வினாடிகளில் | 0 மணி நேரம் |
+| 2000-01-01T00:00:00.000Z | 0 விநாடிகள் | 0 விநாடிகளுக்கு முன்பு | 0 மணி நேரம் |
+| 1999-12-31T23:59:55.000Z | 5 விநாடிகள் | 5 விநாடிகளுக்கு முன்பு | 0 மணி நேரம் |
+| 1999-12-31T23:59:45.000Z | 15 விநாடிகள் | 15 விநாடிகளுக்கு முன்பு | 0 மணி நேரம் |
+| 1999-12-31T23:59:35.000Z | 25 விநாடிகள் | 25 விநாடிகளுக்கு முன்பு | 0 மணி நேரம் |
+| 1999-12-31T23:59:00.000Z | 1 நிமிடம் | 1 நிமிடம் முன்பு | 0 மணி நேரம் |
+| 1999-12-31T23:45:00.000Z | 15 நிமிடங்கள் | 15 நிமிடங்களுக்கு முன்பு | 0 மணி நேரம் |
+| 1999-12-31T23:30:00.000Z | 30 நிமிடங்கள் | 30 நிமிடங்களுக்கு முன்பு | 1 மணி நேரம் |
+| 1999-12-31T23:15:00.000Z | 45 நிமிடங்கள் | 45 நிமிடங்களுக்கு முன்பு | 1 மணி நேரம் |
+| 1999-12-31T23:00:00.000Z | 1 மணி நேரம் | 1 மணி நேரத்திற்கு முன்பு | 1 மணி நேரம் |
+| 1999-12-31T18:00:00.000Z | 6 மணி நேரம் | 6 மணி நேரத்திற்கு முன்பு | 6 மணி நேரம் |
+| 1999-12-30T00:00:00.000Z | 2 நாட்கள் | 2 நாட்களுக்கு முன்பு | 48 மணி நேரம் |
+| 1999-12-15T00:00:00.000Z | 17 நாட்கள் | 17 நாட்களுக்கு முன்பு | 408 மணி நேரம் |
+| 1999-12-01T00:00:00.000Z | 1 மாதம் | 1 மாதம் முன்பு | 744 மணி நேரம் |
+| 1999-11-01T00:00:00.000Z | 2 மாதங்கள் | 2 மாதங்களுக்கு முன்பு | 1464 மணி நேரம் |
+| 1999-06-01T00:00:00.000Z | 7 மாதங்கள் | 7 மாதங்களுக்கு முன்பு | 5136 மணி நேரம் |
+| 1999-01-01T00:00:00.000Z | 1 வருடம் | 1 வருடம் முன்பு | 8760 மணி நேரம் |
+| 1998-12-01T00:00:00.000Z | 1 வருடம் | 1 வருடம் முன்பு | 9504 மணி நேரம் |
+| 1998-06-01T00:00:00.000Z | 2 ஆண்டுகள் | 2 ஆண்டுகளுக்கு முன்பு | 13896 மணி நேரம் |
+| 1998-01-01T00:00:00.000Z | 2 ஆண்டுகள் | 2 ஆண்டுகளுக்கு முன்பு | 17520 மணி நேரம் |
+| 1997-01-01T00:00:00.000Z | 3 ஆண்டுகள் | 3 ஆண்டுகளுக்கு முன்பு | 26280 மணி நேரம் |
+| 1996-01-01T00:00:00.000Z | 4 ஆண்டுகள் | 4 ஆண்டுகளுக்கு முன்பு | 35064 மணி நேரம் |
+| 1995-01-01T00:00:00.000Z | 5 ஆண்டுகள் | 5 ஆண்டுகளுக்கு முன்பு | 43824 மணி நேரம் |
+| 1994-01-01T00:00:00.000Z | 6 ஆண்டுகள் | 6 ஆண்டுகளுக்கு முன்பு | 52584 மணி நேரம் |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------------------ |
+| 2000-01-10T00:00:00.000Z | 10/1/00 |
+| 2000-01-05T00:00:00.000Z | புதன் முற்பகல் 12:00 மணிக்கு |
+| 2000-01-02T00:00:00.000Z | நாளை முற்பகல் 12:00 மணிக்கு |
+| 2000-01-01T00:00:00.000Z | இன்று முற்பகல் 12:00 மணிக்கு |
+| 1999-12-31T00:00:00.000Z | நேற்று முற்பகல் 12:00 மணிக்கு |
+| 1999-12-27T00:00:00.000Z | கடந்த திங்கள் முற்பகல் 12:00 மணிக்கு |
+| 1999-12-21T00:00:00.000Z | 21/12/99 |
diff --git a/date-fns/src/locale/te/_lib/formatDistance/index.js b/date-fns/src/locale/te/_lib/formatDistance/index.js
new file mode 100644
index 0000000..f022f99
--- /dev/null
+++ b/date-fns/src/locale/te/_lib/formatDistance/index.js
@@ -0,0 +1,199 @@
+// Source: https://www.unicode.org/cldr/charts/32/summary/te.html
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ standalone: {
+ one: 'సెకను కన్నా తక్కువ',
+ other: '{{count}} సెకన్ల కన్నా తక్కువ'
+ },
+ withPreposition: {
+ one: 'సెకను',
+ other: '{{count}} సెకన్ల'
+ }
+ },
+
+ xSeconds: {
+ standalone: {
+ one: 'ఒక సెకను', // CLDR #1314
+ other: '{{count}} సెకన్ల'
+ },
+ withPreposition: {
+ one: 'ఒక సెకను',
+ other: '{{count}} సెకన్ల'
+ }
+ },
+
+ halfAMinute: {
+ standalone: 'అర నిమిషం',
+ withPreposition: 'అర నిమిషం'
+ },
+
+ lessThanXMinutes: {
+ standalone: {
+ one: 'ఒక నిమిషం కన్నా తక్కువ',
+ other: '{{count}} నిమిషాల కన్నా తక్కువ'
+ },
+ withPreposition: {
+ one: 'ఒక నిమిషం',
+ other: '{{count}} నిమిషాల'
+ }
+ },
+
+ xMinutes: {
+ standalone: {
+ one: 'ఒక నిమిషం', // CLDR #1311
+ other: '{{count}} నిమిషాలు'
+ },
+ withPreposition: {
+ one: 'ఒక నిమిషం', // CLDR #1311
+ other: '{{count}} నిమిషాల'
+ }
+ },
+
+ aboutXHours: {
+ standalone: {
+ one: 'సుమారు ఒక గంట',
+ other: 'సుమారు {{count}} గంటలు'
+ },
+ withPreposition: {
+ one: 'సుమారు ఒక గంట',
+ other: 'సుమారు {{count}} గంటల'
+ }
+ },
+
+ xHours: {
+ standalone: {
+ one: 'ఒక గంట', // CLDR #1308
+ other: '{{count}} గంటలు'
+ },
+ withPreposition: {
+ one: 'ఒక గంట',
+ other: '{{count}} గంటల'
+ }
+ },
+
+ xDays: {
+ standalone: {
+ one: 'ఒక రోజు', // CLDR #1292
+ other: '{{count}} రోజులు'
+ },
+ withPreposition: {
+ one: 'ఒక రోజు',
+ other: '{{count}} రోజుల'
+ }
+ },
+
+ aboutXWeeks: {
+ standalone: {
+ one: 'సుమారు ఒక వారం',
+ other: 'సుమారు {{count}} వారాలు'
+ },
+ withPreposition: {
+ one: 'సుమారు ఒక వారం',
+ other: 'సుమారు {{count}} వారాలల'
+ }
+ },
+
+ xWeeks: {
+ standalone: {
+ one: 'ఒక వారం',
+ other: '{{count}} వారాలు'
+ },
+ withPreposition: {
+ one: 'ఒక వారం',
+ other: '{{count}} వారాలల'
+ }
+ },
+
+ aboutXMonths: {
+ standalone: {
+ one: 'సుమారు ఒక నెల',
+ other: 'సుమారు {{count}} నెలలు'
+ },
+ withPreposition: {
+ one: 'సుమారు ఒక నెల',
+ other: 'సుమారు {{count}} నెలల'
+ }
+ },
+
+ xMonths: {
+ standalone: {
+ one: 'ఒక నెల', // CLDR #1281
+ other: '{{count}} నెలలు'
+ },
+ withPreposition: {
+ one: 'ఒక నెల',
+ other: '{{count}} నెలల'
+ }
+ },
+
+ aboutXYears: {
+ standalone: {
+ one: 'సుమారు ఒక సంవత్సరం',
+ other: 'సుమారు {{count}} సంవత్సరాలు'
+ },
+ withPreposition: {
+ one: 'సుమారు ఒక సంవత్సరం',
+ other: 'సుమారు {{count}} సంవత్సరాల'
+ }
+ },
+
+ xYears: {
+ standalone: {
+ one: 'ఒక సంవత్సరం', // CLDR #1275
+ other: '{{count}} సంవత్సరాలు'
+ },
+ withPreposition: {
+ one: 'ఒక సంవత్సరం',
+ other: '{{count}} సంవత్సరాల'
+ }
+ },
+
+ overXYears: {
+ standalone: {
+ one: 'ఒక సంవత్సరం పైగా',
+ other: '{{count}} సంవత్సరాలకు పైగా'
+ },
+ withPreposition: {
+ one: 'ఒక సంవత్సరం',
+ other: '{{count}} సంవత్సరాల'
+ }
+ },
+
+ almostXYears: {
+ standalone: {
+ one: 'దాదాపు ఒక సంవత్సరం',
+ other: 'దాదాపు {{count}} సంవత్సరాలు'
+ },
+ withPreposition: {
+ one: 'దాదాపు ఒక సంవత్సరం',
+ other: 'దాదాపు {{count}} సంవత్సరాల'
+ }
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var usageGroup = options.addSuffix
+ ? formatDistanceLocale[token].withPreposition
+ : formatDistanceLocale[token].standalone
+
+ var result
+ if (typeof usageGroup === 'string') {
+ result = usageGroup
+ } else if (count === 1) {
+ result = usageGroup.one
+ } else {
+ result = usageGroup.other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + 'లో'
+ } else {
+ return result + ' క్రితం'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/te/_lib/formatLong/index.js b/date-fns/src/locale/te/_lib/formatLong/index.js
new file mode 100644
index 0000000..c1391f7
--- /dev/null
+++ b/date-fns/src/locale/te/_lib/formatLong/index.js
@@ -0,0 +1,45 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+// Source: https://www.unicode.org/cldr/charts/32/summary/te.html
+
+// CLDR #1807 - #1811
+var dateFormats = {
+ full: 'd, MMMM y, EEEE',
+ long: 'd MMMM, y',
+ medium: 'd MMM, y',
+ short: 'dd-MM-yy'
+}
+
+// CLDR #1807 - #1811
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+// CLDR #1815 - #1818
+var dateTimeFormats = {
+ full: "{{date}} {{time}}'కి'",
+ long: "{{date}} {{time}}'కి'",
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/te/_lib/formatRelative/index.js b/date-fns/src/locale/te/_lib/formatRelative/index.js
new file mode 100644
index 0000000..3bcee42
--- /dev/null
+++ b/date-fns/src/locale/te/_lib/formatRelative/index.js
@@ -0,0 +1,14 @@
+// Source: https://www.unicode.org/cldr/charts/32/summary/te.html
+
+var formatRelativeLocale = {
+ lastWeek: "'గత' eeee p", // CLDR #1384
+ yesterday: "'నిన్న' p", // CLDR #1393
+ today: "'ఈ రోజు' p", // CLDR #1394
+ tomorrow: "'రేపు' p", // CLDR #1395
+ nextWeek: "'తదుపరి' eeee p", // CLDR #1386
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/te/_lib/localize/index.js b/date-fns/src/locale/te/_lib/localize/index.js
new file mode 100644
index 0000000..5eed352
--- /dev/null
+++ b/date-fns/src/locale/te/_lib/localize/index.js
@@ -0,0 +1,173 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+// Source: https://www.unicode.org/cldr/charts/32/summary/te.html
+// Source: https://dsal.uchicago.edu/dictionaries/brown/
+
+// CLDR #1605 - #1608
+var eraValues = {
+ narrow: ['క్రీ.పూ.', 'క్రీ.శ.'],
+ abbreviated: ['క్రీ.పూ.', 'క్రీ.శ.'],
+ wide: ['క్రీస్తు పూర్వం', 'క్రీస్తుశకం']
+}
+
+// CLDR #1613 - #1628
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['త్రై1', 'త్రై2', 'త్రై3', 'త్రై4'],
+ wide: ['1వ త్రైమాసికం', '2వ త్రైమాసికం', '3వ త్రైమాసికం', '4వ త్రైమాసికం']
+}
+
+// CLDR #1637 - #1708
+var monthValues = {
+ narrow: ['జ', 'ఫి', 'మా', 'ఏ', 'మే', 'జూ', 'జు', 'ఆ', 'సె', 'అ', 'న', 'డి'],
+ abbreviated: [
+ 'జన',
+ 'ఫిబ్ర',
+ 'మార్చి',
+ 'ఏప్రి',
+ 'మే',
+ 'జూన్',
+ 'జులై',
+ 'ఆగ',
+ 'సెప్టెం',
+ 'అక్టో',
+ 'నవం',
+ 'డిసెం'
+ ],
+ wide: [
+ 'జనవరి',
+ 'ఫిబ్రవరి',
+ 'మార్చి',
+ 'ఏప్రిల్',
+ 'మే',
+ 'జూన్',
+ 'జులై',
+ 'ఆగస్టు',
+ 'సెప్టెంబర్',
+ 'అక్టోబర్',
+ 'నవంబర్',
+ 'డిసెంబర్'
+ ]
+}
+
+// CLDR #1709 - #1764
+var dayValues = {
+ narrow: ['ఆ', 'సో', 'మ', 'బు', 'గు', 'శు', 'శ'],
+ short: ['ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని'],
+ abbreviated: ['ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని'],
+ wide: [
+ 'ఆదివారం',
+ 'సోమవారం',
+ 'మంగళవారం',
+ 'బుధవారం',
+ 'గురువారం',
+ 'శుక్రవారం',
+ 'శనివారం'
+ ]
+}
+
+// CLDR #1767 - #1806
+var dayPeriodValues = {
+ narrow: {
+ am: 'పూర్వాహ్నం',
+ pm: 'అపరాహ్నం',
+ midnight: 'అర్ధరాత్రి',
+ noon: 'మిట్టమధ్యాహ్నం',
+ morning: 'ఉదయం',
+ afternoon: 'మధ్యాహ్నం',
+ evening: 'సాయంత్రం',
+ night: 'రాత్రి'
+ },
+ abbreviated: {
+ am: 'పూర్వాహ్నం',
+ pm: 'అపరాహ్నం',
+ midnight: 'అర్ధరాత్రి',
+ noon: 'మిట్టమధ్యాహ్నం',
+ morning: 'ఉదయం',
+ afternoon: 'మధ్యాహ్నం',
+ evening: 'సాయంత్రం',
+ night: 'రాత్రి'
+ },
+ wide: {
+ am: 'పూర్వాహ్నం',
+ pm: 'అపరాహ్నం',
+ midnight: 'అర్ధరాత్రి',
+ noon: 'మిట్టమధ్యాహ్నం',
+ morning: 'ఉదయం',
+ afternoon: 'మధ్యాహ్నం',
+ evening: 'సాయంత్రం',
+ night: 'రాత్రి'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'పూర్వాహ్నం',
+ pm: 'అపరాహ్నం',
+ midnight: 'అర్ధరాత్రి',
+ noon: 'మిట్టమధ్యాహ్నం',
+ morning: 'ఉదయం',
+ afternoon: 'మధ్యాహ్నం',
+ evening: 'సాయంత్రం',
+ night: 'రాత్రి'
+ },
+ abbreviated: {
+ am: 'పూర్వాహ్నం',
+ pm: 'అపరాహ్నం',
+ midnight: 'అర్ధరాత్రి',
+ noon: 'మిట్టమధ్యాహ్నం',
+ morning: 'ఉదయం',
+ afternoon: 'మధ్యాహ్నం',
+ evening: 'సాయంత్రం',
+ night: 'రాత్రి'
+ },
+ wide: {
+ am: 'పూర్వాహ్నం',
+ pm: 'అపరాహ్నం',
+ midnight: 'అర్ధరాత్రి',
+ noon: 'మిట్టమధ్యాహ్నం',
+ morning: 'ఉదయం',
+ afternoon: 'మధ్యాహ్నం',
+ evening: 'సాయంత్రం',
+ night: 'రాత్రి'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ return number + 'వ'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/te/_lib/match/index.js b/date-fns/src/locale/te/_lib/match/index.js
new file mode 100644
index 0000000..f5813f6
--- /dev/null
+++ b/date-fns/src/locale/te/_lib/match/index.js
@@ -0,0 +1,140 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(వ)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(క్రీ\.పూ\.|క్రీ\.శ\.)/i,
+ abbreviated: /^(క్రీ\.?\s?పూ\.?|ప్ర\.?\s?శ\.?\s?పూ\.?|క్రీ\.?\s?శ\.?|సా\.?\s?శ\.?)/i,
+ wide: /^(క్రీస్తు పూర్వం|ప్రస్తుత శకానికి పూర్వం|క్రీస్తు శకం|ప్రస్తుత శకం)/i
+}
+var parseEraPatterns = {
+ any: [/^(పూ|శ)/i, /^సా/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^త్రై[1234]/i,
+ wide: /^[1234](వ)? త్రైమాసికం/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(జూ|జు|జ|ఫి|మా|ఏ|మే|ఆ|సె|అ|న|డి)/i,
+ abbreviated: /^(జన|ఫిబ్ర|మార్చి|ఏప్రి|మే|జూన్|జులై|ఆగ|సెప్|అక్టో|నవ|డిసె)/i,
+ wide: /^(జనవరి|ఫిబ్రవరి|మార్చి|ఏప్రిల్|మే|జూన్|జులై|ఆగస్టు|సెప్టెంబర్|అక్టోబర్|నవంబర్|డిసెంబర్)/i
+}
+
+var parseMonthPatterns = {
+ narrow: [
+ /^జ/i,
+ /^ఫి/i,
+ /^మా/i,
+ /^ఏ/i,
+ /^మే/i,
+ /^జూ/i,
+ /^జు/i,
+ /^ఆ/i,
+ /^సె/i,
+ /^అ/i,
+ /^న/i,
+ /^డి/i
+ ],
+ any: [
+ /^జన/i,
+ /^ఫి/i,
+ /^మా/i,
+ /^ఏ/i,
+ /^మే/i,
+ /^జూన్/i,
+ /^జులై/i,
+ /^ఆగ/i,
+ /^సె/i,
+ /^అ/i,
+ /^న/i,
+ /^డి/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(ఆ|సో|మ|బు|గు|శు|శ)/i,
+ short: /^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i,
+ abbreviated: /^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i,
+ wide: /^(ఆదివారం|సోమవారం|మంగళవారం|బుధవారం|గురువారం|శుక్రవారం|శనివారం)/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^ఆ/i, /^సో/i, /^మ/i, /^బు/i, /^గు/i, /^శు/i, /^శ/i],
+ any: [/^ఆది/i, /^సోమ/i, /^మం/i, /^బుధ/i, /^గురు/i, /^శుక్ర/i, /^శని/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i,
+ any: /^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^పూర్వాహ్నం/i,
+ pm: /^అపరాహ్నం/i,
+ midnight: /^అర్ధ/i,
+ noon: /^మిట్ట/i,
+ morning: /ఉదయం/i,
+ afternoon: /మధ్యాహ్నం/i,
+ evening: /సాయంత్రం/i,
+ night: /రాత్రి/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/te/index.d.ts b/date-fns/src/locale/te/index.d.ts
new file mode 100644
index 0000000..2dab4a8
--- /dev/null
+++ b/date-fns/src/locale/te/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { te } from 'date-fns/locale'
+export default te
diff --git a/date-fns/src/locale/te/index.js b/date-fns/src/locale/te/index.js
new file mode 100644
index 0000000..d51e651
--- /dev/null
+++ b/date-fns/src/locale/te/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Telugu locale
+ * @language Telugu
+ * @iso-639-2 tel
+ * @author Kranthi Lakum [@kranthilakum]{@link https://github.com/kranthilakum}
+ */
+var locale = {
+ code: 'te',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/te/index.js.flow b/date-fns/src/locale/te/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/te/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/te/snapshot.md b/date-fns/src/locale/te/snapshot.md
new file mode 100644
index 0000000..38452df
--- /dev/null
+++ b/date-fns/src/locale/te/snapshot.md
@@ -0,0 +1,304 @@
+# Telugu (te) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987వ | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5వ | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987వ | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5వ | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1వ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2వ | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | త్రై1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | త్రై2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1వ త్రైమాసికం | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2వ త్రైమాసికం | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1వ | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2వ | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | త్రై1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | త్రై2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1వ త్రైమాసికం | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2వ త్రైమాసికం | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2వ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7వ | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | ఫిబ్ర | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | జులై | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | ఫిబ్రవరి | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | జులై | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ఫి | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | జు | 2019-01-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2వ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7వ | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | ఫిబ్ర | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | జులై | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | ఫిబ్రవరి | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | జులై | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ఫి | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | జు | 2019-01-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1వ | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49వ | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1వ | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48వ | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11వ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28వ | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42వ | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365వ | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | సోమవారం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్రవారం | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | సో | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శు | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1వ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5వ | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | సోమవారం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్రవారం | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | సో | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శు | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2వ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6వ | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | సోమవారం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్రవారం | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | సో | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శు | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2వ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6వ | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | సోమవారం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్రవారం | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | సో | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శు | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | సోమ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | శుక్ర | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | అపరాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | పూర్వాహ్నం | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ఉదయం | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | మధ్యాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | సాయంత్రం | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | రాత్రి | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ఉదయం | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | మధ్యాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | సాయంత్రం | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | రాత్రి | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ఉదయం | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | మధ్యాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | సాయంత్రం | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | రాత్రి | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ఉదయం | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | మధ్యాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | సాయంత్రం | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | రాత్రి | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ఉదయం | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | మధ్యాహ్నం | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | సాయంత్రం | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | రాత్రి | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11వ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11వ | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11వ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23వ | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11వ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11వ | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11వ | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23వ | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1వ | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55వ | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1వ | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55వ | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11-02-87 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-05-53 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 ఫిబ్ర, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 మే, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 ఫిబ్రవరి, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 మే, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 11, ఫిబ్రవరి 1987, బుధవారం | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29, మే 1453, ఆదివారం | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 అపరాహ్నం | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 అపరాహ్నం | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 అపరాహ్నం | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 అపరాహ్నం | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 అపరాహ్నం GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 అపరాహ్నం GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 అపరాహ్నం GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 అపరాహ్నం GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11-02-87 12:13 అపరాహ్నం | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-05-53 11:59 అపరాహ్నం | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 ఫిబ్ర, 1987 12:13:14 అపరాహ్నం | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 మే, 1453 11:59:59 అపరాహ్నం | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 ఫిబ్రవరి, 1987 12:13:14 అపరాహ్నం GMT+0కి | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 మే, 1453 11:59:59 అపరాహ్నం GMT+0కి | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 11, ఫిబ్రవరి 1987, బుధవారం 12:13:14 అపరాహ్నం GMT+00:00కి | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29, మే 1453, ఆదివారం 11:59:59 అపరాహ్నం GMT+00:00కి | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------------- | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | సుమారు 6 సంవత్సరాలు | సుమారు 6 సంవత్సరాలు | సుమారు 6 సంవత్సరాలలో |
+| 2005-01-01T00:00:00.000Z | సుమారు 5 సంవత్సరాలు | సుమారు 5 సంవత్సరాలు | సుమారు 5 సంవత్సరాలలో |
+| 2004-01-01T00:00:00.000Z | సుమారు 4 సంవత్సరాలు | సుమారు 4 సంవత్సరాలు | సుమారు 4 సంవత్సరాలలో |
+| 2003-01-01T00:00:00.000Z | సుమారు 3 సంవత్సరాలు | సుమారు 3 సంవత్సరాలు | సుమారు 3 సంవత్సరాలలో |
+| 2002-01-01T00:00:00.000Z | సుమారు 2 సంవత్సరాలు | సుమారు 2 సంవత్సరాలు | సుమారు 2 సంవత్సరాలలో |
+| 2001-06-01T00:00:00.000Z | ఒక సంవత్సరం పైగా | ఒక సంవత్సరం పైగా | ఒక సంవత్సరంలో |
+| 2001-02-01T00:00:00.000Z | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరంలో |
+| 2001-01-01T00:00:00.000Z | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరంలో |
+| 2000-06-01T00:00:00.000Z | 5 నెలలు | 5 నెలలు | 5 నెలలలో |
+| 2000-03-01T00:00:00.000Z | 2 నెలలు | 2 నెలలు | 2 నెలలలో |
+| 2000-02-01T00:00:00.000Z | సుమారు ఒక నెల | సుమారు ఒక నెల | సుమారు ఒక నెలలో |
+| 2000-01-15T00:00:00.000Z | 14 రోజులు | 14 రోజులు | 14 రోజులలో |
+| 2000-01-02T00:00:00.000Z | ఒక రోజు | ఒక రోజు | ఒక రోజులో |
+| 2000-01-01T06:00:00.000Z | సుమారు 6 గంటలు | సుమారు 6 గంటలు | సుమారు 6 గంటలలో |
+| 2000-01-01T01:00:00.000Z | సుమారు ఒక గంట | సుమారు ఒక గంట | సుమారు ఒక గంటలో |
+| 2000-01-01T00:45:00.000Z | సుమారు ఒక గంట | సుమారు ఒక గంట | సుమారు ఒక గంటలో |
+| 2000-01-01T00:30:00.000Z | 30 నిమిషాలు | 30 నిమిషాలు | 30 నిమిషాలలో |
+| 2000-01-01T00:15:00.000Z | 15 నిమిషాలు | 15 నిమిషాలు | 15 నిమిషాలలో |
+| 2000-01-01T00:01:00.000Z | ఒక నిమిషం | ఒక నిమిషం | ఒక నిమిషంలో |
+| 2000-01-01T00:00:25.000Z | ఒక నిమిషం కన్నా తక్కువ | అర నిమిషం | ఒక నిమిషంలో |
+| 2000-01-01T00:00:15.000Z | ఒక నిమిషం కన్నా తక్కువ | 20 సెకన్ల కన్నా తక్కువ | ఒక నిమిషంలో |
+| 2000-01-01T00:00:05.000Z | ఒక నిమిషం కన్నా తక్కువ | 10 సెకన్ల కన్నా తక్కువ | ఒక నిమిషంలో |
+| 2000-01-01T00:00:00.000Z | ఒక నిమిషం కన్నా తక్కువ | 5 సెకన్ల కన్నా తక్కువ | ఒక నిమిషం క్రితం |
+| 1999-12-31T23:59:55.000Z | ఒక నిమిషం కన్నా తక్కువ | 10 సెకన్ల కన్నా తక్కువ | ఒక నిమిషం క్రితం |
+| 1999-12-31T23:59:45.000Z | ఒక నిమిషం కన్నా తక్కువ | 20 సెకన్ల కన్నా తక్కువ | ఒక నిమిషం క్రితం |
+| 1999-12-31T23:59:35.000Z | ఒక నిమిషం కన్నా తక్కువ | అర నిమిషం | ఒక నిమిషం క్రితం |
+| 1999-12-31T23:59:00.000Z | ఒక నిమిషం | ఒక నిమిషం | ఒక నిమిషం క్రితం |
+| 1999-12-31T23:45:00.000Z | 15 నిమిషాలు | 15 నిమిషాలు | 15 నిమిషాల క్రితం |
+| 1999-12-31T23:30:00.000Z | 30 నిమిషాలు | 30 నిమిషాలు | 30 నిమిషాల క్రితం |
+| 1999-12-31T23:15:00.000Z | సుమారు ఒక గంట | సుమారు ఒక గంట | సుమారు ఒక గంట క్రితం |
+| 1999-12-31T23:00:00.000Z | సుమారు ఒక గంట | సుమారు ఒక గంట | సుమారు ఒక గంట క్రితం |
+| 1999-12-31T18:00:00.000Z | సుమారు 6 గంటలు | సుమారు 6 గంటలు | సుమారు 6 గంటల క్రితం |
+| 1999-12-30T00:00:00.000Z | 2 రోజులు | 2 రోజులు | 2 రోజుల క్రితం |
+| 1999-12-15T00:00:00.000Z | 17 రోజులు | 17 రోజులు | 17 రోజుల క్రితం |
+| 1999-12-01T00:00:00.000Z | సుమారు ఒక నెల | సుమారు ఒక నెల | సుమారు ఒక నెల క్రితం |
+| 1999-11-01T00:00:00.000Z | 2 నెలలు | 2 నెలలు | 2 నెలల క్రితం |
+| 1999-06-01T00:00:00.000Z | 7 నెలలు | 7 నెలలు | 7 నెలల క్రితం |
+| 1999-01-01T00:00:00.000Z | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరం క్రితం |
+| 1998-12-01T00:00:00.000Z | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరం | సుమారు ఒక సంవత్సరం క్రితం |
+| 1998-06-01T00:00:00.000Z | ఒక సంవత్సరం పైగా | ఒక సంవత్సరం పైగా | ఒక సంవత్సరం క్రితం |
+| 1998-01-01T00:00:00.000Z | సుమారు 2 సంవత్సరాలు | సుమారు 2 సంవత్సరాలు | సుమారు 2 సంవత్సరాల క్రితం |
+| 1997-01-01T00:00:00.000Z | సుమారు 3 సంవత్సరాలు | సుమారు 3 సంవత్సరాలు | సుమారు 3 సంవత్సరాల క్రితం |
+| 1996-01-01T00:00:00.000Z | సుమారు 4 సంవత్సరాలు | సుమారు 4 సంవత్సరాలు | సుమారు 4 సంవత్సరాల క్రితం |
+| 1995-01-01T00:00:00.000Z | సుమారు 5 సంవత్సరాలు | సుమారు 5 సంవత్సరాలు | సుమారు 5 సంవత్సరాల క్రితం |
+| 1994-01-01T00:00:00.000Z | సుమారు 6 సంవత్సరాలు | సుమారు 6 సంవత్సరాలు | సుమారు 6 సంవత్సరాల క్రితం |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------------ | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 సంవత్సరాలు | 6 సంవత్సరాలలో | 52608 గంటలు |
+| 2005-01-01T00:00:00.000Z | 5 సంవత్సరాలు | 5 సంవత్సరాలలో | 43848 గంటలు |
+| 2004-01-01T00:00:00.000Z | 4 సంవత్సరాలు | 4 సంవత్సరాలలో | 35064 గంటలు |
+| 2003-01-01T00:00:00.000Z | 3 సంవత్సరాలు | 3 సంవత్సరాలలో | 26304 గంటలు |
+| 2002-01-01T00:00:00.000Z | 2 సంవత్సరాలు | 2 సంవత్సరాలలో | 17544 గంటలు |
+| 2001-06-01T00:00:00.000Z | ఒక సంవత్సరం | ఒక సంవత్సరంలో | 12408 గంటలు |
+| 2001-02-01T00:00:00.000Z | ఒక సంవత్సరం | ఒక సంవత్సరంలో | 9528 గంటలు |
+| 2001-01-01T00:00:00.000Z | ఒక సంవత్సరం | ఒక సంవత్సరంలో | 8784 గంటలు |
+| 2000-06-01T00:00:00.000Z | 5 నెలలు | 5 నెలలలో | 3648 గంటలు |
+| 2000-03-01T00:00:00.000Z | 2 నెలలు | 2 నెలలలో | 1440 గంటలు |
+| 2000-02-01T00:00:00.000Z | ఒక నెల | ఒక నెలలో | 744 గంటలు |
+| 2000-01-15T00:00:00.000Z | 14 రోజులు | 14 రోజులలో | 336 గంటలు |
+| 2000-01-02T00:00:00.000Z | ఒక రోజు | ఒక రోజులో | 24 గంటలు |
+| 2000-01-01T06:00:00.000Z | 6 గంటలు | 6 గంటలలో | 6 గంటలు |
+| 2000-01-01T01:00:00.000Z | ఒక గంట | ఒక గంటలో | ఒక గంట |
+| 2000-01-01T00:45:00.000Z | 45 నిమిషాలు | 45 నిమిషాలలో | ఒక గంట |
+| 2000-01-01T00:30:00.000Z | 30 నిమిషాలు | 30 నిమిషాలలో | ఒక గంట |
+| 2000-01-01T00:15:00.000Z | 15 నిమిషాలు | 15 నిమిషాలలో | 0 గంటలు |
+| 2000-01-01T00:01:00.000Z | ఒక నిమిషం | ఒక నిమిషంలో | 0 గంటలు |
+| 2000-01-01T00:00:25.000Z | 25 సెకన్ల | 25 సెకన్లలో | 0 గంటలు |
+| 2000-01-01T00:00:15.000Z | 15 సెకన్ల | 15 సెకన్లలో | 0 గంటలు |
+| 2000-01-01T00:00:05.000Z | 5 సెకన్ల | 5 సెకన్లలో | 0 గంటలు |
+| 2000-01-01T00:00:00.000Z | 0 సెకన్ల | 0 సెకన్ల క్రితం | 0 గంటలు |
+| 1999-12-31T23:59:55.000Z | 5 సెకన్ల | 5 సెకన్ల క్రితం | 0 గంటలు |
+| 1999-12-31T23:59:45.000Z | 15 సెకన్ల | 15 సెకన్ల క్రితం | 0 గంటలు |
+| 1999-12-31T23:59:35.000Z | 25 సెకన్ల | 25 సెకన్ల క్రితం | 0 గంటలు |
+| 1999-12-31T23:59:00.000Z | ఒక నిమిషం | ఒక నిమిషం క్రితం | 0 గంటలు |
+| 1999-12-31T23:45:00.000Z | 15 నిమిషాలు | 15 నిమిషాల క్రితం | 0 గంటలు |
+| 1999-12-31T23:30:00.000Z | 30 నిమిషాలు | 30 నిమిషాల క్రితం | ఒక గంట |
+| 1999-12-31T23:15:00.000Z | 45 నిమిషాలు | 45 నిమిషాల క్రితం | ఒక గంట |
+| 1999-12-31T23:00:00.000Z | ఒక గంట | ఒక గంట క్రితం | ఒక గంట |
+| 1999-12-31T18:00:00.000Z | 6 గంటలు | 6 గంటల క్రితం | 6 గంటలు |
+| 1999-12-30T00:00:00.000Z | 2 రోజులు | 2 రోజుల క్రితం | 48 గంటలు |
+| 1999-12-15T00:00:00.000Z | 17 రోజులు | 17 రోజుల క్రితం | 408 గంటలు |
+| 1999-12-01T00:00:00.000Z | ఒక నెల | ఒక నెల క్రితం | 744 గంటలు |
+| 1999-11-01T00:00:00.000Z | 2 నెలలు | 2 నెలల క్రితం | 1464 గంటలు |
+| 1999-06-01T00:00:00.000Z | 7 నెలలు | 7 నెలల క్రితం | 5136 గంటలు |
+| 1999-01-01T00:00:00.000Z | ఒక సంవత్సరం | ఒక సంవత్సరం క్రితం | 8760 గంటలు |
+| 1998-12-01T00:00:00.000Z | ఒక సంవత్సరం | ఒక సంవత్సరం క్రితం | 9504 గంటలు |
+| 1998-06-01T00:00:00.000Z | 2 సంవత్సరాలు | 2 సంవత్సరాల క్రితం | 13896 గంటలు |
+| 1998-01-01T00:00:00.000Z | 2 సంవత్సరాలు | 2 సంవత్సరాల క్రితం | 17520 గంటలు |
+| 1997-01-01T00:00:00.000Z | 3 సంవత్సరాలు | 3 సంవత్సరాల క్రితం | 26280 గంటలు |
+| 1996-01-01T00:00:00.000Z | 4 సంవత్సరాలు | 4 సంవత్సరాల క్రితం | 35064 గంటలు |
+| 1995-01-01T00:00:00.000Z | 5 సంవత్సరాలు | 5 సంవత్సరాల క్రితం | 43824 గంటలు |
+| 1994-01-01T00:00:00.000Z | 6 సంవత్సరాలు | 6 సంవత్సరాల క్రితం | 52584 గంటలు |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10-01-00 |
+| 2000-01-05T00:00:00.000Z | తదుపరి బుధవారం 12:00 పూర్వాహ్నం |
+| 2000-01-02T00:00:00.000Z | రేపు 12:00 పూర్వాహ్నం |
+| 2000-01-01T00:00:00.000Z | ఈ రోజు 12:00 పూర్వాహ్నం |
+| 1999-12-31T00:00:00.000Z | నిన్న 12:00 పూర్వాహ్నం |
+| 1999-12-27T00:00:00.000Z | గత సోమవారం 12:00 పూర్వాహ్నం |
+| 1999-12-21T00:00:00.000Z | 21-12-99 |
diff --git a/date-fns/src/locale/th/_lib/formatDistance/index.js b/date-fns/src/locale/th/_lib/formatDistance/index.js
new file mode 100644
index 0000000..916461d
--- /dev/null
+++ b/date-fns/src/locale/th/_lib/formatDistance/index.js
@@ -0,0 +1,105 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'น้อยกว่า 1 วินาที',
+ other: 'น้อยกว่า {{count}} วินาที'
+ },
+
+ xSeconds: {
+ one: '1 วินาที',
+ other: '{{count}} วินาที'
+ },
+
+ halfAMinute: 'ครึ่งนาที',
+
+ lessThanXMinutes: {
+ one: 'น้อยกว่า 1 นาที',
+ other: 'น้อยกว่า {{count}} นาที'
+ },
+
+ xMinutes: {
+ one: '1 นาที',
+ other: '{{count}} นาที'
+ },
+
+ aboutXHours: {
+ one: 'ประมาณ 1 ชั่วโมง',
+ other: 'ประมาณ {{count}} ชั่วโมง'
+ },
+
+ xHours: {
+ one: '1 ชั่วโมง',
+ other: '{{count}} ชั่วโมง'
+ },
+
+ xDays: {
+ one: '1 วัน',
+ other: '{{count}} วัน'
+ },
+
+ aboutXWeeks: {
+ one: 'ประมาณ 1 สัปดาห์',
+ other: 'ประมาณ {{count}} สัปดาห์'
+ },
+
+ xWeeks: {
+ one: '1 สัปดาห์',
+ other: '{{count}} สัปดาห์'
+ },
+
+ aboutXMonths: {
+ one: 'ประมาณ 1 เดือน',
+ other: 'ประมาณ {{count}} เดือน'
+ },
+
+ xMonths: {
+ one: '1 เดือน',
+ other: '{{count}} เดือน'
+ },
+
+ aboutXYears: {
+ one: 'ประมาณ 1 ปี',
+ other: 'ประมาณ {{count}} ปี'
+ },
+
+ xYears: {
+ one: '1 ปี',
+ other: '{{count}} ปี'
+ },
+
+ overXYears: {
+ one: 'มากกว่า 1 ปี',
+ other: 'มากกว่า {{count}} ปี'
+ },
+
+ almostXYears: {
+ one: 'เกือบ 1 ปี',
+ other: 'เกือบ {{count}} ปี'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ if (token === 'halfAMinute') {
+ return 'ใน' + result
+ } else {
+ return 'ใน ' + result
+ }
+ } else {
+ return result + 'ที่ผ่านมา'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/th/_lib/formatLong/index.js b/date-fns/src/locale/th/_lib/formatLong/index.js
new file mode 100644
index 0000000..b91cf91
--- /dev/null
+++ b/date-fns/src/locale/th/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'วันEEEEที่ do MMMM y',
+ long: 'do MMMM y',
+ medium: 'd MMM y',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss น. zzzz',
+ long: 'H:mm:ss น. z',
+ medium: 'H:mm:ss น.',
+ short: 'H:mm น.'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'เวลา' {{time}}",
+ long: "{{date}} 'เวลา' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'medium'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/th/_lib/formatRelative/index.js b/date-fns/src/locale/th/_lib/formatRelative/index.js
new file mode 100644
index 0000000..622e106
--- /dev/null
+++ b/date-fns/src/locale/th/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee'ที่แล้วเวลา' p",
+ yesterday: "'เมื่อวานนี้เวลา' p",
+ today: "'วันนี้เวลา' p",
+ tomorrow: "'พรุ่งนี้เวลา' p",
+ nextWeek: "eeee 'เวลา' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/th/_lib/localize/index.js b/date-fns/src/locale/th/_lib/localize/index.js
new file mode 100644
index 0000000..24390f3
--- /dev/null
+++ b/date-fns/src/locale/th/_lib/localize/index.js
@@ -0,0 +1,172 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['B', 'คศ'],
+ abbreviated: ['BC', 'ค.ศ.'],
+ wide: ['ปีก่อนคริสตกาล', 'คริสต์ศักราช']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['ไตรมาสแรก', 'ไตรมาสที่สอง', 'ไตรมาสที่สาม', 'ไตรมาสที่สี่']
+}
+
+var dayValues = {
+ narrow: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
+ short: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
+ abbreviated: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'],
+ wide: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์']
+}
+
+var monthValues = {
+ narrow: [
+ 'ม.ค.',
+ 'ก.พ.',
+ 'มี.ค.',
+ 'เม.ย.',
+ 'พ.ค.',
+ 'มิ.ย.',
+ 'ก.ค.',
+ 'ส.ค.',
+ 'ก.ย.',
+ 'ต.ค.',
+ 'พ.ย.',
+ 'ธ.ค.'
+ ],
+ abbreviated: [
+ 'ม.ค.',
+ 'ก.พ.',
+ 'มี.ค.',
+ 'เม.ย.',
+ 'พ.ค.',
+ 'มิ.ย.',
+ 'ก.ค.',
+ 'ส.ค.',
+ 'ก.ย.',
+ 'ต.ค.',
+ 'พ.ย.',
+ 'ธ.ค.'
+ ],
+ wide: [
+ 'มกราคม',
+ 'กุมภาพันธ์',
+ 'มีนาคม',
+ 'เมษายน',
+ 'พฤษภาคม',
+ 'มิถุนายน',
+ 'กรกฎาคม',
+ 'สิงหาคม',
+ 'กันยายน',
+ 'ตุลาคม',
+ 'พฤศจิกายน',
+ 'ธันวาคม'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ก่อนเที่ยง',
+ pm: 'หลังเที่ยง',
+ midnight: 'เที่ยงคืน',
+ noon: 'เที่ยง',
+ morning: 'เช้า',
+ afternoon: 'บ่าย',
+ evening: 'เย็น',
+ night: 'กลางคืน'
+ },
+ abbreviated: {
+ am: 'ก่อนเที่ยง',
+ pm: 'หลังเที่ยง',
+ midnight: 'เที่ยงคืน',
+ noon: 'เที่ยง',
+ morning: 'เช้า',
+ afternoon: 'บ่าย',
+ evening: 'เย็น',
+ night: 'กลางคืน'
+ },
+ wide: {
+ am: 'ก่อนเที่ยง',
+ pm: 'หลังเที่ยง',
+ midnight: 'เที่ยงคืน',
+ noon: 'เที่ยง',
+ morning: 'เช้า',
+ afternoon: 'บ่าย',
+ evening: 'เย็น',
+ night: 'กลางคืน'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ก่อนเที่ยง',
+ pm: 'หลังเที่ยง',
+ midnight: 'เที่ยงคืน',
+ noon: 'เที่ยง',
+ morning: 'ตอนเช้า',
+ afternoon: 'ตอนกลางวัน',
+ evening: 'ตอนเย็น',
+ night: 'ตอนกลางคืน'
+ },
+ abbreviated: {
+ am: 'ก่อนเที่ยง',
+ pm: 'หลังเที่ยง',
+ midnight: 'เที่ยงคืน',
+ noon: 'เที่ยง',
+ morning: 'ตอนเช้า',
+ afternoon: 'ตอนกลางวัน',
+ evening: 'ตอนเย็น',
+ night: 'ตอนกลางคืน'
+ },
+ wide: {
+ am: 'ก่อนเที่ยง',
+ pm: 'หลังเที่ยง',
+ midnight: 'เที่ยงคืน',
+ noon: 'เที่ยง',
+ morning: 'ตอนเช้า',
+ afternoon: 'ตอนกลางวัน',
+ evening: 'ตอนเย็น',
+ night: 'ตอนกลางคืน'
+ }
+}
+
+function ordinalNumber(dirtyNumber) {
+ var number = Number(dirtyNumber)
+ return number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/th/_lib/match/index.js b/date-fns/src/locale/th/_lib/match/index.js
new file mode 100644
index 0000000..c009ce2
--- /dev/null
+++ b/date-fns/src/locale/th/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^\d+/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^([bB]|[aA]|คศ)/i,
+ abbreviated: /^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i,
+ wide: /^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i
+}
+var parseEraPatterns = {
+ any: [/^[bB]/i, /^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^ไตรมาส(ที่)? ?[1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/(1|แรก|หนึ่ง)/i, /(2|สอง)/i, /(3|สาม)/i, /(4|สี่)/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?)/i,
+ abbreviated: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?')/i,
+ wide: /^(มกราคม|กุมภาพันธ์|มีนาคม|เมษายน|พฤษภาคม|มิถุนายน|กรกฎาคม|สิงหาคม|กันยายน|ตุลาคม|พฤศจิกายน|ธันวาคม)/i
+}
+var parseMonthPatterns = {
+ wide: [
+ /^มก/i,
+ /^กุม/i,
+ /^มี/i,
+ /^เม/i,
+ /^พฤษ/i,
+ /^มิ/i,
+ /^กรก/i,
+ /^ส/i,
+ /^กัน/i,
+ /^ต/i,
+ /^พฤศ/i,
+ /^ธ/i
+ ],
+ any: [
+ /^ม\.?ค\.?/i,
+ /^ก\.?พ\.?/i,
+ /^มี\.?ค\.?/i,
+ /^เม\.?ย\.?/i,
+ /^พ\.?ค\.?/i,
+ /^มิ\.?ย\.?/i,
+ /^ก\.?ค\.?/i,
+ /^ส\.?ค\.?/i,
+ /^ก\.?ย\.?/i,
+ /^ต\.?ค\.?/i,
+ /^พ\.?ย\.?/i,
+ /^ธ\.?ค\.?/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
+ short: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
+ abbreviated: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
+ wide: /^(อาทิตย์|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์)/i
+}
+var parseDayPatterns = {
+ wide: [/^อา/i, /^จั/i, /^อั/i, /^พุธ/i, /^พฤ/i, /^ศ/i, /^เส/i],
+ any: [/^อา/i, /^จ/i, /^อ/i, /^พ(?!ฤ)/i, /^พฤ/i, /^ศ/i, /^ส/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(ก่อนเที่ยง|หลังเที่ยง|เที่ยงคืน|เที่ยง|(ตอน.*?)?.*(เที่ยง|เช้า|บ่าย|เย็น|กลางคืน))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^ก่อนเที่ยง/i,
+ pm: /^หลังเที่ยง/i,
+ midnight: /^เที่ยงคืน/i,
+ noon: /^เที่ยง/i,
+ morning: /เช้า/i,
+ afternoon: /บ่าย/i,
+ evening: /เย็น/i,
+ night: /กลางคืน/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/th/index.d.ts b/date-fns/src/locale/th/index.d.ts
new file mode 100644
index 0000000..944dd87
--- /dev/null
+++ b/date-fns/src/locale/th/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { th } from 'date-fns/locale'
+export default th
diff --git a/date-fns/src/locale/th/index.js b/date-fns/src/locale/th/index.js
new file mode 100644
index 0000000..bd63ad7
--- /dev/null
+++ b/date-fns/src/locale/th/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Thai locale.
+ * @language Thai
+ * @iso-639-2 tha
+ * @author Athiwat Hirunworawongkun [@athivvat]{@link https://github.com/athivvat}
+ * @author [@hawkup]{@link https://github.com/hawkup}
+ * @author Jirawat I. [@nodtem66]{@link https://github.com/nodtem66}
+ */
+var locale = {
+ code: 'th',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/th/index.js.flow b/date-fns/src/locale/th/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/th/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/th/snapshot.md b/date-fns/src/locale/th/snapshot.md
new file mode 100644
index 0000000..67d1f6a
--- /dev/null
+++ b/date-fns/src/locale/th/snapshot.md
@@ -0,0 +1,304 @@
+# Thai (th) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | ไตรมาสแรก | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | ไตรมาสที่สอง | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | ไตรมาสแรก | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | ไตรมาสที่สอง | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | ก.พ. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ก.ค. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | กุมภาพันธ์ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | กรกฎาคม | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ก.พ. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ก.ค. | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | ก.พ. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ก.ค. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | กุมภาพันธ์ | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | กรกฎาคม | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ก.พ. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ก.ค. | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49 | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | จันทร์ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศุกร์ | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | จันทร์ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศุกร์ | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | จันทร์ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศุกร์ | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | จันทร์ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศุกร์ | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | จ. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ศ. | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | หลังเที่ยง | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ก่อนเที่ยง | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ตอนเช้า | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ตอนกลางวัน | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ตอนเย็น | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ตอนกลางคืน | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ตอนเช้า | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ตอนกลางวัน | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ตอนเย็น | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ตอนกลางคืน | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ตอนเช้า | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ตอนกลางวัน | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ตอนเย็น | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ตอนกลางคืน | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ตอนเช้า | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ตอนกลางวัน | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ตอนเย็น | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ตอนกลางคืน | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ตอนเช้า | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ตอนกลางวัน | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ตอนเย็น | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ตอนกลางคืน | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 ก.พ. 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 พ.ค. 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 กุมภาพันธ์ 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 พฤษภาคม 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | วันพุธที่ 11 กุมภาพันธ์ 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | วันอาทิตย์ที่ 29 พฤษภาคม 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 น. | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 น. | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 น. | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 น. | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 น. GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 น. GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 น. GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 น. GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 น. | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 23:59 น. | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 ก.พ. 1987, 12:13:14 น. | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 พ.ค. 1453, 23:59:59 น. | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 กุมภาพันธ์ 1987 เวลา 12:13:14 น. GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 พฤษภาคม 1453 เวลา 23:59:59 น. GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | วันพุธที่ 11 กุมภาพันธ์ 1987 เวลา 12:13:14 น. GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | วันอาทิตย์ที่ 29 พฤษภาคม 1453 เวลา 23:59:59 น. GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | ------------------------- |
+| 2006-01-01T00:00:00.000Z | ประมาณ 6 ปี | ประมาณ 6 ปี | ใน ประมาณ 6 ปี |
+| 2005-01-01T00:00:00.000Z | ประมาณ 5 ปี | ประมาณ 5 ปี | ใน ประมาณ 5 ปี |
+| 2004-01-01T00:00:00.000Z | ประมาณ 4 ปี | ประมาณ 4 ปี | ใน ประมาณ 4 ปี |
+| 2003-01-01T00:00:00.000Z | ประมาณ 3 ปี | ประมาณ 3 ปี | ใน ประมาณ 3 ปี |
+| 2002-01-01T00:00:00.000Z | ประมาณ 2 ปี | ประมาณ 2 ปี | ใน ประมาณ 2 ปี |
+| 2001-06-01T00:00:00.000Z | มากกว่า 1 ปี | มากกว่า 1 ปี | ใน มากกว่า 1 ปี |
+| 2001-02-01T00:00:00.000Z | ประมาณ 1 ปี | ประมาณ 1 ปี | ใน ประมาณ 1 ปี |
+| 2001-01-01T00:00:00.000Z | ประมาณ 1 ปี | ประมาณ 1 ปี | ใน ประมาณ 1 ปี |
+| 2000-06-01T00:00:00.000Z | 5 เดือน | 5 เดือน | ใน 5 เดือน |
+| 2000-03-01T00:00:00.000Z | 2 เดือน | 2 เดือน | ใน 2 เดือน |
+| 2000-02-01T00:00:00.000Z | ประมาณ 1 เดือน | ประมาณ 1 เดือน | ใน ประมาณ 1 เดือน |
+| 2000-01-15T00:00:00.000Z | 14 วัน | 14 วัน | ใน 14 วัน |
+| 2000-01-02T00:00:00.000Z | 1 วัน | 1 วัน | ใน 1 วัน |
+| 2000-01-01T06:00:00.000Z | ประมาณ 6 ชั่วโมง | ประมาณ 6 ชั่วโมง | ใน ประมาณ 6 ชั่วโมง |
+| 2000-01-01T01:00:00.000Z | ประมาณ 1 ชั่วโมง | ประมาณ 1 ชั่วโมง | ใน ประมาณ 1 ชั่วโมง |
+| 2000-01-01T00:45:00.000Z | ประมาณ 1 ชั่วโมง | ประมาณ 1 ชั่วโมง | ใน ประมาณ 1 ชั่วโมง |
+| 2000-01-01T00:30:00.000Z | 30 นาที | 30 นาที | ใน 30 นาที |
+| 2000-01-01T00:15:00.000Z | 15 นาที | 15 นาที | ใน 15 นาที |
+| 2000-01-01T00:01:00.000Z | 1 นาที | 1 นาที | ใน 1 นาที |
+| 2000-01-01T00:00:25.000Z | น้อยกว่า 1 นาที | ครึ่งนาที | ใน น้อยกว่า 1 นาที |
+| 2000-01-01T00:00:15.000Z | น้อยกว่า 1 นาที | น้อยกว่า 20 วินาที | ใน น้อยกว่า 1 นาที |
+| 2000-01-01T00:00:05.000Z | น้อยกว่า 1 นาที | น้อยกว่า 10 วินาที | ใน น้อยกว่า 1 นาที |
+| 2000-01-01T00:00:00.000Z | น้อยกว่า 1 นาที | น้อยกว่า 5 วินาที | น้อยกว่า 1 นาทีที่ผ่านมา |
+| 1999-12-31T23:59:55.000Z | น้อยกว่า 1 นาที | น้อยกว่า 10 วินาที | น้อยกว่า 1 นาทีที่ผ่านมา |
+| 1999-12-31T23:59:45.000Z | น้อยกว่า 1 นาที | น้อยกว่า 20 วินาที | น้อยกว่า 1 นาทีที่ผ่านมา |
+| 1999-12-31T23:59:35.000Z | น้อยกว่า 1 นาที | ครึ่งนาที | น้อยกว่า 1 นาทีที่ผ่านมา |
+| 1999-12-31T23:59:00.000Z | 1 นาที | 1 นาที | 1 นาทีที่ผ่านมา |
+| 1999-12-31T23:45:00.000Z | 15 นาที | 15 นาที | 15 นาทีที่ผ่านมา |
+| 1999-12-31T23:30:00.000Z | 30 นาที | 30 นาที | 30 นาทีที่ผ่านมา |
+| 1999-12-31T23:15:00.000Z | ประมาณ 1 ชั่วโมง | ประมาณ 1 ชั่วโมง | ประมาณ 1 ชั่วโมงที่ผ่านมา |
+| 1999-12-31T23:00:00.000Z | ประมาณ 1 ชั่วโมง | ประมาณ 1 ชั่วโมง | ประมาณ 1 ชั่วโมงที่ผ่านมา |
+| 1999-12-31T18:00:00.000Z | ประมาณ 6 ชั่วโมง | ประมาณ 6 ชั่วโมง | ประมาณ 6 ชั่วโมงที่ผ่านมา |
+| 1999-12-30T00:00:00.000Z | 2 วัน | 2 วัน | 2 วันที่ผ่านมา |
+| 1999-12-15T00:00:00.000Z | 17 วัน | 17 วัน | 17 วันที่ผ่านมา |
+| 1999-12-01T00:00:00.000Z | ประมาณ 1 เดือน | ประมาณ 1 เดือน | ประมาณ 1 เดือนที่ผ่านมา |
+| 1999-11-01T00:00:00.000Z | 2 เดือน | 2 เดือน | 2 เดือนที่ผ่านมา |
+| 1999-06-01T00:00:00.000Z | 7 เดือน | 7 เดือน | 7 เดือนที่ผ่านมา |
+| 1999-01-01T00:00:00.000Z | ประมาณ 1 ปี | ประมาณ 1 ปี | ประมาณ 1 ปีที่ผ่านมา |
+| 1998-12-01T00:00:00.000Z | ประมาณ 1 ปี | ประมาณ 1 ปี | ประมาณ 1 ปีที่ผ่านมา |
+| 1998-06-01T00:00:00.000Z | มากกว่า 1 ปี | มากกว่า 1 ปี | มากกว่า 1 ปีที่ผ่านมา |
+| 1998-01-01T00:00:00.000Z | ประมาณ 2 ปี | ประมาณ 2 ปี | ประมาณ 2 ปีที่ผ่านมา |
+| 1997-01-01T00:00:00.000Z | ประมาณ 3 ปี | ประมาณ 3 ปี | ประมาณ 3 ปีที่ผ่านมา |
+| 1996-01-01T00:00:00.000Z | ประมาณ 4 ปี | ประมาณ 4 ปี | ประมาณ 4 ปีที่ผ่านมา |
+| 1995-01-01T00:00:00.000Z | ประมาณ 5 ปี | ประมาณ 5 ปี | ประมาณ 5 ปีที่ผ่านมา |
+| 1994-01-01T00:00:00.000Z | ประมาณ 6 ปี | ประมาณ 6 ปี | ประมาณ 6 ปีที่ผ่านมา |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ------------------ | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 ปี | ใน 6 ปี | 52608 ชั่วโมง |
+| 2005-01-01T00:00:00.000Z | 5 ปี | ใน 5 ปี | 43848 ชั่วโมง |
+| 2004-01-01T00:00:00.000Z | 4 ปี | ใน 4 ปี | 35064 ชั่วโมง |
+| 2003-01-01T00:00:00.000Z | 3 ปี | ใน 3 ปี | 26304 ชั่วโมง |
+| 2002-01-01T00:00:00.000Z | 2 ปี | ใน 2 ปี | 17544 ชั่วโมง |
+| 2001-06-01T00:00:00.000Z | 1 ปี | ใน 1 ปี | 12408 ชั่วโมง |
+| 2001-02-01T00:00:00.000Z | 1 ปี | ใน 1 ปี | 9528 ชั่วโมง |
+| 2001-01-01T00:00:00.000Z | 1 ปี | ใน 1 ปี | 8784 ชั่วโมง |
+| 2000-06-01T00:00:00.000Z | 5 เดือน | ใน 5 เดือน | 3648 ชั่วโมง |
+| 2000-03-01T00:00:00.000Z | 2 เดือน | ใน 2 เดือน | 1440 ชั่วโมง |
+| 2000-02-01T00:00:00.000Z | 1 เดือน | ใน 1 เดือน | 744 ชั่วโมง |
+| 2000-01-15T00:00:00.000Z | 14 วัน | ใน 14 วัน | 336 ชั่วโมง |
+| 2000-01-02T00:00:00.000Z | 1 วัน | ใน 1 วัน | 24 ชั่วโมง |
+| 2000-01-01T06:00:00.000Z | 6 ชั่วโมง | ใน 6 ชั่วโมง | 6 ชั่วโมง |
+| 2000-01-01T01:00:00.000Z | 1 ชั่วโมง | ใน 1 ชั่วโมง | 1 ชั่วโมง |
+| 2000-01-01T00:45:00.000Z | 45 นาที | ใน 45 นาที | 1 ชั่วโมง |
+| 2000-01-01T00:30:00.000Z | 30 นาที | ใน 30 นาที | 1 ชั่วโมง |
+| 2000-01-01T00:15:00.000Z | 15 นาที | ใน 15 นาที | 0 ชั่วโมง |
+| 2000-01-01T00:01:00.000Z | 1 นาที | ใน 1 นาที | 0 ชั่วโมง |
+| 2000-01-01T00:00:25.000Z | 25 วินาที | ใน 25 วินาที | 0 ชั่วโมง |
+| 2000-01-01T00:00:15.000Z | 15 วินาที | ใน 15 วินาที | 0 ชั่วโมง |
+| 2000-01-01T00:00:05.000Z | 5 วินาที | ใน 5 วินาที | 0 ชั่วโมง |
+| 2000-01-01T00:00:00.000Z | 0 วินาที | 0 วินาทีที่ผ่านมา | 0 ชั่วโมง |
+| 1999-12-31T23:59:55.000Z | 5 วินาที | 5 วินาทีที่ผ่านมา | 0 ชั่วโมง |
+| 1999-12-31T23:59:45.000Z | 15 วินาที | 15 วินาทีที่ผ่านมา | 0 ชั่วโมง |
+| 1999-12-31T23:59:35.000Z | 25 วินาที | 25 วินาทีที่ผ่านมา | 0 ชั่วโมง |
+| 1999-12-31T23:59:00.000Z | 1 นาที | 1 นาทีที่ผ่านมา | 0 ชั่วโมง |
+| 1999-12-31T23:45:00.000Z | 15 นาที | 15 นาทีที่ผ่านมา | 0 ชั่วโมง |
+| 1999-12-31T23:30:00.000Z | 30 นาที | 30 นาทีที่ผ่านมา | 1 ชั่วโมง |
+| 1999-12-31T23:15:00.000Z | 45 นาที | 45 นาทีที่ผ่านมา | 1 ชั่วโมง |
+| 1999-12-31T23:00:00.000Z | 1 ชั่วโมง | 1 ชั่วโมงที่ผ่านมา | 1 ชั่วโมง |
+| 1999-12-31T18:00:00.000Z | 6 ชั่วโมง | 6 ชั่วโมงที่ผ่านมา | 6 ชั่วโมง |
+| 1999-12-30T00:00:00.000Z | 2 วัน | 2 วันที่ผ่านมา | 48 ชั่วโมง |
+| 1999-12-15T00:00:00.000Z | 17 วัน | 17 วันที่ผ่านมา | 408 ชั่วโมง |
+| 1999-12-01T00:00:00.000Z | 1 เดือน | 1 เดือนที่ผ่านมา | 744 ชั่วโมง |
+| 1999-11-01T00:00:00.000Z | 2 เดือน | 2 เดือนที่ผ่านมา | 1464 ชั่วโมง |
+| 1999-06-01T00:00:00.000Z | 7 เดือน | 7 เดือนที่ผ่านมา | 5136 ชั่วโมง |
+| 1999-01-01T00:00:00.000Z | 1 ปี | 1 ปีที่ผ่านมา | 8760 ชั่วโมง |
+| 1998-12-01T00:00:00.000Z | 1 ปี | 1 ปีที่ผ่านมา | 9504 ชั่วโมง |
+| 1998-06-01T00:00:00.000Z | 2 ปี | 2 ปีที่ผ่านมา | 13896 ชั่วโมง |
+| 1998-01-01T00:00:00.000Z | 2 ปี | 2 ปีที่ผ่านมา | 17520 ชั่วโมง |
+| 1997-01-01T00:00:00.000Z | 3 ปี | 3 ปีที่ผ่านมา | 26280 ชั่วโมง |
+| 1996-01-01T00:00:00.000Z | 4 ปี | 4 ปีที่ผ่านมา | 35064 ชั่วโมง |
+| 1995-01-01T00:00:00.000Z | 5 ปี | 5 ปีที่ผ่านมา | 43824 ชั่วโมง |
+| 1994-01-01T00:00:00.000Z | 6 ปี | 6 ปีที่ผ่านมา | 52584 ชั่วโมง |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | พุธ เวลา 0:00 น. |
+| 2000-01-02T00:00:00.000Z | พรุ่งนี้เวลา 0:00 น. |
+| 2000-01-01T00:00:00.000Z | วันนี้เวลา 0:00 น. |
+| 1999-12-31T00:00:00.000Z | เมื่อวานนี้เวลา 0:00 น. |
+| 1999-12-27T00:00:00.000Z | จันทร์ที่แล้วเวลา 0:00 น. |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/tr/_lib/formatDistance/index.js b/date-fns/src/locale/tr/_lib/formatDistance/index.js
new file mode 100644
index 0000000..7175bb7
--- /dev/null
+++ b/date-fns/src/locale/tr/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'bir saniyeden az',
+ other: '{{count}} saniyeden az'
+ },
+
+ xSeconds: {
+ one: '1 saniye',
+ other: '{{count}} saniye'
+ },
+
+ halfAMinute: 'yarım dakika',
+
+ lessThanXMinutes: {
+ one: 'bir dakikadan az',
+ other: '{{count}} dakikadan az'
+ },
+
+ xMinutes: {
+ one: '1 dakika',
+ other: '{{count}} dakika'
+ },
+
+ aboutXHours: {
+ one: 'yaklaşık 1 saat',
+ other: 'yaklaşık {{count}} saat'
+ },
+
+ xHours: {
+ one: '1 saat',
+ other: '{{count}} saat'
+ },
+
+ xDays: {
+ one: '1 gün',
+ other: '{{count}} gün'
+ },
+
+ aboutXWeeks: {
+ one: 'yaklaşık 1 hafta',
+ other: 'yaklaşık {{count}} hafta'
+ },
+
+ xWeeks: {
+ one: '1 hafta',
+ other: '{{count}} hafta'
+ },
+
+ aboutXMonths: {
+ one: 'yaklaşık 1 ay',
+ other: 'yaklaşık {{count}} ay'
+ },
+
+ xMonths: {
+ one: '1 ay',
+ other: '{{count}} ay'
+ },
+
+ aboutXYears: {
+ one: 'yaklaşık 1 yıl',
+ other: 'yaklaşık {{count}} yıl'
+ },
+
+ xYears: {
+ one: '1 yıl',
+ other: '{{count}} yıl'
+ },
+
+ overXYears: {
+ one: '1 yıldan fazla',
+ other: '{{count}} yıldan fazla'
+ },
+
+ almostXYears: {
+ one: 'neredeyse 1 yıl',
+ other: 'neredeyse {{count}} yıl'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' sonra'
+ } else {
+ return result + ' önce'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/tr/_lib/formatLong/index.js b/date-fns/src/locale/tr/_lib/formatLong/index.js
new file mode 100644
index 0000000..2d2fa1d
--- /dev/null
+++ b/date-fns/src/locale/tr/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'd MMMM y EEEE',
+ long: 'd MMMM y',
+ medium: 'd MMM y',
+ short: 'dd.MM.yyyy'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'saat' {{time}}",
+ long: "{{date}} 'saat' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/tr/_lib/formatRelative/index.js b/date-fns/src/locale/tr/_lib/formatRelative/index.js
new file mode 100644
index 0000000..24a3535
--- /dev/null
+++ b/date-fns/src/locale/tr/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'geçen hafta' eeee 'saat' p",
+ yesterday: "'dün saat' p",
+ today: "'bugün saat' p",
+ tomorrow: "'yarın saat' p",
+ nextWeek: "eeee 'saat' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/tr/_lib/localize/index.js b/date-fns/src/locale/tr/_lib/localize/index.js
new file mode 100644
index 0000000..1f58296
--- /dev/null
+++ b/date-fns/src/locale/tr/_lib/localize/index.js
@@ -0,0 +1,167 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ abbreviated: ['MÖ', 'MS'],
+ narrow: ['MÖ', 'MS'],
+ wide: ['Milattan Önce', 'Milattan Sonra']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1Ç', '2Ç', '3Ç', '4Ç'],
+ wide: ['İlk çeyrek', 'İkinci Çeyrek', 'Üçüncü çeyrek', 'Son çeyrek']
+}
+
+var monthValues = {
+ narrow: ['O', 'Ş', 'M', 'N', 'M', 'H', 'T', 'A', 'E', 'E', 'K', 'A'],
+ abbreviated: [
+ 'Oca',
+ 'Şub',
+ 'Mar',
+ 'Nis',
+ 'May',
+ 'Haz',
+ 'Tem',
+ 'Ağu',
+ 'Eyl',
+ 'Eki',
+ 'Kas',
+ 'Ara'
+ ],
+ wide: [
+ 'Ocak',
+ 'Şubat',
+ 'Mart',
+ 'Nisan',
+ 'Mayıs',
+ 'Haziran',
+ 'Temmuz',
+ 'Ağustos',
+ 'Eylül',
+ 'Ekim',
+ 'Kasım',
+ 'Aralık'
+ ]
+}
+
+var dayValues = {
+ narrow: ['P', 'P', 'S', 'Ç', 'P', 'C', 'C'],
+ short: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
+ abbreviated: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'],
+ wide: [
+ 'Pazar',
+ 'Pazartesi',
+ 'Salı',
+ 'Çarşamba',
+ 'Perşembe',
+ 'Cuma',
+ 'Cumartesi'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'öö',
+ pm: 'ös',
+ midnight: 'gy',
+ noon: 'ö',
+ morning: 'sa',
+ afternoon: 'ös',
+ evening: 'ak',
+ night: 'ge'
+ },
+ abbreviated: {
+ am: 'ÖÖ',
+ pm: 'ÖS',
+ midnight: 'gece yarısı',
+ noon: 'öğle',
+ morning: 'sabah',
+ afternoon: 'öğleden sonra',
+ evening: 'akşam',
+ night: 'gece'
+ },
+ wide: {
+ am: 'Ö.Ö.',
+ pm: 'Ö.S.',
+ midnight: 'gece yarısı',
+ noon: 'öğle',
+ morning: 'sabah',
+ afternoon: 'öğleden sonra',
+ evening: 'akşam',
+ night: 'gece'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'öö',
+ pm: 'ös',
+ midnight: 'gy',
+ noon: 'ö',
+ morning: 'sa',
+ afternoon: 'ös',
+ evening: 'ak',
+ night: 'ge'
+ },
+ abbreviated: {
+ am: 'ÖÖ',
+ pm: 'ÖS',
+ midnight: 'gece yarısı',
+ noon: 'öğlen',
+ morning: 'sabahleyin',
+ afternoon: 'öğleden sonra',
+ evening: 'akşamleyin',
+ night: 'geceleyin'
+ },
+ wide: {
+ am: 'ö.ö.',
+ pm: 'ö.s.',
+ midnight: 'gece yarısı',
+ noon: 'öğlen',
+ morning: 'sabahleyin',
+ afternoon: 'öğleden sonra',
+ evening: 'akşamleyin',
+ night: 'geceleyin'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+ return number + '.'
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaulFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/tr/_lib/match/index.js b/date-fns/src/locale/tr/_lib/match/index.js
new file mode 100644
index 0000000..9eacf0e
--- /dev/null
+++ b/date-fns/src/locale/tr/_lib/match/index.js
@@ -0,0 +1,153 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(\.)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(mö|ms)/i,
+ abbreviated: /^(mö|ms)/i,
+ wide: /^(milattan önce|milattan sonra)/i
+}
+var parseEraPatterns = {
+ any: [/(^mö|^milattan önce)/i, /(^ms|^milattan sonra)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234]ç/i,
+ wide: /^((i|İ)lk|(i|İ)kinci|üçüncü|son) çeyrek/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i],
+ abbreviated: [/1ç/i, /2ç/i, /3ç/i, /4ç/i],
+ wide: [
+ /^(i|İ)lk çeyrek/i,
+ /(i|İ)kinci çeyrek/i,
+ /üçüncü çeyrek/i,
+ /son çeyrek/i
+ ]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[oşmnhtaek]/i,
+ abbreviated: /^(oca|şub|mar|nis|may|haz|tem|ağu|eyl|eki|kas|ara)/i,
+ wide: /^(ocak|şubat|mart|nisan|mayıs|haziran|temmuz|ağustos|eylül|ekim|kasım|aralık)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^o/i,
+ /^ş/i,
+ /^m/i,
+ /^n/i,
+ /^m/i,
+ /^h/i,
+ /^t/i,
+ /^a/i,
+ /^e/i,
+ /^e/i,
+ /^k/i,
+ /^a/i
+ ],
+ any: [
+ /^o/i,
+ /^ş/i,
+ /^mar/i,
+ /^n/i,
+ /^may/i,
+ /^h/i,
+ /^t/i,
+ /^ağ/i,
+ /^ey/i,
+ /^ek/i,
+ /^k/i,
+ /^ar/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[psçc]/i,
+ short: /^(pz|pt|sa|ça|pe|cu|ct)/i,
+ abbreviated: /^(paz|pts|sal|çar|per|cum|cts)/i,
+ wide: /^(pazar|pazartesi|salı|çarşamba|perşembe|cuma|cumartesi)/i
+}
+var parseDayPatterns = {
+ narrow: [/^p/i, /^p/i, /^s/i, /^ç/i, /^p/i, /^c/i, /^c/i],
+ any: [/^pz/i, /^pt/i, /^sa/i, /^ça/i, /^pe/i, /^cu/i, /^ct/i],
+ wide: [
+ /^pazar/i,
+ /^pazartesi/i,
+ /^salı/i,
+ /^çarşamba/i,
+ /^perşembe/i,
+ /^cuma/i,
+ /cumartesi/i
+ ]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(öö|ös|gy|ö|sa|ös|ak|ge)/i,
+ any: /^(ö\.?\s?[ös]\.?|öğleden sonra|gece yarısı|öğle|(sabah|öğ|akşam|gece)(leyin))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^ö\.?ö\.?/i,
+ pm: /^ö\.?s\.?/i,
+ midnight: /^(gy|gece yarısı)/i,
+ noon: /^öğ/i,
+ morning: /^sa/i,
+ afternoon: /^öğleden sonra/i,
+ evening: /^ak/i,
+ night: /^ge/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/tr/index.d.ts b/date-fns/src/locale/tr/index.d.ts
new file mode 100644
index 0000000..d4c2e0a
--- /dev/null
+++ b/date-fns/src/locale/tr/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { tr } from 'date-fns/locale'
+export default tr
diff --git a/date-fns/src/locale/tr/index.js b/date-fns/src/locale/tr/index.js
new file mode 100644
index 0000000..aacae82
--- /dev/null
+++ b/date-fns/src/locale/tr/index.js
@@ -0,0 +1,33 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Turkish locale.
+ * @language Turkish
+ * @iso-639-2 tur
+ * @author Alpcan Aydın [@alpcanaydin]{@link https://github.com/alpcanaydin}
+ * @author Berkay Sargın [@berkaey]{@link https://github.com/berkaey}
+ * @author Ismail Demirbilek [@dbtek]{@link https://github.com/dbtek}
+ * @author İsmail Kayar [@ikayar]{@link https://github.com/ikayar}
+ *
+ *
+ */
+var locale = {
+ code: 'tr',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/tr/index.js.flow b/date-fns/src/locale/tr/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/tr/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/tr/snapshot.md b/date-fns/src/locale/tr/snapshot.md
new file mode 100644
index 0000000..6475e6a
--- /dev/null
+++ b/date-fns/src/locale/tr/snapshot.md
@@ -0,0 +1,304 @@
+# Turkish (tr) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ---------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987. | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987. | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5. | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1Ç | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2Ç | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | İlk çeyrek | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | İkinci Çeyrek | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2. | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1Ç | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2Ç | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | İlk çeyrek | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | İkinci Çeyrek | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Şub | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Tem | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Şubat | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Temmuz | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Ş | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | T | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7. | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Şub | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Tem | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Şubat | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Temmuz | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Ş | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | T | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1. | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48. | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28. | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42. | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365. | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Pts | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Pts | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Pts | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Pt | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cu | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Pts | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Pt | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cu | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Pts | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Pt | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cu | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5. | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Pts | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cum | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Pazartesi | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Cuma | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | P | 2019-02-17T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | C | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Pt | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Cu | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ö.ö. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ö.s. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ö.s. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ö.ö. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ÖS | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ÖÖ | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ö.ö. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ö.s. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ö.s. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ö.ö. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | öö | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | sabahleyin | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | öğleden sonra | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | akşamleyin | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | geceleyin | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | sabahleyin | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | öğleden sonra | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | akşamleyin | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | geceleyin | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | sabahleyin | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | öğleden sonra | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | akşamleyin | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | geceleyin | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | sabahleyin | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | öğleden sonra | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | akşamleyin | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | geceleyin | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | sa | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ös | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ak | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ge | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11. | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11. | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23. | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1. | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55. | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1. | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55. | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Şub 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Şubat 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mayıs 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 11 Şubat 1987 Çarşamba | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 Mayıs 1453 Pazar | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Şub 1987, 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May 1453, 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Şubat 1987 saat 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 Mayıs 1453 saat 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 11 Şubat 1987 Çarşamba saat 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 Mayıs 1453 Pazar saat 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | ---------------------- |
+| 2006-01-01T00:00:00.000Z | yaklaşık 6 yıl | yaklaşık 6 yıl | yaklaşık 6 yıl sonra |
+| 2005-01-01T00:00:00.000Z | yaklaşık 5 yıl | yaklaşık 5 yıl | yaklaşık 5 yıl sonra |
+| 2004-01-01T00:00:00.000Z | yaklaşık 4 yıl | yaklaşık 4 yıl | yaklaşık 4 yıl sonra |
+| 2003-01-01T00:00:00.000Z | yaklaşık 3 yıl | yaklaşık 3 yıl | yaklaşık 3 yıl sonra |
+| 2002-01-01T00:00:00.000Z | yaklaşık 2 yıl | yaklaşık 2 yıl | yaklaşık 2 yıl sonra |
+| 2001-06-01T00:00:00.000Z | 1 yıldan fazla | 1 yıldan fazla | 1 yıldan fazla sonra |
+| 2001-02-01T00:00:00.000Z | yaklaşık 1 yıl | yaklaşık 1 yıl | yaklaşık 1 yıl sonra |
+| 2001-01-01T00:00:00.000Z | yaklaşık 1 yıl | yaklaşık 1 yıl | yaklaşık 1 yıl sonra |
+| 2000-06-01T00:00:00.000Z | 5 ay | 5 ay | 5 ay sonra |
+| 2000-03-01T00:00:00.000Z | 2 ay | 2 ay | 2 ay sonra |
+| 2000-02-01T00:00:00.000Z | yaklaşık 1 ay | yaklaşık 1 ay | yaklaşık 1 ay sonra |
+| 2000-01-15T00:00:00.000Z | 14 gün | 14 gün | 14 gün sonra |
+| 2000-01-02T00:00:00.000Z | 1 gün | 1 gün | 1 gün sonra |
+| 2000-01-01T06:00:00.000Z | yaklaşık 6 saat | yaklaşık 6 saat | yaklaşık 6 saat sonra |
+| 2000-01-01T01:00:00.000Z | yaklaşık 1 saat | yaklaşık 1 saat | yaklaşık 1 saat sonra |
+| 2000-01-01T00:45:00.000Z | yaklaşık 1 saat | yaklaşık 1 saat | yaklaşık 1 saat sonra |
+| 2000-01-01T00:30:00.000Z | 30 dakika | 30 dakika | 30 dakika sonra |
+| 2000-01-01T00:15:00.000Z | 15 dakika | 15 dakika | 15 dakika sonra |
+| 2000-01-01T00:01:00.000Z | 1 dakika | 1 dakika | 1 dakika sonra |
+| 2000-01-01T00:00:25.000Z | bir dakikadan az | yarım dakika | bir dakikadan az sonra |
+| 2000-01-01T00:00:15.000Z | bir dakikadan az | 20 saniyeden az | bir dakikadan az sonra |
+| 2000-01-01T00:00:05.000Z | bir dakikadan az | 10 saniyeden az | bir dakikadan az sonra |
+| 2000-01-01T00:00:00.000Z | bir dakikadan az | 5 saniyeden az | bir dakikadan az önce |
+| 1999-12-31T23:59:55.000Z | bir dakikadan az | 10 saniyeden az | bir dakikadan az önce |
+| 1999-12-31T23:59:45.000Z | bir dakikadan az | 20 saniyeden az | bir dakikadan az önce |
+| 1999-12-31T23:59:35.000Z | bir dakikadan az | yarım dakika | bir dakikadan az önce |
+| 1999-12-31T23:59:00.000Z | 1 dakika | 1 dakika | 1 dakika önce |
+| 1999-12-31T23:45:00.000Z | 15 dakika | 15 dakika | 15 dakika önce |
+| 1999-12-31T23:30:00.000Z | 30 dakika | 30 dakika | 30 dakika önce |
+| 1999-12-31T23:15:00.000Z | yaklaşık 1 saat | yaklaşık 1 saat | yaklaşık 1 saat önce |
+| 1999-12-31T23:00:00.000Z | yaklaşık 1 saat | yaklaşık 1 saat | yaklaşık 1 saat önce |
+| 1999-12-31T18:00:00.000Z | yaklaşık 6 saat | yaklaşık 6 saat | yaklaşık 6 saat önce |
+| 1999-12-30T00:00:00.000Z | 2 gün | 2 gün | 2 gün önce |
+| 1999-12-15T00:00:00.000Z | 17 gün | 17 gün | 17 gün önce |
+| 1999-12-01T00:00:00.000Z | yaklaşık 1 ay | yaklaşık 1 ay | yaklaşık 1 ay önce |
+| 1999-11-01T00:00:00.000Z | 2 ay | 2 ay | 2 ay önce |
+| 1999-06-01T00:00:00.000Z | 7 ay | 7 ay | 7 ay önce |
+| 1999-01-01T00:00:00.000Z | yaklaşık 1 yıl | yaklaşık 1 yıl | yaklaşık 1 yıl önce |
+| 1998-12-01T00:00:00.000Z | yaklaşık 1 yıl | yaklaşık 1 yıl | yaklaşık 1 yıl önce |
+| 1998-06-01T00:00:00.000Z | 1 yıldan fazla | 1 yıldan fazla | 1 yıldan fazla önce |
+| 1998-01-01T00:00:00.000Z | yaklaşık 2 yıl | yaklaşık 2 yıl | yaklaşık 2 yıl önce |
+| 1997-01-01T00:00:00.000Z | yaklaşık 3 yıl | yaklaşık 3 yıl | yaklaşık 3 yıl önce |
+| 1996-01-01T00:00:00.000Z | yaklaşık 4 yıl | yaklaşık 4 yıl | yaklaşık 4 yıl önce |
+| 1995-01-01T00:00:00.000Z | yaklaşık 5 yıl | yaklaşık 5 yıl | yaklaşık 5 yıl önce |
+| 1994-01-01T00:00:00.000Z | yaklaşık 6 yıl | yaklaşık 6 yıl | yaklaşık 6 yıl önce |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 yıl | 6 yıl sonra | 52608 saat |
+| 2005-01-01T00:00:00.000Z | 5 yıl | 5 yıl sonra | 43848 saat |
+| 2004-01-01T00:00:00.000Z | 4 yıl | 4 yıl sonra | 35064 saat |
+| 2003-01-01T00:00:00.000Z | 3 yıl | 3 yıl sonra | 26304 saat |
+| 2002-01-01T00:00:00.000Z | 2 yıl | 2 yıl sonra | 17544 saat |
+| 2001-06-01T00:00:00.000Z | 1 yıl | 1 yıl sonra | 12408 saat |
+| 2001-02-01T00:00:00.000Z | 1 yıl | 1 yıl sonra | 9528 saat |
+| 2001-01-01T00:00:00.000Z | 1 yıl | 1 yıl sonra | 8784 saat |
+| 2000-06-01T00:00:00.000Z | 5 ay | 5 ay sonra | 3648 saat |
+| 2000-03-01T00:00:00.000Z | 2 ay | 2 ay sonra | 1440 saat |
+| 2000-02-01T00:00:00.000Z | 1 ay | 1 ay sonra | 744 saat |
+| 2000-01-15T00:00:00.000Z | 14 gün | 14 gün sonra | 336 saat |
+| 2000-01-02T00:00:00.000Z | 1 gün | 1 gün sonra | 24 saat |
+| 2000-01-01T06:00:00.000Z | 6 saat | 6 saat sonra | 6 saat |
+| 2000-01-01T01:00:00.000Z | 1 saat | 1 saat sonra | 1 saat |
+| 2000-01-01T00:45:00.000Z | 45 dakika | 45 dakika sonra | 1 saat |
+| 2000-01-01T00:30:00.000Z | 30 dakika | 30 dakika sonra | 1 saat |
+| 2000-01-01T00:15:00.000Z | 15 dakika | 15 dakika sonra | 0 saat |
+| 2000-01-01T00:01:00.000Z | 1 dakika | 1 dakika sonra | 0 saat |
+| 2000-01-01T00:00:25.000Z | 25 saniye | 25 saniye sonra | 0 saat |
+| 2000-01-01T00:00:15.000Z | 15 saniye | 15 saniye sonra | 0 saat |
+| 2000-01-01T00:00:05.000Z | 5 saniye | 5 saniye sonra | 0 saat |
+| 2000-01-01T00:00:00.000Z | 0 saniye | 0 saniye önce | 0 saat |
+| 1999-12-31T23:59:55.000Z | 5 saniye | 5 saniye önce | 0 saat |
+| 1999-12-31T23:59:45.000Z | 15 saniye | 15 saniye önce | 0 saat |
+| 1999-12-31T23:59:35.000Z | 25 saniye | 25 saniye önce | 0 saat |
+| 1999-12-31T23:59:00.000Z | 1 dakika | 1 dakika önce | 0 saat |
+| 1999-12-31T23:45:00.000Z | 15 dakika | 15 dakika önce | 0 saat |
+| 1999-12-31T23:30:00.000Z | 30 dakika | 30 dakika önce | 1 saat |
+| 1999-12-31T23:15:00.000Z | 45 dakika | 45 dakika önce | 1 saat |
+| 1999-12-31T23:00:00.000Z | 1 saat | 1 saat önce | 1 saat |
+| 1999-12-31T18:00:00.000Z | 6 saat | 6 saat önce | 6 saat |
+| 1999-12-30T00:00:00.000Z | 2 gün | 2 gün önce | 48 saat |
+| 1999-12-15T00:00:00.000Z | 17 gün | 17 gün önce | 408 saat |
+| 1999-12-01T00:00:00.000Z | 1 ay | 1 ay önce | 744 saat |
+| 1999-11-01T00:00:00.000Z | 2 ay | 2 ay önce | 1464 saat |
+| 1999-06-01T00:00:00.000Z | 7 ay | 7 ay önce | 5136 saat |
+| 1999-01-01T00:00:00.000Z | 1 yıl | 1 yıl önce | 8760 saat |
+| 1998-12-01T00:00:00.000Z | 1 yıl | 1 yıl önce | 9504 saat |
+| 1998-06-01T00:00:00.000Z | 2 yıl | 2 yıl önce | 13896 saat |
+| 1998-01-01T00:00:00.000Z | 2 yıl | 2 yıl önce | 17520 saat |
+| 1997-01-01T00:00:00.000Z | 3 yıl | 3 yıl önce | 26280 saat |
+| 1996-01-01T00:00:00.000Z | 4 yıl | 4 yıl önce | 35064 saat |
+| 1995-01-01T00:00:00.000Z | 5 yıl | 5 yıl önce | 43824 saat |
+| 1994-01-01T00:00:00.000Z | 6 yıl | 6 yıl önce | 52584 saat |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | Çarşamba saat 00:00 |
+| 2000-01-02T00:00:00.000Z | yarın saat 00:00 |
+| 2000-01-01T00:00:00.000Z | bugün saat 00:00 |
+| 1999-12-31T00:00:00.000Z | dün saat 00:00 |
+| 1999-12-27T00:00:00.000Z | geçen hafta Pazartesi saat 00:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/types.ts b/date-fns/src/locale/types.ts
new file mode 100644
index 0000000..b82c227
--- /dev/null
+++ b/date-fns/src/locale/types.ts
@@ -0,0 +1,105 @@
+export interface Locale {
+ code: string
+ formatDistance: FormatDistanceFn
+ formatRelative: FormatRelativeFn
+ localize: Localize
+ formatLong: FormatLong
+ match: Match
+ options?: LocaleOptions
+}
+
+export interface LocaleOptions {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7
+}
+
+export type FormatDistanceFn = (
+ token:
+ | 'lessThanXSeconds'
+ | 'xSeconds'
+ | 'halfAMinute'
+ | 'lessThanXMinutes'
+ | 'xMinutes'
+ | 'aboutXHours'
+ | 'xHours'
+ | 'xDays'
+ | 'aboutXMonths'
+ | 'xMonths'
+ | 'aboutXYears'
+ | 'xYears'
+ | 'overXYears'
+ | 'almostXYears',
+ count: number,
+ options?: {
+ addSuffix?: boolean
+ comparison?: -1 | 0 | 1
+ }
+) => string
+
+export type FormatRelativeFn = (
+ token: 'lastWeek' | 'yesterday' | 'today' | 'tomorrow' | 'nextWeek' | 'other',
+ date: Date | number,
+ baseDate: Date | number,
+ options?: { weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 }
+) => string
+
+export type LocalizeFn<TValue> = (
+ value: TValue,
+ options?: {
+ width?: 'narrow' | 'short' | 'abbreviated' | 'wide'
+ context?: 'formatting' | 'standalone'
+ }
+) => string
+
+export interface Localize {
+ ordinalNumber: LocalizeFn<number>
+ era: LocalizeFn<0 | 1>
+ quarter: LocalizeFn<1 | 2 | 3 | 4>
+ month: LocalizeFn<0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11>
+ day: LocalizeFn<0 | 1 | 2 | 3 | 4 | 5 | 6>
+ dayPeriod: LocalizeFn<
+ | 'am'
+ | 'pm'
+ | 'midnight'
+ | 'noon'
+ | 'morning'
+ | 'afternoon'
+ | 'evening'
+ | 'night'
+ >
+}
+
+export type FormatLongFn = (options?: {
+ width?: 'full' | 'long' | 'medium' | 'short'
+}) => string
+
+export interface FormatLong {
+ date: FormatLongFn
+ time: FormatLongFn
+ dateTime: FormatLongFn
+}
+
+export type MatchFn<TResult> = (
+ str: string,
+ options?: {
+ width?: 'narrow' | 'short' | 'abbreviated' | 'wide'
+ }
+) => TResult
+
+export interface Match {
+ ordinalNumber: MatchFn<number>
+ era: MatchFn<0 | 1>
+ quarter: MatchFn<1 | 2 | 3 | 4>
+ month: MatchFn<0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11>
+ day: MatchFn<0 | 1 | 2 | 3 | 4 | 5 | 6>
+ dayPeriod: MatchFn<
+ | 'am'
+ | 'pm'
+ | 'midnight'
+ | 'noon'
+ | 'morning'
+ | 'afternoon'
+ | 'evening'
+ | 'night'
+ >
+}
diff --git a/date-fns/src/locale/ug/_lib/formatDistance/index.js b/date-fns/src/locale/ug/_lib/formatDistance/index.js
new file mode 100644
index 0000000..4e5906a
--- /dev/null
+++ b/date-fns/src/locale/ug/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'بىر سىكۇنت ئىچىدە',
+ other: 'سىكۇنت ئىچىدە {{count}}'
+ },
+
+ xSeconds: {
+ one: 'بىر سىكۇنت',
+ other: 'سىكۇنت {{count}}'
+ },
+
+ halfAMinute: 'يىرىم مىنۇت',
+
+ lessThanXMinutes: {
+ one: 'بىر مىنۇت ئىچىدە',
+ other: 'مىنۇت ئىچىدە {{count}}'
+ },
+
+ xMinutes: {
+ one: 'بىر مىنۇت',
+ other: 'مىنۇت {{count}}'
+ },
+
+ aboutXHours: {
+ one: 'تەخمىنەن بىر سائەت',
+ other: 'سائەت {{count}} تەخمىنەن'
+ },
+
+ xHours: {
+ one: 'بىر سائەت',
+ other: 'سائەت {{count}}'
+ },
+
+ xDays: {
+ one: 'بىر كۈن',
+ other: 'كۈن {{count}}'
+ },
+
+ aboutXWeeks: {
+ one: 'تەخمىنەن بىرھەپتە',
+ other: 'ھەپتە {{count}} تەخمىنەن'
+ },
+
+ xWeeks: {
+ one: 'بىرھەپتە',
+ other: 'ھەپتە {{count}}'
+ },
+
+ aboutXMonths: {
+ one: 'تەخمىنەن بىر ئاي',
+ other: 'ئاي {{count}} تەخمىنەن'
+ },
+
+ xMonths: {
+ one: 'بىر ئاي',
+ other: 'ئاي {{count}}'
+ },
+
+ aboutXYears: {
+ one: 'تەخمىنەن بىر يىل',
+ other: 'يىل {{count}} تەخمىنەن'
+ },
+
+ xYears: {
+ one: 'بىر يىل',
+ other: 'يىل {{count}}'
+ },
+
+ overXYears: {
+ one: 'بىر يىلدىن ئارتۇق',
+ other: 'يىلدىن ئارتۇق {{count}}'
+ },
+
+ almostXYears: {
+ one: 'ئاساسەن بىر يىل',
+ other: 'يىل {{count}} ئاساسەن'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result
+ } else {
+ return result + ' بولدى'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/ug/_lib/formatLong/index.js b/date-fns/src/locale/ug/_lib/formatLong/index.js
new file mode 100644
index 0000000..4d9f0fc
--- /dev/null
+++ b/date-fns/src/locale/ug/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, MMMM do, y',
+ long: 'MMMM do, y',
+ medium: 'MMM d, y',
+ short: 'MM/dd/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss a zzzz',
+ long: 'h:mm:ss a z',
+ medium: 'h:mm:ss a',
+ short: 'h:mm a'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'دە' {{time}}",
+ long: "{{date}} 'دە' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/ug/_lib/formatRelative/index.js b/date-fns/src/locale/ug/_lib/formatRelative/index.js
new file mode 100644
index 0000000..849585f
--- /dev/null
+++ b/date-fns/src/locale/ug/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'ئ‍ۆتكەن' eeee 'دە' p",
+ yesterday: "'تۈنۈگۈن دە' p",
+ today: "'بۈگۈن دە' p",
+ tomorrow: "'ئەتە دە' p",
+ nextWeek: "eeee 'دە' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/ug/_lib/localize/index.js b/date-fns/src/locale/ug/_lib/localize/index.js
new file mode 100644
index 0000000..73da2b9
--- /dev/null
+++ b/date-fns/src/locale/ug/_lib/localize/index.js
@@ -0,0 +1,177 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['ب', 'ك'],
+ abbreviated: ['ب', 'ك'],
+ wide: ['مىيلادىدىن بۇرۇن', 'مىيلادىدىن كىيىن']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1', '2', '3', '4'],
+ wide: ['بىرىنجى چارەك', 'ئىككىنجى چارەك', 'ئۈچىنجى چارەك', 'تۆتىنجى چارەك']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['ي', 'ف', 'م', 'ا', 'م', 'ى', 'ى', 'ا', 'س', 'ۆ', 'ن', 'د'],
+ abbreviated: [
+ 'يانۋار',
+ 'فېۋىرال',
+ 'مارت',
+ 'ئاپرىل',
+ 'ماي',
+ 'ئىيۇن',
+ 'ئىيول',
+ 'ئاۋغۇست',
+ 'سىنتەبىر',
+ 'ئۆكتەبىر',
+ 'نويابىر',
+ 'دىكابىر'
+ ],
+ wide: [
+ 'يانۋار',
+ 'فېۋىرال',
+ 'مارت',
+ 'ئاپرىل',
+ 'ماي',
+ 'ئىيۇن',
+ 'ئىيول',
+ 'ئاۋغۇست',
+ 'سىنتەبىر',
+ 'ئۆكتەبىر',
+ 'نويابىر',
+ 'دىكابىر'
+ ]
+}
+
+var dayValues = {
+ narrow: ['ي', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
+ short: ['ي', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
+ abbreviated: [
+ 'يەكشەنبە',
+ 'دۈشەنبە',
+ 'سەيشەنبە',
+ 'چارشەنبە',
+ 'پەيشەنبە',
+ 'جۈمە',
+ 'شەنبە'
+ ],
+ wide: [
+ 'يەكشەنبە',
+ 'دۈشەنبە',
+ 'سەيشەنبە',
+ 'چارشەنبە',
+ 'پەيشەنبە',
+ 'جۈمە',
+ 'شەنبە'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ئە',
+ pm: 'چ',
+ midnight: 'ك',
+ noon: 'چ',
+ morning: 'ئەتىگەن',
+ afternoon: 'چۈشتىن كىيىن',
+ evening: 'ئاخشىم',
+ night: 'كىچە'
+ },
+ abbreviated: {
+ am: 'ئە',
+ pm: 'چ',
+ midnight: 'ك',
+ noon: 'چ',
+ morning: 'ئەتىگەن',
+ afternoon: 'چۈشتىن كىيىن',
+ evening: 'ئاخشىم',
+ night: 'كىچە'
+ },
+ wide: {
+ am: 'ئە',
+ pm: 'چ',
+ midnight: 'ك',
+ noon: 'چ',
+ morning: 'ئەتىگەن',
+ afternoon: 'چۈشتىن كىيىن',
+ evening: 'ئاخشىم',
+ night: 'كىچە'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ئە',
+ pm: 'چ',
+ midnight: 'ك',
+ noon: 'چ',
+ morning: 'ئەتىگەندە',
+ afternoon: 'چۈشتىن كىيىن',
+ evening: 'ئاخشامدا',
+ night: 'كىچىدە'
+ },
+ abbreviated: {
+ am: 'ئە',
+ pm: 'چ',
+ midnight: 'ك',
+ noon: 'چ',
+ morning: 'ئەتىگەندە',
+ afternoon: 'چۈشتىن كىيىن',
+ evening: 'ئاخشامدا',
+ night: 'كىچىدە'
+ },
+ wide: {
+ am: 'ئە',
+ pm: 'چ',
+ midnight: 'ك',
+ noon: 'چ',
+ morning: 'ئەتىگەندە',
+ afternoon: 'چۈشتىن كىيىن',
+ evening: 'ئاخشامدا',
+ night: 'كىچىدە'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ return String(dirtyNumber)
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/ug/_lib/match/index.js b/date-fns/src/locale/ug/_lib/match/index.js
new file mode 100644
index 0000000..76b722d
--- /dev/null
+++ b/date-fns/src/locale/ug/_lib/match/index.js
@@ -0,0 +1,136 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(ب|ك)/i,
+ wide: /^(مىيلادىدىن بۇرۇن|مىيلادىدىن كىيىن)/i
+}
+var parseEraPatterns = {
+ any: [/^بۇرۇن/i, /^كىيىن/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^چ[1234]/i,
+ wide: /^چارەك [1234]/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[يفمئامئ‍ئاسۆند]/i,
+ abbreviated: /^(يانۋار|فېۋىرال|مارت|ئاپرىل|ماي|ئىيۇن|ئىيول|ئاۋغۇست|سىنتەبىر|ئۆكتەبىر|نويابىر|دىكابىر)/i,
+ wide: /^(يانۋار|فېۋىرال|مارت|ئاپرىل|ماي|ئىيۇن|ئىيول|ئاۋغۇست|سىنتەبىر|ئۆكتەبىر|نويابىر|دىكابىر)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^ي/i,
+ /^ف/i,
+ /^م/i,
+ /^ا/i,
+ /^م/i,
+ /^ى‍/i,
+ /^ى‍/i,
+ /^ا‍/i,
+ /^س/i,
+ /^ۆ/i,
+ /^ن/i,
+ /^د/i
+ ],
+ any: [
+ /^يان/i,
+ /^فېۋ/i,
+ /^مار/i,
+ /^ئاپ/i,
+ /^ماي/i,
+ /^ئىيۇن/i,
+ /^ئىيول/i,
+ /^ئاۋ/i,
+ /^سىن/i,
+ /^ئۆك/i,
+ /^نوي/i,
+ /^دىك/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[دسچپجشي]/i,
+ short: /^(يە|دۈ|سە|چا|پە|جۈ|شە)/i,
+ abbreviated: /^(يە|دۈ|سە|چا|پە|جۈ|شە)/i,
+ wide: /^(يەكشەنبە|دۈشەنبە|سەيشەنبە|چارشەنبە|پەيشەنبە|جۈمە|شەنبە)/i
+}
+var parseDayPatterns = {
+ narrow: [/^ي/i, /^د/i, /^س/i, /^چ/i, /^پ/i, /^ج/i, /^ش/i],
+ any: [/^ي/i, /^د/i, /^س/i, /^چ/i, /^پ/i, /^ج/i, /^ش/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(ئە|چ|ك|چ|(دە|ئەتىگەن) ( ئە‍|چۈشتىن كىيىن|ئاخشىم|كىچە))/i,
+ any: /^(ئە|چ|ك|چ|(دە|ئەتىگەن) ( ئە‍|چۈشتىن كىيىن|ئاخشىم|كىچە))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^ئە/i,
+ pm: /^چ/i,
+ midnight: /^ك/i,
+ noon: /^چ/i,
+ morning: /ئەتىگەن/i,
+ afternoon: /چۈشتىن كىيىن/i,
+ evening: /ئاخشىم/i,
+ night: /كىچە/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/ug/index.d.ts b/date-fns/src/locale/ug/index.d.ts
new file mode 100644
index 0000000..a67a679
--- /dev/null
+++ b/date-fns/src/locale/ug/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { ug } from 'date-fns/locale'
+export default ug
diff --git a/date-fns/src/locale/ug/index.js b/date-fns/src/locale/ug/index.js
new file mode 100644
index 0000000..63b4cf1
--- /dev/null
+++ b/date-fns/src/locale/ug/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Uighur locale
+ * @language Uighur
+ * @iso-639-2 uig
+ * @author Abduwaly M. [@abduwaly]{@link https://github.com/abduwaly}
+ */
+var locale = {
+ code: 'ug',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 0 /* Sunday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/ug/index.js.flow b/date-fns/src/locale/ug/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/ug/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/ug/snapshot.md b/date-fns/src/locale/ug/snapshot.md
new file mode 100644
index 0000000..1eb8440
--- /dev/null
+++ b/date-fns/src/locale/ug/snapshot.md
@@ -0,0 +1,304 @@
+# Uighur (ug) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | -------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-28T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-26T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | بىرىنجى چارەك | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | ئىككىنجى چارەك | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | بىرىنجى چارەك | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | ئىككىنجى چارەك | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | فېۋىرال | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ئىيول | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | فېۋىرال | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ئىيول | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ى | Invalid Date |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | فېۋىرال | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ئىيول | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | فېۋىرال | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ئىيول | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | ف | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | ى | Invalid Date |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-30T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 49 | 2019-12-01T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | دۈشەنبە | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | دۈشەنبە | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | دۈشەنبە | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | دۈشەنبە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | دۈشەنبە | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | دۈشەنبە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | دۈشەنبە | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | دۈشەنبە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 6 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | دۈشەنبە | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | دۈشەنبە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | جۈمە | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | د | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | ج | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | چ | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ئە | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ئەتىگەندە | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | چۈشتىن كىيىن | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ئاخشامدا | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | كىچىدە | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | ئەتىگەندە | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | چۈشتىن كىيىن | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ئاخشامدا | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | كىچىدە | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | ئەتىگەندە | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | چۈشتىن كىيىن | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ئاخشامدا | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | كىچىدە | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | ئەتىگەندە | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | چۈشتىن كىيىن | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ئاخشامدا | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | كىچىدە | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ئەتىگەندە | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | چۈشتىن كىيىن | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | ئاخشامدا | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | كىچىدە | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 02/11/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | فېۋىرال 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | فېۋىرال 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | چارشەنبە, فېۋىرال 11, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | يەكشەنبە, ماي 29, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 چ | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 چ | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 چ | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 چ | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 چ GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 چ GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 چ GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 چ GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 02/11/1987, 12:13 چ | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 05/29/1453, 11:59 چ | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | فېۋىرال 11, 1987, 12:13:14 چ | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453, 11:59:59 چ | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | فېۋىرال 11, 1987 دە 12:13:14 چ GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | ماي 29, 1453 دە 11:59:59 چ GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | چارشەنبە, فېۋىرال 11, 1987 دە 12:13:14 چ GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | يەكشەنبە, ماي 29, 1453 دە 11:59:59 چ GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ------------------ | ---------------------- | ------------------------ |
+| 2006-01-01T00:00:00.000Z | يىل 6 تەخمىنەن | يىل 6 تەخمىنەن | يىل 6 تەخمىنەن |
+| 2005-01-01T00:00:00.000Z | يىل 5 تەخمىنەن | يىل 5 تەخمىنەن | يىل 5 تەخمىنەن |
+| 2004-01-01T00:00:00.000Z | يىل 4 تەخمىنەن | يىل 4 تەخمىنەن | يىل 4 تەخمىنەن |
+| 2003-01-01T00:00:00.000Z | يىل 3 تەخمىنەن | يىل 3 تەخمىنەن | يىل 3 تەخمىنەن |
+| 2002-01-01T00:00:00.000Z | يىل 2 تەخمىنەن | يىل 2 تەخمىنەن | يىل 2 تەخمىنەن |
+| 2001-06-01T00:00:00.000Z | بىر يىلدىن ئارتۇق | بىر يىلدىن ئارتۇق | بىر يىلدىن ئارتۇق |
+| 2001-02-01T00:00:00.000Z | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل |
+| 2001-01-01T00:00:00.000Z | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل |
+| 2000-06-01T00:00:00.000Z | ئاي 5 | ئاي 5 | ئاي 5 |
+| 2000-03-01T00:00:00.000Z | ئاي 2 | ئاي 2 | ئاي 2 |
+| 2000-02-01T00:00:00.000Z | تەخمىنەن بىر ئاي | تەخمىنەن بىر ئاي | تەخمىنەن بىر ئاي |
+| 2000-01-15T00:00:00.000Z | كۈن 14 | كۈن 14 | كۈن 14 |
+| 2000-01-02T00:00:00.000Z | بىر كۈن | بىر كۈن | بىر كۈن |
+| 2000-01-01T06:00:00.000Z | سائەت 6 تەخمىنەن | سائەت 6 تەخمىنەن | سائەت 6 تەخمىنەن |
+| 2000-01-01T01:00:00.000Z | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت |
+| 2000-01-01T00:45:00.000Z | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت |
+| 2000-01-01T00:30:00.000Z | مىنۇت 30 | مىنۇت 30 | مىنۇت 30 |
+| 2000-01-01T00:15:00.000Z | مىنۇت 15 | مىنۇت 15 | مىنۇت 15 |
+| 2000-01-01T00:01:00.000Z | بىر مىنۇت | بىر مىنۇت | بىر مىنۇت |
+| 2000-01-01T00:00:25.000Z | بىر مىنۇت ئىچىدە | يىرىم مىنۇت | بىر مىنۇت ئىچىدە |
+| 2000-01-01T00:00:15.000Z | بىر مىنۇت ئىچىدە | سىكۇنت ئىچىدە 20 | بىر مىنۇت ئىچىدە |
+| 2000-01-01T00:00:05.000Z | بىر مىنۇت ئىچىدە | سىكۇنت ئىچىدە 10 | بىر مىنۇت ئىچىدە |
+| 2000-01-01T00:00:00.000Z | بىر مىنۇت ئىچىدە | سىكۇنت ئىچىدە 5 | بىر مىنۇت ئىچىدە بولدى |
+| 1999-12-31T23:59:55.000Z | بىر مىنۇت ئىچىدە | سىكۇنت ئىچىدە 10 | بىر مىنۇت ئىچىدە بولدى |
+| 1999-12-31T23:59:45.000Z | بىر مىنۇت ئىچىدە | سىكۇنت ئىچىدە 20 | بىر مىنۇت ئىچىدە بولدى |
+| 1999-12-31T23:59:35.000Z | بىر مىنۇت ئىچىدە | يىرىم مىنۇت | بىر مىنۇت ئىچىدە بولدى |
+| 1999-12-31T23:59:00.000Z | بىر مىنۇت | بىر مىنۇت | بىر مىنۇت بولدى |
+| 1999-12-31T23:45:00.000Z | مىنۇت 15 | مىنۇت 15 | مىنۇت 15 بولدى |
+| 1999-12-31T23:30:00.000Z | مىنۇت 30 | مىنۇت 30 | مىنۇت 30 بولدى |
+| 1999-12-31T23:15:00.000Z | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت بولدى |
+| 1999-12-31T23:00:00.000Z | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت | تەخمىنەن بىر سائەت بولدى |
+| 1999-12-31T18:00:00.000Z | سائەت 6 تەخمىنەن | سائەت 6 تەخمىنەن | سائەت 6 تەخمىنەن بولدى |
+| 1999-12-30T00:00:00.000Z | كۈن 2 | كۈن 2 | كۈن 2 بولدى |
+| 1999-12-15T00:00:00.000Z | كۈن 17 | كۈن 17 | كۈن 17 بولدى |
+| 1999-12-01T00:00:00.000Z | تەخمىنەن بىر ئاي | تەخمىنەن بىر ئاي | تەخمىنەن بىر ئاي بولدى |
+| 1999-11-01T00:00:00.000Z | ئاي 2 | ئاي 2 | ئاي 2 بولدى |
+| 1999-06-01T00:00:00.000Z | ئاي 7 | ئاي 7 | ئاي 7 بولدى |
+| 1999-01-01T00:00:00.000Z | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل بولدى |
+| 1998-12-01T00:00:00.000Z | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل | تەخمىنەن بىر يىل بولدى |
+| 1998-06-01T00:00:00.000Z | بىر يىلدىن ئارتۇق | بىر يىلدىن ئارتۇق | بىر يىلدىن ئارتۇق بولدى |
+| 1998-01-01T00:00:00.000Z | يىل 2 تەخمىنەن | يىل 2 تەخمىنەن | يىل 2 تەخمىنەن بولدى |
+| 1997-01-01T00:00:00.000Z | يىل 3 تەخمىنەن | يىل 3 تەخمىنەن | يىل 3 تەخمىنەن بولدى |
+| 1996-01-01T00:00:00.000Z | يىل 4 تەخمىنەن | يىل 4 تەخمىنەن | يىل 4 تەخمىنەن بولدى |
+| 1995-01-01T00:00:00.000Z | يىل 5 تەخمىنەن | يىل 5 تەخمىنەن | يىل 5 تەخمىنەن بولدى |
+| 1994-01-01T00:00:00.000Z | يىل 6 تەخمىنەن | يىل 6 تەخمىنەن | يىل 6 تەخمىنەن بولدى |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | يىل 6 | يىل 6 | سائەت 52608 |
+| 2005-01-01T00:00:00.000Z | يىل 5 | يىل 5 | سائەت 43848 |
+| 2004-01-01T00:00:00.000Z | يىل 4 | يىل 4 | سائەت 35064 |
+| 2003-01-01T00:00:00.000Z | يىل 3 | يىل 3 | سائەت 26304 |
+| 2002-01-01T00:00:00.000Z | يىل 2 | يىل 2 | سائەت 17544 |
+| 2001-06-01T00:00:00.000Z | بىر يىل | بىر يىل | سائەت 12408 |
+| 2001-02-01T00:00:00.000Z | بىر يىل | بىر يىل | سائەت 9528 |
+| 2001-01-01T00:00:00.000Z | بىر يىل | بىر يىل | سائەت 8784 |
+| 2000-06-01T00:00:00.000Z | ئاي 5 | ئاي 5 | سائەت 3648 |
+| 2000-03-01T00:00:00.000Z | ئاي 2 | ئاي 2 | سائەت 1440 |
+| 2000-02-01T00:00:00.000Z | بىر ئاي | بىر ئاي | سائەت 744 |
+| 2000-01-15T00:00:00.000Z | كۈن 14 | كۈن 14 | سائەت 336 |
+| 2000-01-02T00:00:00.000Z | بىر كۈن | بىر كۈن | سائەت 24 |
+| 2000-01-01T06:00:00.000Z | سائەت 6 | سائەت 6 | سائەت 6 |
+| 2000-01-01T01:00:00.000Z | بىر سائەت | بىر سائەت | بىر سائەت |
+| 2000-01-01T00:45:00.000Z | مىنۇت 45 | مىنۇت 45 | بىر سائەت |
+| 2000-01-01T00:30:00.000Z | مىنۇت 30 | مىنۇت 30 | بىر سائەت |
+| 2000-01-01T00:15:00.000Z | مىنۇت 15 | مىنۇت 15 | سائەت 0 |
+| 2000-01-01T00:01:00.000Z | بىر مىنۇت | بىر مىنۇت | سائەت 0 |
+| 2000-01-01T00:00:25.000Z | سىكۇنت 25 | سىكۇنت 25 | سائەت 0 |
+| 2000-01-01T00:00:15.000Z | سىكۇنت 15 | سىكۇنت 15 | سائەت 0 |
+| 2000-01-01T00:00:05.000Z | سىكۇنت 5 | سىكۇنت 5 | سائەت 0 |
+| 2000-01-01T00:00:00.000Z | سىكۇنت 0 | سىكۇنت 0 بولدى | سائەت 0 |
+| 1999-12-31T23:59:55.000Z | سىكۇنت 5 | سىكۇنت 5 بولدى | سائەت 0 |
+| 1999-12-31T23:59:45.000Z | سىكۇنت 15 | سىكۇنت 15 بولدى | سائەت 0 |
+| 1999-12-31T23:59:35.000Z | سىكۇنت 25 | سىكۇنت 25 بولدى | سائەت 0 |
+| 1999-12-31T23:59:00.000Z | بىر مىنۇت | بىر مىنۇت بولدى | سائەت 0 |
+| 1999-12-31T23:45:00.000Z | مىنۇت 15 | مىنۇت 15 بولدى | سائەت 0 |
+| 1999-12-31T23:30:00.000Z | مىنۇت 30 | مىنۇت 30 بولدى | بىر سائەت |
+| 1999-12-31T23:15:00.000Z | مىنۇت 45 | مىنۇت 45 بولدى | بىر سائەت |
+| 1999-12-31T23:00:00.000Z | بىر سائەت | بىر سائەت بولدى | بىر سائەت |
+| 1999-12-31T18:00:00.000Z | سائەت 6 | سائەت 6 بولدى | سائەت 6 |
+| 1999-12-30T00:00:00.000Z | كۈن 2 | كۈن 2 بولدى | سائەت 48 |
+| 1999-12-15T00:00:00.000Z | كۈن 17 | كۈن 17 بولدى | سائەت 408 |
+| 1999-12-01T00:00:00.000Z | بىر ئاي | بىر ئاي بولدى | سائەت 744 |
+| 1999-11-01T00:00:00.000Z | ئاي 2 | ئاي 2 بولدى | سائەت 1464 |
+| 1999-06-01T00:00:00.000Z | ئاي 7 | ئاي 7 بولدى | سائەت 5136 |
+| 1999-01-01T00:00:00.000Z | بىر يىل | بىر يىل بولدى | سائەت 8760 |
+| 1998-12-01T00:00:00.000Z | بىر يىل | بىر يىل بولدى | سائەت 9504 |
+| 1998-06-01T00:00:00.000Z | يىل 2 | يىل 2 بولدى | سائەت 13896 |
+| 1998-01-01T00:00:00.000Z | يىل 2 | يىل 2 بولدى | سائەت 17520 |
+| 1997-01-01T00:00:00.000Z | يىل 3 | يىل 3 بولدى | سائەت 26280 |
+| 1996-01-01T00:00:00.000Z | يىل 4 | يىل 4 بولدى | سائەت 35064 |
+| 1995-01-01T00:00:00.000Z | يىل 5 | يىل 5 بولدى | سائەت 43824 |
+| 1994-01-01T00:00:00.000Z | يىل 6 | يىل 6 بولدى | سائەت 52584 |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------------- |
+| 2000-01-10T00:00:00.000Z | 01/10/2000 |
+| 2000-01-05T00:00:00.000Z | چارشەنبە دە 12:00 ئە |
+| 2000-01-02T00:00:00.000Z | ئەتە دە 12:00 ئە |
+| 2000-01-01T00:00:00.000Z | بۈگۈن دە 12:00 ئە |
+| 1999-12-31T00:00:00.000Z | تۈنۈگۈن دە 12:00 ئە |
+| 1999-12-27T00:00:00.000Z | ئ‍ۆتكەن دۈشەنبە دە 12:00 ئە |
+| 1999-12-21T00:00:00.000Z | 12/21/1999 |
diff --git a/date-fns/src/locale/uk/_lib/formatDistance/index.js b/date-fns/src/locale/uk/_lib/formatDistance/index.js
new file mode 100644
index 0000000..dcf337b
--- /dev/null
+++ b/date-fns/src/locale/uk/_lib/formatDistance/index.js
@@ -0,0 +1,247 @@
+function declension(scheme, count) {
+ // scheme for count=1 exists
+ if (scheme.one !== undefined && count === 1) {
+ return scheme.one
+ }
+
+ var rem10 = count % 10
+ var rem100 = count % 100
+
+ // 1, 21, 31, ...
+ if (rem10 === 1 && rem100 !== 11) {
+ return scheme.singularNominative.replace('{{count}}', count)
+
+ // 2, 3, 4, 22, 23, 24, 32 ...
+ } else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
+ return scheme.singularGenitive.replace('{{count}}', count)
+
+ // 5, 6, 7, 8, 9, 10, 11, ...
+ } else {
+ return scheme.pluralGenitive.replace('{{count}}', count)
+ }
+}
+
+function buildLocalizeTokenFn(scheme) {
+ return function(count, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ if (scheme.future) {
+ return declension(scheme.future, count)
+ } else {
+ return 'за ' + declension(scheme.regular, count)
+ }
+ } else {
+ if (scheme.past) {
+ return declension(scheme.past, count)
+ } else {
+ return declension(scheme.regular, count) + ' тому'
+ }
+ }
+ } else {
+ return declension(scheme.regular, count)
+ }
+ }
+}
+
+var formatDistanceLocale = {
+ lessThanXSeconds: buildLocalizeTokenFn({
+ regular: {
+ one: 'менше секунди',
+ singularNominative: 'менше {{count}} секунди',
+ singularGenitive: 'менше {{count}} секунд',
+ pluralGenitive: 'менше {{count}} секунд'
+ },
+ future: {
+ one: 'менше, ніж за секунду',
+ singularNominative: 'менше, ніж за {{count}} секунду',
+ singularGenitive: 'менше, ніж за {{count}} секунди',
+ pluralGenitive: 'менше, ніж за {{count}} секунд'
+ }
+ }),
+
+ xSeconds: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} секунда',
+ singularGenitive: '{{count}} секунди',
+ pluralGenitive: '{{count}} секунд'
+ },
+ past: {
+ singularNominative: '{{count}} секунду тому',
+ singularGenitive: '{{count}} секунди тому',
+ pluralGenitive: '{{count}} секунд тому'
+ },
+ future: {
+ singularNominative: 'за {{count}} секунду',
+ singularGenitive: 'за {{count}} секунди',
+ pluralGenitive: 'за {{count}} секунд'
+ }
+ }),
+
+ halfAMinute: function(_, options) {
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return 'за півхвилини'
+ } else {
+ return 'півхвилини тому'
+ }
+ }
+
+ return 'півхвилини'
+ },
+
+ lessThanXMinutes: buildLocalizeTokenFn({
+ regular: {
+ one: 'менше хвилини',
+ singularNominative: 'менше {{count}} хвилини',
+ singularGenitive: 'менше {{count}} хвилин',
+ pluralGenitive: 'менше {{count}} хвилин'
+ },
+ future: {
+ one: 'менше, ніж за хвилину',
+ singularNominative: 'менше, ніж за {{count}} хвилину',
+ singularGenitive: 'менше, ніж за {{count}} хвилини',
+ pluralGenitive: 'менше, ніж за {{count}} хвилин'
+ }
+ }),
+
+ xMinutes: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} хвилина',
+ singularGenitive: '{{count}} хвилини',
+ pluralGenitive: '{{count}} хвилин'
+ },
+ past: {
+ singularNominative: '{{count}} хвилину тому',
+ singularGenitive: '{{count}} хвилини тому',
+ pluralGenitive: '{{count}} хвилин тому'
+ },
+ future: {
+ singularNominative: 'за {{count}} хвилину',
+ singularGenitive: 'за {{count}} хвилини',
+ pluralGenitive: 'за {{count}} хвилин'
+ }
+ }),
+
+ aboutXHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'близько {{count}} години',
+ singularGenitive: 'близько {{count}} годин',
+ pluralGenitive: 'близько {{count}} годин'
+ },
+ future: {
+ singularNominative: 'приблизно за {{count}} годину',
+ singularGenitive: 'приблизно за {{count}} години',
+ pluralGenitive: 'приблизно за {{count}} годин'
+ }
+ }),
+
+ xHours: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} годину',
+ singularGenitive: '{{count}} години',
+ pluralGenitive: '{{count}} годин'
+ }
+ }),
+
+ xDays: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} день',
+ singularGenitive: '{{count}} дня',
+ pluralGenitive: '{{count}} днів'
+ }
+ }),
+
+ aboutXWeeks: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'близько {{count}} тижня',
+ singularGenitive: 'близько {{count}} тижнів',
+ pluralGenitive: 'близько {{count}} тижнів'
+ },
+ future: {
+ singularNominative: 'приблизно за {{count}} тиждень',
+ singularGenitive: 'приблизно за {{count}} тижні',
+ pluralGenitive: 'приблизно за {{count}} тижні'
+ }
+ }),
+
+ xWeeks: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} тиждень',
+ singularGenitive: '{{count}} тижня',
+ pluralGenitive: '{{count}} тижні'
+ }
+ }),
+
+ aboutXMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'близько {{count}} місяця',
+ singularGenitive: 'близько {{count}} місяців',
+ pluralGenitive: 'близько {{count}} місяців'
+ },
+ future: {
+ singularNominative: 'приблизно за {{count}} місяць',
+ singularGenitive: 'приблизно за {{count}} місяця',
+ pluralGenitive: 'приблизно за {{count}} місяців'
+ }
+ }),
+
+ xMonths: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} місяць',
+ singularGenitive: '{{count}} місяця',
+ pluralGenitive: '{{count}} місяців'
+ }
+ }),
+
+ aboutXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'близько {{count}} року',
+ singularGenitive: 'близько {{count}} років',
+ pluralGenitive: 'близько {{count}} років'
+ },
+ future: {
+ singularNominative: 'приблизно за {{count}} рік',
+ singularGenitive: 'приблизно за {{count}} роки',
+ pluralGenitive: 'приблизно за {{count}} років'
+ }
+ }),
+
+ xYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: '{{count}} рік',
+ singularGenitive: '{{count}} роки',
+ pluralGenitive: '{{count}} років'
+ }
+ }),
+
+ overXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'більше {{count}} року',
+ singularGenitive: 'більше {{count}} років',
+ pluralGenitive: 'більше {{count}} років'
+ },
+ future: {
+ singularNominative: 'більше, ніж за {{count}} рік',
+ singularGenitive: 'більше, ніж за {{count}} роки',
+ pluralGenitive: 'більше, ніж за {{count}} років'
+ }
+ }),
+
+ almostXYears: buildLocalizeTokenFn({
+ regular: {
+ singularNominative: 'майже {{count}} рік',
+ singularGenitive: 'майже {{count}} роки',
+ pluralGenitive: 'майже {{count}} років'
+ },
+ future: {
+ singularNominative: 'майже за {{count}} рік',
+ singularGenitive: 'майже за {{count}} роки',
+ pluralGenitive: 'майже за {{count}} років'
+ }
+ })
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+ return formatDistanceLocale[token](count, options)
+}
diff --git a/date-fns/src/locale/uk/_lib/formatLong/index.js b/date-fns/src/locale/uk/_lib/formatLong/index.js
new file mode 100644
index 0000000..5edcf4c
--- /dev/null
+++ b/date-fns/src/locale/uk/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "EEEE, do MMMM y 'р.'",
+ long: "do MMMM y 'р.'",
+ medium: "d MMM y 'р.'",
+ short: 'dd.MM.y'
+}
+
+var timeFormats = {
+ full: 'H:mm:ss zzzz',
+ long: 'H:mm:ss z',
+ medium: 'H:mm:ss',
+ short: 'H:mm'
+}
+
+var dateTimeFormats = {
+ full: "{{date}} 'о' {{time}}",
+ long: "{{date}} 'о' {{time}}",
+ medium: '{{date}}, {{time}}',
+ short: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/uk/_lib/formatRelative/index.js b/date-fns/src/locale/uk/_lib/formatRelative/index.js
new file mode 100644
index 0000000..1f3c405
--- /dev/null
+++ b/date-fns/src/locale/uk/_lib/formatRelative/index.js
@@ -0,0 +1,82 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+var accusativeWeekdays = [
+ 'неділю',
+ 'понеділок',
+ 'вівторок',
+ 'середу',
+ 'четвер',
+ 'п’ятницю',
+ 'суботу'
+]
+
+function lastWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 5:
+ case 6:
+ return "'у минулу " + weekday + " о' p"
+ case 1:
+ case 2:
+ case 4:
+ return "'у минулий " + weekday + " о' p"
+ }
+}
+
+function thisWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ return "'у " + weekday + " о' p"
+}
+
+function nextWeek(day) {
+ var weekday = accusativeWeekdays[day]
+
+ switch (day) {
+ case 0:
+ case 3:
+ case 5:
+ case 6:
+ return "'у наступну " + weekday + " о' p"
+ case 1:
+ case 2:
+ case 4:
+ return "'у наступний " + weekday + " о' p"
+ }
+}
+
+var formatRelativeLocale = {
+ lastWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return lastWeek(day)
+ }
+ },
+ yesterday: "'вчора о' p",
+ today: "'сьогодні о' p",
+ tomorrow: "'завтра о' p",
+ nextWeek: function(date, baseDate, options) {
+ var day = date.getUTCDay()
+ if (isSameUTCWeek(date, baseDate, options)) {
+ return thisWeek(day)
+ } else {
+ return nextWeek(day)
+ }
+ },
+ other: 'P'
+}
+
+export default function formatRelative(token, date, baseDate, options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(date, baseDate, options)
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/uk/_lib/localize/index.js b/date-fns/src/locale/uk/_lib/localize/index.js
new file mode 100644
index 0000000..ab9c7ff
--- /dev/null
+++ b/date-fns/src/locale/uk/_lib/localize/index.js
@@ -0,0 +1,217 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['до н.е.', 'н.е.'],
+ abbreviated: ['до н. е.', 'н. е.'],
+ wide: ['до нашої ери', 'нашої ери']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['1-й кв.', '2-й кв.', '3-й кв.', '4-й кв.'],
+ wide: ['1-й квартал', '2-й квартал', '3-й квартал', '4-й квартал']
+}
+
+var monthValues = {
+ // ДСТУ 3582:2013
+ narrow: ['С', 'Л', 'Б', 'К', 'Т', 'Ч', 'Л', 'С', 'В', 'Ж', 'Л', 'Г'],
+ abbreviated: [
+ 'січ.',
+ 'лют.',
+ 'берез.',
+ 'квіт.',
+ 'трав.',
+ 'черв.',
+ 'лип.',
+ 'серп.',
+ 'верес.',
+ 'жовт.',
+ 'листоп.',
+ 'груд.'
+ ],
+ wide: [
+ 'січень',
+ 'лютий',
+ 'березень',
+ 'квітень',
+ 'травень',
+ 'червень',
+ 'липень',
+ 'серпень',
+ 'вересень',
+ 'жовтень',
+ 'листопад',
+ 'грудень'
+ ]
+}
+
+var formattingMonthValues = {
+ narrow: ['С', 'Л', 'Б', 'К', 'Т', 'Ч', 'Л', 'С', 'В', 'Ж', 'Л', 'Г'],
+ abbreviated: [
+ 'січ.',
+ 'лют.',
+ 'берез.',
+ 'квіт.',
+ 'трав.',
+ 'черв.',
+ 'лип.',
+ 'серп.',
+ 'верес.',
+ 'жовт.',
+ 'листоп.',
+ 'груд.'
+ ],
+ wide: [
+ 'січня',
+ 'лютого',
+ 'березня',
+ 'квітня',
+ 'травня',
+ 'червня',
+ 'липня',
+ 'серпня',
+ 'вересня',
+ 'жовтня',
+ 'листопада',
+ 'грудня'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Н', 'П', 'В', 'С', 'Ч', 'П', 'С'],
+ short: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
+ abbreviated: ['нед', 'пон', 'вів', 'сер', 'чтв', 'птн', 'суб'],
+ wide: [
+ 'неділя',
+ 'понеділок',
+ 'вівторок',
+ 'середа',
+ 'четвер',
+ 'п’ятниця',
+ 'субота'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'півн.',
+ noon: 'пол.',
+ morning: 'ранок',
+ afternoon: 'день',
+ evening: 'веч.',
+ night: 'ніч'
+ },
+ abbreviated: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'півн.',
+ noon: 'пол.',
+ morning: 'ранок',
+ afternoon: 'день',
+ evening: 'веч.',
+ night: 'ніч'
+ },
+ wide: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'північ',
+ noon: 'полудень',
+ morning: 'ранок',
+ afternoon: 'день',
+ evening: 'вечір',
+ night: 'ніч'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'півн.',
+ noon: 'пол.',
+ morning: 'ранку',
+ afternoon: 'дня',
+ evening: 'веч.',
+ night: 'ночі'
+ },
+ abbreviated: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'півн.',
+ noon: 'пол.',
+ morning: 'ранку',
+ afternoon: 'дня',
+ evening: 'веч.',
+ night: 'ночі'
+ },
+ wide: {
+ am: 'ДП',
+ pm: 'ПП',
+ midnight: 'північ',
+ noon: 'полудень',
+ morning: 'ранку',
+ afternoon: 'дня',
+ evening: 'веч.',
+ night: 'ночі'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var suffix
+
+ if (unit === 'date') {
+ if (dirtyNumber === 3 || dirtyNumber === 23) {
+ suffix = '-є'
+ } else {
+ suffix = '-е'
+ }
+ } else if (unit === 'minute' || unit === 'second' || unit === 'hour') {
+ suffix = '-а'
+ } else {
+ suffix = '-й'
+ }
+
+ return dirtyNumber + suffix
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'any',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/uk/_lib/match/index.js b/date-fns/src/locale/uk/_lib/match/index.js
new file mode 100644
index 0000000..863aa59
--- /dev/null
+++ b/date-fns/src/locale/uk/_lib/match/index.js
@@ -0,0 +1,142 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(-?(е|й|є|а|я))?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^((до )?н\.?\s?е\.?)/i,
+ abbreviated: /^((до )?н\.?\s?е\.?)/i,
+ wide: /^(до нашої ери|нашої ери|наша ера)/i
+}
+
+var parseEraPatterns = {
+ any: [/^д/i, /^н/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^[1234](-?[иі]?й?)? кв.?/i,
+ wide: /^[1234](-?[иі]?й?)? квартал/i
+}
+
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[слбктчвжг]/i,
+ abbreviated: /^(січ|лют|бер|берез|кві|трав?|чер|лип|сер|вер|жов|лис(топ)?|груд)\.?/i,
+ wide: /^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопада?|грудень|грудня)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^с/i,
+ /^л/i,
+ /^б/i,
+ /^к/i,
+ /^т/i,
+ /^ч/i,
+ /^л/i,
+ /^с/i,
+ /^в/i,
+ /^ж/i,
+ /^л/i,
+ /^г/i
+ ],
+ any: [
+ /^сі/i,
+ /^лю/i,
+ /^б/i,
+ /^к/i,
+ /^т/i,
+ /^ч/i,
+ /^лип/i,
+ /^се/i,
+ /^в/i,
+ /^ж/i,
+ /^лис/i,
+ /^г/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[нпвсч]/i,
+ short: /^(нд|пн|вт|ср|чт|пт|сб)\.?/i,
+ abbreviated: /^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,
+ wide: /^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i
+}
+
+var parseDayPatterns = {
+ narrow: [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i],
+ any: [/^н/i, /^п[он]/i, /^в/i, /^с[ер]/i, /^ч/i, /^п\W*?[ят]/i, /^с[уб]/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,
+ abbreviated: /^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,
+ wide: /^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i
+}
+
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^дп/i,
+ pm: /^пп/i,
+ midnight: /^півн/i,
+ noon: /^пол/i,
+ morning: /^р/i,
+ afternoon: /^д[ен]/i,
+ evening: /^в/i,
+ night: /^н/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/uk/index.d.ts b/date-fns/src/locale/uk/index.d.ts
new file mode 100644
index 0000000..972da88
--- /dev/null
+++ b/date-fns/src/locale/uk/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { uk } from 'date-fns/locale'
+export default uk
diff --git a/date-fns/src/locale/uk/index.js b/date-fns/src/locale/uk/index.js
new file mode 100644
index 0000000..b6274fa
--- /dev/null
+++ b/date-fns/src/locale/uk/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Ukrainian locale.
+ * @language Ukrainian
+ * @iso-639-2 ukr
+ * @author Andrii Korzh [@korzhyk]{@link https://github.com/korzhyk}
+ * @author Andriy Shcherbyak [@shcherbyakdev]{@link https://github.com/shcherbyakdev}
+ */
+var locale = {
+ code: 'uk',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/uk/index.js.flow b/date-fns/src/locale/uk/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/uk/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/uk/snapshot.md b/date-fns/src/locale/uk/snapshot.md
new file mode 100644
index 0000000..d88d4f9
--- /dev/null
+++ b/date-fns/src/locale/uk/snapshot.md
@@ -0,0 +1,304 @@
+# Ukrainian (uk) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987-й | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-й | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987-й | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5-й | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1-й | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 1-й кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й кв. | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-й квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й квартал | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1-й | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 1-й кв. | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й кв. | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-й квартал | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2-й квартал | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2-й | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-й | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | лют. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | лип. | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | лютого | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | липня | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2-й | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7-й | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | лют. | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | лип. | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | лютий | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | липень | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Л | 2019-02-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1-й | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-й | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1-й | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48-й | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11-е | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28-е | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365-й | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | понеділок | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | п’ятниця | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-й | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | понеділок | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | п’ятниця | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-й | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | понеділок | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | п’ятниця | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1-й | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5-й | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | пон | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | птн | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | понеділок | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | п’ятниця | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | П | 2019-02-11T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | пн | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | пт | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | пп | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | дп | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | ПП | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ДП | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ранку | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночі | 2019-02-11T00:00:00.000Z |
+| | BB | 2019-02-11T11:13:14.015Z | ранку | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночі | 2019-02-11T00:00:00.000Z |
+| | BBB | 2019-02-11T11:13:14.015Z | ранку | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночі | 2019-02-11T00:00:00.000Z |
+| | BBBB | 2019-02-11T11:13:14.015Z | ранку | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночі | 2019-02-11T00:00:00.000Z |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ранку | 2019-02-11T04:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | дня | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | веч. | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | ночі | 2019-02-11T00:00:00.000Z |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11-а | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-а | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11-а | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-а | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11-а | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11-а | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11-а | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23-а | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1-а | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55-а | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1-а | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55-а | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11.02.1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 лют. 1987 р. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 трав. 1453 р. | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11-е лютого 1987 р. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29-е травня 1453 р. | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | середа, 11-е лютого 1987 р. | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | неділя, 29-е травня 1453 р. | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11.02.1987, 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29.05.1453, 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 лют. 1987 р., 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 трав. 1453 р., 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11-е лютого 1987 р. о 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29-е травня 1453 р. о 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | середа, 11-е лютого 1987 р. о 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | неділя, 29-е травня 1453 р. о 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | --------------------- |
+| 2006-01-01T00:00:00.000Z | близько 6 років | близько 6 років | приблизно за 6 років |
+| 2005-01-01T00:00:00.000Z | близько 5 років | близько 5 років | приблизно за 5 років |
+| 2004-01-01T00:00:00.000Z | близько 4 років | близько 4 років | приблизно за 4 роки |
+| 2003-01-01T00:00:00.000Z | близько 3 років | близько 3 років | приблизно за 3 роки |
+| 2002-01-01T00:00:00.000Z | близько 2 років | близько 2 років | приблизно за 2 роки |
+| 2001-06-01T00:00:00.000Z | більше 1 року | більше 1 року | більше, ніж за 1 рік |
+| 2001-02-01T00:00:00.000Z | близько 1 року | близько 1 року | приблизно за 1 рік |
+| 2001-01-01T00:00:00.000Z | близько 1 року | близько 1 року | приблизно за 1 рік |
+| 2000-06-01T00:00:00.000Z | 5 місяців | 5 місяців | за 5 місяців |
+| 2000-03-01T00:00:00.000Z | 2 місяця | 2 місяця | за 2 місяця |
+| 2000-02-01T00:00:00.000Z | близько 1 місяця | близько 1 місяця | приблизно за 1 місяць |
+| 2000-01-15T00:00:00.000Z | 14 днів | 14 днів | за 14 днів |
+| 2000-01-02T00:00:00.000Z | 1 день | 1 день | за 1 день |
+| 2000-01-01T06:00:00.000Z | близько 6 годин | близько 6 годин | приблизно за 6 годин |
+| 2000-01-01T01:00:00.000Z | близько 1 години | близько 1 години | приблизно за 1 годину |
+| 2000-01-01T00:45:00.000Z | близько 1 години | близько 1 години | приблизно за 1 годину |
+| 2000-01-01T00:30:00.000Z | 30 хвилин | 30 хвилин | за 30 хвилин |
+| 2000-01-01T00:15:00.000Z | 15 хвилин | 15 хвилин | за 15 хвилин |
+| 2000-01-01T00:01:00.000Z | 1 хвилина | 1 хвилина | за 1 хвилину |
+| 2000-01-01T00:00:25.000Z | менше хвилини | півхвилини | менше, ніж за хвилину |
+| 2000-01-01T00:00:15.000Z | менше хвилини | менше 20 секунд | менше, ніж за хвилину |
+| 2000-01-01T00:00:05.000Z | менше хвилини | менше 10 секунд | менше, ніж за хвилину |
+| 2000-01-01T00:00:00.000Z | менше хвилини | менше 5 секунд | менше хвилини тому |
+| 1999-12-31T23:59:55.000Z | менше хвилини | менше 10 секунд | менше хвилини тому |
+| 1999-12-31T23:59:45.000Z | менше хвилини | менше 20 секунд | менше хвилини тому |
+| 1999-12-31T23:59:35.000Z | менше хвилини | півхвилини | менше хвилини тому |
+| 1999-12-31T23:59:00.000Z | 1 хвилина | 1 хвилина | 1 хвилину тому |
+| 1999-12-31T23:45:00.000Z | 15 хвилин | 15 хвилин | 15 хвилин тому |
+| 1999-12-31T23:30:00.000Z | 30 хвилин | 30 хвилин | 30 хвилин тому |
+| 1999-12-31T23:15:00.000Z | близько 1 години | близько 1 години | близько 1 години тому |
+| 1999-12-31T23:00:00.000Z | близько 1 години | близько 1 години | близько 1 години тому |
+| 1999-12-31T18:00:00.000Z | близько 6 годин | близько 6 годин | близько 6 годин тому |
+| 1999-12-30T00:00:00.000Z | 2 дня | 2 дня | 2 дня тому |
+| 1999-12-15T00:00:00.000Z | 17 днів | 17 днів | 17 днів тому |
+| 1999-12-01T00:00:00.000Z | близько 1 місяця | близько 1 місяця | близько 1 місяця тому |
+| 1999-11-01T00:00:00.000Z | 2 місяця | 2 місяця | 2 місяця тому |
+| 1999-06-01T00:00:00.000Z | 7 місяців | 7 місяців | 7 місяців тому |
+| 1999-01-01T00:00:00.000Z | близько 1 року | близько 1 року | близько 1 року тому |
+| 1998-12-01T00:00:00.000Z | близько 1 року | близько 1 року | близько 1 року тому |
+| 1998-06-01T00:00:00.000Z | більше 1 року | більше 1 року | більше 1 року тому |
+| 1998-01-01T00:00:00.000Z | близько 2 років | близько 2 років | близько 2 років тому |
+| 1997-01-01T00:00:00.000Z | близько 3 років | близько 3 років | близько 3 років тому |
+| 1996-01-01T00:00:00.000Z | близько 4 років | близько 4 років | близько 4 років тому |
+| 1995-01-01T00:00:00.000Z | близько 5 років | близько 5 років | близько 5 років тому |
+| 1994-01-01T00:00:00.000Z | близько 6 років | близько 6 років | близько 6 років тому |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 років | за 6 років | 52608 годин |
+| 2005-01-01T00:00:00.000Z | 5 років | за 5 років | 43848 годин |
+| 2004-01-01T00:00:00.000Z | 4 роки | за 4 роки | 35064 години |
+| 2003-01-01T00:00:00.000Z | 3 роки | за 3 роки | 26304 години |
+| 2002-01-01T00:00:00.000Z | 2 роки | за 2 роки | 17544 години |
+| 2001-06-01T00:00:00.000Z | 1 рік | за 1 рік | 12408 годин |
+| 2001-02-01T00:00:00.000Z | 1 рік | за 1 рік | 9528 годин |
+| 2001-01-01T00:00:00.000Z | 1 рік | за 1 рік | 8784 години |
+| 2000-06-01T00:00:00.000Z | 5 місяців | за 5 місяців | 3648 годин |
+| 2000-03-01T00:00:00.000Z | 2 місяця | за 2 місяця | 1440 годин |
+| 2000-02-01T00:00:00.000Z | 1 місяць | за 1 місяць | 744 години |
+| 2000-01-15T00:00:00.000Z | 14 днів | за 14 днів | 336 годин |
+| 2000-01-02T00:00:00.000Z | 1 день | за 1 день | 24 години |
+| 2000-01-01T06:00:00.000Z | 6 годин | за 6 годин | 6 годин |
+| 2000-01-01T01:00:00.000Z | 1 годину | за 1 годину | 1 годину |
+| 2000-01-01T00:45:00.000Z | 45 хвилин | за 45 хвилин | 1 годину |
+| 2000-01-01T00:30:00.000Z | 30 хвилин | за 30 хвилин | 1 годину |
+| 2000-01-01T00:15:00.000Z | 15 хвилин | за 15 хвилин | 0 годин |
+| 2000-01-01T00:01:00.000Z | 1 хвилина | за 1 хвилину | 0 годин |
+| 2000-01-01T00:00:25.000Z | 25 секунд | за 25 секунд | 0 годин |
+| 2000-01-01T00:00:15.000Z | 15 секунд | за 15 секунд | 0 годин |
+| 2000-01-01T00:00:05.000Z | 5 секунд | за 5 секунд | 0 годин |
+| 2000-01-01T00:00:00.000Z | 0 секунд | 0 секунд тому | 0 годин |
+| 1999-12-31T23:59:55.000Z | 5 секунд | 5 секунд тому | 0 годин |
+| 1999-12-31T23:59:45.000Z | 15 секунд | 15 секунд тому | 0 годин |
+| 1999-12-31T23:59:35.000Z | 25 секунд | 25 секунд тому | 0 годин |
+| 1999-12-31T23:59:00.000Z | 1 хвилина | 1 хвилину тому | 0 годин |
+| 1999-12-31T23:45:00.000Z | 15 хвилин | 15 хвилин тому | 0 годин |
+| 1999-12-31T23:30:00.000Z | 30 хвилин | 30 хвилин тому | 1 годину |
+| 1999-12-31T23:15:00.000Z | 45 хвилин | 45 хвилин тому | 1 годину |
+| 1999-12-31T23:00:00.000Z | 1 годину | 1 годину тому | 1 годину |
+| 1999-12-31T18:00:00.000Z | 6 годин | 6 годин тому | 6 годин |
+| 1999-12-30T00:00:00.000Z | 2 дня | 2 дня тому | 48 годин |
+| 1999-12-15T00:00:00.000Z | 17 днів | 17 днів тому | 408 годин |
+| 1999-12-01T00:00:00.000Z | 1 місяць | 1 місяць тому | 744 години |
+| 1999-11-01T00:00:00.000Z | 2 місяця | 2 місяця тому | 1464 години |
+| 1999-06-01T00:00:00.000Z | 7 місяців | 7 місяців тому | 5136 годин |
+| 1999-01-01T00:00:00.000Z | 1 рік | 1 рік тому | 8760 годин |
+| 1998-12-01T00:00:00.000Z | 1 рік | 1 рік тому | 9504 години |
+| 1998-06-01T00:00:00.000Z | 2 роки | 2 роки тому | 13896 годин |
+| 1998-01-01T00:00:00.000Z | 2 роки | 2 роки тому | 17520 годин |
+| 1997-01-01T00:00:00.000Z | 3 роки | 3 роки тому | 26280 годин |
+| 1996-01-01T00:00:00.000Z | 4 роки | 4 роки тому | 35064 години |
+| 1995-01-01T00:00:00.000Z | 5 років | 5 років тому | 43824 години |
+| 1994-01-01T00:00:00.000Z | 6 років | 6 років тому | 52584 години |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------ |
+| 2000-01-10T00:00:00.000Z | 10.01.2000 |
+| 2000-01-05T00:00:00.000Z | у наступну середу о 0:00 |
+| 2000-01-02T00:00:00.000Z | завтра о 0:00 |
+| 2000-01-01T00:00:00.000Z | сьогодні о 0:00 |
+| 1999-12-31T00:00:00.000Z | вчора о 0:00 |
+| 1999-12-27T00:00:00.000Z | у понеділок о 0:00 |
+| 1999-12-21T00:00:00.000Z | 21.12.1999 |
diff --git a/date-fns/src/locale/uz/_lib/formatDistance/index.js b/date-fns/src/locale/uz/_lib/formatDistance/index.js
new file mode 100644
index 0000000..9e1a259
--- /dev/null
+++ b/date-fns/src/locale/uz/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'sekunddan kam',
+ other: '{{count}} sekunddan kam'
+ },
+
+ xSeconds: {
+ one: '1 sekund',
+ other: '{{count}} sekund'
+ },
+
+ halfAMinute: 'yarim minut',
+
+ lessThanXMinutes: {
+ one: 'bir minutdan kam',
+ other: '{{count}} minutdan kam'
+ },
+
+ xMinutes: {
+ one: '1 minut',
+ other: '{{count}} minut'
+ },
+
+ aboutXHours: {
+ one: 'tahminan 1 soat',
+ other: 'tahminan {{count}} soat'
+ },
+
+ xHours: {
+ one: '1 soat',
+ other: '{{count}} soat'
+ },
+
+ xDays: {
+ one: '1 kun',
+ other: '{{count}} kun'
+ },
+
+ aboutXWeeks: {
+ one: 'tahminan 1 hafta',
+ other: 'tahminan {{count}} hafta'
+ },
+
+ xWeeks: {
+ one: '1 hafta',
+ other: '{{count}} hafta'
+ },
+
+ aboutXMonths: {
+ one: 'tahminan 1 oy',
+ other: 'tahminan {{count}} oy'
+ },
+
+ xMonths: {
+ one: '1 oy',
+ other: '{{count}} oy'
+ },
+
+ aboutXYears: {
+ one: 'tahminan 1 yil',
+ other: 'tahminan {{count}} yil'
+ },
+
+ xYears: {
+ one: '1 yil',
+ other: '{{count}} yil'
+ },
+
+ overXYears: {
+ one: "1 yildan ko'p",
+ other: "{{count}} yildan ko'p"
+ },
+
+ almostXYears: {
+ one: 'deyarli 1 yil',
+ other: 'deyarli {{count}} yil'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' dan keyin'
+ } else {
+ return result + ' oldin'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/uz/_lib/formatLong/index.js b/date-fns/src/locale/uz/_lib/formatLong/index.js
new file mode 100644
index 0000000..e2e59a5
--- /dev/null
+++ b/date-fns/src/locale/uz/_lib/formatLong/index.js
@@ -0,0 +1,38 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: 'EEEE, do MMMM, y',
+ long: 'do MMMM, y',
+ medium: 'd MMM, y',
+ short: 'dd/MM/yyyy'
+}
+
+var timeFormats = {
+ full: 'h:mm:ss zzzz',
+ long: 'h:mm:ss z',
+ medium: 'h:mm:ss',
+ short: 'h:mm'
+}
+
+var dateTimeFormats = {
+ any: '{{date}}, {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'any'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/uz/_lib/formatRelative/index.js b/date-fns/src/locale/uz/_lib/formatRelative/index.js
new file mode 100644
index 0000000..92838cd
--- /dev/null
+++ b/date-fns/src/locale/uz/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'oldingi' eeee p 'da'",
+ yesterday: "'kecha' p 'da'",
+ today: "'bugun' p 'da'",
+ tomorrow: "'ertaga' p 'da'",
+ nextWeek: "eeee p 'da'",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/uz/_lib/localize/index.js b/date-fns/src/locale/uz/_lib/localize/index.js
new file mode 100644
index 0000000..6530e3d
--- /dev/null
+++ b/date-fns/src/locale/uz/_lib/localize/index.js
@@ -0,0 +1,181 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['M.A', 'M.'],
+ abbreviated: ['M.A', 'M.'],
+ wide: ['Miloddan Avvalgi', 'Milodiy']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['CH.1', 'CH.2', 'CH.3', 'CH.4'],
+ wide: ['1-chi chorak', '2-chi chorak', '3-chi chorak', '4-chi chorak']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['Y', 'F', 'M', 'A', 'M', 'I', 'I', 'A', 'S', 'O', 'N', 'D'],
+ abbreviated: [
+ 'Yan',
+ 'Fev',
+ 'Mar',
+ 'Apr',
+ 'May',
+ 'Iyun',
+ 'Iyul',
+ 'Avg',
+ 'Sen',
+ 'Okt',
+ 'Noy',
+ 'Dek'
+ ],
+ wide: [
+ 'Yanvar',
+ 'Fevral',
+ 'Mart',
+ 'Aprel',
+ 'May',
+ 'Iyun',
+ 'Iyul',
+ 'Avgust',
+ 'Sentabr',
+ 'Oktabr',
+ 'Noyabr',
+ 'Dekabr'
+ ]
+}
+
+var dayValues = {
+ narrow: ['Y', 'D', 'S', 'CH', 'P', 'J', 'SH'],
+ short: ['Ya', 'Du', 'Se', 'Cho', 'Pa', 'Ju', 'Sha'],
+ abbreviated: ['Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan'],
+ wide: [
+ 'Yakshanba',
+ 'Dushanba',
+ 'Seshanba',
+ 'Chorshanba',
+ 'Payshanba',
+ 'Juma',
+ 'Shanba'
+ ]
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'y.t',
+ noon: 'p.',
+ morning: 'ertalab',
+ afternoon: 'tushdan keyin',
+ evening: 'kechqurun',
+ night: 'tun'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'yarim tun',
+ noon: 'peshin',
+ morning: 'ertalab',
+ afternoon: 'tushdan keyin',
+ evening: 'kechqurun',
+ night: 'tun'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'yarim tun',
+ noon: 'peshin',
+ morning: 'ertalab',
+ afternoon: 'tushdan keyin',
+ evening: 'kechqurun',
+ night: 'tun'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'a',
+ pm: 'p',
+ midnight: 'y.t',
+ noon: 'p.',
+ morning: 'ertalab',
+ afternoon: 'tushdan keyin',
+ evening: 'kechqurun',
+ night: 'tun'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'yarim tun',
+ noon: 'peshin',
+ morning: 'ertalab',
+ afternoon: 'tushdan keyin',
+ evening: 'kechqurun',
+ night: 'tun'
+ },
+ wide: {
+ am: 'a.m.',
+ pm: 'p.m.',
+ midnight: 'yarim tun',
+ noon: 'peshin',
+ morning: 'ertalab',
+ afternoon: 'tushdan keyin',
+ evening: 'kechqurun',
+ night: 'tun'
+ }
+}
+
+function ordinalNumber(dirtyNumber, _dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ return number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/uz/_lib/match/index.js b/date-fns/src/locale/uz/_lib/match/index.js
new file mode 100644
index 0000000..8190bba
--- /dev/null
+++ b/date-fns/src/locale/uz/_lib/match/index.js
@@ -0,0 +1,137 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)(chi)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(m\.a|m\.)/i,
+ abbreviated: /^(m\.a\.?\s?m\.?)/i,
+ wide: /^(miloddan avval|miloddan keyin)/i
+}
+var parseEraPatterns = {
+ any: [/^b/i, /^(a|c)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^q[1234]/i,
+ wide: /^[1234](chi)? chorak/i
+}
+var parseQuarterPatterns = {
+ any: [/1/i, /2/i, /3/i, /4/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^[yfmasond]/i,
+ abbreviated: /^(yan|fev|mar|apr|may|iyun|iyul|avg|sen|okt|noy|dek)/i,
+ wide: /^(yanvar|fevral|mart|aprel|may|iyun|iyul|avgust|sentabr|oktabr|noyabr|dekabr)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^y/i,
+ /^f/i,
+ /^m/i,
+ /^a/i,
+ /^m/i,
+ /^i/i,
+ /^i/i,
+ /^a/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ],
+ any: [
+ /^ya/i,
+ /^f/i,
+ /^mar/i,
+ /^ap/i,
+ /^may/i,
+ /^iyun/i,
+ /^iyul/i,
+ /^av/i,
+ /^s/i,
+ /^o/i,
+ /^n/i,
+ /^d/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[ydschj]/i,
+ short: /^(ya|du|se|cho|pa|ju|sha)/i,
+ abbreviated: /^(yak|dush|sesh|chor|pay|jum|shan)/i,
+ wide: /^(yakshanba|dushanba|seshanba|chorshanba|payshanba|juma|shanba)/i
+}
+var parseDayPatterns = {
+ narrow: [/^y/i, /^d/i, /^s/i, /^ch/i, /^p/i, /^j/i, /^sh/i],
+ any: [/^ya/i, /^d/i, /^se/i, /^ch/i, /^p/i, /^j/i, /^sh/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|y\.t|p| (ertalab|tushdan keyin|kechqurun|tun))/i,
+ any: /^([ap]\.?\s?m\.?|yarim tun|peshin| (ertalab|tushdan keyin|kechqurun|tun))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^a/i,
+ pm: /^p/i,
+ midnight: /^y\.t/i,
+ noon: /^pe/i,
+ morning: /ertalab/i,
+ afternoon: /tushdan keyin/i,
+ evening: /kechqurun/i,
+ night: /tun/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/uz/index.d.ts b/date-fns/src/locale/uz/index.d.ts
new file mode 100644
index 0000000..e10b1f6
--- /dev/null
+++ b/date-fns/src/locale/uz/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { uz } from 'date-fns/locale'
+export default uz
diff --git a/date-fns/src/locale/uz/index.js b/date-fns/src/locale/uz/index.js
new file mode 100644
index 0000000..42c0fef
--- /dev/null
+++ b/date-fns/src/locale/uz/index.js
@@ -0,0 +1,28 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Uzbek locale.
+ * @language Uzbek
+ * @iso-639-2 uzb
+ * @author Mukhammadali [@mukhammadali]{@link https://github.com/Mukhammadali}
+ */
+var locale = {
+ code: 'uz',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/uz/index.js.flow b/date-fns/src/locale/uz/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/uz/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/uz/snapshot.md b/date-fns/src/locale/uz/snapshot.md
new file mode 100644
index 0000000..384dc12
--- /dev/null
+++ b/date-fns/src/locale/uz/snapshot.md
@@ -0,0 +1,304 @@
+# Uzbek (uz) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ----------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | CH.1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | CH.2 | Invalid Date |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 1-chi chorak | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2-chi chorak | Invalid Date |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | CH.1 | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | CH.2 | Invalid Date |
+| | qqqq | 2019-01-01T12:13:14.015Z | 1-chi chorak | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | 2-chi chorak | Invalid Date |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | Fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Iyul | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | Fevral | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Iyul | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | Invalid Date |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Fev | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Iyul | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Fevral | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Iyul | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | F | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | I | Invalid Date |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Dush | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | Dush | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | Dush | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | Dushanba | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Juma | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | D | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Du | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ju | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | Dush | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | Dushanba | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Juma | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | D | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Du | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ju | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | Dush | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | Dushanba | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Juma | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | D | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Du | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ju | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | Dush | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Jum | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | Dushanba | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Juma | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | D | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | J | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Du | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Ju | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p.m. | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a.m. | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | p | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | a | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | ertalab | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | tushdan keyin | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | kechqurun | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | tun | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | ertalab | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | tushdan keyin | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | kechqurun | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | tun | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | ertalab | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | tushdan keyin | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | kechqurun | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | tun | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | ertalab | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | tushdan keyin | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | kechqurun | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | tun | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | ertalab | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | tushdan keyin | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | kechqurun | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | tun | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 Fev, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 11 Fevral, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Chorshanba, 11 Fevral, 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Yakshanba, 29 May, 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 11:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987, 12:13 | 1987-02-11T00:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453, 11:59 | 1453-05-29T11:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 Fev, 1987, 12:13:14 | 1987-02-11T00:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453, 11:59:59 | 1453-05-29T11:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 11 Fevral, 1987, 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 29 May, 1453, 11:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Chorshanba, 11 Fevral, 1987, 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Yakshanba, 29 May, 1453, 11:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ---------------- | ---------------------- | -------------------------- |
+| 2006-01-01T00:00:00.000Z | tahminan 6 yil | tahminan 6 yil | tahminan 6 yil dan keyin |
+| 2005-01-01T00:00:00.000Z | tahminan 5 yil | tahminan 5 yil | tahminan 5 yil dan keyin |
+| 2004-01-01T00:00:00.000Z | tahminan 4 yil | tahminan 4 yil | tahminan 4 yil dan keyin |
+| 2003-01-01T00:00:00.000Z | tahminan 3 yil | tahminan 3 yil | tahminan 3 yil dan keyin |
+| 2002-01-01T00:00:00.000Z | tahminan 2 yil | tahminan 2 yil | tahminan 2 yil dan keyin |
+| 2001-06-01T00:00:00.000Z | 1 yildan ko'p | 1 yildan ko'p | 1 yildan ko'p dan keyin |
+| 2001-02-01T00:00:00.000Z | tahminan 1 yil | tahminan 1 yil | tahminan 1 yil dan keyin |
+| 2001-01-01T00:00:00.000Z | tahminan 1 yil | tahminan 1 yil | tahminan 1 yil dan keyin |
+| 2000-06-01T00:00:00.000Z | 5 oy | 5 oy | 5 oy dan keyin |
+| 2000-03-01T00:00:00.000Z | 2 oy | 2 oy | 2 oy dan keyin |
+| 2000-02-01T00:00:00.000Z | tahminan 1 oy | tahminan 1 oy | tahminan 1 oy dan keyin |
+| 2000-01-15T00:00:00.000Z | 14 kun | 14 kun | 14 kun dan keyin |
+| 2000-01-02T00:00:00.000Z | 1 kun | 1 kun | 1 kun dan keyin |
+| 2000-01-01T06:00:00.000Z | tahminan 6 soat | tahminan 6 soat | tahminan 6 soat dan keyin |
+| 2000-01-01T01:00:00.000Z | tahminan 1 soat | tahminan 1 soat | tahminan 1 soat dan keyin |
+| 2000-01-01T00:45:00.000Z | tahminan 1 soat | tahminan 1 soat | tahminan 1 soat dan keyin |
+| 2000-01-01T00:30:00.000Z | 30 minut | 30 minut | 30 minut dan keyin |
+| 2000-01-01T00:15:00.000Z | 15 minut | 15 minut | 15 minut dan keyin |
+| 2000-01-01T00:01:00.000Z | 1 minut | 1 minut | 1 minut dan keyin |
+| 2000-01-01T00:00:25.000Z | bir minutdan kam | yarim minut | bir minutdan kam dan keyin |
+| 2000-01-01T00:00:15.000Z | bir minutdan kam | 20 sekunddan kam | bir minutdan kam dan keyin |
+| 2000-01-01T00:00:05.000Z | bir minutdan kam | 10 sekunddan kam | bir minutdan kam dan keyin |
+| 2000-01-01T00:00:00.000Z | bir minutdan kam | 5 sekunddan kam | bir minutdan kam oldin |
+| 1999-12-31T23:59:55.000Z | bir minutdan kam | 10 sekunddan kam | bir minutdan kam oldin |
+| 1999-12-31T23:59:45.000Z | bir minutdan kam | 20 sekunddan kam | bir minutdan kam oldin |
+| 1999-12-31T23:59:35.000Z | bir minutdan kam | yarim minut | bir minutdan kam oldin |
+| 1999-12-31T23:59:00.000Z | 1 minut | 1 minut | 1 minut oldin |
+| 1999-12-31T23:45:00.000Z | 15 minut | 15 minut | 15 minut oldin |
+| 1999-12-31T23:30:00.000Z | 30 minut | 30 minut | 30 minut oldin |
+| 1999-12-31T23:15:00.000Z | tahminan 1 soat | tahminan 1 soat | tahminan 1 soat oldin |
+| 1999-12-31T23:00:00.000Z | tahminan 1 soat | tahminan 1 soat | tahminan 1 soat oldin |
+| 1999-12-31T18:00:00.000Z | tahminan 6 soat | tahminan 6 soat | tahminan 6 soat oldin |
+| 1999-12-30T00:00:00.000Z | 2 kun | 2 kun | 2 kun oldin |
+| 1999-12-15T00:00:00.000Z | 17 kun | 17 kun | 17 kun oldin |
+| 1999-12-01T00:00:00.000Z | tahminan 1 oy | tahminan 1 oy | tahminan 1 oy oldin |
+| 1999-11-01T00:00:00.000Z | 2 oy | 2 oy | 2 oy oldin |
+| 1999-06-01T00:00:00.000Z | 7 oy | 7 oy | 7 oy oldin |
+| 1999-01-01T00:00:00.000Z | tahminan 1 yil | tahminan 1 yil | tahminan 1 yil oldin |
+| 1998-12-01T00:00:00.000Z | tahminan 1 yil | tahminan 1 yil | tahminan 1 yil oldin |
+| 1998-06-01T00:00:00.000Z | 1 yildan ko'p | 1 yildan ko'p | 1 yildan ko'p oldin |
+| 1998-01-01T00:00:00.000Z | tahminan 2 yil | tahminan 2 yil | tahminan 2 yil oldin |
+| 1997-01-01T00:00:00.000Z | tahminan 3 yil | tahminan 3 yil | tahminan 3 yil oldin |
+| 1996-01-01T00:00:00.000Z | tahminan 4 yil | tahminan 4 yil | tahminan 4 yil oldin |
+| 1995-01-01T00:00:00.000Z | tahminan 5 yil | tahminan 5 yil | tahminan 5 yil oldin |
+| 1994-01-01T00:00:00.000Z | tahminan 6 yil | tahminan 6 yil | tahminan 6 yil oldin |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | --------- | ------------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 yil | 6 yil dan keyin | 52608 soat |
+| 2005-01-01T00:00:00.000Z | 5 yil | 5 yil dan keyin | 43848 soat |
+| 2004-01-01T00:00:00.000Z | 4 yil | 4 yil dan keyin | 35064 soat |
+| 2003-01-01T00:00:00.000Z | 3 yil | 3 yil dan keyin | 26304 soat |
+| 2002-01-01T00:00:00.000Z | 2 yil | 2 yil dan keyin | 17544 soat |
+| 2001-06-01T00:00:00.000Z | 1 yil | 1 yil dan keyin | 12408 soat |
+| 2001-02-01T00:00:00.000Z | 1 yil | 1 yil dan keyin | 9528 soat |
+| 2001-01-01T00:00:00.000Z | 1 yil | 1 yil dan keyin | 8784 soat |
+| 2000-06-01T00:00:00.000Z | 5 oy | 5 oy dan keyin | 3648 soat |
+| 2000-03-01T00:00:00.000Z | 2 oy | 2 oy dan keyin | 1440 soat |
+| 2000-02-01T00:00:00.000Z | 1 oy | 1 oy dan keyin | 744 soat |
+| 2000-01-15T00:00:00.000Z | 14 kun | 14 kun dan keyin | 336 soat |
+| 2000-01-02T00:00:00.000Z | 1 kun | 1 kun dan keyin | 24 soat |
+| 2000-01-01T06:00:00.000Z | 6 soat | 6 soat dan keyin | 6 soat |
+| 2000-01-01T01:00:00.000Z | 1 soat | 1 soat dan keyin | 1 soat |
+| 2000-01-01T00:45:00.000Z | 45 minut | 45 minut dan keyin | 1 soat |
+| 2000-01-01T00:30:00.000Z | 30 minut | 30 minut dan keyin | 1 soat |
+| 2000-01-01T00:15:00.000Z | 15 minut | 15 minut dan keyin | 0 soat |
+| 2000-01-01T00:01:00.000Z | 1 minut | 1 minut dan keyin | 0 soat |
+| 2000-01-01T00:00:25.000Z | 25 sekund | 25 sekund dan keyin | 0 soat |
+| 2000-01-01T00:00:15.000Z | 15 sekund | 15 sekund dan keyin | 0 soat |
+| 2000-01-01T00:00:05.000Z | 5 sekund | 5 sekund dan keyin | 0 soat |
+| 2000-01-01T00:00:00.000Z | 0 sekund | 0 sekund oldin | 0 soat |
+| 1999-12-31T23:59:55.000Z | 5 sekund | 5 sekund oldin | 0 soat |
+| 1999-12-31T23:59:45.000Z | 15 sekund | 15 sekund oldin | 0 soat |
+| 1999-12-31T23:59:35.000Z | 25 sekund | 25 sekund oldin | 0 soat |
+| 1999-12-31T23:59:00.000Z | 1 minut | 1 minut oldin | 0 soat |
+| 1999-12-31T23:45:00.000Z | 15 minut | 15 minut oldin | 0 soat |
+| 1999-12-31T23:30:00.000Z | 30 minut | 30 minut oldin | 1 soat |
+| 1999-12-31T23:15:00.000Z | 45 minut | 45 minut oldin | 1 soat |
+| 1999-12-31T23:00:00.000Z | 1 soat | 1 soat oldin | 1 soat |
+| 1999-12-31T18:00:00.000Z | 6 soat | 6 soat oldin | 6 soat |
+| 1999-12-30T00:00:00.000Z | 2 kun | 2 kun oldin | 48 soat |
+| 1999-12-15T00:00:00.000Z | 17 kun | 17 kun oldin | 408 soat |
+| 1999-12-01T00:00:00.000Z | 1 oy | 1 oy oldin | 744 soat |
+| 1999-11-01T00:00:00.000Z | 2 oy | 2 oy oldin | 1464 soat |
+| 1999-06-01T00:00:00.000Z | 7 oy | 7 oy oldin | 5136 soat |
+| 1999-01-01T00:00:00.000Z | 1 yil | 1 yil oldin | 8760 soat |
+| 1998-12-01T00:00:00.000Z | 1 yil | 1 yil oldin | 9504 soat |
+| 1998-06-01T00:00:00.000Z | 2 yil | 2 yil oldin | 13896 soat |
+| 1998-01-01T00:00:00.000Z | 2 yil | 2 yil oldin | 17520 soat |
+| 1997-01-01T00:00:00.000Z | 3 yil | 3 yil oldin | 26280 soat |
+| 1996-01-01T00:00:00.000Z | 4 yil | 4 yil oldin | 35064 soat |
+| 1995-01-01T00:00:00.000Z | 5 yil | 5 yil oldin | 43824 soat |
+| 1994-01-01T00:00:00.000Z | 6 yil | 6 yil oldin | 52584 soat |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | ------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | Chorshanba 12:00 da |
+| 2000-01-02T00:00:00.000Z | ertaga 12:00 da |
+| 2000-01-01T00:00:00.000Z | bugun 12:00 da |
+| 1999-12-31T00:00:00.000Z | kecha 12:00 da |
+| 1999-12-27T00:00:00.000Z | oldingi Dushanba 12:00 da |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/vi/_lib/formatDistance/index.js b/date-fns/src/locale/vi/_lib/formatDistance/index.js
new file mode 100644
index 0000000..35677f0
--- /dev/null
+++ b/date-fns/src/locale/vi/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: 'dưới 1 giây',
+ other: 'dưới {{count}} giây'
+ },
+
+ xSeconds: {
+ one: '1 giây',
+ other: '{{count}} giây'
+ },
+
+ halfAMinute: 'nửa phút',
+
+ lessThanXMinutes: {
+ one: 'dưới 1 phút',
+ other: 'dưới {{count}} phút'
+ },
+
+ xMinutes: {
+ one: '1 phút',
+ other: '{{count}} phút'
+ },
+
+ aboutXHours: {
+ one: 'khoảng 1 giờ',
+ other: 'khoảng {{count}} giờ'
+ },
+
+ xHours: {
+ one: '1 giờ',
+ other: '{{count}} giờ'
+ },
+
+ xDays: {
+ one: '1 ngày',
+ other: '{{count}} ngày'
+ },
+
+ aboutXWeeks: {
+ one: 'khoảng 1 tuần',
+ other: 'khoảng {{count}} tuần'
+ },
+
+ xWeeks: {
+ one: '1 tuần',
+ other: '{{count}} tuần'
+ },
+
+ aboutXMonths: {
+ one: 'khoảng 1 tháng',
+ other: 'khoảng {{count}} tháng'
+ },
+
+ xMonths: {
+ one: '1 tháng',
+ other: '{{count}} tháng'
+ },
+
+ aboutXYears: {
+ one: 'khoảng 1 năm',
+ other: 'khoảng {{count}} năm'
+ },
+
+ xYears: {
+ one: '1 năm',
+ other: '{{count}} năm'
+ },
+
+ overXYears: {
+ one: 'hơn 1 năm',
+ other: 'hơn {{count}} năm'
+ },
+
+ almostXYears: {
+ one: 'gần 1 năm',
+ other: 'gần {{count}} năm'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + ' nữa'
+ } else {
+ return result + ' trước'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/vi/_lib/formatLong/index.js b/date-fns/src/locale/vi/_lib/formatLong/index.js
new file mode 100644
index 0000000..4762cc6
--- /dev/null
+++ b/date-fns/src/locale/vi/_lib/formatLong/index.js
@@ -0,0 +1,47 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ // thứ Sáu, ngày 25 tháng 08 năm 2017
+ full: "EEEE, 'ngày' d MMMM 'năm' y",
+ // ngày 25 tháng 08 năm 2017
+ long: "'ngày' d MMMM 'năm' y",
+ // 25 thg 08 năm 2017
+ medium: "d MMM 'năm' y",
+ // 25/08/2017
+ short: 'dd/MM/y'
+}
+
+var timeFormats = {
+ full: 'HH:mm:ss zzzz',
+ long: 'HH:mm:ss z',
+ medium: 'HH:mm:ss',
+ short: 'HH:mm'
+}
+
+var dateTimeFormats = {
+ // thứ Sáu, ngày 25 tháng 08 năm 2017 23:25:59
+ full: '{{date}} {{time}}',
+ // ngày 25 tháng 08 năm 2017 23:25
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/vi/_lib/formatRelative/index.js b/date-fns/src/locale/vi/_lib/formatRelative/index.js
new file mode 100644
index 0000000..4270321
--- /dev/null
+++ b/date-fns/src/locale/vi/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "eeee 'tuần trước vào lúc' p",
+ yesterday: "'hôm qua vào lúc' p",
+ today: "'hôm nay vào lúc' p",
+ tomorrow: "'ngày mai vào lúc' p",
+ nextWeek: "eeee 'tới vào lúc' p",
+ other: 'P'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/vi/_lib/localize/index.js b/date-fns/src/locale/vi/_lib/localize/index.js
new file mode 100644
index 0000000..07dbe80
--- /dev/null
+++ b/date-fns/src/locale/vi/_lib/localize/index.js
@@ -0,0 +1,295 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+// Vietnamese locale reference: http://www.localeplanet.com/icu/vi-VN/index.html
+// Capitalization reference: http://hcmup.edu.vn/index.php?option=com_content&view=article&id=4106%3Avit-hoa-trong-vn-bn-hanh-chinh&catid=2345%3Atham-kho&Itemid=4103&lang=vi&site=134
+
+var eraValues = {
+ narrow: ['TCN', 'SCN'],
+ abbreviated: ['trước CN', 'sau CN'],
+ wide: ['trước Công Nguyên', 'sau Công Nguyên']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ wide: ['Quý 1', 'Quý 2', 'Quý 3', 'Quý 4']
+}
+
+var formattingQuarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
+ // I notice many news outlet use this "quý II/2018"
+ wide: ['quý I', 'quý II', 'quý III', 'quý IV']
+}
+
+// Note: in English, the names of days of the week and months are capitalized.
+// If you are making a new locale based on this one, check if the same is true for the language you're working on.
+// Generally, formatted dates should look like they are in the middle of a sentence,
+// e.g. in Spanish language the weekdays and months should be in the lowercase.
+var monthValues = {
+ narrow: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
+ abbreviated: [
+ 'Thg 1',
+ 'Thg 2',
+ 'Thg 3',
+ 'Thg 4',
+ 'Thg 5',
+ 'Thg 6',
+ 'Thg 7',
+ 'Thg 8',
+ 'Thg 9',
+ 'Thg 10',
+ 'Thg 11',
+ 'Thg 12'
+ ],
+ wide: [
+ 'Tháng Một',
+ 'Tháng Hai',
+ 'Tháng Ba',
+ 'Tháng Tư',
+ 'Tháng Năm',
+ 'Tháng Sáu',
+ 'Tháng Bảy',
+ 'Tháng Tám',
+ 'Tháng Chín',
+ 'Tháng Mười',
+ 'Tháng Mười Một',
+ 'Tháng Mười Hai'
+ ]
+}
+// In Vietnamese date formatting, month number less than 10 expected to have leading zero
+var formattingMonthValues = {
+ narrow: [
+ '01',
+ '02',
+ '03',
+ '04',
+ '05',
+ '06',
+ '07',
+ '08',
+ '09',
+ '10',
+ '11',
+ '12'
+ ],
+ abbreviated: [
+ 'thg 1',
+ 'thg 2',
+ 'thg 3',
+ 'thg 4',
+ 'thg 5',
+ 'thg 6',
+ 'thg 7',
+ 'thg 8',
+ 'thg 9',
+ 'thg 10',
+ 'thg 11',
+ 'thg 12'
+ ],
+ wide: [
+ 'tháng 01',
+ 'tháng 02',
+ 'tháng 03',
+ 'tháng 04',
+ 'tháng 05',
+ 'tháng 06',
+ 'tháng 07',
+ 'tháng 08',
+ 'tháng 09',
+ 'tháng 10',
+ 'tháng 11',
+ 'tháng 12'
+ ]
+}
+
+var dayValues = {
+ narrow: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
+ short: ['CN', 'Th 2', 'Th 3', 'Th 4', 'Th 5', 'Th 6', 'Th 7'],
+ abbreviated: ['CN', 'Thứ 2', 'Thứ 3', 'Thứ 4', 'Thứ 5', 'Thứ 6', 'Thứ 7'],
+ wide: [
+ 'Chủ Nhật',
+ 'Thứ Hai',
+ 'Thứ Ba',
+ 'Thứ Tư',
+ 'Thứ Năm',
+ 'Thứ Sáu',
+ 'Thứ Bảy'
+ ]
+}
+
+// Vietnamese are used to AM/PM borrowing from English, hence `narrow` and
+// `abbreviated` are just like English but I'm leaving the `wide`
+// format being localized with abbreviations found in some systems (SÁng / CHiều);
+// however, personally, I don't think `Chiều` sounds appropriate for `PM`
+var dayPeriodValues = {
+ // narrow date period is extremely rare in Vietnamese
+ // I used abbreviated form for noon, morning and afternoon
+ // which are regconizable by Vietnamese, others cannot be any shorter
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'nửa đêm',
+ noon: 'tr',
+ morning: 'sg',
+ afternoon: 'ch',
+ evening: 'tối',
+ night: 'đêm'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'nửa đêm',
+ noon: 'trưa',
+ morning: 'sáng',
+ afternoon: 'chiều',
+ evening: 'tối',
+ night: 'đêm'
+ },
+ wide: {
+ am: 'SA',
+ pm: 'CH',
+ midnight: 'nửa đêm',
+ noon: 'trưa',
+ morning: 'sáng',
+ afternoon: 'chiều',
+ evening: 'tối',
+ night: 'đêm'
+ }
+}
+
+var formattingDayPeriodValues = {
+ narrow: {
+ am: 'am',
+ pm: 'pm',
+ midnight: 'nửa đêm',
+ noon: 'tr',
+ morning: 'sg',
+ afternoon: 'ch',
+ evening: 'tối',
+ night: 'đêm'
+ },
+ abbreviated: {
+ am: 'AM',
+ pm: 'PM',
+ midnight: 'nửa đêm',
+ noon: 'trưa',
+ morning: 'sáng',
+ afternoon: 'chiều',
+ evening: 'tối',
+ night: 'đêm'
+ },
+ wide: {
+ am: 'SA',
+ pm: 'CH',
+ midnight: 'nửa đêm',
+ noon: 'giữa trưa',
+ morning: 'vào buổi sáng',
+ afternoon: 'vào buổi chiều',
+ evening: 'vào buổi tối',
+ night: 'vào ban đêm'
+ }
+}
+
+// If ordinal numbers depend on context, for example,
+// if they are different for different grammatical genders,
+// use `options.unit`:
+//
+// var options = dirtyOptions || {}
+// var unit = String(options.unit)
+//
+// where `unit` can be 'month', 'quarter', 'week', 'isoWeek', 'dayOfYear',
+// 'dayOfMonth' or 'dayOfWeek'
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+ var number = parseInt(dirtyNumber, 10)
+
+ if (unit === 'quarter') {
+ // many news outlets use "quý I"...
+ switch (number) {
+ case 1:
+ return 'I'
+ case 2:
+ return 'II'
+ case 3:
+ return 'III'
+ case 4:
+ return 'IV'
+ }
+ } else if (unit === 'day') {
+ // day of week in Vietnamese has ordinal number meaning,
+ // so we should use them, else it'll sound weird
+ switch (number) {
+ case 1:
+ return 'thứ 2' // meaning 2nd day but it's the first day of the week :D
+ case 2:
+ return 'thứ 3' // meaning 3rd day
+ case 3:
+ return 'thứ 4' // meaning 4th day and so on
+ case 4:
+ return 'thứ 5'
+ case 5:
+ return 'thứ 6'
+ case 6:
+ return 'thứ 7'
+ case 7:
+ return 'chủ nhật' // meaning Sunday, there's no 8th day :D
+ }
+ } else if (unit === 'week') {
+ if (number === 1) {
+ return 'thứ nhất'
+ } else {
+ return 'thứ ' + number
+ }
+ } else if (unit === 'dayOfYear') {
+ if (number === 1) {
+ return 'đầu tiên'
+ } else {
+ return 'thứ ' + number
+ }
+ }
+
+ // there are no different forms of ordinal numbers in Vietnamese
+ return number
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingQuarterValues,
+ defaultFormattingWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingMonthValues,
+ defaultFormattingWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/vi/_lib/match/index.js b/date-fns/src/locale/vi/_lib/match/index.js
new file mode 100644
index 0000000..177c278
--- /dev/null
+++ b/date-fns/src/locale/vi/_lib/match/index.js
@@ -0,0 +1,158 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(\d+)/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(tcn|scn)/i,
+ abbreviated: /^(trước CN|sau CN)/i,
+ wide: /^(trước Công Nguyên|sau Công Nguyên)/i
+}
+var parseEraPatterns = {
+ any: [/^t/i, /^s/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^([1234]|i{1,3}v?)/i,
+ abbreviated: /^q([1234]|i{1,3}v?)/i,
+ wide: /^quý ([1234]|i{1,3}v?)/i
+}
+var parseQuarterPatterns = {
+ any: [/(1|i)$/i, /(2|ii)$/i, /(3|iii)$/i, /(4|iv)$/i]
+}
+
+var matchMonthPatterns = {
+ // month number may contain leading 0, 'thg' prefix may have space, underscore or empty before number
+ // note the order of '1' since it is a sub-string of '10', so must be lower priority
+ narrow: /^(0?[2-9]|10|11|12|0?1)/i,
+ // note the order of 'thg 1' since it is sub-string of 'thg 10', so must be lower priority
+ abbreviated: /^thg[ _]?(0?[1-9](?!\d)|10|11|12)/i,
+ // note the order of 'Mười' since it is sub-string of Mười Một, so must be lower priority
+ wide: /^tháng ?(Một|Hai|Ba|Tư|Năm|Sáu|Bảy|Tám|Chín|Mười|Mười ?Một|Mười ?Hai|0?[1-9](?!\d)|10|11|12)/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /0?1$/i,
+ /0?2/i,
+ /3/,
+ /4/,
+ /5/,
+ /6/,
+ /7/,
+ /8/,
+ /9/,
+ /10/,
+ /11/,
+ /12/
+ ],
+ abbreviated: [
+ /^thg[ _]?0?1(?!\d)/i,
+ /^thg[ _]?0?2/i,
+ /^thg[ _]?0?3/i,
+ /^thg[ _]?0?4/i,
+ /^thg[ _]?0?5/i,
+ /^thg[ _]?0?6/i,
+ /^thg[ _]?0?7/i,
+ /^thg[ _]?0?8/i,
+ /^thg[ _]?0?9/i,
+ /^thg[ _]?10/i,
+ /^thg[ _]?11/i,
+ /^thg[ _]?12/i
+ ],
+ wide: [
+ /^tháng ?(Một|0?1(?!\d))/i,
+ /^tháng ?(Hai|0?2)/i,
+ /^tháng ?(Ba|0?3)/i,
+ /^tháng ?(Tư|0?4)/i,
+ /^tháng ?(Năm|0?5)/i,
+ /^tháng ?(Sáu|0?6)/i,
+ /^tháng ?(Bảy|0?7)/i,
+ /^tháng ?(Tám|0?8)/i,
+ /^tháng ?(Chín|0?9)/i,
+ /^tháng ?(Mười|10)/i,
+ /^tháng ?(Mười ?Một|11)/i,
+ /^tháng ?(Mười ?Hai|12)/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^(CN|T2|T3|T4|T5|T6|T7)/i,
+ short: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
+ abbreviated: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
+ wide: /^(Chủ ?Nhật|Chúa ?Nhật|thứ ?Hai|thứ ?Ba|thứ ?Tư|thứ ?Năm|thứ ?Sáu|thứ ?Bảy)/i
+}
+var parseDayPatterns = {
+ narrow: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
+ short: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
+ abbreviated: [/CN/i, /2/i, /3/i, /4/i, /5/i, /6/i, /7/i],
+ wide: [/(Chủ|Chúa) ?Nhật/i, /Hai/i, /Ba/i, /Tư/i, /Năm/i, /Sáu/i, /Bảy/i]
+}
+
+var matchDayPeriodPatterns = {
+ narrow: /^(a|p|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
+ abbreviated: /^(am|pm|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
+ wide: /^(ch[^i]*|sa|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^(a|sa)/i,
+ pm: /^(p|ch[^i]*)/i,
+ midnight: /nửa đêm/i,
+ noon: /trưa/i,
+ morning: /sáng/i,
+ afternoon: /chiều/i,
+ evening: /tối/i,
+ night: /^đêm/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/vi/index.d.ts b/date-fns/src/locale/vi/index.d.ts
new file mode 100644
index 0000000..17be5ca
--- /dev/null
+++ b/date-fns/src/locale/vi/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { vi } from 'date-fns/locale'
+export default vi
diff --git a/date-fns/src/locale/vi/index.js b/date-fns/src/locale/vi/index.js
new file mode 100644
index 0000000..a3487e7
--- /dev/null
+++ b/date-fns/src/locale/vi/index.js
@@ -0,0 +1,29 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Vietnamese locale (Vietnam).
+ * @language Vietnamese
+ * @iso-639-2 vie
+ * @author Thanh Tran [@trongthanh]{@link https://github.com/trongthanh}
+ * @author Leroy Hopson [@lihop]{@link https://github.com/lihop}
+ */
+var locale = {
+ code: 'vi',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 1 /* First week of new year contains Jan 1st */
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/vi/index.js.flow b/date-fns/src/locale/vi/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/vi/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/vi/snapshot.md b/date-fns/src/locale/vi/snapshot.md
new file mode 100644
index 0000000..3609a7a
--- /dev/null
+++ b/date-fns/src/locale/vi/snapshot.md
@@ -0,0 +1,304 @@
+# Vietnamese (vi) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------------ | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 5 | 0004-12-27T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | I | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II | Invalid Date |
+| | QQQ | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | quý I | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | quý II | 2019-01-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | I | Invalid Date |
+| | | 2019-04-01T12:13:14.015Z | II | Invalid Date |
+| | qqq | 2019-01-01T12:13:14.015Z | Q1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Q2 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | Quý 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | Quý 2 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | thg 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | thg 7 | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | tháng 02 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | tháng 07 | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 02 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 07 | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | Thg 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Thg 7 | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | Tháng Hai | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | Tháng Bảy | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | thứ nhất | Invalid Date |
+| | | 2019-12-01T12:13:14.015Z | thứ 48 | Invalid Date |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | thứ nhất | Invalid Date |
+| | | 2019-12-01T12:13:14.015Z | thứ 48 | Invalid Date |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | thứ 42 | Invalid Date |
+| | | 2019-12-31T12:13:14.015Z | thứ 365 | Invalid Date |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | Thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Thứ 6 | Invalid Date |
+| | EE | 2019-02-11T12:13:14.015Z | Thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Thứ 6 | Invalid Date |
+| | EEE | 2019-02-11T12:13:14.015Z | Thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Thứ 6 | Invalid Date |
+| | EEEE | 2019-02-11T12:13:14.015Z | Thứ Hai | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Thứ Sáu | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | T2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | T6 | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | Th 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Th 6 | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | thứ 6 | Invalid Date |
+| | iii | 2019-02-11T12:13:14.015Z | Thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Thứ 6 | Invalid Date |
+| | iiii | 2019-02-11T12:13:14.015Z | Thứ Hai | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Thứ Sáu | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | T2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | T6 | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | Th 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Th 6 | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | thứ 6 | Invalid Date |
+| | eee | 2019-02-11T12:13:14.015Z | Thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Thứ 6 | Invalid Date |
+| | eeee | 2019-02-11T12:13:14.015Z | Thứ Hai | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Thứ Sáu | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | T2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | T6 | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | Th 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Th 6 | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | thứ 6 | Invalid Date |
+| | ccc | 2019-02-11T12:13:14.015Z | Thứ 2 | Invalid Date |
+| | | 2019-02-15T12:13:14.015Z | Thứ 6 | Invalid Date |
+| | cccc | 2019-02-11T12:13:14.015Z | Thứ Hai | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Thứ Sáu | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | T2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | T6 | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | Th 2 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | Th 6 | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | SA | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | CH | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | CH | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | SA | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | am | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | am | Invalid Date |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | PM | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | AM | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | pm | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | am | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | SA | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | CH | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | CH | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | SA | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | am | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | pm | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | am | Invalid Date |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | sáng | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | chiều | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | tối | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | đêm | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | sáng | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | chiều | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | tối | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | đêm | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | sáng | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | chiều | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | tối | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | đêm | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | vào buổi sáng | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | vào buổi chiều | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | vào buổi tối | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | vào ban đêm | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | sg | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | ch | Invalid Date |
+| | | 2019-02-11T19:13:14.015Z | tối | Invalid Date |
+| | | 2019-02-11T02:13:14.015Z | đêm | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 11/02/1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 11 thg 2 năm 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 thg 5 năm 1453 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | ngày 11 tháng 02 năm 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | ngày 29 tháng 05 năm 1453 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | Thứ Tư, ngày 11 tháng 02 năm 1987 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | Chủ Nhật, ngày 29 tháng 05 năm 1453 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+0 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 23:59:59 GMT+00:00 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 11/02/1987 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29/05/1453 23:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 11 thg 2 năm 1987 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 29 thg 5 năm 1453 23:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | ngày 11 tháng 02 năm 1987 12:13:14 GMT+0 | Errored |
+| | | 1453-05-29T23:59:59.999Z | ngày 29 tháng 05 năm 1453 23:59:59 GMT+0 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | Thứ Tư, ngày 11 tháng 02 năm 1987 12:13:14 GMT+00:00 | Errored |
+| | | 1453-05-29T23:59:59.999Z | Chủ Nhật, ngày 29 tháng 05 năm 1453 23:59:59 GMT+00:00 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | -------------- | ---------------------- | -------------------- |
+| 2006-01-01T00:00:00.000Z | khoảng 6 năm | khoảng 6 năm | khoảng 6 năm nữa |
+| 2005-01-01T00:00:00.000Z | khoảng 5 năm | khoảng 5 năm | khoảng 5 năm nữa |
+| 2004-01-01T00:00:00.000Z | khoảng 4 năm | khoảng 4 năm | khoảng 4 năm nữa |
+| 2003-01-01T00:00:00.000Z | khoảng 3 năm | khoảng 3 năm | khoảng 3 năm nữa |
+| 2002-01-01T00:00:00.000Z | khoảng 2 năm | khoảng 2 năm | khoảng 2 năm nữa |
+| 2001-06-01T00:00:00.000Z | hơn 1 năm | hơn 1 năm | hơn 1 năm nữa |
+| 2001-02-01T00:00:00.000Z | khoảng 1 năm | khoảng 1 năm | khoảng 1 năm nữa |
+| 2001-01-01T00:00:00.000Z | khoảng 1 năm | khoảng 1 năm | khoảng 1 năm nữa |
+| 2000-06-01T00:00:00.000Z | 5 tháng | 5 tháng | 5 tháng nữa |
+| 2000-03-01T00:00:00.000Z | 2 tháng | 2 tháng | 2 tháng nữa |
+| 2000-02-01T00:00:00.000Z | khoảng 1 tháng | khoảng 1 tháng | khoảng 1 tháng nữa |
+| 2000-01-15T00:00:00.000Z | 14 ngày | 14 ngày | 14 ngày nữa |
+| 2000-01-02T00:00:00.000Z | 1 ngày | 1 ngày | 1 ngày nữa |
+| 2000-01-01T06:00:00.000Z | khoảng 6 giờ | khoảng 6 giờ | khoảng 6 giờ nữa |
+| 2000-01-01T01:00:00.000Z | khoảng 1 giờ | khoảng 1 giờ | khoảng 1 giờ nữa |
+| 2000-01-01T00:45:00.000Z | khoảng 1 giờ | khoảng 1 giờ | khoảng 1 giờ nữa |
+| 2000-01-01T00:30:00.000Z | 30 phút | 30 phút | 30 phút nữa |
+| 2000-01-01T00:15:00.000Z | 15 phút | 15 phút | 15 phút nữa |
+| 2000-01-01T00:01:00.000Z | 1 phút | 1 phút | 1 phút nữa |
+| 2000-01-01T00:00:25.000Z | dưới 1 phút | nửa phút | dưới 1 phút nữa |
+| 2000-01-01T00:00:15.000Z | dưới 1 phút | dưới 20 giây | dưới 1 phút nữa |
+| 2000-01-01T00:00:05.000Z | dưới 1 phút | dưới 10 giây | dưới 1 phút nữa |
+| 2000-01-01T00:00:00.000Z | dưới 1 phút | dưới 5 giây | dưới 1 phút trước |
+| 1999-12-31T23:59:55.000Z | dưới 1 phút | dưới 10 giây | dưới 1 phút trước |
+| 1999-12-31T23:59:45.000Z | dưới 1 phút | dưới 20 giây | dưới 1 phút trước |
+| 1999-12-31T23:59:35.000Z | dưới 1 phút | nửa phút | dưới 1 phút trước |
+| 1999-12-31T23:59:00.000Z | 1 phút | 1 phút | 1 phút trước |
+| 1999-12-31T23:45:00.000Z | 15 phút | 15 phút | 15 phút trước |
+| 1999-12-31T23:30:00.000Z | 30 phút | 30 phút | 30 phút trước |
+| 1999-12-31T23:15:00.000Z | khoảng 1 giờ | khoảng 1 giờ | khoảng 1 giờ trước |
+| 1999-12-31T23:00:00.000Z | khoảng 1 giờ | khoảng 1 giờ | khoảng 1 giờ trước |
+| 1999-12-31T18:00:00.000Z | khoảng 6 giờ | khoảng 6 giờ | khoảng 6 giờ trước |
+| 1999-12-30T00:00:00.000Z | 2 ngày | 2 ngày | 2 ngày trước |
+| 1999-12-15T00:00:00.000Z | 17 ngày | 17 ngày | 17 ngày trước |
+| 1999-12-01T00:00:00.000Z | khoảng 1 tháng | khoảng 1 tháng | khoảng 1 tháng trước |
+| 1999-11-01T00:00:00.000Z | 2 tháng | 2 tháng | 2 tháng trước |
+| 1999-06-01T00:00:00.000Z | 7 tháng | 7 tháng | 7 tháng trước |
+| 1999-01-01T00:00:00.000Z | khoảng 1 năm | khoảng 1 năm | khoảng 1 năm trước |
+| 1998-12-01T00:00:00.000Z | khoảng 1 năm | khoảng 1 năm | khoảng 1 năm trước |
+| 1998-06-01T00:00:00.000Z | hơn 1 năm | hơn 1 năm | hơn 1 năm trước |
+| 1998-01-01T00:00:00.000Z | khoảng 2 năm | khoảng 2 năm | khoảng 2 năm trước |
+| 1997-01-01T00:00:00.000Z | khoảng 3 năm | khoảng 3 năm | khoảng 3 năm trước |
+| 1996-01-01T00:00:00.000Z | khoảng 4 năm | khoảng 4 năm | khoảng 4 năm trước |
+| 1995-01-01T00:00:00.000Z | khoảng 5 năm | khoảng 5 năm | khoảng 5 năm trước |
+| 1994-01-01T00:00:00.000Z | khoảng 6 năm | khoảng 6 năm | khoảng 6 năm trước |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 năm | 6 năm nữa | 52608 giờ |
+| 2005-01-01T00:00:00.000Z | 5 năm | 5 năm nữa | 43848 giờ |
+| 2004-01-01T00:00:00.000Z | 4 năm | 4 năm nữa | 35064 giờ |
+| 2003-01-01T00:00:00.000Z | 3 năm | 3 năm nữa | 26304 giờ |
+| 2002-01-01T00:00:00.000Z | 2 năm | 2 năm nữa | 17544 giờ |
+| 2001-06-01T00:00:00.000Z | 1 năm | 1 năm nữa | 12408 giờ |
+| 2001-02-01T00:00:00.000Z | 1 năm | 1 năm nữa | 9528 giờ |
+| 2001-01-01T00:00:00.000Z | 1 năm | 1 năm nữa | 8784 giờ |
+| 2000-06-01T00:00:00.000Z | 5 tháng | 5 tháng nữa | 3648 giờ |
+| 2000-03-01T00:00:00.000Z | 2 tháng | 2 tháng nữa | 1440 giờ |
+| 2000-02-01T00:00:00.000Z | 1 tháng | 1 tháng nữa | 744 giờ |
+| 2000-01-15T00:00:00.000Z | 14 ngày | 14 ngày nữa | 336 giờ |
+| 2000-01-02T00:00:00.000Z | 1 ngày | 1 ngày nữa | 24 giờ |
+| 2000-01-01T06:00:00.000Z | 6 giờ | 6 giờ nữa | 6 giờ |
+| 2000-01-01T01:00:00.000Z | 1 giờ | 1 giờ nữa | 1 giờ |
+| 2000-01-01T00:45:00.000Z | 45 phút | 45 phút nữa | 1 giờ |
+| 2000-01-01T00:30:00.000Z | 30 phút | 30 phút nữa | 1 giờ |
+| 2000-01-01T00:15:00.000Z | 15 phút | 15 phút nữa | 0 giờ |
+| 2000-01-01T00:01:00.000Z | 1 phút | 1 phút nữa | 0 giờ |
+| 2000-01-01T00:00:25.000Z | 25 giây | 25 giây nữa | 0 giờ |
+| 2000-01-01T00:00:15.000Z | 15 giây | 15 giây nữa | 0 giờ |
+| 2000-01-01T00:00:05.000Z | 5 giây | 5 giây nữa | 0 giờ |
+| 2000-01-01T00:00:00.000Z | 0 giây | 0 giây trước | 0 giờ |
+| 1999-12-31T23:59:55.000Z | 5 giây | 5 giây trước | 0 giờ |
+| 1999-12-31T23:59:45.000Z | 15 giây | 15 giây trước | 0 giờ |
+| 1999-12-31T23:59:35.000Z | 25 giây | 25 giây trước | 0 giờ |
+| 1999-12-31T23:59:00.000Z | 1 phút | 1 phút trước | 0 giờ |
+| 1999-12-31T23:45:00.000Z | 15 phút | 15 phút trước | 0 giờ |
+| 1999-12-31T23:30:00.000Z | 30 phút | 30 phút trước | 1 giờ |
+| 1999-12-31T23:15:00.000Z | 45 phút | 45 phút trước | 1 giờ |
+| 1999-12-31T23:00:00.000Z | 1 giờ | 1 giờ trước | 1 giờ |
+| 1999-12-31T18:00:00.000Z | 6 giờ | 6 giờ trước | 6 giờ |
+| 1999-12-30T00:00:00.000Z | 2 ngày | 2 ngày trước | 48 giờ |
+| 1999-12-15T00:00:00.000Z | 17 ngày | 17 ngày trước | 408 giờ |
+| 1999-12-01T00:00:00.000Z | 1 tháng | 1 tháng trước | 744 giờ |
+| 1999-11-01T00:00:00.000Z | 2 tháng | 2 tháng trước | 1464 giờ |
+| 1999-06-01T00:00:00.000Z | 7 tháng | 7 tháng trước | 5136 giờ |
+| 1999-01-01T00:00:00.000Z | 1 năm | 1 năm trước | 8760 giờ |
+| 1998-12-01T00:00:00.000Z | 1 năm | 1 năm trước | 9504 giờ |
+| 1998-06-01T00:00:00.000Z | 2 năm | 2 năm trước | 13896 giờ |
+| 1998-01-01T00:00:00.000Z | 2 năm | 2 năm trước | 17520 giờ |
+| 1997-01-01T00:00:00.000Z | 3 năm | 3 năm trước | 26280 giờ |
+| 1996-01-01T00:00:00.000Z | 4 năm | 4 năm trước | 35064 giờ |
+| 1995-01-01T00:00:00.000Z | 5 năm | 5 năm trước | 43824 giờ |
+| 1994-01-01T00:00:00.000Z | 6 năm | 6 năm trước | 52584 giờ |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | -------------------------------- |
+| 2000-01-10T00:00:00.000Z | 10/01/2000 |
+| 2000-01-05T00:00:00.000Z | Thứ Tư tới vào lúc 00:00 |
+| 2000-01-02T00:00:00.000Z | ngày mai vào lúc 00:00 |
+| 2000-01-01T00:00:00.000Z | hôm nay vào lúc 00:00 |
+| 1999-12-31T00:00:00.000Z | hôm qua vào lúc 00:00 |
+| 1999-12-27T00:00:00.000Z | Thứ Hai tuần trước vào lúc 00:00 |
+| 1999-12-21T00:00:00.000Z | 21/12/1999 |
diff --git a/date-fns/src/locale/zh-CN/_lib/formatDistance/index.js b/date-fns/src/locale/zh-CN/_lib/formatDistance/index.js
new file mode 100644
index 0000000..df916e8
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: '不到 1 秒',
+ other: '不到 {{count}} 秒'
+ },
+
+ xSeconds: {
+ one: '1 秒',
+ other: '{{count}} 秒'
+ },
+
+ halfAMinute: '半分钟',
+
+ lessThanXMinutes: {
+ one: '不到 1 分钟',
+ other: '不到 {{count}} 分钟'
+ },
+
+ xMinutes: {
+ one: '1 分钟',
+ other: '{{count}} 分钟'
+ },
+
+ xHours: {
+ one: '1 小时',
+ other: '{{count}} 小时'
+ },
+
+ aboutXHours: {
+ one: '大约 1 小时',
+ other: '大约 {{count}} 小时'
+ },
+
+ xDays: {
+ one: '1 天',
+ other: '{{count}} 天'
+ },
+
+ aboutXWeeks: {
+ one: '大约 1 个星期',
+ other: '大约 {{count}} 个星期'
+ },
+
+ xWeeks: {
+ one: '1 个星期',
+ other: '{{count}} 个星期'
+ },
+
+ aboutXMonths: {
+ one: '大约 1 个月',
+ other: '大约 {{count}} 个月'
+ },
+
+ xMonths: {
+ one: '1 个月',
+ other: '{{count}} 个月'
+ },
+
+ aboutXYears: {
+ one: '大约 1 年',
+ other: '大约 {{count}} 年'
+ },
+
+ xYears: {
+ one: '1 年',
+ other: '{{count}} 年'
+ },
+
+ overXYears: {
+ one: '超过 1 年',
+ other: '超过 {{count}} 年'
+ },
+
+ almostXYears: {
+ one: '将近 1 年',
+ other: '将近 {{count}} 年'
+ }
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + '内'
+ } else {
+ return result + '前'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/zh-CN/_lib/formatLong/index.js b/date-fns/src/locale/zh-CN/_lib/formatLong/index.js
new file mode 100644
index 0000000..2d3ba38
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "y'年'M'月'd'日' EEEE",
+ long: "y'年'M'月'd'日'",
+ medium: 'yyyy-MM-dd',
+ short: 'yy-MM-dd'
+}
+
+var timeFormats = {
+ full: 'zzzz a h:mm:ss',
+ long: 'z a h:mm:ss',
+ medium: 'a h:mm:ss',
+ short: 'a h:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/zh-CN/_lib/formatRelative/index.js b/date-fns/src/locale/zh-CN/_lib/formatRelative/index.js
new file mode 100644
index 0000000..bc50f4d
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/_lib/formatRelative/index.js
@@ -0,0 +1,29 @@
+import isSameUTCWeek from '../../../../_lib/isSameUTCWeek/index'
+
+function checkWeek(_date, _baseDate, _options, baseFormat) {
+ if (isSameUTCWeek(_date, _baseDate, _options)) {
+ return baseFormat // in same week
+ } else if (_date.getTime() > _baseDate.getTime()) {
+ return "'下个'" + baseFormat // in next week
+ }
+ return "'上个'" + baseFormat // in last week
+}
+
+var formatRelativeLocale = {
+ lastWeek: checkWeek, // days before yesterday, maybe in this week or last week
+ yesterday: "'昨天' p",
+ today: "'今天' p",
+ tomorrow: "'明天' p",
+ nextWeek: checkWeek, // days after tomorrow, maybe in this week or next week
+ other: 'PP p'
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ var format = formatRelativeLocale[token]
+
+ if (typeof format === 'function') {
+ return format(_date, _baseDate, _options, 'eeee p')
+ }
+
+ return format
+}
diff --git a/date-fns/src/locale/zh-CN/_lib/localize/index.js b/date-fns/src/locale/zh-CN/_lib/localize/index.js
new file mode 100644
index 0000000..c3027be
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/_lib/localize/index.js
@@ -0,0 +1,194 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['前', '公元'],
+ abbreviated: ['前', '公元'],
+ wide: ['公元前', '公元']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['第一刻', '第二刻', '第三刻', '第四刻'],
+ wide: ['第一刻钟', '第二刻钟', '第三刻钟', '第四刻钟']
+}
+
+var monthValues = {
+ narrow: [
+ '一',
+ '二',
+ '三',
+ '四',
+ '五',
+ '六',
+ '七',
+ '八',
+ '九',
+ '十',
+ '十一',
+ '十二'
+ ],
+ abbreviated: [
+ '1月',
+ '2月',
+ '3月',
+ '4月',
+ '5月',
+ '6月',
+ '7月',
+ '8月',
+ '9月',
+ '10月',
+ '11月',
+ '12月'
+ ],
+ wide: [
+ '一月',
+ '二月',
+ '三月',
+ '四月',
+ '五月',
+ '六月',
+ '七月',
+ '八月',
+ '九月',
+ '十月',
+ '十一月',
+ '十二月'
+ ]
+}
+
+var dayValues = {
+ narrow: ['日', '一', '二', '三', '四', '五', '六'],
+ short: ['日', '一', '二', '三', '四', '五', '六'],
+ abbreviated: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
+ wide: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: '上',
+ pm: '下',
+ midnight: '凌晨',
+ noon: '午',
+ morning: '早',
+ afternoon: '下午',
+ evening: '晚',
+ night: '夜'
+ },
+ abbreviated: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜间'
+ },
+ wide: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜间'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: '上',
+ pm: '下',
+ midnight: '凌晨',
+ noon: '午',
+ morning: '早',
+ afternoon: '下午',
+ evening: '晚',
+ night: '夜'
+ },
+ abbreviated: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜间'
+ },
+ wide: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜间'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+ var number = Number(dirtyNumber)
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+
+ switch (unit) {
+ case 'date':
+ return number.toString() + '日'
+ case 'hour':
+ return number.toString() + '时'
+ case 'minute':
+ return number.toString() + '分'
+ case 'second':
+ return number.toString() + '秒'
+ default:
+ return '第 ' + number.toString()
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/zh-CN/_lib/match/index.js b/date-fns/src/locale/zh-CN/_lib/match/index.js
new file mode 100644
index 0000000..7b4cb2f
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/_lib/match/index.js
@@ -0,0 +1,135 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(第\s*)?\d+(日|时|分|秒)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(前)/i,
+ abbreviated: /^(前)/i,
+ wide: /^(公元前|公元)/i
+}
+var parseEraPatterns = {
+ any: [/^(前)/i, /^(公元)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^第[一二三四]刻/i,
+ wide: /^第[一二三四]刻钟/i
+}
+var parseQuarterPatterns = {
+ any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
+ abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
+ wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^一/i,
+ /^二/i,
+ /^三/i,
+ /^四/i,
+ /^五/i,
+ /^六/i,
+ /^七/i,
+ /^八/i,
+ /^九/i,
+ /^十(?!(一|二))/i,
+ /^十一/i,
+ /^十二/i
+ ],
+ any: [
+ /^一|1/i,
+ /^二|2/i,
+ /^三|3/i,
+ /^四|4/i,
+ /^五|5/i,
+ /^六|6/i,
+ /^七|7/i,
+ /^八|8/i,
+ /^九|9/i,
+ /^十(?!(一|二))|10/i,
+ /^十一|11/i,
+ /^十二|12/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[一二三四五六日]/i,
+ short: /^[一二三四五六日]/i,
+ abbreviated: /^周[一二三四五六日]/i,
+ wide: /^星期[一二三四五六日]/i
+}
+var parseDayPatterns = {
+ any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^上午?/i,
+ pm: /^下午?/i,
+ midnight: /^午夜/i,
+ noon: /^[中正]午/i,
+ morning: /^早上/i,
+ afternoon: /^下午/i,
+ evening: /^晚上?/i,
+ night: /^凌晨/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/zh-CN/index.d.ts b/date-fns/src/locale/zh-CN/index.d.ts
new file mode 100644
index 0000000..ffe2f2e
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { zhCN } from 'date-fns/locale'
+export default zhCN
diff --git a/date-fns/src/locale/zh-CN/index.js b/date-fns/src/locale/zh-CN/index.js
new file mode 100644
index 0000000..0540e58
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/index.js
@@ -0,0 +1,32 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Chinese Simplified locale.
+ * @language Chinese Simplified
+ * @iso-639-2 zho
+ * @author Changyu Geng [@KingMario]{@link https://github.com/KingMario}
+ * @author Song Shuoyun [@fnlctrl]{@link https://github.com/fnlctrl}
+ * @author sabrinaM [@sabrinamiao]{@link https://github.com/sabrinamiao}
+ * @author Carney Wu [@cubicwork]{@link https://github.com/cubicwork}
+ * @author Terrence Lam [@skyuplam]{@link https://github.com/skyuplam}
+ */
+var locale = {
+ code: 'zh-CN',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/zh-CN/index.js.flow b/date-fns/src/locale/zh-CN/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/zh-CN/snapshot.md b/date-fns/src/locale/zh-CN/snapshot.md
new file mode 100644
index 0000000..b11b41d
--- /dev/null
+++ b/date-fns/src/locale/zh-CN/snapshot.md
@@ -0,0 +1,304 @@
+# Chinese Simplified (zh-CN) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 第 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 第 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 第 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 第 4 | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 第 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 第一刻 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 第一刻钟 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻钟 | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 第 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 第一刻 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 第一刻钟 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻钟 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 第 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 第 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | 二月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七月 | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 二 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七 | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 第 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 第 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | 二月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七月 | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 二 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七 | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 第 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 第 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 第 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 第 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 日 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 日 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 第 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 第 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | 周一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 周五 | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | 周一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 周五 | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | 周一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 周五 | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 第 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 第 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | 周一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 周五 | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 第 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 第 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | 周一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 周五 | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 第 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 第 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | 周一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 周五 | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜间 | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜间 | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜间 | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜间 | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | 早 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜 | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 时 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 时 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 时 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 时 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 时 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 时 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 时 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 时 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 分 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 分 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 秒 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 秒 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 87-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53-05-29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 下午 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 下午 11:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 下午 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 下午 11:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | GMT+0 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | GMT+0 下午 11:59:59 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | GMT+00:00 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | GMT+00:00 下午 11:59:59 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 87-02-11 下午 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53-05-29 下午 11:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987-02-11 下午 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 下午 11:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 GMT+0 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 GMT+0 下午 11:59:59 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 GMT+00:00 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 GMT+00:00 下午 11:59:59 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------- | ---------------------- | ----------------- |
+| 2006-01-01T00:00:00.000Z | 大约 6 年 | 大约 6 年 | 大约 6 年内 |
+| 2005-01-01T00:00:00.000Z | 大约 5 年 | 大约 5 年 | 大约 5 年内 |
+| 2004-01-01T00:00:00.000Z | 大约 4 年 | 大约 4 年 | 大约 4 年内 |
+| 2003-01-01T00:00:00.000Z | 大约 3 年 | 大约 3 年 | 大约 3 年内 |
+| 2002-01-01T00:00:00.000Z | 大约 2 年 | 大约 2 年 | 大约 2 年内 |
+| 2001-06-01T00:00:00.000Z | 超过 1 年 | 超过 1 年 | 超过 1 年内 |
+| 2001-02-01T00:00:00.000Z | 大约 1 年 | 大约 1 年 | 大约 1 年内 |
+| 2001-01-01T00:00:00.000Z | 大约 1 年 | 大约 1 年 | 大约 1 年内 |
+| 2000-06-01T00:00:00.000Z | 5 个月 | 5 个月 | 5 个月内 |
+| 2000-03-01T00:00:00.000Z | 2 个月 | 2 个月 | 2 个月内 |
+| 2000-02-01T00:00:00.000Z | 大约 1 个月 | 大约 1 个月 | 大约 1 个月内 |
+| 2000-01-15T00:00:00.000Z | 14 天 | 14 天 | 14 天内 |
+| 2000-01-02T00:00:00.000Z | 1 天 | 1 天 | 1 天内 |
+| 2000-01-01T06:00:00.000Z | 大约 6 小时 | 大约 6 小时 | 大约 6 小时内 |
+| 2000-01-01T01:00:00.000Z | 大约 1 小时 | 大约 1 小时 | 大约 1 小时内 |
+| 2000-01-01T00:45:00.000Z | 大约 1 小时 | 大约 1 小时 | 大约 1 小时内 |
+| 2000-01-01T00:30:00.000Z | 30 分钟 | 30 分钟 | 30 分钟内 |
+| 2000-01-01T00:15:00.000Z | 15 分钟 | 15 分钟 | 15 分钟内 |
+| 2000-01-01T00:01:00.000Z | 1 分钟 | 1 分钟 | 1 分钟内 |
+| 2000-01-01T00:00:25.000Z | 不到 1 分钟 | 半分钟 | 不到 1 分钟内 |
+| 2000-01-01T00:00:15.000Z | 不到 1 分钟 | 不到 20 秒 | 不到 1 分钟内 |
+| 2000-01-01T00:00:05.000Z | 不到 1 分钟 | 不到 10 秒 | 不到 1 分钟内 |
+| 2000-01-01T00:00:00.000Z | 不到 1 分钟 | 不到 5 秒 | 不到 1 分钟前 |
+| 1999-12-31T23:59:55.000Z | 不到 1 分钟 | 不到 10 秒 | 不到 1 分钟前 |
+| 1999-12-31T23:59:45.000Z | 不到 1 分钟 | 不到 20 秒 | 不到 1 分钟前 |
+| 1999-12-31T23:59:35.000Z | 不到 1 分钟 | 半分钟 | 不到 1 分钟前 |
+| 1999-12-31T23:59:00.000Z | 1 分钟 | 1 分钟 | 1 分钟前 |
+| 1999-12-31T23:45:00.000Z | 15 分钟 | 15 分钟 | 15 分钟前 |
+| 1999-12-31T23:30:00.000Z | 30 分钟 | 30 分钟 | 30 分钟前 |
+| 1999-12-31T23:15:00.000Z | 大约 1 小时 | 大约 1 小时 | 大约 1 小时前 |
+| 1999-12-31T23:00:00.000Z | 大约 1 小时 | 大约 1 小时 | 大约 1 小时前 |
+| 1999-12-31T18:00:00.000Z | 大约 6 小时 | 大约 6 小时 | 大约 6 小时前 |
+| 1999-12-30T00:00:00.000Z | 2 天 | 2 天 | 2 天前 |
+| 1999-12-15T00:00:00.000Z | 17 天 | 17 天 | 17 天前 |
+| 1999-12-01T00:00:00.000Z | 大约 1 个月 | 大约 1 个月 | 大约 1 个月前 |
+| 1999-11-01T00:00:00.000Z | 2 个月 | 2 个月 | 2 个月前 |
+| 1999-06-01T00:00:00.000Z | 7 个月 | 7 个月 | 7 个月前 |
+| 1999-01-01T00:00:00.000Z | 大约 1 年 | 大约 1 年 | 大约 1 年前 |
+| 1998-12-01T00:00:00.000Z | 大约 1 年 | 大约 1 年 | 大约 1 年前 |
+| 1998-06-01T00:00:00.000Z | 超过 1 年 | 超过 1 年 | 超过 1 年前 |
+| 1998-01-01T00:00:00.000Z | 大约 2 年 | 大约 2 年 | 大约 2 年前 |
+| 1997-01-01T00:00:00.000Z | 大约 3 年 | 大约 3 年 | 大约 3 年前 |
+| 1996-01-01T00:00:00.000Z | 大约 4 年 | 大约 4 年 | 大约 4 年前 |
+| 1995-01-01T00:00:00.000Z | 大约 5 年 | 大约 5 年 | 大约 5 年前 |
+| 1994-01-01T00:00:00.000Z | 大约 6 年 | 大约 6 年 | 大约 6 年前 |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 年 | 6 年内 | 52608 小时 |
+| 2005-01-01T00:00:00.000Z | 5 年 | 5 年内 | 43848 小时 |
+| 2004-01-01T00:00:00.000Z | 4 年 | 4 年内 | 35064 小时 |
+| 2003-01-01T00:00:00.000Z | 3 年 | 3 年内 | 26304 小时 |
+| 2002-01-01T00:00:00.000Z | 2 年 | 2 年内 | 17544 小时 |
+| 2001-06-01T00:00:00.000Z | 1 年 | 1 年内 | 12408 小时 |
+| 2001-02-01T00:00:00.000Z | 1 年 | 1 年内 | 9528 小时 |
+| 2001-01-01T00:00:00.000Z | 1 年 | 1 年内 | 8784 小时 |
+| 2000-06-01T00:00:00.000Z | 5 个月 | 5 个月内 | 3648 小时 |
+| 2000-03-01T00:00:00.000Z | 2 个月 | 2 个月内 | 1440 小时 |
+| 2000-02-01T00:00:00.000Z | 1 个月 | 1 个月内 | 744 小时 |
+| 2000-01-15T00:00:00.000Z | 14 天 | 14 天内 | 336 小时 |
+| 2000-01-02T00:00:00.000Z | 1 天 | 1 天内 | 24 小时 |
+| 2000-01-01T06:00:00.000Z | 6 小时 | 6 小时内 | 6 小时 |
+| 2000-01-01T01:00:00.000Z | 1 小时 | 1 小时内 | 1 小时 |
+| 2000-01-01T00:45:00.000Z | 45 分钟 | 45 分钟内 | 1 小时 |
+| 2000-01-01T00:30:00.000Z | 30 分钟 | 30 分钟内 | 1 小时 |
+| 2000-01-01T00:15:00.000Z | 15 分钟 | 15 分钟内 | 0 小时 |
+| 2000-01-01T00:01:00.000Z | 1 分钟 | 1 分钟内 | 0 小时 |
+| 2000-01-01T00:00:25.000Z | 25 秒 | 25 秒内 | 0 小时 |
+| 2000-01-01T00:00:15.000Z | 15 秒 | 15 秒内 | 0 小时 |
+| 2000-01-01T00:00:05.000Z | 5 秒 | 5 秒内 | 0 小时 |
+| 2000-01-01T00:00:00.000Z | 0 秒 | 0 秒前 | 0 小时 |
+| 1999-12-31T23:59:55.000Z | 5 秒 | 5 秒前 | 0 小时 |
+| 1999-12-31T23:59:45.000Z | 15 秒 | 15 秒前 | 0 小时 |
+| 1999-12-31T23:59:35.000Z | 25 秒 | 25 秒前 | 0 小时 |
+| 1999-12-31T23:59:00.000Z | 1 分钟 | 1 分钟前 | 0 小时 |
+| 1999-12-31T23:45:00.000Z | 15 分钟 | 15 分钟前 | 0 小时 |
+| 1999-12-31T23:30:00.000Z | 30 分钟 | 30 分钟前 | 1 小时 |
+| 1999-12-31T23:15:00.000Z | 45 分钟 | 45 分钟前 | 1 小时 |
+| 1999-12-31T23:00:00.000Z | 1 小时 | 1 小时前 | 1 小时 |
+| 1999-12-31T18:00:00.000Z | 6 小时 | 6 小时前 | 6 小时 |
+| 1999-12-30T00:00:00.000Z | 2 天 | 2 天前 | 48 小时 |
+| 1999-12-15T00:00:00.000Z | 17 天 | 17 天前 | 408 小时 |
+| 1999-12-01T00:00:00.000Z | 1 个月 | 1 个月前 | 744 小时 |
+| 1999-11-01T00:00:00.000Z | 2 个月 | 2 个月前 | 1464 小时 |
+| 1999-06-01T00:00:00.000Z | 7 个月 | 7 个月前 | 5136 小时 |
+| 1999-01-01T00:00:00.000Z | 1 年 | 1 年前 | 8760 小时 |
+| 1998-12-01T00:00:00.000Z | 1 年 | 1 年前 | 9504 小时 |
+| 1998-06-01T00:00:00.000Z | 2 年 | 2 年前 | 13896 小时 |
+| 1998-01-01T00:00:00.000Z | 2 年 | 2 年前 | 17520 小时 |
+| 1997-01-01T00:00:00.000Z | 3 年 | 3 年前 | 26280 小时 |
+| 1996-01-01T00:00:00.000Z | 4 年 | 4 年前 | 35064 小时 |
+| 1995-01-01T00:00:00.000Z | 5 年 | 5 年前 | 43824 小时 |
+| 1994-01-01T00:00:00.000Z | 6 年 | 6 年前 | 52584 小时 |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------- |
+| 2000-01-10T00:00:00.000Z | 2000-01-10 上午 12:00 |
+| 2000-01-05T00:00:00.000Z | 下个星期三 上午 12:00 |
+| 2000-01-02T00:00:00.000Z | 明天 上午 12:00 |
+| 2000-01-01T00:00:00.000Z | 今天 上午 12:00 |
+| 1999-12-31T00:00:00.000Z | 昨天 上午 12:00 |
+| 1999-12-27T00:00:00.000Z | 星期一 上午 12:00 |
+| 1999-12-21T00:00:00.000Z | 1999-12-21 上午 12:00 |
diff --git a/date-fns/src/locale/zh-TW/_lib/formatDistance/index.js b/date-fns/src/locale/zh-TW/_lib/formatDistance/index.js
new file mode 100644
index 0000000..affa550
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/_lib/formatDistance/index.js
@@ -0,0 +1,101 @@
+var formatDistanceLocale = {
+ lessThanXSeconds: {
+ one: '少於 1 秒',
+ other: '少於 {{count}} 秒',
+ },
+
+ xSeconds: {
+ one: '1 秒',
+ other: '{{count}} 秒',
+ },
+
+ halfAMinute: '半分鐘',
+
+ lessThanXMinutes: {
+ one: '少於 1 分鐘',
+ other: '少於 {{count}} 分鐘',
+ },
+
+ xMinutes: {
+ one: '1 分鐘',
+ other: '{{count}} 分鐘',
+ },
+
+ xHours: {
+ one: '1 小時',
+ other: '{{count}} 小時',
+ },
+
+ aboutXHours: {
+ one: '大約 1 小時',
+ other: '大約 {{count}} 小時',
+ },
+
+ xDays: {
+ one: '1 天',
+ other: '{{count}} 天',
+ },
+
+ aboutXWeeks: {
+ one: '大約 1 個星期',
+ other: '大約 {{count}} 個星期',
+ },
+
+ xWeeks: {
+ one: '1 個星期',
+ other: '{{count}} 個星期',
+ },
+
+ aboutXMonths: {
+ one: '大約 1 個月',
+ other: '大約 {{count}} 個月',
+ },
+
+ xMonths: {
+ one: '1 個月',
+ other: '{{count}} 個月',
+ },
+
+ aboutXYears: {
+ one: '大約 1 年',
+ other: '大約 {{count}} 年',
+ },
+
+ xYears: {
+ one: '1 年',
+ other: '{{count}} 年',
+ },
+
+ overXYears: {
+ one: '超過 1 年',
+ other: '超過 {{count}} 年',
+ },
+
+ almostXYears: {
+ one: '將近 1 年',
+ other: '將近 {{count}} 年',
+ },
+}
+
+export default function formatDistance(token, count, options) {
+ options = options || {}
+
+ var result
+ if (typeof formatDistanceLocale[token] === 'string') {
+ result = formatDistanceLocale[token]
+ } else if (count === 1) {
+ result = formatDistanceLocale[token].one
+ } else {
+ result = formatDistanceLocale[token].other.replace('{{count}}', count)
+ }
+
+ if (options.addSuffix) {
+ if (options.comparison > 0) {
+ return result + '內'
+ } else {
+ return result + '前'
+ }
+ }
+
+ return result
+}
diff --git a/date-fns/src/locale/zh-TW/_lib/formatLong/index.js b/date-fns/src/locale/zh-TW/_lib/formatLong/index.js
new file mode 100644
index 0000000..2d3ba38
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/_lib/formatLong/index.js
@@ -0,0 +1,41 @@
+import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index'
+
+var dateFormats = {
+ full: "y'年'M'月'd'日' EEEE",
+ long: "y'年'M'月'd'日'",
+ medium: 'yyyy-MM-dd',
+ short: 'yy-MM-dd'
+}
+
+var timeFormats = {
+ full: 'zzzz a h:mm:ss',
+ long: 'z a h:mm:ss',
+ medium: 'a h:mm:ss',
+ short: 'a h:mm'
+}
+
+var dateTimeFormats = {
+ full: '{{date}} {{time}}',
+ long: '{{date}} {{time}}',
+ medium: '{{date}} {{time}}',
+ short: '{{date}} {{time}}'
+}
+
+var formatLong = {
+ date: buildFormatLongFn({
+ formats: dateFormats,
+ defaultWidth: 'full'
+ }),
+
+ time: buildFormatLongFn({
+ formats: timeFormats,
+ defaultWidth: 'full'
+ }),
+
+ dateTime: buildFormatLongFn({
+ formats: dateTimeFormats,
+ defaultWidth: 'full'
+ })
+}
+
+export default formatLong
diff --git a/date-fns/src/locale/zh-TW/_lib/formatRelative/index.js b/date-fns/src/locale/zh-TW/_lib/formatRelative/index.js
new file mode 100644
index 0000000..fed9857
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/_lib/formatRelative/index.js
@@ -0,0 +1,12 @@
+var formatRelativeLocale = {
+ lastWeek: "'上個'eeee p",
+ yesterday: "'昨天' p",
+ today: "'今天' p",
+ tomorrow: "'明天' p",
+ nextWeek: "'下個'eeee p",
+ other: 'P',
+}
+
+export default function formatRelative(token, _date, _baseDate, _options) {
+ return formatRelativeLocale[token]
+}
diff --git a/date-fns/src/locale/zh-TW/_lib/localize/index.js b/date-fns/src/locale/zh-TW/_lib/localize/index.js
new file mode 100644
index 0000000..360caf1
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/_lib/localize/index.js
@@ -0,0 +1,196 @@
+import buildLocalizeFn from '../../../_lib/buildLocalizeFn/index'
+
+var eraValues = {
+ narrow: ['前', '公元'],
+ abbreviated: ['前', '公元'],
+ wide: ['公元前', '公元']
+}
+
+var quarterValues = {
+ narrow: ['1', '2', '3', '4'],
+ abbreviated: ['第一刻', '第二刻', '第三刻', '第四刻'],
+ wide: ['第一刻鐘', '第二刻鐘', '第三刻鐘', '第四刻鐘']
+}
+
+var monthValues = {
+ narrow: [
+ '一',
+ '二',
+ '三',
+ '四',
+ '五',
+ '六',
+ '七',
+ '八',
+ '九',
+ '十',
+ '十一',
+ '十二'
+ ],
+ abbreviated: [
+ '1月',
+ '2月',
+ '3月',
+ '4月',
+ '5月',
+ '6月',
+ '7月',
+ '8月',
+ '9月',
+ '10月',
+ '11月',
+ '12月'
+ ],
+ wide: [
+ '一月',
+ '二月',
+ '三月',
+ '四月',
+ '五月',
+ '六月',
+ '七月',
+ '八月',
+ '九月',
+ '十月',
+ '十一月',
+ '十二月'
+ ]
+}
+
+var dayValues = {
+ narrow: ['日', '一', '二', '三', '四', '五', '六'],
+ short: ['日', '一', '二', '三', '四', '五', '六'],
+ abbreviated: ['週日', '週一', '週二', '週三', '週四', '週五', '週六'],
+ wide: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
+}
+
+var dayPeriodValues = {
+ narrow: {
+ am: '上',
+ pm: '下',
+ midnight: '凌晨',
+ noon: '午',
+ morning: '早',
+ afternoon: '下午',
+ evening: '晚',
+ night: '夜'
+ },
+ abbreviated: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜間'
+ },
+ wide: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜間'
+ }
+}
+var formattingDayPeriodValues = {
+ narrow: {
+ am: '上',
+ pm: '下',
+ midnight: '凌晨',
+ noon: '午',
+ morning: '早',
+ afternoon: '下午',
+ evening: '晚',
+ night: '夜'
+ },
+ abbreviated: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜間'
+ },
+ wide: {
+ am: '上午',
+ pm: '下午',
+ midnight: '凌晨',
+ noon: '中午',
+ morning: '早晨',
+ afternoon: '中午',
+ evening: '晚上',
+ night: '夜間'
+ }
+}
+
+function ordinalNumber(dirtyNumber, dirtyOptions) {
+ var number = Number(dirtyNumber)
+
+ // If ordinal numbers depend on context, for example,
+ // if they are different for different grammatical genders,
+ // use `options.unit`:
+ //
+ // var options = dirtyOptions || {}
+ // var unit = String(options.unit)
+ //
+ // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
+ // 'day', 'hour', 'minute', 'second'
+
+ var options = dirtyOptions || {}
+ var unit = String(options.unit)
+
+ switch (unit) {
+ case 'date':
+ return number.toString() + '日'
+ case 'hour':
+ return number.toString() + '時'
+ case 'minute':
+ return number.toString() + '分'
+ case 'second':
+ return number.toString() + '秒'
+ default:
+ return '第 ' + number.toString()
+ }
+}
+
+var localize = {
+ ordinalNumber: ordinalNumber,
+
+ era: buildLocalizeFn({
+ values: eraValues,
+ defaultWidth: 'wide'
+ }),
+
+ quarter: buildLocalizeFn({
+ values: quarterValues,
+ defaultWidth: 'wide',
+ argumentCallback: function(quarter) {
+ return Number(quarter) - 1
+ }
+ }),
+
+ month: buildLocalizeFn({
+ values: monthValues,
+ defaultWidth: 'wide'
+ }),
+
+ day: buildLocalizeFn({
+ values: dayValues,
+ defaultWidth: 'wide'
+ }),
+
+ dayPeriod: buildLocalizeFn({
+ values: dayPeriodValues,
+ defaultWidth: 'wide',
+ formattingValues: formattingDayPeriodValues,
+ defaultFormattingWidth: 'wide'
+ })
+}
+
+export default localize
diff --git a/date-fns/src/locale/zh-TW/_lib/match/index.js b/date-fns/src/locale/zh-TW/_lib/match/index.js
new file mode 100644
index 0000000..460a9cd
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/_lib/match/index.js
@@ -0,0 +1,135 @@
+import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index'
+import buildMatchFn from '../../../_lib/buildMatchFn/index'
+
+var matchOrdinalNumberPattern = /^(第\s*)?\d+(日|時|分|秒)?/i
+var parseOrdinalNumberPattern = /\d+/i
+
+var matchEraPatterns = {
+ narrow: /^(前)/i,
+ abbreviated: /^(前)/i,
+ wide: /^(公元前|公元)/i
+}
+var parseEraPatterns = {
+ any: [/^(前)/i, /^(公元)/i]
+}
+
+var matchQuarterPatterns = {
+ narrow: /^[1234]/i,
+ abbreviated: /^第[一二三四]刻/i,
+ wide: /^第[一二三四]刻鐘/i
+}
+var parseQuarterPatterns = {
+ any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i]
+}
+
+var matchMonthPatterns = {
+ narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
+ abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
+ wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
+}
+var parseMonthPatterns = {
+ narrow: [
+ /^一/i,
+ /^二/i,
+ /^三/i,
+ /^四/i,
+ /^五/i,
+ /^六/i,
+ /^七/i,
+ /^八/i,
+ /^九/i,
+ /^十(?!(一|二))/i,
+ /^十一/i,
+ /^十二/i
+ ],
+ any: [
+ /^一|1/i,
+ /^二|2/i,
+ /^三|3/i,
+ /^四|4/i,
+ /^五|5/i,
+ /^六|6/i,
+ /^七|7/i,
+ /^八|8/i,
+ /^九|9/i,
+ /^十(?!(一|二))|10/i,
+ /^十一|11/i,
+ /^十二|12/i
+ ]
+}
+
+var matchDayPatterns = {
+ narrow: /^[一二三四五六日]/i,
+ short: /^[一二三四五六日]/i,
+ abbreviated: /^週[一二三四五六日]/i,
+ wide: /^星期[一二三四五六日]/i
+}
+var parseDayPatterns = {
+ any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i]
+}
+
+var matchDayPeriodPatterns = {
+ any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i
+}
+var parseDayPeriodPatterns = {
+ any: {
+ am: /^上午?/i,
+ pm: /^下午?/i,
+ midnight: /^午夜/i,
+ noon: /^[中正]午/i,
+ morning: /^早上/i,
+ afternoon: /^下午/i,
+ evening: /^晚上?/i,
+ night: /^凌晨/i
+ }
+}
+
+var match = {
+ ordinalNumber: buildMatchPatternFn({
+ matchPattern: matchOrdinalNumberPattern,
+ parsePattern: parseOrdinalNumberPattern,
+ valueCallback: function(value) {
+ return parseInt(value, 10)
+ }
+ }),
+
+ era: buildMatchFn({
+ matchPatterns: matchEraPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseEraPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ quarter: buildMatchFn({
+ matchPatterns: matchQuarterPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseQuarterPatterns,
+ defaultParseWidth: 'any',
+ valueCallback: function(index) {
+ return index + 1
+ }
+ }),
+
+ month: buildMatchFn({
+ matchPatterns: matchMonthPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseMonthPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ day: buildMatchFn({
+ matchPatterns: matchDayPatterns,
+ defaultMatchWidth: 'wide',
+ parsePatterns: parseDayPatterns,
+ defaultParseWidth: 'any'
+ }),
+
+ dayPeriod: buildMatchFn({
+ matchPatterns: matchDayPeriodPatterns,
+ defaultMatchWidth: 'any',
+ parsePatterns: parseDayPeriodPatterns,
+ defaultParseWidth: 'any'
+ })
+}
+
+export default match
diff --git a/date-fns/src/locale/zh-TW/index.d.ts b/date-fns/src/locale/zh-TW/index.d.ts
new file mode 100644
index 0000000..745a08f
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { zhTW } from 'date-fns/locale'
+export default zhTW
diff --git a/date-fns/src/locale/zh-TW/index.js b/date-fns/src/locale/zh-TW/index.js
new file mode 100644
index 0000000..bf43c2f
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/index.js
@@ -0,0 +1,30 @@
+import formatDistance from './_lib/formatDistance/index'
+import formatLong from './_lib/formatLong/index'
+import formatRelative from './_lib/formatRelative/index'
+import localize from './_lib/localize/index'
+import match from './_lib/match/index'
+
+/**
+ * @type {Locale}
+ * @category Locales
+ * @summary Chinese Traditional locale.
+ * @language Chinese Traditional
+ * @iso-639-2 zho
+ * @author tonypai [@tpai]{@link https://github.com/tpai}
+ * @author Jack Hsu [@jackhsu978]{@link https://github.com/jackhsu978}
+ * @author Terrence Lam [@skyuplam]{@link https://github.com/skyuplam}
+ */
+var locale = {
+ code: 'zh-TW',
+ formatDistance: formatDistance,
+ formatLong: formatLong,
+ formatRelative: formatRelative,
+ localize: localize,
+ match: match,
+ options: {
+ weekStartsOn: 1 /* Monday */,
+ firstWeekContainsDate: 4
+ }
+}
+
+export default locale
diff --git a/date-fns/src/locale/zh-TW/index.js.flow b/date-fns/src/locale/zh-TW/index.js.flow
new file mode 100644
index 0000000..b9dfe66
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/index.js.flow
@@ -0,0 +1,35 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+declare module.exports: Locale
diff --git a/date-fns/src/locale/zh-TW/snapshot.md b/date-fns/src/locale/zh-TW/snapshot.md
new file mode 100644
index 0000000..787f7e0
--- /dev/null
+++ b/date-fns/src/locale/zh-TW/snapshot.md
@@ -0,0 +1,304 @@
+# Chinese Traditional (zh-TW) locale
+
+## `format` and `parse`
+
+| Title | Token string | Date | `format` result | `parse` result |
+| ------------------------------- | ------------ | ------------------------ | ------------------------------------------------- | ------------------------ |
+| Calendar year | yo | 1987-02-11T12:13:14.015Z | 第 1987 | 1987-01-01T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 第 5 | 0005-01-01T00:00:00.000Z |
+| Local week-numbering year | Yo | 1987-02-11T12:13:14.015Z | 第 1987 | 1986-12-29T00:00:00.000Z |
+| | | 0005-01-01T12:13:14.015Z | 第 4 | 0003-12-29T00:00:00.000Z |
+| Quarter (formatting) | Qo | 2019-01-01T12:13:14.015Z | 第 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第 2 | 2019-04-01T00:00:00.000Z |
+| | QQQ | 2019-01-01T12:13:14.015Z | 第一刻 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻 | 2019-04-01T00:00:00.000Z |
+| | QQQQ | 2019-01-01T12:13:14.015Z | 第一刻鐘 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻鐘 | 2019-04-01T00:00:00.000Z |
+| | QQQQQ | 2019-01-01T12:13:14.015Z | 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 2 | 2019-04-01T00:00:00.000Z |
+| Quarter (stand-alone) | qo | 2019-01-01T12:13:14.015Z | 第 1 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第 2 | 2019-04-01T00:00:00.000Z |
+| | qqq | 2019-01-01T12:13:14.015Z | 第一刻 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻 | 2019-04-01T00:00:00.000Z |
+| | qqqq | 2019-01-01T12:13:14.015Z | 第一刻鐘 | 2019-01-01T00:00:00.000Z |
+| | | 2019-04-01T12:13:14.015Z | 第二刻鐘 | 2019-04-01T00:00:00.000Z |
+| Month (formatting) | Mo | 2019-02-11T12:13:14.015Z | 第 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 第 7 | 2019-07-01T00:00:00.000Z |
+| | MMM | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | MMMM | 2019-02-11T12:13:14.015Z | 二月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七月 | 2019-07-01T00:00:00.000Z |
+| | MMMMM | 2019-02-11T12:13:14.015Z | 二 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七 | 2019-07-01T00:00:00.000Z |
+| Month (stand-alone) | Lo | 2019-02-11T12:13:14.015Z | 第 2 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 第 7 | 2019-07-01T00:00:00.000Z |
+| | LLL | 2019-02-11T12:13:14.015Z | 2 月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 7 月 | 2019-07-01T00:00:00.000Z |
+| | LLLL | 2019-02-11T12:13:14.015Z | 二月 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七月 | 2019-07-01T00:00:00.000Z |
+| | LLLLL | 2019-02-11T12:13:14.015Z | 二 | 2019-02-01T00:00:00.000Z |
+| | | 2019-07-10T12:13:14.015Z | 七 | 2019-07-01T00:00:00.000Z |
+| Local week of year | wo | 2019-01-01T12:13:14.015Z | 第 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 第 48 | 2019-11-25T00:00:00.000Z |
+| ISO week of year | Io | 2019-01-01T12:13:14.015Z | 第 1 | 2018-12-31T00:00:00.000Z |
+| | | 2019-12-01T12:13:14.015Z | 第 48 | 2019-11-25T00:00:00.000Z |
+| Day of month | do | 2019-02-11T12:13:14.015Z | 11 日 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-28T12:13:14.015Z | 28 日 | 2019-02-28T00:00:00.000Z |
+| Day of year | Do | 2019-02-11T12:13:14.015Z | 第 42 | 2019-02-11T00:00:00.000Z |
+| | | 2019-12-31T12:13:14.015Z | 第 365 | 2019-12-31T00:00:00.000Z |
+| Day of week (formatting) | E | 2019-02-11T12:13:14.015Z | 週一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 週五 | 2019-02-15T00:00:00.000Z |
+| | EE | 2019-02-11T12:13:14.015Z | 週一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 週五 | 2019-02-15T00:00:00.000Z |
+| | EEE | 2019-02-11T12:13:14.015Z | 週一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 週五 | 2019-02-15T00:00:00.000Z |
+| | EEEE | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | EEEEE | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | EEEEEE | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| ISO day of week (formatting) | io | 2019-02-11T12:13:14.015Z | 第 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 第 5 | 2019-02-15T00:00:00.000Z |
+| | iii | 2019-02-11T12:13:14.015Z | 週一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 週五 | 2019-02-15T00:00:00.000Z |
+| | iiii | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | iiiii | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | iiiiii | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| Local day of week (formatting) | eo | 2019-02-11T12:13:14.015Z | 第 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 第 5 | 2019-02-15T00:00:00.000Z |
+| | eee | 2019-02-11T12:13:14.015Z | 週一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 週五 | 2019-02-15T00:00:00.000Z |
+| | eeee | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | eeeee | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | eeeeee | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| Local day of week (stand-alone) | co | 2019-02-11T12:13:14.015Z | 第 1 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 第 5 | 2019-02-15T00:00:00.000Z |
+| | ccc | 2019-02-11T12:13:14.015Z | 週一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 週五 | 2019-02-15T00:00:00.000Z |
+| | cccc | 2019-02-11T12:13:14.015Z | 星期一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 星期五 | 2019-02-15T00:00:00.000Z |
+| | ccccc | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| | cccccc | 2019-02-11T12:13:14.015Z | 一 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-15T12:13:14.015Z | 五 | 2019-02-15T00:00:00.000Z |
+| AM, PM | a | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aa | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aaa | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aaaa | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | aaaaa | 2019-02-11T11:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| AM, PM, noon, midnight | b | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bb | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bbb | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bbbb | 2019-02-11T11:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上午 | 2019-02-11T00:00:00.000Z |
+| | bbbbb | 2019-02-11T11:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 下 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 上 | 2019-02-11T00:00:00.000Z |
+| Flexible day period | B | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜間 | Invalid Date |
+| | BB | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜間 | Invalid Date |
+| | BBB | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜間 | Invalid Date |
+| | BBBB | 2019-02-11T11:13:14.015Z | 早晨 | Invalid Date |
+| | | 2019-02-11T14:13:14.015Z | 中午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚上 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜間 | Invalid Date |
+| | BBBBB | 2019-02-11T11:13:14.015Z | 早 | 2019-02-11T00:00:00.000Z |
+| | | 2019-02-11T14:13:14.015Z | 下午 | 2019-02-11T12:00:00.000Z |
+| | | 2019-02-11T19:13:14.015Z | 晚 | 2019-02-11T17:00:00.000Z |
+| | | 2019-02-11T02:13:14.015Z | 夜 | Invalid Date |
+| Hour [1-12] | ho | 2019-02-11T11:13:14.015Z | 11 時 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 時 | 2019-02-11T23:00:00.000Z |
+| Hour [0-23] | Ho | 2019-02-11T11:13:14.015Z | 11 時 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 時 | 2019-02-11T23:00:00.000Z |
+| Hour [0-11] | Ko | 2019-02-11T11:13:14.015Z | 11 時 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 11 時 | 2019-02-11T23:00:00.000Z |
+| Hour [1-24] | ko | 2019-02-11T11:13:14.015Z | 11 時 | 2019-02-11T11:00:00.000Z |
+| | | 2019-02-11T23:13:14.015Z | 23 時 | 2019-02-11T23:00:00.000Z |
+| Minute | mo | 2019-01-01T12:01:14.015Z | 1 分 | 2019-01-01T12:01:00.000Z |
+| | | 2019-04-01T12:55:14.015Z | 55 分 | 2019-04-01T12:55:00.000Z |
+| Second | so | 2019-01-01T12:13:01.015Z | 1 秒 | 2019-01-01T12:13:01.000Z |
+| | | 2019-04-01T12:13:55.015Z | 55 秒 | 2019-04-01T12:13:55.000Z |
+| Long localized date | P | 1987-02-11T12:13:14.015Z | 87-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53-05-29 | 1453-05-29T00:00:00.000Z |
+| | PP | 1987-02-11T12:13:14.015Z | 1987-02-11 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 | 1453-05-29T00:00:00.000Z |
+| | PPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 | 1453-05-29T00:00:00.000Z |
+| | PPPP | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 | 1987-02-11T00:00:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 | 1453-05-29T00:00:00.000Z |
+| Long localized time | p | 1987-02-11T12:13:14.015Z | 下午 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 下午 11:59 | 1453-05-29T23:59:00.000Z |
+| | pp | 1987-02-11T12:13:14.015Z | 下午 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 下午 11:59:59 | 1453-05-29T23:59:59.000Z |
+| | ppp | 1987-02-11T12:13:14.015Z | GMT+0 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | GMT+0 下午 11:59:59 | Errored |
+| | pppp | 1987-02-11T12:13:14.015Z | GMT+00:00 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | GMT+00:00 下午 11:59:59 | Errored |
+| Combination of date and time | Pp | 1987-02-11T12:13:14.015Z | 87-02-11 下午 12:13 | 1987-02-11T12:13:00.000Z |
+| | | 1453-05-29T23:59:59.999Z | 53-05-29 下午 11:59 | 1453-05-29T23:59:00.000Z |
+| | PPpp | 1987-02-11T12:13:14.015Z | 1987-02-11 下午 12:13:14 | 1987-02-11T12:13:14.000Z |
+| | | 1453-05-29T23:59:59.999Z | 1453-05-29 下午 11:59:59 | 1453-05-29T23:59:59.000Z |
+| | PPPppp | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 GMT+0 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 GMT+0 下午 11:59:59 | Errored |
+| | PPPPpppp | 1987-02-11T12:13:14.015Z | 1987 年 2 月 11 日 星期三 GMT+00:00 下午 12:13:14 | Errored |
+| | | 1453-05-29T23:59:59.999Z | 1453 年 5 月 29 日 星期日 GMT+00:00 下午 11:59:59 | Errored |
+
+## `formatDistance`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `includeSeconds: true` | `addSuffix: true` |
+| ------------------------ | ----------- | ---------------------- | ----------------- |
+| 2006-01-01T00:00:00.000Z | 大約 6 年 | 大約 6 年 | 大約 6 年內 |
+| 2005-01-01T00:00:00.000Z | 大約 5 年 | 大約 5 年 | 大約 5 年內 |
+| 2004-01-01T00:00:00.000Z | 大約 4 年 | 大約 4 年 | 大約 4 年內 |
+| 2003-01-01T00:00:00.000Z | 大約 3 年 | 大約 3 年 | 大約 3 年內 |
+| 2002-01-01T00:00:00.000Z | 大約 2 年 | 大約 2 年 | 大約 2 年內 |
+| 2001-06-01T00:00:00.000Z | 超過 1 年 | 超過 1 年 | 超過 1 年內 |
+| 2001-02-01T00:00:00.000Z | 大約 1 年 | 大約 1 年 | 大約 1 年內 |
+| 2001-01-01T00:00:00.000Z | 大約 1 年 | 大約 1 年 | 大約 1 年內 |
+| 2000-06-01T00:00:00.000Z | 5 個月 | 5 個月 | 5 個月內 |
+| 2000-03-01T00:00:00.000Z | 2 個月 | 2 個月 | 2 個月內 |
+| 2000-02-01T00:00:00.000Z | 大約 1 個月 | 大約 1 個月 | 大約 1 個月內 |
+| 2000-01-15T00:00:00.000Z | 14 天 | 14 天 | 14 天內 |
+| 2000-01-02T00:00:00.000Z | 1 天 | 1 天 | 1 天內 |
+| 2000-01-01T06:00:00.000Z | 大約 6 小時 | 大約 6 小時 | 大約 6 小時內 |
+| 2000-01-01T01:00:00.000Z | 大約 1 小時 | 大約 1 小時 | 大約 1 小時內 |
+| 2000-01-01T00:45:00.000Z | 大約 1 小時 | 大約 1 小時 | 大約 1 小時內 |
+| 2000-01-01T00:30:00.000Z | 30 分鐘 | 30 分鐘 | 30 分鐘內 |
+| 2000-01-01T00:15:00.000Z | 15 分鐘 | 15 分鐘 | 15 分鐘內 |
+| 2000-01-01T00:01:00.000Z | 1 分鐘 | 1 分鐘 | 1 分鐘內 |
+| 2000-01-01T00:00:25.000Z | 少於 1 分鐘 | 半分鐘 | 少於 1 分鐘內 |
+| 2000-01-01T00:00:15.000Z | 少於 1 分鐘 | 少於 20 秒 | 少於 1 分鐘內 |
+| 2000-01-01T00:00:05.000Z | 少於 1 分鐘 | 少於 10 秒 | 少於 1 分鐘內 |
+| 2000-01-01T00:00:00.000Z | 少於 1 分鐘 | 少於 5 秒 | 少於 1 分鐘前 |
+| 1999-12-31T23:59:55.000Z | 少於 1 分鐘 | 少於 10 秒 | 少於 1 分鐘前 |
+| 1999-12-31T23:59:45.000Z | 少於 1 分鐘 | 少於 20 秒 | 少於 1 分鐘前 |
+| 1999-12-31T23:59:35.000Z | 少於 1 分鐘 | 半分鐘 | 少於 1 分鐘前 |
+| 1999-12-31T23:59:00.000Z | 1 分鐘 | 1 分鐘 | 1 分鐘前 |
+| 1999-12-31T23:45:00.000Z | 15 分鐘 | 15 分鐘 | 15 分鐘前 |
+| 1999-12-31T23:30:00.000Z | 30 分鐘 | 30 分鐘 | 30 分鐘前 |
+| 1999-12-31T23:15:00.000Z | 大約 1 小時 | 大約 1 小時 | 大約 1 小時前 |
+| 1999-12-31T23:00:00.000Z | 大約 1 小時 | 大約 1 小時 | 大約 1 小時前 |
+| 1999-12-31T18:00:00.000Z | 大約 6 小時 | 大約 6 小時 | 大約 6 小時前 |
+| 1999-12-30T00:00:00.000Z | 2 天 | 2 天 | 2 天前 |
+| 1999-12-15T00:00:00.000Z | 17 天 | 17 天 | 17 天前 |
+| 1999-12-01T00:00:00.000Z | 大約 1 個月 | 大約 1 個月 | 大約 1 個月前 |
+| 1999-11-01T00:00:00.000Z | 2 個月 | 2 個月 | 2 個月前 |
+| 1999-06-01T00:00:00.000Z | 7 個月 | 7 個月 | 7 個月前 |
+| 1999-01-01T00:00:00.000Z | 大約 1 年 | 大約 1 年 | 大約 1 年前 |
+| 1998-12-01T00:00:00.000Z | 大約 1 年 | 大約 1 年 | 大約 1 年前 |
+| 1998-06-01T00:00:00.000Z | 超過 1 年 | 超過 1 年 | 超過 1 年前 |
+| 1998-01-01T00:00:00.000Z | 大約 2 年 | 大約 2 年 | 大約 2 年前 |
+| 1997-01-01T00:00:00.000Z | 大約 3 年 | 大約 3 年 | 大約 3 年前 |
+| 1996-01-01T00:00:00.000Z | 大約 4 年 | 大約 4 年 | 大約 4 年前 |
+| 1995-01-01T00:00:00.000Z | 大約 5 年 | 大約 5 年 | 大約 5 年前 |
+| 1994-01-01T00:00:00.000Z | 大約 6 年 | 大約 6 年 | 大約 6 年前 |
+
+## `formatDistanceStrict`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result | `addSuffix: true` | With forced unit (i.e. `hour`) |
+| ------------------------ | ------- | ----------------- | ------------------------------ |
+| 2006-01-01T00:00:00.000Z | 6 年 | 6 年內 | 52608 小時 |
+| 2005-01-01T00:00:00.000Z | 5 年 | 5 年內 | 43848 小時 |
+| 2004-01-01T00:00:00.000Z | 4 年 | 4 年內 | 35064 小時 |
+| 2003-01-01T00:00:00.000Z | 3 年 | 3 年內 | 26304 小時 |
+| 2002-01-01T00:00:00.000Z | 2 年 | 2 年內 | 17544 小時 |
+| 2001-06-01T00:00:00.000Z | 1 年 | 1 年內 | 12408 小時 |
+| 2001-02-01T00:00:00.000Z | 1 年 | 1 年內 | 9528 小時 |
+| 2001-01-01T00:00:00.000Z | 1 年 | 1 年內 | 8784 小時 |
+| 2000-06-01T00:00:00.000Z | 5 個月 | 5 個月內 | 3648 小時 |
+| 2000-03-01T00:00:00.000Z | 2 個月 | 2 個月內 | 1440 小時 |
+| 2000-02-01T00:00:00.000Z | 1 個月 | 1 個月內 | 744 小時 |
+| 2000-01-15T00:00:00.000Z | 14 天 | 14 天內 | 336 小時 |
+| 2000-01-02T00:00:00.000Z | 1 天 | 1 天內 | 24 小時 |
+| 2000-01-01T06:00:00.000Z | 6 小時 | 6 小時內 | 6 小時 |
+| 2000-01-01T01:00:00.000Z | 1 小時 | 1 小時內 | 1 小時 |
+| 2000-01-01T00:45:00.000Z | 45 分鐘 | 45 分鐘內 | 1 小時 |
+| 2000-01-01T00:30:00.000Z | 30 分鐘 | 30 分鐘內 | 1 小時 |
+| 2000-01-01T00:15:00.000Z | 15 分鐘 | 15 分鐘內 | 0 小時 |
+| 2000-01-01T00:01:00.000Z | 1 分鐘 | 1 分鐘內 | 0 小時 |
+| 2000-01-01T00:00:25.000Z | 25 秒 | 25 秒內 | 0 小時 |
+| 2000-01-01T00:00:15.000Z | 15 秒 | 15 秒內 | 0 小時 |
+| 2000-01-01T00:00:05.000Z | 5 秒 | 5 秒內 | 0 小時 |
+| 2000-01-01T00:00:00.000Z | 0 秒 | 0 秒前 | 0 小時 |
+| 1999-12-31T23:59:55.000Z | 5 秒 | 5 秒前 | 0 小時 |
+| 1999-12-31T23:59:45.000Z | 15 秒 | 15 秒前 | 0 小時 |
+| 1999-12-31T23:59:35.000Z | 25 秒 | 25 秒前 | 0 小時 |
+| 1999-12-31T23:59:00.000Z | 1 分鐘 | 1 分鐘前 | 0 小時 |
+| 1999-12-31T23:45:00.000Z | 15 分鐘 | 15 分鐘前 | 0 小時 |
+| 1999-12-31T23:30:00.000Z | 30 分鐘 | 30 分鐘前 | 1 小時 |
+| 1999-12-31T23:15:00.000Z | 45 分鐘 | 45 分鐘前 | 1 小時 |
+| 1999-12-31T23:00:00.000Z | 1 小時 | 1 小時前 | 1 小時 |
+| 1999-12-31T18:00:00.000Z | 6 小時 | 6 小時前 | 6 小時 |
+| 1999-12-30T00:00:00.000Z | 2 天 | 2 天前 | 48 小時 |
+| 1999-12-15T00:00:00.000Z | 17 天 | 17 天前 | 408 小時 |
+| 1999-12-01T00:00:00.000Z | 1 個月 | 1 個月前 | 744 小時 |
+| 1999-11-01T00:00:00.000Z | 2 個月 | 2 個月前 | 1464 小時 |
+| 1999-06-01T00:00:00.000Z | 7 個月 | 7 個月前 | 5136 小時 |
+| 1999-01-01T00:00:00.000Z | 1 年 | 1 年前 | 8760 小時 |
+| 1998-12-01T00:00:00.000Z | 1 年 | 1 年前 | 9504 小時 |
+| 1998-06-01T00:00:00.000Z | 2 年 | 2 年前 | 13896 小時 |
+| 1998-01-01T00:00:00.000Z | 2 年 | 2 年前 | 17520 小時 |
+| 1997-01-01T00:00:00.000Z | 3 年 | 3 年前 | 26280 小時 |
+| 1996-01-01T00:00:00.000Z | 4 年 | 4 年前 | 35064 小時 |
+| 1995-01-01T00:00:00.000Z | 5 年 | 5 年前 | 43824 小時 |
+| 1994-01-01T00:00:00.000Z | 6 年 | 6 年前 | 52584 小時 |
+
+## `formatRelative`
+
+If now is January 1st, 2000, 00:00.
+
+| Date | Result |
+| ------------------------ | --------------------- |
+| 2000-01-10T00:00:00.000Z | 00-01-10 |
+| 2000-01-05T00:00:00.000Z | 下個星期三 上午 12:00 |
+| 2000-01-02T00:00:00.000Z | 明天 上午 12:00 |
+| 2000-01-01T00:00:00.000Z | 今天 上午 12:00 |
+| 1999-12-31T00:00:00.000Z | 昨天 上午 12:00 |
+| 1999-12-27T00:00:00.000Z | 上個星期一 上午 12:00 |
+| 1999-12-21T00:00:00.000Z | 99-12-21 |
diff --git a/date-fns/src/max/benchmark.js b/date-fns/src/max/benchmark.js
new file mode 100644
index 0000000..6726268
--- /dev/null
+++ b/date-fns/src/max/benchmark.js
@@ -0,0 +1,27 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import max from '.'
+import moment from 'moment'
+
+suite(
+ 'max',
+ function() {
+ benchmark('date-fns', function() {
+ return max([this.dateA, this.dateB])
+ })
+
+ benchmark('Moment.js', function() {
+ return moment.max(this.momentA, this.momentB)
+ })
+ },
+ {
+ setup: function() {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+ }
+)
diff --git a/date-fns/src/max/index.d.ts b/date-fns/src/max/index.d.ts
new file mode 100644
index 0000000..733a96e
--- /dev/null
+++ b/date-fns/src/max/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { max } from 'date-fns'
+export default max
diff --git a/date-fns/src/max/index.js.flow b/date-fns/src/max/index.js.flow
new file mode 100644
index 0000000..8543909
--- /dev/null
+++ b/date-fns/src/max/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (datesArray: (Date | number)[]) => Date
diff --git a/date-fns/src/max/index.ts b/date-fns/src/max/index.ts
new file mode 100644
index 0000000..1c74453
--- /dev/null
+++ b/date-fns/src/max/index.ts
@@ -0,0 +1,69 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name max
+ * @category Common Helpers
+ * @summary Return the latest of the given dates.
+ *
+ * @description
+ * Return the latest of the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - `max` function now accepts an array of dates rather than spread arguments.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ * var date1 = new Date(1989, 6, 10)
+ * var date2 = new Date(1987, 1, 11)
+ * var maxDate = max(date1, date2)
+ *
+ * // v2.0.0 onward:
+ * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]
+ * var maxDate = max(dates)
+ * ```
+ *
+ * @param {Date[]|Number[]} datesArray - the dates to compare
+ * @returns {Date} the latest of the dates
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which of these dates is the latest?
+ * var result = max([
+ * new Date(1989, 6, 10),
+ * new Date(1987, 1, 11),
+ * new Date(1995, 6, 2),
+ * new Date(1990, 0, 1)
+ * ])
+ * //=> Sun Jul 02 1995 00:00:00
+ */
+export default function max(dirtyDatesArray: Date[] | string[] | number[]): Date {
+ requiredArgs(1, arguments)
+
+ let datesArray
+ // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method
+ if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {
+ datesArray = dirtyDatesArray
+
+ // If `dirtyDatesArray` is Array-like Object, convert to Array.
+ } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {
+ datesArray = Array.prototype.slice.call(dirtyDatesArray)
+ } else {
+ // `dirtyDatesArray` is non-iterable, return Invalid Date
+ return new Date(NaN)
+ }
+
+ let result: Date | undefined
+ datesArray.forEach(function(dirtyDate) {
+ const currentDate = toDate(dirtyDate)
+
+ if (result === undefined || result < currentDate || isNaN(Number(currentDate))) {
+ result = currentDate
+ }
+ })
+
+ return result || new Date(NaN)
+}
diff --git a/date-fns/src/max/test.ts b/date-fns/src/max/test.ts
new file mode 100644
index 0000000..a394457
--- /dev/null
+++ b/date-fns/src/max/test.ts
@@ -0,0 +1,92 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import max from '.'
+
+describe('max', function() {
+ function isInvalidDate(dirtyDate: Date | number): boolean {
+ return dirtyDate instanceof Date && isNaN(Number(dirtyDate))
+ }
+
+ it('returns the latest date', function() {
+ const result = max([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ ])
+ assert.deepEqual(result, new Date(1989, 6 /* Jul */, 10))
+ })
+
+ it('accepts array with more than 2 entries', function() {
+ const result = max([
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1995, 6 /* Jul */, 2),
+ new Date(1990, 0 /* Jan */, 1)
+ ])
+ assert.deepEqual(result, new Date(1995, 6 /* Jul */, 2))
+ })
+
+ it('accepts timestamps', function() {
+ const result = max([
+ new Date(1989, 6 /* Jul */, 10).getTime(),
+ new Date(1987, 1 /* Feb */, 11).getTime()
+ ])
+ assert.deepEqual(result, new Date(1989, 6 /* Jul */, 10))
+ })
+
+ it('returns `Invalid Date` if any given date is invalid', function() {
+ const result = max([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(NaN),
+ new Date(1987, 1 /* Feb */, 11)
+ ])
+ assert(isInvalidDate(result))
+ })
+
+ it('returns `Invalid Date` if any given value is undefined', function() {
+ const result = max([
+ new Date(1989, 6 /* Jul */, 10),
+ // @ts-expect-error
+ undefined,
+ new Date(1987, 1 /* Feb */, 11)
+ ])
+ assert(isInvalidDate(result))
+ })
+
+ it('returns `Invalid Date` for empty array', function() {
+ const result = max([])
+ assert(isInvalidDate(result))
+ })
+
+ it('converts Array-like objects into Array', function() {
+ // @ts-expect-error
+ const result = max({
+ '0': new Date(1989, 6 /* Jul */, 10),
+ '1': new Date(1987, 1 /* Feb */, 11),
+ length: 2
+ })
+ assert.deepEqual(result, new Date(1989, 6 /* Jul */, 10))
+ })
+
+ it('converts iterable objects into Array', function() {
+ const result = max(
+ // @ts-expect-error
+ new Set([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11)
+ ])
+ )
+ assert.deepEqual(result, new Date(1989, 6 /* Jul */, 10))
+ })
+
+ it('returns `Invalid Date` if given a non-iterable value', function() {
+ // @ts-expect-error
+ const result = max(undefined)
+ assert(isInvalidDate(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(max.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/milliseconds/index.d.ts b/date-fns/src/milliseconds/index.d.ts
new file mode 100644
index 0000000..6927b52
--- /dev/null
+++ b/date-fns/src/milliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { milliseconds } from 'date-fns'
+export default milliseconds
diff --git a/date-fns/src/milliseconds/index.js.flow b/date-fns/src/milliseconds/index.js.flow
new file mode 100644
index 0000000..5ca1b36
--- /dev/null
+++ b/date-fns/src/milliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (duration: Duration) => number
diff --git a/date-fns/src/milliseconds/index.ts b/date-fns/src/milliseconds/index.ts
new file mode 100644
index 0000000..6519229
--- /dev/null
+++ b/date-fns/src/milliseconds/index.ts
@@ -0,0 +1,62 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { Duration } from '../types'
+
+// Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
+// 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
+const daysInYear = 365.2425
+
+/**
+ * @name milliseconds
+ * @category Millisecond Helpers
+ * @summary
+ * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds.
+ *
+ * @description
+ * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds.
+ *
+ * One years equals 365.2425 days according to the formula:
+ *
+ * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
+ * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
+ *
+ * One month is a year divided by 12.
+ *
+ * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {number} the milliseconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // 1 year in milliseconds
+ * milliseconds({ years: 1 })
+ * //=> 31556952000
+ *
+ * // 3 months in milliseconds
+ * milliseconds({ months: 3 })
+ * //=> 7889238000
+ */
+export default function milliseconds({
+ years,
+ months,
+ weeks,
+ days,
+ hours,
+ minutes,
+ seconds,
+}: Duration): number {
+ requiredArgs(1, arguments)
+
+ let totalDays = 0
+
+ if (years) totalDays += years * daysInYear
+ if (months) totalDays += months * (daysInYear / 12)
+ if (weeks) totalDays += weeks * 7
+ if (days) totalDays += days
+
+ let totalSeconds = totalDays * 24 * 60 * 60
+
+ if (hours) totalSeconds += hours * 60 * 60
+ if (minutes) totalSeconds += minutes * 60
+ if (seconds) totalSeconds += seconds
+
+ return Math.round(totalSeconds * 1000)
+}
diff --git a/date-fns/src/milliseconds/test.ts b/date-fns/src/milliseconds/test.ts
new file mode 100644
index 0000000..e576c23
--- /dev/null
+++ b/date-fns/src/milliseconds/test.ts
@@ -0,0 +1,65 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import milliseconds from '.'
+
+describe('milliseconds', () => {
+ it('converts years to milliseconds', () => {
+ const result = milliseconds({ years: 2 })
+ assert(result === 63113904000)
+ })
+
+ it('converts months to milliseconds', () => {
+ const result = milliseconds({ months: 3 })
+ assert(result === 7889238000)
+ })
+
+ it('converts weeks to milliseconds', () => {
+ const result = milliseconds({ weeks: 2 })
+ assert(result === 1209600000)
+ })
+
+ it('converts days to milliseconds', () => {
+ const result = milliseconds({ days: 5 })
+ assert(result === 432000000)
+ })
+
+ it('converts hours to milliseconds', () => {
+ const result = milliseconds({ hours: 2 })
+ assert(result === 7200000)
+ })
+
+ it('converts minutes to milliseconds', () => {
+ const result = milliseconds({ minutes: 5 })
+ assert(result === 300000)
+ })
+
+ it('converts seconds to milliseconds', () => {
+ const result = milliseconds({ seconds: 10 })
+ assert(result === 10000)
+ })
+
+ it('sums all the duration values', () => {
+ const result = milliseconds({
+ years: 2,
+ months: 3,
+ weeks: 2,
+ days: 5,
+ hours: 2,
+ minutes: 5,
+ seconds: 10
+ })
+ assert(result === 72652252000)
+ })
+
+ it('returns 0 for an empty duration', () => {
+ const result = milliseconds({})
+ assert(result === 0)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ // @ts-expect-error
+ assert.throws(milliseconds.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/millisecondsToHours/index.d.ts b/date-fns/src/millisecondsToHours/index.d.ts
new file mode 100644
index 0000000..af90bf8
--- /dev/null
+++ b/date-fns/src/millisecondsToHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { millisecondsToHours } from 'date-fns'
+export default millisecondsToHours
diff --git a/date-fns/src/millisecondsToHours/index.js.flow b/date-fns/src/millisecondsToHours/index.js.flow
new file mode 100644
index 0000000..c998756
--- /dev/null
+++ b/date-fns/src/millisecondsToHours/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (milliseconds: number) => number
diff --git a/date-fns/src/millisecondsToHours/index.ts b/date-fns/src/millisecondsToHours/index.ts
new file mode 100644
index 0000000..a843a4d
--- /dev/null
+++ b/date-fns/src/millisecondsToHours/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { millisecondsInHour } from '../constants/index'
+
+/**
+ * @name millisecondsToHours
+ * @category Conversion Helpers
+ * @summary Convert milliseconds to hours.
+ *
+ * @description
+ * Convert a number of milliseconds to a full number of hours.
+ *
+ * @param {number} milliseconds - number of milliseconds to be converted
+ *
+ * @returns {number} the number of milliseconds converted in hours
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 7200000 milliseconds to hours:
+ * const result = millisecondsToHours(7200000)
+ * //=> 2
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = millisecondsToHours(7199999)
+ * //=> 1
+ */
+export default function millisecondsToHours(milliseconds: number): number {
+ requiredArgs(1, arguments)
+ const hours = milliseconds / millisecondsInHour
+ return Math.floor(hours)
+}
diff --git a/date-fns/src/millisecondsToHours/test.ts b/date-fns/src/millisecondsToHours/test.ts
new file mode 100644
index 0000000..5fed366
--- /dev/null
+++ b/date-fns/src/millisecondsToHours/test.ts
@@ -0,0 +1,22 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import millisecondsToHours from '.'
+
+describe('millisecondsToHours', function () {
+
+ it('converts milliseconds to hours', function () {
+ assert(millisecondsToHours(3600000) === 1)
+ assert(millisecondsToHours(7200000) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(millisecondsToHours(3600001) === 1)
+ assert(millisecondsToHours(3599999) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(millisecondsToHours(3600000.5) === 1)
+ assert(millisecondsToHours(0) === 0)
+ })
+})
diff --git a/date-fns/src/millisecondsToMinutes/index.d.ts b/date-fns/src/millisecondsToMinutes/index.d.ts
new file mode 100644
index 0000000..ea00809
--- /dev/null
+++ b/date-fns/src/millisecondsToMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { millisecondsToMinutes } from 'date-fns'
+export default millisecondsToMinutes
diff --git a/date-fns/src/millisecondsToMinutes/index.js.flow b/date-fns/src/millisecondsToMinutes/index.js.flow
new file mode 100644
index 0000000..c998756
--- /dev/null
+++ b/date-fns/src/millisecondsToMinutes/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (milliseconds: number) => number
diff --git a/date-fns/src/millisecondsToMinutes/index.ts b/date-fns/src/millisecondsToMinutes/index.ts
new file mode 100644
index 0000000..b4529f2
--- /dev/null
+++ b/date-fns/src/millisecondsToMinutes/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { millisecondsInMinute } from '../constants/index'
+
+/**
+ * @name millisecondsToMinutes
+ * @category Conversion Helpers
+ * @summary Convert milliseconds to minutes.
+ *
+ * @description
+ * Convert a number of milliseconds to a full number of minutes.
+ *
+ * @param {number} milliseconds - number of milliseconds to be converted.
+ *
+ * @returns {number} the number of milliseconds converted in minutes
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 60000 milliseconds to minutes:
+ * const result = millisecondsToMinutes(60000)
+ * //=> 1
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = millisecondsToMinutes(119999)
+ * //=> 1
+ */
+export default function millisecondsToMinutes(milliseconds: number): number {
+ requiredArgs(1, arguments)
+ const minutes = milliseconds / millisecondsInMinute
+ return Math.floor(minutes)
+}
diff --git a/date-fns/src/millisecondsToMinutes/test.ts b/date-fns/src/millisecondsToMinutes/test.ts
new file mode 100644
index 0000000..3d14345
--- /dev/null
+++ b/date-fns/src/millisecondsToMinutes/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import millisecondsToMinutes from '.'
+
+describe('millisecondsToMinutes', () => {
+ it('converts milliseconds to minutes', function () {
+ assert(millisecondsToMinutes(60000) === 1)
+ assert(millisecondsToMinutes(120000) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(millisecondsToMinutes(60001) === 1)
+ assert(millisecondsToMinutes(59999) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(millisecondsToMinutes(60000.5) === 1)
+ assert(millisecondsToMinutes(0) === 0)
+ })
+})
diff --git a/date-fns/src/millisecondsToSeconds/index.d.ts b/date-fns/src/millisecondsToSeconds/index.d.ts
new file mode 100644
index 0000000..d761abd
--- /dev/null
+++ b/date-fns/src/millisecondsToSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { millisecondsToSeconds } from 'date-fns'
+export default millisecondsToSeconds
diff --git a/date-fns/src/millisecondsToSeconds/index.js.flow b/date-fns/src/millisecondsToSeconds/index.js.flow
new file mode 100644
index 0000000..c998756
--- /dev/null
+++ b/date-fns/src/millisecondsToSeconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (milliseconds: number) => number
diff --git a/date-fns/src/millisecondsToSeconds/index.ts b/date-fns/src/millisecondsToSeconds/index.ts
new file mode 100644
index 0000000..ea35328
--- /dev/null
+++ b/date-fns/src/millisecondsToSeconds/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { millisecondsInSecond } from '../constants/index'
+
+/**
+ * @name millisecondsToSeconds
+ * @category Conversion Helpers
+ * @summary Convert milliseconds to seconds.
+ *
+ * @description
+ * Convert a number of milliseconds to a full number of seconds.
+ *
+ * @param {number} milliseconds - number of milliseconds to be converted
+ *
+ * @returns {number} the number of milliseconds converted in seconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 1000 miliseconds to seconds:
+ * const result = millisecondsToSeconds(1000)
+ * //=> 1
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = millisecondsToSeconds(1999)
+ * //=> 1
+ */
+export default function millisecondsToSeconds(milliseconds: number): number {
+ requiredArgs(1, arguments)
+ const seconds = milliseconds / millisecondsInSecond
+ return Math.floor(seconds)
+}
diff --git a/date-fns/src/millisecondsToSeconds/test.ts b/date-fns/src/millisecondsToSeconds/test.ts
new file mode 100644
index 0000000..6e3c15b
--- /dev/null
+++ b/date-fns/src/millisecondsToSeconds/test.ts
@@ -0,0 +1,22 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import millisecondsToSeconds from '.'
+
+describe('millisecondsToSeconds', function () {
+
+ it('converts milliseconds to seconds', function () {
+ assert(millisecondsToSeconds(1000) === 1)
+ assert(millisecondsToSeconds(2000) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(millisecondsToSeconds(1001) === 1)
+ assert(millisecondsToSeconds(999) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(millisecondsToSeconds(1000.5) === 1)
+ assert(millisecondsToSeconds(0) === 0)
+ })
+})
diff --git a/date-fns/src/min/benchmark.js b/date-fns/src/min/benchmark.js
new file mode 100644
index 0000000..e2a997b
--- /dev/null
+++ b/date-fns/src/min/benchmark.js
@@ -0,0 +1,27 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import min from '.'
+import moment from 'moment'
+
+suite(
+ 'min',
+ function() {
+ benchmark('date-fns', function() {
+ return min([this.dateA, this.dateB])
+ })
+
+ benchmark('Moment.js', function() {
+ return moment.min(this.momentA, this.momentB)
+ })
+ },
+ {
+ setup: function() {
+ this.dateA = new Date()
+ this.momentA = moment()
+ this.dateB = new Date(this.dateA.getTime() + 604800000)
+ this.momentB = this.momentA.clone().add(7, 'days')
+ }
+ }
+)
diff --git a/date-fns/src/min/index.d.ts b/date-fns/src/min/index.d.ts
new file mode 100644
index 0000000..f7227e7
--- /dev/null
+++ b/date-fns/src/min/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { min } from 'date-fns'
+export default min
diff --git a/date-fns/src/min/index.js.flow b/date-fns/src/min/index.js.flow
new file mode 100644
index 0000000..8543909
--- /dev/null
+++ b/date-fns/src/min/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (datesArray: (Date | number)[]) => Date
diff --git a/date-fns/src/min/index.ts b/date-fns/src/min/index.ts
new file mode 100644
index 0000000..b29763d
--- /dev/null
+++ b/date-fns/src/min/index.ts
@@ -0,0 +1,73 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name min
+ * @category Common Helpers
+ * @summary Returns the earliest of the given dates.
+ *
+ * @description
+ * Returns the earliest of the given dates.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - `min` function now accepts an array of dates rather than spread arguments.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ * const date1 = new Date(1989, 6, 10)
+ * const date2 = new Date(1987, 1, 11)
+ * const minDate = min(date1, date2)
+ *
+ * // v2.0.0 onward:
+ * const dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]
+ * const minDate = min(dates)
+ * ```
+ *
+ * @param {Date[]|Number[]} datesArray - the dates to compare
+ * @returns {Date} - the earliest of the dates
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Which of these dates is the earliest?
+ * const result = min([
+ * new Date(1989, 6, 10),
+ * new Date(1987, 1, 11),
+ * new Date(1995, 6, 2),
+ * new Date(1990, 0, 1)
+ * ])
+ * //=> Wed Feb 11 1987 00:00:00
+ */
+export default function min(dirtyDatesArray: Date[] | number[]): Date {
+ requiredArgs(1, arguments)
+
+ let datesArray: Date[] | number[]
+ // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method
+ if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {
+ datesArray = dirtyDatesArray
+ // If `dirtyDatesArray` is Array-like Object, convert to Array.
+ } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {
+ datesArray = Array.prototype.slice.call(dirtyDatesArray)
+ } else {
+ // `dirtyDatesArray` is non-iterable, return Invalid Date
+ return new Date(NaN)
+ }
+
+ let result: Date | undefined
+
+ datesArray.forEach(function (dirtyDate: Date | number) {
+ let currentDate = toDate(dirtyDate)
+
+ if (
+ result === undefined ||
+ result > currentDate ||
+ isNaN(currentDate.getDate())
+ ) {
+ result = currentDate
+ }
+ })
+
+ return result || new Date(NaN)
+}
diff --git a/date-fns/src/min/test.ts b/date-fns/src/min/test.ts
new file mode 100644
index 0000000..9bf83ad
--- /dev/null
+++ b/date-fns/src/min/test.ts
@@ -0,0 +1,93 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import min from '.'
+
+describe('min', () => {
+ const isInvalidDate = (dirtyDate: Date): boolean => {
+ return dirtyDate instanceof Date && isNaN(dirtyDate.getDate())
+ }
+
+ it('returns the earliest date', () => {
+ const result = min([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11),
+ ])
+ assert.deepStrictEqual(result, new Date(1987, 1 /* Feb */, 11))
+ })
+
+ it('accepts array with more than 2 entries', () => {
+ const result = min([
+ new Date(1987, 1 /* Feb */, 11),
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1985, 6 /* Jul */, 2),
+ new Date(1990, 0 /* Jan */, 1),
+ ])
+ assert.deepStrictEqual(result, new Date(1985, 6 /* Jul */, 2))
+ })
+
+ it('accepts timestamps', () => {
+ const result = min([
+ new Date(1989, 6 /* Jul */, 10).getTime(),
+ new Date(1987, 1 /* Feb */, 11).getTime(),
+ ])
+ assert.deepStrictEqual(result, new Date(1987, 1 /* Feb */, 11))
+ })
+
+ it('returns `Invalid Date` if any given date is invalid', () => {
+ const result = min([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(NaN),
+ new Date(1987, 1 /* Feb */, 11),
+ ])
+ assert(isInvalidDate(result))
+ })
+
+ it('returns `Invalid Date` if any given value is undefined', () => {
+ const result = min([
+ new Date(1989, 6 /* Jul */, 10),
+ // @ts-expect-error
+ undefined,
+ new Date(1987, 1 /* Feb */, 11),
+ ])
+ assert(isInvalidDate(result))
+ })
+
+ it('returns `Invalid Date` for empty array', () => {
+ const result = min([])
+ assert(isInvalidDate(result))
+ })
+
+ it('converts Array-like objects into Array', () => {
+ // @ts-expect-error
+ const result = min({
+ '0': new Date(1989, 6 /* Jul */, 10),
+ '1': new Date(1987, 1 /* Feb */, 11),
+ length: 2,
+ })
+ assert.deepStrictEqual(result, new Date(1987, 1 /* Feb */, 11))
+ })
+
+ it('converts iterable objects into Array', () => {
+ const result = min(
+ // @ts-expect-error
+ new Set([
+ new Date(1989, 6 /* Jul */, 10),
+ new Date(1987, 1 /* Feb */, 11),
+ ])
+ )
+ assert.deepStrictEqual(result, new Date(1987, 1 /* Feb */, 11))
+ })
+
+ it('returns `Invalid Date` if given a non-iterable value', () => {
+ // @ts-expect-error
+ const result = min(undefined)
+ assert(isInvalidDate(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ // @ts-expect-error
+ assert.throws(min.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/minutesToHours/index.d.ts b/date-fns/src/minutesToHours/index.d.ts
new file mode 100644
index 0000000..d29fb02
--- /dev/null
+++ b/date-fns/src/minutesToHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { minutesToHours } from 'date-fns'
+export default minutesToHours
diff --git a/date-fns/src/minutesToHours/index.js.flow b/date-fns/src/minutesToHours/index.js.flow
new file mode 100644
index 0000000..efb76c7
--- /dev/null
+++ b/date-fns/src/minutesToHours/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (minutes: number) => number
diff --git a/date-fns/src/minutesToHours/index.ts b/date-fns/src/minutesToHours/index.ts
new file mode 100644
index 0000000..9fd8cbb
--- /dev/null
+++ b/date-fns/src/minutesToHours/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { minutesInHour } from '../constants/index'
+
+/**
+ * @name minutesToHours
+ * @category Conversion Helpers
+ * @summary Convert minutes to hours.
+ *
+ * @description
+ * Convert a number of minutes to a full number of hours.
+ *
+ * @param {number} minutes - number of minutes to be converted
+ *
+ * @returns {number} the number of minutes converted in hours
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 140 minutes to hours:
+ * const result = minutesToHours(120)
+ * //=> 2
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = minutesToHours(179)
+ * //=> 2
+ */
+export default function minutesToHours(minutes: number): number {
+ requiredArgs(1, arguments)
+ const hours = minutes / minutesInHour
+ return Math.floor(hours)
+}
diff --git a/date-fns/src/minutesToHours/test.ts b/date-fns/src/minutesToHours/test.ts
new file mode 100644
index 0000000..be34522
--- /dev/null
+++ b/date-fns/src/minutesToHours/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import minuteToHours from '.'
+
+describe('minuteToHours', function () {
+ it('converts minutes to hours', function () {
+ assert(minuteToHours(60) === 1)
+ assert(minuteToHours(120) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(minuteToHours(61) === 1)
+ assert(minuteToHours(59) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(minuteToHours(60.5) === 1)
+ assert(minuteToHours(0) === 0)
+ })
+})
diff --git a/date-fns/src/minutesToMilliseconds/index.d.ts b/date-fns/src/minutesToMilliseconds/index.d.ts
new file mode 100644
index 0000000..14b5513
--- /dev/null
+++ b/date-fns/src/minutesToMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { minutesToMilliseconds } from 'date-fns'
+export default minutesToMilliseconds
diff --git a/date-fns/src/minutesToMilliseconds/index.js.flow b/date-fns/src/minutesToMilliseconds/index.js.flow
new file mode 100644
index 0000000..efb76c7
--- /dev/null
+++ b/date-fns/src/minutesToMilliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (minutes: number) => number
diff --git a/date-fns/src/minutesToMilliseconds/index.ts b/date-fns/src/minutesToMilliseconds/index.ts
new file mode 100644
index 0000000..dd95314
--- /dev/null
+++ b/date-fns/src/minutesToMilliseconds/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { millisecondsInMinute } from '../constants/index'
+
+/**
+ * @name minutesToMilliseconds
+ * @category Conversion Helpers
+ * @summary Convert minutes to milliseconds.
+ *
+ * @description
+ * Convert a number of minutes to a full number of milliseconds.
+ *
+ * @param {number} minutes - number of minutes to be converted
+ *
+ * @returns {number} the number of minutes converted in milliseconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 minutes to milliseconds
+ * const result = minutesToMilliseconds(2)
+ * //=> 120000
+ */
+export default function minutesToMilliseconds(minutes: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(minutes * millisecondsInMinute)
+}
diff --git a/date-fns/src/minutesToMilliseconds/test.ts b/date-fns/src/minutesToMilliseconds/test.ts
new file mode 100644
index 0000000..4864a2b
--- /dev/null
+++ b/date-fns/src/minutesToMilliseconds/test.ts
@@ -0,0 +1,20 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import minutesToMilliseconds from '.'
+
+describe('minutesToMilliseconds', function () {
+ it('converts minutes to milliseconds', function () {
+ assert(minutesToMilliseconds(1) === 60000)
+ assert(minutesToMilliseconds(2) === 120000)
+ })
+
+ it('uses floor rounding', () => {
+ assert(minutesToMilliseconds(0.123456) === 7407)
+ })
+
+ it('handles border values', () => {
+ assert(minutesToMilliseconds(1.5) === 90000)
+ assert(minutesToMilliseconds(0) === 0)
+ })
+})
diff --git a/date-fns/src/minutesToSeconds/index.d.ts b/date-fns/src/minutesToSeconds/index.d.ts
new file mode 100644
index 0000000..7998c9b
--- /dev/null
+++ b/date-fns/src/minutesToSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { minutesToSeconds } from 'date-fns'
+export default minutesToSeconds
diff --git a/date-fns/src/minutesToSeconds/index.js.flow b/date-fns/src/minutesToSeconds/index.js.flow
new file mode 100644
index 0000000..efb76c7
--- /dev/null
+++ b/date-fns/src/minutesToSeconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (minutes: number) => number
diff --git a/date-fns/src/minutesToSeconds/index.ts b/date-fns/src/minutesToSeconds/index.ts
new file mode 100644
index 0000000..d4b5c4c
--- /dev/null
+++ b/date-fns/src/minutesToSeconds/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { secondsInMinute } from '../constants/index'
+
+/**
+ * @name minutesToSeconds
+ * @category Conversion Helpers
+ * @summary Convert minutes to seconds.
+ *
+ * @description
+ * Convert a number of minutes to a full number of seconds.
+ *
+ * @param { number } minutes - number of minutes to be converted
+ *
+ * @returns {number} the number of minutes converted in seconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 minutes to seconds
+ * const result = minutesToSeconds(2)
+ * //=> 120
+ */
+export default function minutesToSeconds(minutes: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(minutes * secondsInMinute)
+}
diff --git a/date-fns/src/minutesToSeconds/test.ts b/date-fns/src/minutesToSeconds/test.ts
new file mode 100644
index 0000000..9cdd4c2
--- /dev/null
+++ b/date-fns/src/minutesToSeconds/test.ts
@@ -0,0 +1,20 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import minutesToSeconds from '.'
+
+describe('minutesToSeconds', function () {
+ it('converts minutes to seconds', function () {
+ assert(minutesToSeconds(1) === 60)
+ assert(minutesToSeconds(2) === 120)
+ })
+
+ it('uses floor rounding', () => {
+ assert(minutesToSeconds(0.123456) === 7)
+ })
+
+ it('handles border values', () => {
+ assert(minutesToSeconds(1.5) === 90)
+ assert(minutesToSeconds(0) === 0)
+ })
+})
diff --git a/date-fns/src/monthsToQuarters/index.d.ts b/date-fns/src/monthsToQuarters/index.d.ts
new file mode 100644
index 0000000..895b1a9
--- /dev/null
+++ b/date-fns/src/monthsToQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { monthsToQuarters } from 'date-fns'
+export default monthsToQuarters
diff --git a/date-fns/src/monthsToQuarters/index.js.flow b/date-fns/src/monthsToQuarters/index.js.flow
new file mode 100644
index 0000000..de9ea9b
--- /dev/null
+++ b/date-fns/src/monthsToQuarters/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (months: number) => number
diff --git a/date-fns/src/monthsToQuarters/index.ts b/date-fns/src/monthsToQuarters/index.ts
new file mode 100644
index 0000000..0e5bb5d
--- /dev/null
+++ b/date-fns/src/monthsToQuarters/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { monthsInQuarter } from '../constants/index'
+
+/**
+ * @name monthsToQuarters
+ * @category Conversion Helpers
+ * @summary Convert number of months to quarters.
+ *
+ * @description
+ * Convert a number of months to a full number of quarters.
+ *
+ * @param {number} months - number of months to be converted.
+ *
+ * @returns {number} the number of months converted in quarters
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 6 months to quarters:
+ * const result = monthsToQuarters(6)
+ * //=> 2
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = monthsToQuarters(7)
+ * //=> 2
+ */
+export default function monthsToQuarters(months: number): number {
+ requiredArgs(1, arguments)
+ const quarters = months / monthsInQuarter
+ return Math.floor(quarters)
+}
diff --git a/date-fns/src/monthsToQuarters/test.ts b/date-fns/src/monthsToQuarters/test.ts
new file mode 100644
index 0000000..a1907d3
--- /dev/null
+++ b/date-fns/src/monthsToQuarters/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import monthsToQuarters from '.'
+
+describe('monthsToQuarters', function () {
+ it('converts months to quarters', function () {
+ assert(monthsToQuarters(3) === 1)
+ assert(monthsToQuarters(6) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(monthsToQuarters(4) === 1)
+ assert(monthsToQuarters(2) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(monthsToQuarters(3.5) === 1)
+ assert(monthsToQuarters(0) === 0)
+ })
+})
diff --git a/date-fns/src/monthsToYears/index.d.ts b/date-fns/src/monthsToYears/index.d.ts
new file mode 100644
index 0000000..16c41fb
--- /dev/null
+++ b/date-fns/src/monthsToYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { monthsToYears } from 'date-fns'
+export default monthsToYears
diff --git a/date-fns/src/monthsToYears/index.js.flow b/date-fns/src/monthsToYears/index.js.flow
new file mode 100644
index 0000000..de9ea9b
--- /dev/null
+++ b/date-fns/src/monthsToYears/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (months: number) => number
diff --git a/date-fns/src/monthsToYears/index.ts b/date-fns/src/monthsToYears/index.ts
new file mode 100644
index 0000000..f1615a7
--- /dev/null
+++ b/date-fns/src/monthsToYears/index.ts
@@ -0,0 +1,30 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { monthsInYear } from '../constants/index'
+
+/**
+ * @name monthsToYears
+ * @category Conversion Helpers
+ * @summary Convert number of months to years.
+ *
+ * @description
+ * Convert a number of months to a full number of years.
+ *
+ * @param {number} months - number of months to be converted
+ *
+ * @returns {number} the number of months converted in years
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 36 months to years:
+ * const result = monthsToYears(36)
+ * //=> 3
+ *
+ * // It uses floor rounding:
+ * const result = monthsToYears(40)
+ * //=> 3
+ */
+export default function monthsToYears(months: number): number {
+ requiredArgs(1, arguments)
+ const years = months / monthsInYear
+ return Math.floor(years)
+}
diff --git a/date-fns/src/monthsToYears/test.ts b/date-fns/src/monthsToYears/test.ts
new file mode 100644
index 0000000..5aa86c9
--- /dev/null
+++ b/date-fns/src/monthsToYears/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import monthsToYears from '.'
+
+describe('monthsToYears', function () {
+ it('converts months to years', function () {
+ assert(monthsToYears(12) === 1)
+ assert(monthsToYears(24) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(monthsToYears(13) === 1)
+ assert(monthsToYears(11) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(monthsToYears(12.5) === 1)
+ assert(monthsToYears(0) === 0)
+ })
+})
diff --git a/date-fns/src/nextDay/index.d.ts b/date-fns/src/nextDay/index.d.ts
new file mode 100644
index 0000000..ed09673
--- /dev/null
+++ b/date-fns/src/nextDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextDay } from 'date-fns'
+export default nextDay
diff --git a/date-fns/src/nextDay/index.js.flow b/date-fns/src/nextDay/index.js.flow
new file mode 100644
index 0000000..4b45d7f
--- /dev/null
+++ b/date-fns/src/nextDay/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, day: Day) => Date
diff --git a/date-fns/src/nextDay/index.ts b/date-fns/src/nextDay/index.ts
new file mode 100644
index 0000000..25c879a
--- /dev/null
+++ b/date-fns/src/nextDay/index.ts
@@ -0,0 +1,46 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import getDay from '../getDay'
+import addDays from '../addDays'
+import toDate from '../toDate'
+import { Day } from '../types'
+
+const baseMap = [7, 6, 5, 4, 3, 2, 1]
+
+/**
+ * @name nextDay
+ * @category Weekday Helpers
+ * @summary When is the next day of the week?
+ *
+ * @description
+ * When is the next day of the week? 0-6 the day of the week, 0 represents Sunday.
+ *
+ * @param {Date | number} date - the date to check
+ * @param {Day} day - day of the week
+ * @returns {Date} - the date is the next day of week
+ * @throws {TypeError} - 2 arguments required
+ *
+ * @example
+ * // When is the next Monday after Mar, 20, 2020?
+ * const result = nextDay(new Date(2020, 2, 20), 1)
+ * //=> Mon Mar 23 2020 00:00:00
+ *
+ * @example
+ * // When is the next Tuesday after Mar, 21, 2020?
+ * const result = nextDay(new Date(2020, 2, 21), 2)
+ * //=> Tue Mar 24 2020 00:00:00
+ */
+export default function nextDay(date: Date | number, day: Day): Date {
+ requiredArgs(2, arguments)
+ const map = genMap(day)
+ return addDays(toDate(date), map[getDay(toDate(date))])
+}
+
+function genMap(daysToMove: number): number[] {
+ if (daysToMove === 0) {
+ return baseMap
+ } else {
+ const mapStart = baseMap.slice(-daysToMove)
+ const mapEnd = baseMap.slice(0, baseMap.length - daysToMove)
+ return mapStart.concat(mapEnd)
+ }
+}
diff --git a/date-fns/src/nextDay/test.ts b/date-fns/src/nextDay/test.ts
new file mode 100644
index 0000000..495bd2e
--- /dev/null
+++ b/date-fns/src/nextDay/test.ts
@@ -0,0 +1,86 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextDay from '.'
+
+describe('nextDay', function () {
+ it('returns the following Monday given various dates before the same', function () {
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 2 /* Mar */, 20), 1),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 2 /* Mar */, 19), 1),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 2 /* Mar */, 18), 1),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 2 /* Mar */, 17), 1),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 2 /* Mar */, 16), 1),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 2 /* Mar */, 22), 1),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 4 /* May */, 2), 1),
+ new Date(2020, 4 /* May */, 4)
+ )
+ })
+
+ it('returns the following Tuesday given the Saturday before it', function () {
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 4 /* May */, 2), 2),
+ new Date(2020, 4 /* May */, 5)
+ )
+ })
+
+ it('returns the following Wednesday given the Saturday before it', function () {
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 4 /* May */, 2), 3),
+ new Date(2020, 4 /* May */, 6)
+ )
+ })
+
+ it('returns the following Thursday given the Saturday before it', function () {
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 4 /* May */, 2), 4),
+ new Date(2020, 4 /* May */, 7)
+ )
+ })
+
+ it('returns the following Friday given the Saturday before it', function () {
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 4 /* May */, 2), 5),
+ new Date(2020, 4 /* May */, 8)
+ )
+ })
+
+ it('returns the following Saturday given the Saturday before it', function () {
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 4 /* May */, 2), 6),
+ new Date(2020, 4 /* May */, 9)
+ )
+ })
+
+ it('returns next Sunday given the day is Sunday', function () {
+ assert.deepStrictEqual(
+ nextDay(new Date(2020, 2 /* Mar */, 22), 0),
+ new Date(2020, 2 /* Mar */, 29)
+ )
+ })
+})
diff --git a/date-fns/src/nextFriday/index.d.ts b/date-fns/src/nextFriday/index.d.ts
new file mode 100644
index 0000000..1ea773c
--- /dev/null
+++ b/date-fns/src/nextFriday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextFriday } from 'date-fns'
+export default nextFriday
diff --git a/date-fns/src/nextFriday/index.js.flow b/date-fns/src/nextFriday/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/nextFriday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/nextFriday/index.ts b/date-fns/src/nextFriday/index.ts
new file mode 100644
index 0000000..28d02bc
--- /dev/null
+++ b/date-fns/src/nextFriday/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import nextDay from '../nextDay/index'
+import toDate from '../toDate/index'
+
+/**
+ * @name nextFriday
+ * @category Weekday Helpers
+ * @summary When is the next Friday?
+ *
+ * @description
+ * When is the next Friday?
+ *
+ * @param {Date | number} date - the date to start counting from
+ * @returns {Date} the next Friday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // When is the next Friday after Mar, 22, 2020?
+ * const result = nextFriday(new Date(2020, 2, 22))
+ * //=> Fri Mar 27 2020 00:00:00
+ */
+export default function nextFriday(date: Date | number): Date {
+ requiredArgs(1, arguments)
+ return nextDay(toDate(date), 5)
+}
diff --git a/date-fns/src/nextFriday/test.ts b/date-fns/src/nextFriday/test.ts
new file mode 100644
index 0000000..ee9ece0
--- /dev/null
+++ b/date-fns/src/nextFriday/test.ts
@@ -0,0 +1,48 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextFriday from '.'
+
+describe('nextFriday', () => {
+ it('returns the following Friday given various dates before the same', () => {
+ assert.deepStrictEqual(
+ nextFriday(new Date(2020, 2 /* Mar */, 23)),
+ new Date(2020, 2 /* Mar */, 27)
+ )
+
+ assert.deepStrictEqual(
+ nextFriday(new Date(2020, 2 /* Mar */, 22)),
+ new Date(2020, 2 /* Mar */, 27)
+ )
+
+ assert.deepStrictEqual(
+ nextFriday(new Date(2020, 2 /* Mar */, 21)),
+ new Date(2020, 2 /* Mar */, 27)
+ )
+
+ assert.deepStrictEqual(
+ nextFriday(new Date(2020, 2 /* Mar */, 20)),
+ new Date(2020, 2 /* Mar */, 27)
+ )
+
+ assert.deepStrictEqual(
+ nextFriday(new Date(2020, 2 /* Mar */, 19)),
+ new Date(2020, 2 /* Mar */, 20)
+ )
+
+ assert.deepStrictEqual(
+ nextFriday(new Date(2020, 2 /* Mar */, 18)),
+ new Date(2020, 2 /* Mar */, 20)
+ )
+
+ assert.deepStrictEqual(
+ nextFriday(new Date(2020, 2 /* Mar */, 17)),
+ new Date(2020, 2 /* Mar */, 20)
+ )
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', () => {
+ assert(nextFriday(new Date(NaN)) instanceof Date)
+ })
+})
diff --git a/date-fns/src/nextMonday/index.d.ts b/date-fns/src/nextMonday/index.d.ts
new file mode 100644
index 0000000..d266886
--- /dev/null
+++ b/date-fns/src/nextMonday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextMonday } from 'date-fns'
+export default nextMonday
diff --git a/date-fns/src/nextMonday/index.js.flow b/date-fns/src/nextMonday/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/nextMonday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/nextMonday/index.ts b/date-fns/src/nextMonday/index.ts
new file mode 100644
index 0000000..201b8c6
--- /dev/null
+++ b/date-fns/src/nextMonday/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import nextDay from '../nextDay/index'
+import toDate from '../toDate/index'
+
+/**
+ * @name nextMonday
+ * @category Weekday Helpers
+ * @summary When is the next Monday?
+ *
+ * @description
+ * When is the next Monday?
+ *
+ * @param {Date | number} date - the date to start counting from
+ * @returns {Date} the next Monday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // When is the next Monday after Mar, 22, 2020?
+ * const result = nextMonday(new Date(2020, 2, 22))
+ * //=> Mon Mar 23 2020 00:00:00
+ */
+export default function nextMonday(date: Date | number): Date {
+ requiredArgs(1, arguments)
+ return nextDay(toDate(date), 1)
+}
diff --git a/date-fns/src/nextMonday/test.ts b/date-fns/src/nextMonday/test.ts
new file mode 100644
index 0000000..281a31c
--- /dev/null
+++ b/date-fns/src/nextMonday/test.ts
@@ -0,0 +1,48 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextMonday from '.'
+
+describe('nextMonday', function () {
+ it('returns the following Monday given various dates before the same', function () {
+ assert.deepStrictEqual(
+ nextMonday(new Date(2020, 2 /* Mar */, 23)),
+ new Date(2020, 2 /* Mar */, 30)
+ )
+
+ assert.deepStrictEqual(
+ nextMonday(new Date(2020, 2 /* Mar */, 22)),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextMonday(new Date(2020, 3 /* Apr */, 11)),
+ new Date(2020, 3 /* Apr */, 13)
+ )
+
+ assert.deepStrictEqual(
+ nextMonday(new Date(2020, 2 /* Mar */, 20)),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextMonday(new Date(2020, 2 /* Mar */, 19)),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextMonday(new Date(2020, 2 /* Mar */, 18)),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+
+ assert.deepStrictEqual(
+ nextMonday(new Date(2020, 2 /* Mar */, 17)),
+ new Date(2020, 2 /* Mar */, 23)
+ )
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ assert(nextMonday(new Date(NaN)) instanceof Date)
+ })
+})
diff --git a/date-fns/src/nextSaturday/index.d.ts b/date-fns/src/nextSaturday/index.d.ts
new file mode 100644
index 0000000..20532f7
--- /dev/null
+++ b/date-fns/src/nextSaturday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextSaturday } from 'date-fns'
+export default nextSaturday
diff --git a/date-fns/src/nextSaturday/index.js.flow b/date-fns/src/nextSaturday/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/nextSaturday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/nextSaturday/index.ts b/date-fns/src/nextSaturday/index.ts
new file mode 100644
index 0000000..ac3d5a6
--- /dev/null
+++ b/date-fns/src/nextSaturday/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import nextDay from '../nextDay/index'
+import toDate from '../toDate/index'
+
+/**
+ * @name nextSaturday
+ * @category Weekday Helpers
+ * @summary When is the next Saturday?
+ *
+ * @description
+ * When is the next Saturday?
+ *
+ * @param {Date | number} date - the date to start counting from
+ * @returns {Date} the next Saturday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // When is the next Saturday after Mar, 22, 2020?
+ * const result = nextSaturday(new Date(2020, 2, 22))
+ * //=> Sat Mar 28 2020 00:00:00
+ */
+export default function nextSaturday(date: Date | number): Date {
+ requiredArgs(1, arguments)
+ return nextDay(toDate(date), 6)
+}
diff --git a/date-fns/src/nextSaturday/test.ts b/date-fns/src/nextSaturday/test.ts
new file mode 100644
index 0000000..6799b46
--- /dev/null
+++ b/date-fns/src/nextSaturday/test.ts
@@ -0,0 +1,48 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextSaturday from '.'
+
+describe('nextSaturday', () => {
+ it('returns the following Saturday given various dates before the same', () => {
+ assert.deepStrictEqual(
+ nextSaturday(new Date(2020, 2 /* Mar */, 23)),
+ new Date(2020, 2 /* Mar */, 28)
+ )
+
+ assert.deepStrictEqual(
+ nextSaturday(new Date(2020, 2 /* Mar */, 22)),
+ new Date(2020, 2 /* Mar */, 28)
+ )
+
+ assert.deepStrictEqual(
+ nextSaturday(new Date(2020, 2 /* Mar */, 21)),
+ new Date(2020, 2 /* Mar */, 28)
+ )
+
+ assert.deepStrictEqual(
+ nextSaturday(new Date(2020, 2 /* Mar */, 20)),
+ new Date(2020, 2 /* Mar */, 21)
+ )
+
+ assert.deepStrictEqual(
+ nextSaturday(new Date(2020, 2 /* Mar */, 19)),
+ new Date(2020, 2 /* Mar */, 21)
+ )
+
+ assert.deepStrictEqual(
+ nextSaturday(new Date(2020, 2 /* Mar */, 18)),
+ new Date(2020, 2 /* Mar */, 21)
+ )
+
+ assert.deepStrictEqual(
+ nextSaturday(new Date(2020, 2 /* Mar */, 17)),
+ new Date(2020, 2 /* Mar */, 21)
+ )
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', () => {
+ assert(nextSaturday(new Date(NaN)) instanceof Date)
+ })
+})
diff --git a/date-fns/src/nextSunday/index.d.ts b/date-fns/src/nextSunday/index.d.ts
new file mode 100644
index 0000000..e0a7965
--- /dev/null
+++ b/date-fns/src/nextSunday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextSunday } from 'date-fns'
+export default nextSunday
diff --git a/date-fns/src/nextSunday/index.js.flow b/date-fns/src/nextSunday/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/nextSunday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/nextSunday/index.ts b/date-fns/src/nextSunday/index.ts
new file mode 100644
index 0000000..5320ac3
--- /dev/null
+++ b/date-fns/src/nextSunday/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import nextDay from '../nextDay/index'
+import toDate from '../toDate/index'
+
+/**
+ * @name nextSunday
+ * @category Weekday Helpers
+ * @summary When is the next Sunday?
+ *
+ * @description
+ * When is the next Sunday?
+ *
+ * @param {Date | number} date - the date to start counting from
+ * @returns {Date} the next Sunday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // When is the next Sunday after Mar, 22, 2020?
+ * const result = nextSunday(new Date(2020, 2, 22))
+ * //=> Sun Mar 29 2020 00:00:00
+ */
+export default function nextSunday(date: Date | number): Date {
+ requiredArgs(1, arguments)
+ return nextDay(toDate(date), 0)
+}
diff --git a/date-fns/src/nextSunday/test.ts b/date-fns/src/nextSunday/test.ts
new file mode 100644
index 0000000..468c53b
--- /dev/null
+++ b/date-fns/src/nextSunday/test.ts
@@ -0,0 +1,48 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextSunday from '.'
+
+describe('nextSunday', () => {
+ it('returns the following Sunday given various dates before the same', () => {
+ assert.deepStrictEqual(
+ nextSunday(new Date(2020, 2 /* Mar */, 23)),
+ new Date(2020, 2 /* Mar */, 29)
+ )
+
+ assert.deepStrictEqual(
+ nextSunday(new Date(2020, 2 /* Mar */, 22)),
+ new Date(2020, 2 /* Mar */, 29)
+ )
+
+ assert.deepStrictEqual(
+ nextSunday(new Date(2020, 2 /* Mar */, 21)),
+ new Date(2020, 2 /* Mar */, 22)
+ )
+
+ assert.deepStrictEqual(
+ nextSunday(new Date(2020, 2 /* Mar */, 20)),
+ new Date(2020, 2 /* Mar */, 22)
+ )
+
+ assert.deepStrictEqual(
+ nextSunday(new Date(2020, 2 /* Mar */, 19)),
+ new Date(2020, 2 /* Mar */, 22)
+ )
+
+ assert.deepStrictEqual(
+ nextSunday(new Date(2020, 2 /* Mar */, 18)),
+ new Date(2020, 2 /* Mar */, 22)
+ )
+
+ assert.deepStrictEqual(
+ nextSunday(new Date(2020, 2 /* Mar */, 17)),
+ new Date(2020, 2 /* Mar */, 22)
+ )
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', () => {
+ assert(nextSunday(new Date(NaN)) instanceof Date)
+ })
+})
diff --git a/date-fns/src/nextThursday/index.d.ts b/date-fns/src/nextThursday/index.d.ts
new file mode 100644
index 0000000..092c3ba
--- /dev/null
+++ b/date-fns/src/nextThursday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextThursday } from 'date-fns'
+export default nextThursday
diff --git a/date-fns/src/nextThursday/index.js.flow b/date-fns/src/nextThursday/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/nextThursday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/nextThursday/index.ts b/date-fns/src/nextThursday/index.ts
new file mode 100644
index 0000000..8b096ef
--- /dev/null
+++ b/date-fns/src/nextThursday/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import nextDay from '../nextDay/index'
+import toDate from '../toDate/index'
+
+/**
+ * @name nextThursday
+ * @category Weekday Helpers
+ * @summary When is the next Thursday?
+ *
+ * @description
+ * When is the next Thursday?
+ *
+ * @param {Date | number} date - the date to start counting from
+ * @returns {Date} the next Thursday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // When is the next Thursday after Mar, 22, 2020?
+ * const result = nextThursday(new Date(2020, 2, 22))
+ * //=> Thur Mar 26 2020 00:00:00
+ */
+export default function nextThursday(date: Date | number): Date {
+ requiredArgs(1, arguments)
+ return nextDay(toDate(date), 4)
+}
diff --git a/date-fns/src/nextThursday/test.ts b/date-fns/src/nextThursday/test.ts
new file mode 100644
index 0000000..a0ab2d0
--- /dev/null
+++ b/date-fns/src/nextThursday/test.ts
@@ -0,0 +1,48 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextThursday from '.'
+
+describe('nextThursday', () => {
+ it('returns the following Thursday given various dates before the same', () => {
+ assert.deepStrictEqual(
+ nextThursday(new Date(2020, 2 /* Mar */, 23)),
+ new Date(2020, 2 /* Mar */, 26)
+ )
+
+ assert.deepStrictEqual(
+ nextThursday(new Date(2020, 2 /* Mar */, 22)),
+ new Date(2020, 2 /* Mar */, 26)
+ )
+
+ assert.deepStrictEqual(
+ nextThursday(new Date(2020, 2 /* Mar */, 21)),
+ new Date(2020, 2 /* Mar */, 26)
+ )
+
+ assert.deepStrictEqual(
+ nextThursday(new Date(2020, 2 /* Mar */, 20)),
+ new Date(2020, 2 /* Mar */, 26)
+ )
+
+ assert.deepStrictEqual(
+ nextThursday(new Date(2020, 2 /* Mar */, 19)),
+ new Date(2020, 2 /* Mar */, 26)
+ )
+
+ assert.deepStrictEqual(
+ nextThursday(new Date(2020, 2 /* Mar */, 18)),
+ new Date(2020, 2 /* Mar */, 19)
+ )
+
+ assert.deepStrictEqual(
+ nextThursday(new Date(2020, 2 /* Mar */, 17)),
+ new Date(2020, 2 /* Mar */, 19)
+ )
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', () => {
+ assert(nextThursday(new Date(NaN)) instanceof Date)
+ })
+})
diff --git a/date-fns/src/nextTuesday/index.d.ts b/date-fns/src/nextTuesday/index.d.ts
new file mode 100644
index 0000000..0e332ac
--- /dev/null
+++ b/date-fns/src/nextTuesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextTuesday } from 'date-fns'
+export default nextTuesday
diff --git a/date-fns/src/nextTuesday/index.js.flow b/date-fns/src/nextTuesday/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/nextTuesday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/nextTuesday/index.ts b/date-fns/src/nextTuesday/index.ts
new file mode 100644
index 0000000..eb1304d
--- /dev/null
+++ b/date-fns/src/nextTuesday/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import nextDay from '../nextDay/index'
+import toDate from '../toDate/index'
+
+/**
+ * @name nextTuesday
+ * @category Weekday Helpers
+ * @summary When is the next Tuesday?
+ *
+ * @description
+ * When is the next Tuesday?
+ *
+ * @param {Date | number} date - the date to start counting from
+ * @returns {Date} the next Tuesday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // When is the next Tuesday after Mar, 22, 2020?
+ * const result = nextTuesday(new Date(2020, 2, 22))
+ * //=> Tue Mar 24 2020 00:00:00
+ */
+export default function nextTuesday(date: Date | number): Date {
+ requiredArgs(1, arguments)
+ return nextDay(toDate(date), 2)
+}
diff --git a/date-fns/src/nextTuesday/test.ts b/date-fns/src/nextTuesday/test.ts
new file mode 100644
index 0000000..ddc9c9c
--- /dev/null
+++ b/date-fns/src/nextTuesday/test.ts
@@ -0,0 +1,47 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextTuesday from '.'
+
+describe('nextTuesday', function () {
+ it('returns the following Tuesday given various dates before the same', function () {
+ assert.deepStrictEqual(
+ nextTuesday(new Date(2020, 2 /* Mar */, 23)),
+ new Date(2020, 2 /* Mar */, 24)
+ )
+
+ assert.deepStrictEqual(
+ nextTuesday(new Date(2020, 2 /* Mar */, 22)),
+ new Date(2020, 2 /* Mar */, 24)
+ )
+
+ assert.deepStrictEqual(
+ nextTuesday(new Date(2020, 3 /* Apr */, 11)),
+ new Date(2020, 3 /* Apr */, 14)
+ )
+
+ assert.deepStrictEqual(
+ nextTuesday(new Date(2020, 2 /* Mar */, 20)),
+ new Date(2020, 2 /* Mar */, 24)
+ )
+
+ assert.deepStrictEqual(
+ nextTuesday(new Date(2020, 2 /* Mar */, 19)),
+ new Date(2020, 2 /* Mar */, 24)
+ )
+
+ assert.deepStrictEqual(
+ nextTuesday(new Date(2020, 2 /* Mar */, 18)),
+ new Date(2020, 2 /* Mar */, 24)
+ )
+
+ assert.deepStrictEqual(
+ nextTuesday(new Date(2020, 2 /* Mar */, 17)),
+ new Date(2020, 2 /* Mar */, 24)
+ )
+ })
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ assert(nextTuesday(new Date(NaN)) instanceof Date)
+ })
+})
diff --git a/date-fns/src/nextWednesday/index.d.ts b/date-fns/src/nextWednesday/index.d.ts
new file mode 100644
index 0000000..42f7eb3
--- /dev/null
+++ b/date-fns/src/nextWednesday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { nextWednesday } from 'date-fns'
+export default nextWednesday
diff --git a/date-fns/src/nextWednesday/index.js.flow b/date-fns/src/nextWednesday/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/nextWednesday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/nextWednesday/index.ts b/date-fns/src/nextWednesday/index.ts
new file mode 100644
index 0000000..e652c3c
--- /dev/null
+++ b/date-fns/src/nextWednesday/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import nextDay from '../nextDay/index'
+import toDate from '../toDate/index'
+
+/**
+ * @name nextWednesday
+ * @category Weekday Helpers
+ * @summary When is the next Wednesday?
+ *
+ * @description
+ * When is the next Wednesday?
+ *
+ * @param {Date | number} date - the date to start counting from
+ * @returns {Date} the next Wednesday
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // When is the next Wednesday after Mar, 22, 2020?
+ * const result = nextWednesday(new Date(2020, 2, 22))
+ * //=> Wed Mar 25 2020 00:00:00
+ */
+export default function nextWednesday(date: Date | number): Date {
+ requiredArgs(1, arguments)
+ return nextDay(toDate(date), 3)
+}
diff --git a/date-fns/src/nextWednesday/test.ts b/date-fns/src/nextWednesday/test.ts
new file mode 100644
index 0000000..68a8fc2
--- /dev/null
+++ b/date-fns/src/nextWednesday/test.ts
@@ -0,0 +1,48 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import nextWednesday from '.'
+
+describe('nextWednesday', () => {
+ it('returns the following Wednesday given various dates before the same', () => {
+ assert.deepStrictEqual(
+ nextWednesday(new Date(2020, 2 /* Mar */, 23)),
+ new Date(2020, 2 /* Mar */, 25)
+ )
+
+ assert.deepStrictEqual(
+ nextWednesday(new Date(2020, 2 /* Mar */, 22)),
+ new Date(2020, 2 /* Mar */, 25)
+ )
+
+ assert.deepStrictEqual(
+ nextWednesday(new Date(2020, 2 /* Mar */, 21)),
+ new Date(2020, 2 /* Mar */, 25)
+ )
+
+ assert.deepStrictEqual(
+ nextWednesday(new Date(2020, 2 /* Mar */, 20)),
+ new Date(2020, 2 /* Mar */, 25)
+ )
+
+ assert.deepStrictEqual(
+ nextWednesday(new Date(2020, 2 /* Mar */, 19)),
+ new Date(2020, 2 /* Mar */, 25)
+ )
+
+ assert.deepStrictEqual(
+ nextWednesday(new Date(2020, 2 /* Mar */, 18)),
+ new Date(2020, 2 /* Mar */, 25)
+ )
+
+ assert.deepStrictEqual(
+ nextWednesday(new Date(2020, 2 /* Mar */, 17)),
+ new Date(2020, 2 /* Mar */, 18)
+ )
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', () => {
+ assert(nextWednesday(new Date(NaN)) instanceof Date)
+ })
+})
diff --git a/date-fns/src/parse/_lib/parsers/index.js b/date-fns/src/parse/_lib/parsers/index.js
new file mode 100644
index 0000000..3a37108
--- /dev/null
+++ b/date-fns/src/parse/_lib/parsers/index.js
@@ -0,0 +1,1735 @@
+import getUTCWeekYear from '../../../_lib/getUTCWeekYear/index'
+import setUTCDay from '../../../_lib/setUTCDay/index'
+import setUTCISODay from '../../../_lib/setUTCISODay/index'
+import setUTCISOWeek from '../../../_lib/setUTCISOWeek/index'
+import setUTCWeek from '../../../_lib/setUTCWeek/index'
+import startOfUTCISOWeek from '../../../_lib/startOfUTCISOWeek/index'
+import startOfUTCWeek from '../../../_lib/startOfUTCWeek/index'
+
+var MILLISECONDS_IN_HOUR = 3600000
+var MILLISECONDS_IN_MINUTE = 60000
+var MILLISECONDS_IN_SECOND = 1000
+
+var numericPatterns = {
+ month: /^(1[0-2]|0?\d)/, // 0 to 12
+ date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31
+ dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366
+ week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53
+ hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23
+ hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24
+ hour11h: /^(1[0-1]|0?\d)/, // 0 to 11
+ hour12h: /^(1[0-2]|0?\d)/, // 0 to 12
+ minute: /^[0-5]?\d/, // 0 to 59
+ second: /^[0-5]?\d/, // 0 to 59
+
+ singleDigit: /^\d/, // 0 to 9
+ twoDigits: /^\d{1,2}/, // 0 to 99
+ threeDigits: /^\d{1,3}/, // 0 to 999
+ fourDigits: /^\d{1,4}/, // 0 to 9999
+
+ anyDigitsSigned: /^-?\d+/,
+ singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9
+ twoDigitsSigned: /^-?\d{1,2}/, // 0 to 99, -0 to -99
+ threeDigitsSigned: /^-?\d{1,3}/, // 0 to 999, -0 to -999
+ fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
+}
+
+var timezonePatterns = {
+ basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
+ basic: /^([+-])(\d{2})(\d{2})|Z/,
+ basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
+ extended: /^([+-])(\d{2}):(\d{2})|Z/,
+ extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
+}
+
+function parseNumericPattern(pattern, string, valueCallback) {
+ var matchResult = string.match(pattern)
+
+ if (!matchResult) {
+ return null
+ }
+
+ var value = parseInt(matchResult[0], 10)
+
+ return {
+ value: valueCallback ? valueCallback(value) : value,
+ rest: string.slice(matchResult[0].length)
+ }
+}
+
+function parseTimezonePattern(pattern, string) {
+ var matchResult = string.match(pattern)
+
+ if (!matchResult) {
+ return null
+ }
+
+ // Input is 'Z'
+ if (matchResult[0] === 'Z') {
+ return {
+ value: 0,
+ rest: string.slice(1)
+ }
+ }
+
+ var sign = matchResult[1] === '+' ? 1 : -1
+ var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0
+ var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0
+ var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0
+
+ return {
+ value:
+ sign *
+ (hours * MILLISECONDS_IN_HOUR +
+ minutes * MILLISECONDS_IN_MINUTE +
+ seconds * MILLISECONDS_IN_SECOND),
+ rest: string.slice(matchResult[0].length)
+ }
+}
+
+function parseAnyDigitsSigned(string, valueCallback) {
+ return parseNumericPattern(
+ numericPatterns.anyDigitsSigned,
+ string,
+ valueCallback
+ )
+}
+
+function parseNDigits(n, string, valueCallback) {
+ switch (n) {
+ case 1:
+ return parseNumericPattern(
+ numericPatterns.singleDigit,
+ string,
+ valueCallback
+ )
+ case 2:
+ return parseNumericPattern(
+ numericPatterns.twoDigits,
+ string,
+ valueCallback
+ )
+ case 3:
+ return parseNumericPattern(
+ numericPatterns.threeDigits,
+ string,
+ valueCallback
+ )
+ case 4:
+ return parseNumericPattern(
+ numericPatterns.fourDigits,
+ string,
+ valueCallback
+ )
+ default:
+ return parseNumericPattern(
+ new RegExp('^\\d{1,' + n + '}'),
+ string,
+ valueCallback
+ )
+ }
+}
+
+function parseNDigitsSigned(n, string, valueCallback) {
+ switch (n) {
+ case 1:
+ return parseNumericPattern(
+ numericPatterns.singleDigitSigned,
+ string,
+ valueCallback
+ )
+ case 2:
+ return parseNumericPattern(
+ numericPatterns.twoDigitsSigned,
+ string,
+ valueCallback
+ )
+ case 3:
+ return parseNumericPattern(
+ numericPatterns.threeDigitsSigned,
+ string,
+ valueCallback
+ )
+ case 4:
+ return parseNumericPattern(
+ numericPatterns.fourDigitsSigned,
+ string,
+ valueCallback
+ )
+ default:
+ return parseNumericPattern(
+ new RegExp('^-?\\d{1,' + n + '}'),
+ string,
+ valueCallback
+ )
+ }
+}
+
+function dayPeriodEnumToHours(enumValue) {
+ switch (enumValue) {
+ case 'morning':
+ return 4
+ case 'evening':
+ return 17
+ case 'pm':
+ case 'noon':
+ case 'afternoon':
+ return 12
+ case 'am':
+ case 'midnight':
+ case 'night':
+ default:
+ return 0
+ }
+}
+
+function normalizeTwoDigitYear(twoDigitYear, currentYear) {
+ var isCommonEra = currentYear > 0
+ // Absolute number of the current year:
+ // 1 -> 1 AC
+ // 0 -> 1 BC
+ // -1 -> 2 BC
+ var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear
+
+ var result
+ if (absCurrentYear <= 50) {
+ result = twoDigitYear || 100
+ } else {
+ var rangeEnd = absCurrentYear + 50
+ var rangeEndCentury = Math.floor(rangeEnd / 100) * 100
+ var isPreviousCentury = twoDigitYear >= rangeEnd % 100
+ result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0)
+ }
+
+ return isCommonEra ? result : 1 - result
+}
+
+var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+
+// User for validation
+function isLeapYearIndex(year) {
+ return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0)
+}
+
+/*
+ * | | Unit | | Unit |
+ * |-----|--------------------------------|-----|--------------------------------|
+ * | a | AM, PM | A* | Milliseconds in day |
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
+ * | d | Day of month | D | Day of year |
+ * | e | Local day of week | E | Day of week |
+ * | f | | F* | Day of week in month |
+ * | g* | Modified Julian day | G | Era |
+ * | h | Hour [1-12] | H | Hour [0-23] |
+ * | i! | ISO day of week | I! | ISO week of year |
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
+ * | k | Hour [1-24] | K | Hour [0-11] |
+ * | l* | (deprecated) | L | Stand-alone month |
+ * | m | Minute | M | Month |
+ * | n | | N | |
+ * | o! | Ordinal number modifier | O* | Timezone (GMT) |
+ * | p | | P | |
+ * | q | Stand-alone quarter | Q | Quarter |
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
+ * | s | Second | S | Fraction of second |
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
+ * | u | Extended year | U* | Cyclic year |
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
+ * | w | Local week of year | W* | Week of month |
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
+ * | y | Year (abs) | Y | Local week-numbering year |
+ * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
+ *
+ * Letters marked by * are not implemented but reserved by Unicode standard.
+ *
+ * Letters marked by ! are non-standard, but implemented by date-fns:
+ * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
+ * i.e. 7 for Sunday, 1 for Monday, etc.
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
+ * `R` is supposed to be used in conjunction with `I` and `i`
+ * for universal ISO week-numbering date, whereas
+ * `Y` is supposed to be used in conjunction with `w` and `e`
+ * for week-numbering date specific to the locale.
+ */
+var parsers = {
+ // Era
+ G: {
+ priority: 140,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ // AD, BC
+ case 'G':
+ case 'GG':
+ case 'GGG':
+ return (
+ match.era(string, { width: 'abbreviated' }) ||
+ match.era(string, { width: 'narrow' })
+ )
+ // A, B
+ case 'GGGGG':
+ return match.era(string, { width: 'narrow' })
+ // Anno Domini, Before Christ
+ case 'GGGG':
+ default:
+ return (
+ match.era(string, { width: 'wide' }) ||
+ match.era(string, { width: 'abbreviated' }) ||
+ match.era(string, { width: 'narrow' })
+ )
+ }
+ },
+
+ set: function(date, flags, value, _options) {
+ flags.era = value
+ date.setUTCFullYear(value, 0, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['R', 'u', 't', 'T']
+ },
+
+ // Year
+ y: {
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
+ // | Year | y | yy | yyy | yyyy | yyyyy |
+ // |----------|-------|----|-------|-------|-------|
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
+
+ priority: 130,
+
+ parse: function(string, token, match, _options) {
+ var valueCallback = function(year) {
+ return {
+ year: year,
+ isTwoDigitYear: token === 'yy'
+ }
+ }
+
+ switch (token) {
+ case 'y':
+ return parseNDigits(4, string, valueCallback)
+ case 'yo':
+ return match.ordinalNumber(string, {
+ unit: 'year',
+ valueCallback: valueCallback
+ })
+ default:
+ return parseNDigits(token.length, string, valueCallback)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value.isTwoDigitYear || value.year > 0
+ },
+
+ set: function(date, flags, value, _options) {
+ var currentYear = date.getUTCFullYear()
+
+ if (value.isTwoDigitYear) {
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(
+ value.year,
+ currentYear
+ )
+ date.setUTCFullYear(normalizedTwoDigitYear, 0, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ }
+
+ var year =
+ !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year
+ date.setUTCFullYear(year, 0, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']
+ },
+
+ // Local week-numbering year
+ Y: {
+ priority: 130,
+
+ parse: function(string, token, match, _options) {
+ var valueCallback = function(year) {
+ return {
+ year: year,
+ isTwoDigitYear: token === 'YY'
+ }
+ }
+
+ switch (token) {
+ case 'Y':
+ return parseNDigits(4, string, valueCallback)
+ case 'Yo':
+ return match.ordinalNumber(string, {
+ unit: 'year',
+ valueCallback: valueCallback
+ })
+ default:
+ return parseNDigits(token.length, string, valueCallback)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value.isTwoDigitYear || value.year > 0
+ },
+
+ set: function(date, flags, value, options) {
+ var currentYear = getUTCWeekYear(date, options)
+
+ if (value.isTwoDigitYear) {
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(
+ value.year,
+ currentYear
+ )
+ date.setUTCFullYear(
+ normalizedTwoDigitYear,
+ 0,
+ options.firstWeekContainsDate
+ )
+ date.setUTCHours(0, 0, 0, 0)
+ return startOfUTCWeek(date, options)
+ }
+
+ var year =
+ !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year
+ date.setUTCFullYear(year, 0, options.firstWeekContainsDate)
+ date.setUTCHours(0, 0, 0, 0)
+ return startOfUTCWeek(date, options)
+ },
+
+ incompatibleTokens: [
+ 'y',
+ 'R',
+ 'u',
+ 'Q',
+ 'q',
+ 'M',
+ 'L',
+ 'I',
+ 'd',
+ 'D',
+ 'i',
+ 't',
+ 'T'
+ ]
+ },
+
+ // ISO week-numbering year
+ R: {
+ priority: 130,
+
+ parse: function(string, token, _match, _options) {
+ if (token === 'R') {
+ return parseNDigitsSigned(4, string)
+ }
+
+ return parseNDigitsSigned(token.length, string)
+ },
+
+ set: function(_date, _flags, value, _options) {
+ var firstWeekOfYear = new Date(0)
+ firstWeekOfYear.setUTCFullYear(value, 0, 4)
+ firstWeekOfYear.setUTCHours(0, 0, 0, 0)
+ return startOfUTCISOWeek(firstWeekOfYear)
+ },
+
+ incompatibleTokens: [
+ 'G',
+ 'y',
+ 'Y',
+ 'u',
+ 'Q',
+ 'q',
+ 'M',
+ 'L',
+ 'w',
+ 'd',
+ 'D',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Extended year
+ u: {
+ priority: 130,
+
+ parse: function(string, token, _match, _options) {
+ if (token === 'u') {
+ return parseNDigitsSigned(4, string)
+ }
+
+ return parseNDigitsSigned(token.length, string)
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCFullYear(value, 0, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']
+ },
+
+ // Quarter
+ Q: {
+ priority: 120,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ // 1, 2, 3, 4
+ case 'Q':
+ case 'QQ': // 01, 02, 03, 04
+ return parseNDigits(token.length, string)
+ // 1st, 2nd, 3rd, 4th
+ case 'Qo':
+ return match.ordinalNumber(string, { unit: 'quarter' })
+ // Q1, Q2, Q3, Q4
+ case 'QQQ':
+ return (
+ match.quarter(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.quarter(string, { width: 'narrow', context: 'formatting' })
+ )
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case 'QQQQQ':
+ return match.quarter(string, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ // 1st quarter, 2nd quarter, ...
+ case 'QQQQ':
+ default:
+ return (
+ match.quarter(string, { width: 'wide', context: 'formatting' }) ||
+ match.quarter(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.quarter(string, { width: 'narrow', context: 'formatting' })
+ )
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 1 && value <= 4
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCMonth((value - 1) * 3, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'Y',
+ 'R',
+ 'q',
+ 'M',
+ 'L',
+ 'w',
+ 'I',
+ 'd',
+ 'D',
+ 'i',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Stand-alone quarter
+ q: {
+ priority: 120,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ // 1, 2, 3, 4
+ case 'q':
+ case 'qq': // 01, 02, 03, 04
+ return parseNDigits(token.length, string)
+ // 1st, 2nd, 3rd, 4th
+ case 'qo':
+ return match.ordinalNumber(string, { unit: 'quarter' })
+ // Q1, Q2, Q3, Q4
+ case 'qqq':
+ return (
+ match.quarter(string, {
+ width: 'abbreviated',
+ context: 'standalone'
+ }) ||
+ match.quarter(string, { width: 'narrow', context: 'standalone' })
+ )
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
+ case 'qqqqq':
+ return match.quarter(string, {
+ width: 'narrow',
+ context: 'standalone'
+ })
+ // 1st quarter, 2nd quarter, ...
+ case 'qqqq':
+ default:
+ return (
+ match.quarter(string, { width: 'wide', context: 'standalone' }) ||
+ match.quarter(string, {
+ width: 'abbreviated',
+ context: 'standalone'
+ }) ||
+ match.quarter(string, { width: 'narrow', context: 'standalone' })
+ )
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 1 && value <= 4
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCMonth((value - 1) * 3, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'Y',
+ 'R',
+ 'Q',
+ 'M',
+ 'L',
+ 'w',
+ 'I',
+ 'd',
+ 'D',
+ 'i',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Month
+ M: {
+ priority: 110,
+
+ parse: function(string, token, match, _options) {
+ var valueCallback = function(value) {
+ return value - 1
+ }
+
+ switch (token) {
+ // 1, 2, ..., 12
+ case 'M':
+ return parseNumericPattern(
+ numericPatterns.month,
+ string,
+ valueCallback
+ )
+ // 01, 02, ..., 12
+ case 'MM':
+ return parseNDigits(2, string, valueCallback)
+ // 1st, 2nd, ..., 12th
+ case 'Mo':
+ return match.ordinalNumber(string, {
+ unit: 'month',
+ valueCallback: valueCallback
+ })
+ // Jan, Feb, ..., Dec
+ case 'MMM':
+ return (
+ match.month(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.month(string, { width: 'narrow', context: 'formatting' })
+ )
+ // J, F, ..., D
+ case 'MMMMM':
+ return match.month(string, { width: 'narrow', context: 'formatting' })
+ // January, February, ..., December
+ case 'MMMM':
+ default:
+ return (
+ match.month(string, { width: 'wide', context: 'formatting' }) ||
+ match.month(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.month(string, { width: 'narrow', context: 'formatting' })
+ )
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 11
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCMonth(value, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'Y',
+ 'R',
+ 'q',
+ 'Q',
+ 'L',
+ 'w',
+ 'I',
+ 'D',
+ 'i',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Stand-alone month
+ L: {
+ priority: 110,
+
+ parse: function(string, token, match, _options) {
+ var valueCallback = function(value) {
+ return value - 1
+ }
+
+ switch (token) {
+ // 1, 2, ..., 12
+ case 'L':
+ return parseNumericPattern(
+ numericPatterns.month,
+ string,
+ valueCallback
+ )
+ // 01, 02, ..., 12
+ case 'LL':
+ return parseNDigits(2, string, valueCallback)
+ // 1st, 2nd, ..., 12th
+ case 'Lo':
+ return match.ordinalNumber(string, {
+ unit: 'month',
+ valueCallback: valueCallback
+ })
+ // Jan, Feb, ..., Dec
+ case 'LLL':
+ return (
+ match.month(string, {
+ width: 'abbreviated',
+ context: 'standalone'
+ }) ||
+ match.month(string, { width: 'narrow', context: 'standalone' })
+ )
+ // J, F, ..., D
+ case 'LLLLL':
+ return match.month(string, { width: 'narrow', context: 'standalone' })
+ // January, February, ..., December
+ case 'LLLL':
+ default:
+ return (
+ match.month(string, { width: 'wide', context: 'standalone' }) ||
+ match.month(string, {
+ width: 'abbreviated',
+ context: 'standalone'
+ }) ||
+ match.month(string, { width: 'narrow', context: 'standalone' })
+ )
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 11
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCMonth(value, 1)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'Y',
+ 'R',
+ 'q',
+ 'Q',
+ 'M',
+ 'w',
+ 'I',
+ 'D',
+ 'i',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Local week of year
+ w: {
+ priority: 100,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'w':
+ return parseNumericPattern(numericPatterns.week, string)
+ case 'wo':
+ return match.ordinalNumber(string, { unit: 'week' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 1 && value <= 53
+ },
+
+ set: function(date, _flags, value, options) {
+ return startOfUTCWeek(setUTCWeek(date, value, options), options)
+ },
+
+ incompatibleTokens: [
+ 'y',
+ 'R',
+ 'u',
+ 'q',
+ 'Q',
+ 'M',
+ 'L',
+ 'I',
+ 'd',
+ 'D',
+ 'i',
+ 't',
+ 'T'
+ ]
+ },
+
+ // ISO week of year
+ I: {
+ priority: 100,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'I':
+ return parseNumericPattern(numericPatterns.week, string)
+ case 'Io':
+ return match.ordinalNumber(string, { unit: 'week' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 1 && value <= 53
+ },
+
+ set: function(date, _flags, value, options) {
+ return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options)
+ },
+
+ incompatibleTokens: [
+ 'y',
+ 'Y',
+ 'u',
+ 'q',
+ 'Q',
+ 'M',
+ 'L',
+ 'w',
+ 'd',
+ 'D',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Day of the month
+ d: {
+ priority: 90,
+
+ subPriority: 1,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'd':
+ return parseNumericPattern(numericPatterns.date, string)
+ case 'do':
+ return match.ordinalNumber(string, { unit: 'date' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(date, value, _options) {
+ var year = date.getUTCFullYear()
+ var isLeapYear = isLeapYearIndex(year)
+ var month = date.getUTCMonth()
+ if (isLeapYear) {
+ return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month]
+ } else {
+ return value >= 1 && value <= DAYS_IN_MONTH[month]
+ }
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCDate(value)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'Y',
+ 'R',
+ 'q',
+ 'Q',
+ 'w',
+ 'I',
+ 'D',
+ 'i',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Day of year
+ D: {
+ priority: 90,
+
+ subPriority: 1,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'D':
+ case 'DD':
+ return parseNumericPattern(numericPatterns.dayOfYear, string)
+ case 'Do':
+ return match.ordinalNumber(string, { unit: 'date' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(date, value, _options) {
+ var year = date.getUTCFullYear()
+ var isLeapYear = isLeapYearIndex(year)
+ if (isLeapYear) {
+ return value >= 1 && value <= 366
+ } else {
+ return value >= 1 && value <= 365
+ }
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCMonth(0, value)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'Y',
+ 'R',
+ 'q',
+ 'Q',
+ 'M',
+ 'L',
+ 'w',
+ 'I',
+ 'd',
+ 'E',
+ 'i',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Day of week
+ E: {
+ priority: 90,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ // Tue
+ case 'E':
+ case 'EE':
+ case 'EEE':
+ return (
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.day(string, { width: 'short', context: 'formatting' }) ||
+ match.day(string, { width: 'narrow', context: 'formatting' })
+ )
+ // T
+ case 'EEEEE':
+ return match.day(string, { width: 'narrow', context: 'formatting' })
+ // Tu
+ case 'EEEEEE':
+ return (
+ match.day(string, { width: 'short', context: 'formatting' }) ||
+ match.day(string, { width: 'narrow', context: 'formatting' })
+ )
+ // Tuesday
+ case 'EEEE':
+ default:
+ return (
+ match.day(string, { width: 'wide', context: 'formatting' }) ||
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.day(string, { width: 'short', context: 'formatting' }) ||
+ match.day(string, { width: 'narrow', context: 'formatting' })
+ )
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 6
+ },
+
+ set: function(date, _flags, value, options) {
+ date = setUTCDay(date, value, options)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']
+ },
+
+ // Local day of week
+ e: {
+ priority: 90,
+ parse: function(string, token, match, options) {
+ var valueCallback = function(value) {
+ var wholeWeekDays = Math.floor((value - 1) / 7) * 7
+ return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays
+ }
+
+ switch (token) {
+ // 3
+ case 'e':
+ case 'ee': // 03
+ return parseNDigits(token.length, string, valueCallback)
+ // 3rd
+ case 'eo':
+ return match.ordinalNumber(string, {
+ unit: 'day',
+ valueCallback: valueCallback
+ })
+ // Tue
+ case 'eee':
+ return (
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.day(string, { width: 'short', context: 'formatting' }) ||
+ match.day(string, { width: 'narrow', context: 'formatting' })
+ )
+ // T
+ case 'eeeee':
+ return match.day(string, { width: 'narrow', context: 'formatting' })
+ // Tu
+ case 'eeeeee':
+ return (
+ match.day(string, { width: 'short', context: 'formatting' }) ||
+ match.day(string, { width: 'narrow', context: 'formatting' })
+ )
+ // Tuesday
+ case 'eeee':
+ default:
+ return (
+ match.day(string, { width: 'wide', context: 'formatting' }) ||
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.day(string, { width: 'short', context: 'formatting' }) ||
+ match.day(string, { width: 'narrow', context: 'formatting' })
+ )
+ }
+ },
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 6
+ },
+ set: function(date, _flags, value, options) {
+ date = setUTCDay(date, value, options)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'y',
+ 'R',
+ 'u',
+ 'q',
+ 'Q',
+ 'M',
+ 'L',
+ 'I',
+ 'd',
+ 'D',
+ 'E',
+ 'i',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // Stand-alone local day of week
+ c: {
+ priority: 90,
+
+ parse: function(string, token, match, options) {
+ var valueCallback = function(value) {
+ var wholeWeekDays = Math.floor((value - 1) / 7) * 7
+ return ((value + options.weekStartsOn + 6) % 7) + wholeWeekDays
+ }
+
+ switch (token) {
+ // 3
+ case 'c':
+ case 'cc': // 03
+ return parseNDigits(token.length, string, valueCallback)
+ // 3rd
+ case 'co':
+ return match.ordinalNumber(string, {
+ unit: 'day',
+ valueCallback: valueCallback
+ })
+ // Tue
+ case 'ccc':
+ return (
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'standalone'
+ }) ||
+ match.day(string, { width: 'short', context: 'standalone' }) ||
+ match.day(string, { width: 'narrow', context: 'standalone' })
+ )
+ // T
+ case 'ccccc':
+ return match.day(string, { width: 'narrow', context: 'standalone' })
+ // Tu
+ case 'cccccc':
+ return (
+ match.day(string, { width: 'short', context: 'standalone' }) ||
+ match.day(string, { width: 'narrow', context: 'standalone' })
+ )
+ // Tuesday
+ case 'cccc':
+ default:
+ return (
+ match.day(string, { width: 'wide', context: 'standalone' }) ||
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'standalone'
+ }) ||
+ match.day(string, { width: 'short', context: 'standalone' }) ||
+ match.day(string, { width: 'narrow', context: 'standalone' })
+ )
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 6
+ },
+
+ set: function(date, _flags, value, options) {
+ date = setUTCDay(date, value, options)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'y',
+ 'R',
+ 'u',
+ 'q',
+ 'Q',
+ 'M',
+ 'L',
+ 'I',
+ 'd',
+ 'D',
+ 'E',
+ 'i',
+ 'e',
+ 't',
+ 'T'
+ ]
+ },
+
+ // ISO day of week
+ i: {
+ priority: 90,
+
+ parse: function(string, token, match, _options) {
+ var valueCallback = function(value) {
+ if (value === 0) {
+ return 7
+ }
+ return value
+ }
+
+ switch (token) {
+ // 2
+ case 'i':
+ case 'ii': // 02
+ return parseNDigits(token.length, string)
+ // 2nd
+ case 'io':
+ return match.ordinalNumber(string, { unit: 'day' })
+ // Tue
+ case 'iii':
+ return (
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'formatting',
+ valueCallback: valueCallback
+ }) ||
+ match.day(string, {
+ width: 'short',
+ context: 'formatting',
+ valueCallback: valueCallback
+ }) ||
+ match.day(string, {
+ width: 'narrow',
+ context: 'formatting',
+ valueCallback: valueCallback
+ })
+ )
+ // T
+ case 'iiiii':
+ return match.day(string, {
+ width: 'narrow',
+ context: 'formatting',
+ valueCallback: valueCallback
+ })
+ // Tu
+ case 'iiiiii':
+ return (
+ match.day(string, {
+ width: 'short',
+ context: 'formatting',
+ valueCallback: valueCallback
+ }) ||
+ match.day(string, {
+ width: 'narrow',
+ context: 'formatting',
+ valueCallback: valueCallback
+ })
+ )
+ // Tuesday
+ case 'iiii':
+ default:
+ return (
+ match.day(string, {
+ width: 'wide',
+ context: 'formatting',
+ valueCallback: valueCallback
+ }) ||
+ match.day(string, {
+ width: 'abbreviated',
+ context: 'formatting',
+ valueCallback: valueCallback
+ }) ||
+ match.day(string, {
+ width: 'short',
+ context: 'formatting',
+ valueCallback: valueCallback
+ }) ||
+ match.day(string, {
+ width: 'narrow',
+ context: 'formatting',
+ valueCallback: valueCallback
+ })
+ )
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 1 && value <= 7
+ },
+
+ set: function(date, _flags, value, options) {
+ date = setUTCISODay(date, value, options)
+ date.setUTCHours(0, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: [
+ 'y',
+ 'Y',
+ 'u',
+ 'q',
+ 'Q',
+ 'M',
+ 'L',
+ 'w',
+ 'd',
+ 'D',
+ 'E',
+ 'e',
+ 'c',
+ 't',
+ 'T'
+ ]
+ },
+
+ // AM or PM
+ a: {
+ priority: 80,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'a':
+ case 'aa':
+ case 'aaa':
+ return (
+ match.dayPeriod(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.dayPeriod(string, { width: 'narrow', context: 'formatting' })
+ )
+ case 'aaaaa':
+ return match.dayPeriod(string, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ case 'aaaa':
+ default:
+ return (
+ match.dayPeriod(string, { width: 'wide', context: 'formatting' }) ||
+ match.dayPeriod(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.dayPeriod(string, { width: 'narrow', context: 'formatting' })
+ )
+ }
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']
+ },
+
+ // AM, PM, midnight
+ b: {
+ priority: 80,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'b':
+ case 'bb':
+ case 'bbb':
+ return (
+ match.dayPeriod(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.dayPeriod(string, { width: 'narrow', context: 'formatting' })
+ )
+ case 'bbbbb':
+ return match.dayPeriod(string, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ case 'bbbb':
+ default:
+ return (
+ match.dayPeriod(string, { width: 'wide', context: 'formatting' }) ||
+ match.dayPeriod(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.dayPeriod(string, { width: 'narrow', context: 'formatting' })
+ )
+ }
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']
+ },
+
+ // in the morning, in the afternoon, in the evening, at night
+ B: {
+ priority: 80,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'B':
+ case 'BB':
+ case 'BBB':
+ return (
+ match.dayPeriod(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.dayPeriod(string, { width: 'narrow', context: 'formatting' })
+ )
+ case 'BBBBB':
+ return match.dayPeriod(string, {
+ width: 'narrow',
+ context: 'formatting'
+ })
+ case 'BBBB':
+ default:
+ return (
+ match.dayPeriod(string, { width: 'wide', context: 'formatting' }) ||
+ match.dayPeriod(string, {
+ width: 'abbreviated',
+ context: 'formatting'
+ }) ||
+ match.dayPeriod(string, { width: 'narrow', context: 'formatting' })
+ )
+ }
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['a', 'b', 't', 'T']
+ },
+
+ // Hour [1-12]
+ h: {
+ priority: 70,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'h':
+ return parseNumericPattern(numericPatterns.hour12h, string)
+ case 'ho':
+ return match.ordinalNumber(string, { unit: 'hour' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 1 && value <= 12
+ },
+
+ set: function(date, _flags, value, _options) {
+ var isPM = date.getUTCHours() >= 12
+ if (isPM && value < 12) {
+ date.setUTCHours(value + 12, 0, 0, 0)
+ } else if (!isPM && value === 12) {
+ date.setUTCHours(0, 0, 0, 0)
+ } else {
+ date.setUTCHours(value, 0, 0, 0)
+ }
+ return date
+ },
+
+ incompatibleTokens: ['H', 'K', 'k', 't', 'T']
+ },
+
+ // Hour [0-23]
+ H: {
+ priority: 70,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'H':
+ return parseNumericPattern(numericPatterns.hour23h, string)
+ case 'Ho':
+ return match.ordinalNumber(string, { unit: 'hour' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 23
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCHours(value, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']
+ },
+
+ // Hour [0-11]
+ K: {
+ priority: 70,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'K':
+ return parseNumericPattern(numericPatterns.hour11h, string)
+ case 'Ko':
+ return match.ordinalNumber(string, { unit: 'hour' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 11
+ },
+
+ set: function(date, _flags, value, _options) {
+ var isPM = date.getUTCHours() >= 12
+ if (isPM && value < 12) {
+ date.setUTCHours(value + 12, 0, 0, 0)
+ } else {
+ date.setUTCHours(value, 0, 0, 0)
+ }
+ return date
+ },
+
+ incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']
+ },
+
+ // Hour [1-24]
+ k: {
+ priority: 70,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'k':
+ return parseNumericPattern(numericPatterns.hour24h, string)
+ case 'ko':
+ return match.ordinalNumber(string, { unit: 'hour' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 1 && value <= 24
+ },
+
+ set: function(date, _flags, value, _options) {
+ var hours = value <= 24 ? value % 24 : value
+ date.setUTCHours(hours, 0, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']
+ },
+
+ // Minute
+ m: {
+ priority: 60,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 'm':
+ return parseNumericPattern(numericPatterns.minute, string)
+ case 'mo':
+ return match.ordinalNumber(string, { unit: 'minute' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 59
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCMinutes(value, 0, 0)
+ return date
+ },
+
+ incompatibleTokens: ['t', 'T']
+ },
+
+ // Second
+ s: {
+ priority: 50,
+
+ parse: function(string, token, match, _options) {
+ switch (token) {
+ case 's':
+ return parseNumericPattern(numericPatterns.second, string)
+ case 'so':
+ return match.ordinalNumber(string, { unit: 'second' })
+ default:
+ return parseNDigits(token.length, string)
+ }
+ },
+
+ validate: function(_date, value, _options) {
+ return value >= 0 && value <= 59
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCSeconds(value, 0)
+ return date
+ },
+
+ incompatibleTokens: ['t', 'T']
+ },
+
+ // Fraction of second
+ S: {
+ priority: 30,
+
+ parse: function(string, token, _match, _options) {
+ var valueCallback = function(value) {
+ return Math.floor(value * Math.pow(10, -token.length + 3))
+ }
+ return parseNDigits(token.length, string, valueCallback)
+ },
+
+ set: function(date, _flags, value, _options) {
+ date.setUTCMilliseconds(value)
+ return date
+ },
+
+ incompatibleTokens: ['t', 'T']
+ },
+
+ // Timezone (ISO-8601. +00:00 is `'Z'`)
+ X: {
+ priority: 10,
+
+ parse: function(string, token, _match, _options) {
+ switch (token) {
+ case 'X':
+ return parseTimezonePattern(
+ timezonePatterns.basicOptionalMinutes,
+ string
+ )
+ case 'XX':
+ return parseTimezonePattern(timezonePatterns.basic, string)
+ case 'XXXX':
+ return parseTimezonePattern(
+ timezonePatterns.basicOptionalSeconds,
+ string
+ )
+ case 'XXXXX':
+ return parseTimezonePattern(
+ timezonePatterns.extendedOptionalSeconds,
+ string
+ )
+ case 'XXX':
+ default:
+ return parseTimezonePattern(timezonePatterns.extended, string)
+ }
+ },
+
+ set: function(date, flags, value, _options) {
+ if (flags.timestampIsSet) {
+ return date
+ }
+ return new Date(date.getTime() - value)
+ },
+
+ incompatibleTokens: ['t', 'T', 'x']
+ },
+
+ // Timezone (ISO-8601)
+ x: {
+ priority: 10,
+
+ parse: function(string, token, _match, _options) {
+ switch (token) {
+ case 'x':
+ return parseTimezonePattern(
+ timezonePatterns.basicOptionalMinutes,
+ string
+ )
+ case 'xx':
+ return parseTimezonePattern(timezonePatterns.basic, string)
+ case 'xxxx':
+ return parseTimezonePattern(
+ timezonePatterns.basicOptionalSeconds,
+ string
+ )
+ case 'xxxxx':
+ return parseTimezonePattern(
+ timezonePatterns.extendedOptionalSeconds,
+ string
+ )
+ case 'xxx':
+ default:
+ return parseTimezonePattern(timezonePatterns.extended, string)
+ }
+ },
+
+ set: function(date, flags, value, _options) {
+ if (flags.timestampIsSet) {
+ return date
+ }
+ return new Date(date.getTime() - value)
+ },
+
+ incompatibleTokens: ['t', 'T', 'X']
+ },
+
+ // Seconds timestamp
+ t: {
+ priority: 40,
+
+ parse: function(string, _token, _match, _options) {
+ return parseAnyDigitsSigned(string)
+ },
+
+ set: function(_date, _flags, value, _options) {
+ return [new Date(value * 1000), { timestampIsSet: true }]
+ },
+
+ incompatibleTokens: '*'
+ },
+
+ // Milliseconds timestamp
+ T: {
+ priority: 20,
+
+ parse: function(string, _token, _match, _options) {
+ return parseAnyDigitsSigned(string)
+ },
+
+ set: function(_date, _flags, value, _options) {
+ return [new Date(value), { timestampIsSet: true }]
+ },
+
+ incompatibleTokens: '*'
+ }
+}
+
+export default parsers
diff --git a/date-fns/src/parse/benchmark.js b/date-fns/src/parse/benchmark.js
new file mode 100644
index 0000000..2b816d7
--- /dev/null
+++ b/date-fns/src/parse/benchmark.js
@@ -0,0 +1,20 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import parse from '.'
+import moment from 'moment'
+
+suite('parse', function () {
+ benchmark('date-fns', function () {
+ return parse('Tuesday, January 10th 2017, 11:07:40 am', 'dddd, MMMM Do YYYY, h:mm:ss a', this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return moment('Tuesday, January 10th 2017, 11:07:40 am', 'dddd, MMMM Do YYYY, h:mm:ss a')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/parse/index.d.ts b/date-fns/src/parse/index.d.ts
new file mode 100644
index 0000000..2c5eb60
--- /dev/null
+++ b/date-fns/src/parse/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parse } from 'date-fns'
+export default parse
diff --git a/date-fns/src/parse/index.js b/date-fns/src/parse/index.js
new file mode 100644
index 0000000..ef8b2d3
--- /dev/null
+++ b/date-fns/src/parse/index.js
@@ -0,0 +1,626 @@
+import defaultLocale from '../locale/en-US/index'
+import subMilliseconds from '../subMilliseconds/index'
+import toDate from '../toDate/index'
+import assign from '../_lib/assign/index'
+import longFormatters from '../_lib/format/longFormatters/index'
+import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index'
+import {
+ isProtectedDayOfYearToken,
+ isProtectedWeekYearToken,
+ throwProtectedError
+} from '../_lib/protectedTokens/index'
+import toInteger from '../_lib/toInteger/index'
+import parsers from './_lib/parsers/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+var TIMEZONE_UNIT_PRIORITY = 10
+
+// This RegExp consists of three parts separated by `|`:
+// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
+// (one of the certain letters followed by `o`)
+// - (\w)\1* matches any sequences of the same letter
+// - '' matches two quote characters in a row
+// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
+// except a single quote symbol, which ends the sequence.
+// Two quote characters do not end the sequence.
+// If there is no matching single quote
+// then the sequence will continue until the end of the string.
+// - . matches any single character unmatched by previous parts of the RegExps
+var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g
+
+// This RegExp catches symbols escaped by quotes, and also
+// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
+var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g
+
+var escapedStringRegExp = /^'([^]*?)'?$/
+var doubleQuoteRegExp = /''/g
+
+var notWhitespaceRegExp = /\S/
+var unescapedLatinCharacterRegExp = /[a-zA-Z]/
+
+/**
+ * @name parse
+ * @category Common Helpers
+ * @summary Parse the date.
+ *
+ * @description
+ * Return the date parsed from string using the given format string.
+ *
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
+ * > See: https://git.io/fxCyr
+ *
+ * The characters in the format string wrapped between two single quotes characters (') are escaped.
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
+ *
+ * Format of the format string is based on Unicode Technical Standard #35:
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
+ * with a few additions (see note 5 below the table).
+ *
+ * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
+ * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
+ *
+ * ```javascript
+ * parse('23 AM', 'HH a', new Date())
+ * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
+ * ```
+ *
+ * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
+ *
+ * Accepted format string patterns:
+ * | Unit |Prior| Pattern | Result examples | Notes |
+ * |---------------------------------|-----|---------|-----------------------------------|-------|
+ * | Era | 140 | G..GGG | AD, BC | |
+ * | | | GGGG | Anno Domini, Before Christ | 2 |
+ * | | | GGGGG | A, B | |
+ * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
+ * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
+ * | | | yy | 44, 01, 00, 17 | 4 |
+ * | | | yyy | 044, 001, 123, 999 | 4 |
+ * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
+ * | | | yyyyy | ... | 2,4 |
+ * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
+ * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
+ * | | | YY | 44, 01, 00, 17 | 4,6 |
+ * | | | YYY | 044, 001, 123, 999 | 4 |
+ * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
+ * | | | YYYYY | ... | 2,4 |
+ * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
+ * | | | RR | -43, 01, 00, 17 | 4,5 |
+ * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
+ * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
+ * | | | RRRRR | ... | 2,4,5 |
+ * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
+ * | | | uu | -43, 01, 99, -99 | 4 |
+ * | | | uuu | -043, 001, 123, 999, -999 | 4 |
+ * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
+ * | | | uuuuu | ... | 2,4 |
+ * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
+ * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
+ * | | | QQ | 01, 02, 03, 04 | |
+ * | | | QQQ | Q1, Q2, Q3, Q4 | |
+ * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
+ * | | | QQQQQ | 1, 2, 3, 4 | 4 |
+ * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
+ * | | | qo | 1st, 2nd, 3rd, 4th | 5 |
+ * | | | qq | 01, 02, 03, 04 | |
+ * | | | qqq | Q1, Q2, Q3, Q4 | |
+ * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
+ * | | | qqqqq | 1, 2, 3, 4 | 3 |
+ * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
+ * | | | Mo | 1st, 2nd, ..., 12th | 5 |
+ * | | | MM | 01, 02, ..., 12 | |
+ * | | | MMM | Jan, Feb, ..., Dec | |
+ * | | | MMMM | January, February, ..., December | 2 |
+ * | | | MMMMM | J, F, ..., D | |
+ * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
+ * | | | Lo | 1st, 2nd, ..., 12th | 5 |
+ * | | | LL | 01, 02, ..., 12 | |
+ * | | | LLL | Jan, Feb, ..., Dec | |
+ * | | | LLLL | January, February, ..., December | 2 |
+ * | | | LLLLL | J, F, ..., D | |
+ * | Local week of year | 100 | w | 1, 2, ..., 53 | |
+ * | | | wo | 1st, 2nd, ..., 53th | 5 |
+ * | | | ww | 01, 02, ..., 53 | |
+ * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
+ * | | | Io | 1st, 2nd, ..., 53th | 5 |
+ * | | | II | 01, 02, ..., 53 | 5 |
+ * | Day of month | 90 | d | 1, 2, ..., 31 | |
+ * | | | do | 1st, 2nd, ..., 31st | 5 |
+ * | | | dd | 01, 02, ..., 31 | |
+ * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
+ * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
+ * | | | DD | 01, 02, ..., 365, 366 | 7 |
+ * | | | DDD | 001, 002, ..., 365, 366 | |
+ * | | | DDDD | ... | 2 |
+ * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
+ * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
+ * | | | EEEEE | M, T, W, T, F, S, S | |
+ * | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
+ * | | | io | 1st, 2nd, ..., 7th | 5 |
+ * | | | ii | 01, 02, ..., 07 | 5 |
+ * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |
+ * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
+ * | | | iiiii | M, T, W, T, F, S, S | 5 |
+ * | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |
+ * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
+ * | | | eo | 2nd, 3rd, ..., 1st | 5 |
+ * | | | ee | 02, 03, ..., 01 | |
+ * | | | eee | Mon, Tue, Wed, ..., Sun | |
+ * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
+ * | | | eeeee | M, T, W, T, F, S, S | |
+ * | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
+ * | | | co | 2nd, 3rd, ..., 1st | 5 |
+ * | | | cc | 02, 03, ..., 01 | |
+ * | | | ccc | Mon, Tue, Wed, ..., Sun | |
+ * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
+ * | | | ccccc | M, T, W, T, F, S, S | |
+ * | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
+ * | AM, PM | 80 | a..aaa | AM, PM | |
+ * | | | aaaa | a.m., p.m. | 2 |
+ * | | | aaaaa | a, p | |
+ * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
+ * | | | bbbb | a.m., p.m., noon, midnight | 2 |
+ * | | | bbbbb | a, p, n, mi | |
+ * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
+ * | | | BBBB | at night, in the morning, ... | 2 |
+ * | | | BBBBB | at night, in the morning, ... | |
+ * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
+ * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
+ * | | | hh | 01, 02, ..., 11, 12 | |
+ * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
+ * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
+ * | | | HH | 00, 01, 02, ..., 23 | |
+ * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
+ * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
+ * | | | KK | 01, 02, ..., 11, 00 | |
+ * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
+ * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
+ * | | | kk | 24, 01, 02, ..., 23 | |
+ * | Minute | 60 | m | 0, 1, ..., 59 | |
+ * | | | mo | 0th, 1st, ..., 59th | 5 |
+ * | | | mm | 00, 01, ..., 59 | |
+ * | Second | 50 | s | 0, 1, ..., 59 | |
+ * | | | so | 0th, 1st, ..., 59th | 5 |
+ * | | | ss | 00, 01, ..., 59 | |
+ * | Seconds timestamp | 40 | t | 512969520 | |
+ * | | | tt | ... | 2 |
+ * | Fraction of second | 30 | S | 0, 1, ..., 9 | |
+ * | | | SS | 00, 01, ..., 99 | |
+ * | | | SSS | 000, 0001, ..., 999 | |
+ * | | | SSSS | ... | 2 |
+ * | Milliseconds timestamp | 20 | T | 512969520900 | |
+ * | | | TT | ... | 2 |
+ * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
+ * | | | XX | -0800, +0530, Z | |
+ * | | | XXX | -08:00, +05:30, Z | |
+ * | | | XXXX | -0800, +0530, Z, +123456 | 2 |
+ * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
+ * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
+ * | | | xx | -0800, +0530, +0000 | |
+ * | | | xxx | -08:00, +05:30, +00:00 | 2 |
+ * | | | xxxx | -0800, +0530, +0000, +123456 | |
+ * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
+ * | Long localized date | NA | P | 05/29/1453 | 5,8 |
+ * | | | PP | May 29, 1453 | |
+ * | | | PPP | May 29th, 1453 | |
+ * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
+ * | Long localized time | NA | p | 12:00 AM | 5,8 |
+ * | | | pp | 12:00:00 AM | |
+ * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
+ * | | | PPpp | May 29, 1453, 12:00:00 AM | |
+ * | | | PPPpp | May 29th, 1453 at ... | |
+ * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
+ * Notes:
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
+ * are the same as "stand-alone" units, but are different in some languages.
+ * "Formatting" units are declined according to the rules of the language
+ * in the context of a date. "Stand-alone" units are always nominative singular.
+ * In `format` function, they will produce different result:
+ *
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
+ *
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
+ *
+ * `parse` will try to match both formatting and stand-alone units interchangably.
+ *
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
+ * the single quote characters (see below).
+ * If the sequence is longer than listed in table:
+ * - for numerical units (`yyyyyyyy`) `parse` will try to match a number
+ * as wide as the sequence
+ * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
+ * These variations are marked with "2" in the last column of the table.
+ *
+ * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
+ * These tokens represent the shortest form of the quarter.
+ *
+ * 4. The main difference between `y` and `u` patterns are B.C. years:
+ *
+ * | Year | `y` | `u` |
+ * |------|-----|-----|
+ * | AC 1 | 1 | 1 |
+ * | BC 1 | 1 | 0 |
+ * | BC 2 | 2 | -1 |
+ *
+ * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
+ *
+ * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
+ *
+ * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
+ *
+ * while `uu` will just assign the year as is:
+ *
+ * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
+ *
+ * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
+ *
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
+ * except local week-numbering years are dependent on `options.weekStartsOn`
+ * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}
+ * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).
+ *
+ * 5. These patterns are not in the Unicode Technical Standard #35:
+ * - `i`: ISO day of week
+ * - `I`: ISO week of year
+ * - `R`: ISO week-numbering year
+ * - `o`: ordinal number modifier
+ * - `P`: long localized date
+ * - `p`: long localized time
+ *
+ * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
+ *
+ * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
+ *
+ * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
+ * on the given locale.
+ *
+ * using `en-US` locale: `P` => `MM/dd/yyyy`
+ * using `en-US` locale: `p` => `hh:mm a`
+ * using `pt-BR` locale: `P` => `dd/MM/yyyy`
+ * using `pt-BR` locale: `p` => `HH:mm`
+ *
+ * Values will be assigned to the date in the descending order of its unit's priority.
+ * Units of an equal priority overwrite each other in the order of appearance.
+ *
+ * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
+ * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
+ *
+ * `referenceDate` must be passed for correct work of the function.
+ * If you're not sure which `referenceDate` to supply, create a new instance of Date:
+ * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
+ * In this case parsing will be done in the context of the current date.
+ * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
+ * then `Invalid Date` will be returned.
+ *
+ * The result may vary by locale.
+ *
+ * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
+ *
+ * If parsing failed, `Invalid Date` will be returned.
+ * Invalid Date is a Date, whose time value is NaN.
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - Old `parse` was renamed to `toDate`.
+ * Now `parse` is a new function which parses a string using a provided format.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ * parse('2016-01-01')
+ *
+ * // v2.0.0 onward (toDate no longer accepts a string)
+ * toDate(1392098430000) // Unix to timestamp
+ * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date
+ * parse('2016-01-01', 'yyyy-MM-dd', new Date())
+ * ```
+ *
+ * @param {String} dateString - the string to parse
+ * @param {String} formatString - the string of tokens
+ * @param {Date|Number} referenceDate - defines values missing from the parsed dateString
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
+ * see: https://git.io/fxCyr
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
+ * see: https://git.io/fxCyr
+ * @returns {Date} the parsed date
+ * @throws {TypeError} 3 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ * @throws {RangeError} `options.locale` must contain `match` property
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
+ *
+ * @example
+ * // Parse 11 February 2014 from middle-endian format:
+ * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
+ * //=> Tue Feb 11 2014 00:00:00
+ *
+ * @example
+ * // Parse 28th of February in Esperanto locale in the context of 2010 year:
+ * import eo from 'date-fns/locale/eo'
+ * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
+ * locale: eo
+ * })
+ * //=> Sun Feb 28 2010 00:00:00
+ */
+export default function parse(
+ dirtyDateString,
+ dirtyFormatString,
+ dirtyReferenceDate,
+ dirtyOptions
+) {
+ requiredArgs(3, arguments)
+
+ var dateString = String(dirtyDateString)
+ var formatString = String(dirtyFormatString)
+ var options = dirtyOptions || {}
+
+ var locale = options.locale || defaultLocale
+
+ if (!locale.match) {
+ throw new RangeError('locale must contain match property')
+ }
+
+ var localeFirstWeekContainsDate =
+ locale.options && locale.options.firstWeekContainsDate
+ var defaultFirstWeekContainsDate =
+ localeFirstWeekContainsDate == null
+ ? 1
+ : toInteger(localeFirstWeekContainsDate)
+ var firstWeekContainsDate =
+ options.firstWeekContainsDate == null
+ ? defaultFirstWeekContainsDate
+ : toInteger(options.firstWeekContainsDate)
+
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
+ throw new RangeError(
+ 'firstWeekContainsDate must be between 1 and 7 inclusively'
+ )
+ }
+
+ var localeWeekStartsOn = locale.options && locale.options.weekStartsOn
+ var defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ var weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ if (formatString === '') {
+ if (dateString === '') {
+ return toDate(dirtyReferenceDate)
+ } else {
+ return new Date(NaN)
+ }
+ }
+
+ var subFnOptions = {
+ firstWeekContainsDate: firstWeekContainsDate,
+ weekStartsOn: weekStartsOn,
+ locale: locale
+ }
+
+ // If timezone isn't specified, it will be set to the system timezone
+ var setters = [
+ {
+ priority: TIMEZONE_UNIT_PRIORITY,
+ subPriority: -1,
+ set: dateToSystemTimezone,
+ index: 0
+ }
+ ]
+
+ var i
+
+ var tokens = formatString
+ .match(longFormattingTokensRegExp)
+ .map(function(substring) {
+ var firstCharacter = substring[0]
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
+ var longFormatter = longFormatters[firstCharacter]
+ return longFormatter(substring, locale.formatLong, subFnOptions)
+ }
+ return substring
+ })
+ .join('')
+ .match(formattingTokensRegExp)
+
+ const usedTokens = []
+
+ for (i = 0; i < tokens.length; i++) {
+ var token = tokens[i]
+
+ if (
+ !options.useAdditionalWeekYearTokens &&
+ isProtectedWeekYearToken(token)
+ ) {
+ throwProtectedError(token, formatString, dirtyDateString)
+ }
+ if (
+ !options.useAdditionalDayOfYearTokens &&
+ isProtectedDayOfYearToken(token)
+ ) {
+ throwProtectedError(token, formatString, dirtyDateString)
+ }
+
+ var firstCharacter = token[0]
+ var parser = parsers[firstCharacter]
+ if (parser) {
+ const { incompatibleTokens } = parser
+ if (Array.isArray(incompatibleTokens)) {
+ let incompatibleToken
+ for (let i = 0; i < usedTokens.length; i++) {
+ const usedToken = usedTokens[i].token
+ if (
+ incompatibleTokens.indexOf(usedToken) !== -1 ||
+ usedToken === firstCharacter
+ ) {
+ incompatibleToken = usedTokens[i]
+ break
+ }
+ }
+ if (incompatibleToken) {
+ throw new RangeError(
+ `The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`
+ )
+ }
+ } else if (parser.incompatibleTokens === '*' && usedTokens.length) {
+ throw new RangeError(
+ `The format string mustn't contain \`${token}\` and any other token at the same time`
+ )
+ }
+
+ usedTokens.push({ token: firstCharacter, fullToken: token })
+
+ var parseResult = parser.parse(
+ dateString,
+ token,
+ locale.match,
+ subFnOptions
+ )
+
+ if (!parseResult) {
+ return new Date(NaN)
+ }
+
+ setters.push({
+ priority: parser.priority,
+ subPriority: parser.subPriority || 0,
+ set: parser.set,
+ validate: parser.validate,
+ value: parseResult.value,
+ index: setters.length
+ })
+
+ dateString = parseResult.rest
+ } else {
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
+ throw new RangeError(
+ 'Format string contains an unescaped latin alphabet character `' +
+ firstCharacter +
+ '`'
+ )
+ }
+
+ // Replace two single quote characters with one single quote character
+ if (token === "''") {
+ token = "'"
+ } else if (firstCharacter === "'") {
+ token = cleanEscapedString(token)
+ }
+
+ // Cut token from string, or, if string doesn't match the token, return Invalid Date
+ if (dateString.indexOf(token) === 0) {
+ dateString = dateString.slice(token.length)
+ } else {
+ return new Date(NaN)
+ }
+ }
+ }
+
+ // Check if the remaining input contains something other than whitespace
+ if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
+ return new Date(NaN)
+ }
+
+ var uniquePrioritySetters = setters
+ .map(function(setter) {
+ return setter.priority
+ })
+ .sort(function(a, b) {
+ return b - a
+ })
+ .filter(function(priority, index, array) {
+ return array.indexOf(priority) === index
+ })
+ .map(function(priority) {
+ return setters
+ .filter(function(setter) {
+ return setter.priority === priority
+ })
+ .sort(function(a, b) {
+ return b.subPriority - a.subPriority
+ })
+ })
+ .map(function(setterArray) {
+ return setterArray[0]
+ })
+
+ var date = toDate(dirtyReferenceDate)
+
+ if (isNaN(date)) {
+ return new Date(NaN)
+ }
+
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37
+ var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date))
+
+ var flags = {}
+ for (i = 0; i < uniquePrioritySetters.length; i++) {
+ var setter = uniquePrioritySetters[i]
+
+ if (
+ setter.validate &&
+ !setter.validate(utcDate, setter.value, subFnOptions)
+ ) {
+ return new Date(NaN)
+ }
+
+ var result = setter.set(utcDate, flags, setter.value, subFnOptions)
+ // Result is tuple (date, flags)
+ if (result[0]) {
+ utcDate = result[0]
+ assign(flags, result[1])
+ // Result is date
+ } else {
+ utcDate = result
+ }
+ }
+
+ return utcDate
+}
+
+function dateToSystemTimezone(date, flags) {
+ if (flags.timestampIsSet) {
+ return date
+ }
+
+ var convertedDate = new Date(0)
+ convertedDate.setFullYear(
+ date.getUTCFullYear(),
+ date.getUTCMonth(),
+ date.getUTCDate()
+ )
+ convertedDate.setHours(
+ date.getUTCHours(),
+ date.getUTCMinutes(),
+ date.getUTCSeconds(),
+ date.getUTCMilliseconds()
+ )
+ return convertedDate
+}
+
+function cleanEscapedString(input) {
+ return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'")
+}
diff --git a/date-fns/src/parse/index.js.flow b/date-fns/src/parse/index.js.flow
new file mode 100644
index 0000000..f8e1cfe
--- /dev/null
+++ b/date-fns/src/parse/index.js.flow
@@ -0,0 +1,63 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ dateString: string,
+ formatString: string,
+ referenceDate: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ useAdditionalWeekYearTokens?: boolean,
+ useAdditionalDayOfYearTokens?: boolean,
+ }
+) => Date
diff --git a/date-fns/src/parse/test.js b/date-fns/src/parse/test.js
new file mode 100644
index 0000000..cf0ad52
--- /dev/null
+++ b/date-fns/src/parse/test.js
@@ -0,0 +1,2665 @@
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import parse from '.'
+
+describe('parse', function () {
+ var referenceDate = new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 900)
+
+ it('escapes characters between the single quote characters', function () {
+ var result = parse(
+ '2018 hello world July 2nd',
+ "yyyy 'hello world' MMMM do",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date(2018, 6 /* Jul */, 2))
+ })
+
+ it('two single quote characters are transformed into a "real" single quote', function () {
+ var result = parse("'5 o'clock'", "''h 'o''clock'''", referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 5))
+ })
+
+ it('accepts new line charactor', function () {
+ var result = parse(
+ '2014-04-04\n05:00:00',
+ "yyyy-MM-dd'\n'HH:mm:ss",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date(2014, 3 /* Apr */, 4, 5))
+ })
+
+ describe('era', function () {
+ it('abbreviated', function () {
+ var result = parse('10000 BC', 'yyyyy G', referenceDate)
+ assert.deepEqual(result, new Date(-9999, 0 /* Jan */, 1))
+ })
+
+ it('wide', function () {
+ var result = parse('2018 Anno Domini', 'yyyy GGGG', referenceDate)
+ assert.deepEqual(result, new Date(2018, 0 /* Jan */, 1))
+ })
+
+ it('narrow', function () {
+ var result = parse('44 B', 'y GGGGG', referenceDate)
+ assert.deepEqual(result, new Date(-43, 0 /* Jan */, 1))
+ })
+
+ it('with week-numbering year', function () {
+ var result = parse('44 B', 'Y GGGGG', referenceDate)
+ assert.deepEqual(result, new Date(-44, 11 /* Dec */, 30))
+ })
+
+ it('parses stand-alone BC', function () {
+ var result = parse('BC', 'G', referenceDate)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('parses stand-alone AD', function () {
+ var result = parse('AD', 'G', referenceDate)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(1, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ describe('validation', () => {
+ ;[
+ ['G', 'BC'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when G is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 420`,
+ `${token} G`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`G\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('calendar year', function () {
+ it('numeric', function () {
+ var result = parse('2017', 'y', referenceDate)
+ assert.deepEqual(result, new Date(2017, 0 /* Jan */, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('2017th', 'yo', referenceDate)
+ assert.deepEqual(result, new Date(2017, 0 /* Jan */, 1))
+ })
+
+ describe('two-digit numeric year', function () {
+ it('works as expected', function () {
+ var result = parse('02', 'yy', referenceDate)
+ assert.deepEqual(result, new Date(2002, 0 /* Jan */, 1))
+ })
+
+ it('gets the 100 year range from `referenceDate`', function () {
+ var result = parse('02', 'yy', new Date(1860, 6 /* Jul */, 2))
+ assert.deepEqual(result, new Date(1902, 0 /* Jan */, 1))
+ })
+ })
+
+ it('three-digit zero-padding', function () {
+ var result = parse('123', 'yyy', referenceDate)
+ assert.deepEqual(result, new Date(123, 0 /* Jan */, 1))
+ })
+
+ it('four-digit zero-padding', function () {
+ var result = parse('0044', 'yyyy', referenceDate)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(44, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse('000001', 'yyyyyy', referenceDate)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(1, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ describe('validation', () => {
+ ;[
+ ['y', '2019'],
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['w', '1'],
+ ['I', '1'],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when y is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 2019`,
+ `${token} y`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`y\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('local week-numbering year', function () {
+ it('numeric', function () {
+ var result = parse('2002', 'Y', referenceDate)
+ assert.deepEqual(result, new Date(2001, 11 /* Dec */, 30))
+ })
+
+ it('ordinal', function () {
+ var result = parse('12345th', 'Yo', referenceDate)
+ assert.deepEqual(result, new Date(12344, 11 /* Dec */, 31))
+ })
+
+ describe('two-digit numeric year', function () {
+ it('works as expected', function () {
+ var result = parse('02', 'YY', referenceDate, {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(2001, 11 /* Dec */, 30))
+ })
+
+ it('gets the 100 year range from `referenceDate`', function () {
+ var result = parse('02', 'YY', new Date(1860, 6 /* Jul */, 2), {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(1901, 11 /* Dec */, 29))
+ })
+ })
+
+ it('three-digit zero-padding', function () {
+ var result = parse('123', 'YYY', referenceDate)
+ assert.deepEqual(result, new Date(122, 11 /* Dec */, 27))
+ })
+
+ it('four-digit zero-padding', function () {
+ var result = parse('2018', 'YYYY', referenceDate, {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(2017, 11 /* Dec */, 31))
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse('000001', 'YYYYYY', referenceDate)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 11 /* Dec */, 31)
+ expectedResult.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in options', function () {
+ var result = parse('2018', 'Y', referenceDate, {
+ weekStartsOn: 1 /* Mon */,
+ firstWeekContainsDate: 4,
+ })
+ assert.deepEqual(result, new Date(2018, 0 /* Jan */, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['y', '2019'],
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['i', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when Y is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 2019`,
+ `${token} Y`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`Y\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('ISO week-numbering year', function () {
+ it('numeric', function () {
+ var result = parse('-1234', 'R', referenceDate)
+ assert.deepEqual(result, new Date(-1234, 0 /* Jan */, 3))
+ })
+
+ it('two-digit zero-padding', function () {
+ var result = parse('-02', 'RR', referenceDate)
+ assert.deepEqual(result, new Date(-3, 11 /* Dec */, 29))
+ })
+
+ it('three-digit zero-padding', function () {
+ var result = parse('123', 'RRR', referenceDate)
+ assert.deepEqual(result, new Date(123, 0 /* Jan */, 4))
+ })
+
+ it('four-digit zero-padding', function () {
+ var result = parse('2018', 'RRRR', referenceDate)
+ assert.deepEqual(result, new Date(2018, 0 /* Jan */, 1))
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse('000001', 'RRRRRR', referenceDate)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(1, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ describe('validation', () => {
+ ;[
+ ['G', 'AD'],
+ ['y', '2019'],
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when R is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 2019`,
+ `${token} R`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`R\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('extended year', function () {
+ it('numeric', function () {
+ var result = parse('-1234', 'u', referenceDate)
+ assert.deepEqual(result, new Date(-1234, 0 /* Jan */, 1))
+ })
+
+ it('two-digit zero-padding', function () {
+ var result = parse('-02', 'uu', referenceDate)
+ assert.deepEqual(result, new Date(-2, 0 /* Jan */, 1))
+ })
+
+ it('three-digit zero-padding', function () {
+ var result = parse('123', 'uuu', referenceDate)
+ assert.deepEqual(result, new Date(123, 0 /* Jan */, 1))
+ })
+
+ it('four-digit zero-padding', function () {
+ var result = parse('2018', 'uuuu', referenceDate)
+ assert.deepEqual(result, new Date(2018, 0 /* Jan */, 1))
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse('000001', 'uuuuuu', referenceDate)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(1, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ describe('validation', () => {
+ ;[
+ ['G', 'AD'],
+ ['y', '2019'],
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['w', '1'],
+ ['I', '1'],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when u is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 2019`,
+ `${token} u`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`u\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('quarter with following year', function () {
+ it('first quarter', function () {
+ var result = parse('Q1/2020', 'QQQ/yyyy', referenceDate)
+ assert.deepEqual(result, new Date(2020, 0 /* Jan */, 1))
+ })
+
+ it('second quarter', function () {
+ var result = parse('Q2/2020', 'QQQ/yyyy', referenceDate)
+ assert.deepEqual(result, new Date(2020, 3 /* Apr */, 1))
+ })
+
+ it('third quarter', function () {
+ var result = parse('Q3/2020', 'QQQ/yyyy', referenceDate)
+ assert.deepEqual(result, new Date(2020, 6 /* Jul */, 1))
+ })
+
+ it('fourth quarter', function () {
+ var result = parse('Q4/2020', 'QQQ/yyyy', referenceDate)
+ assert.deepEqual(result, new Date(2020, 9 /* Oct */, 1))
+ })
+ })
+
+ describe('quarter (formatting)', function () {
+ it('numeric', function () {
+ var result = parse('1', 'Q', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('1st', 'Qo', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('02', 'QQ', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 1))
+ })
+
+ it('abbreviated', function () {
+ var result = parse('Q3', 'QQQ', referenceDate)
+ assert.deepEqual(result, new Date(1986, 6 /* Jul */, 1))
+ })
+
+ it('wide', function () {
+ var result = parse('4st quarter', 'QQQQ', referenceDate)
+ assert.deepEqual(result, new Date(1986, 9 /* Oct */, 1))
+ })
+
+ it('narrow', function () {
+ var result = parse('1', 'QQQQQ', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when Q is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} Q`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`Q\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('quarter (stand-alone)', function () {
+ it('numeric', function () {
+ var result = parse('1', 'q', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('1th', 'qo', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('02', 'qq', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 1))
+ })
+
+ it('abbreviated', function () {
+ var result = parse('Q3', 'qqq', referenceDate)
+ assert.deepEqual(result, new Date(1986, 6 /* Jul */, 1))
+ })
+
+ it('wide', function () {
+ var result = parse('4th quarter', 'qqqq', referenceDate)
+ assert.deepEqual(result, new Date(1986, 9 /* Oct */, 1))
+ })
+
+ it('narrow', function () {
+ var result = parse('1', 'qqqqq', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when q is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} q`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`q\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('month (formatting)', function () {
+ it('numeric', function () {
+ var result = parse('6', 'M', referenceDate)
+ assert.deepEqual(result, new Date(1986, 5 /* Jun */, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('6th', 'Mo', referenceDate)
+ assert.deepEqual(result, new Date(1986, 5 /* Jun */, 1))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('01', 'MM', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('abbreviated', function () {
+ var result = parse('Nov', 'MMM', referenceDate)
+ assert.deepEqual(result, new Date(1986, 10 /* Nov */, 1))
+ })
+
+ it('wide', function () {
+ var result = parse('February', 'MMMM', referenceDate)
+ assert.deepEqual(result, new Date(1986, 1 /* Feb */, 1))
+ })
+
+ it('narrow', function () {
+ var result = parse('J', 'MMMMM', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when M is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} M`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`M\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('month (stand-alone)', function () {
+ it('numeric', function () {
+ var result = parse('6', 'L', referenceDate)
+ assert.deepEqual(result, new Date(1986, 5 /* Jun */, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('6th', 'Lo', referenceDate)
+ assert.deepEqual(result, new Date(1986, 5 /* Jun */, 1))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('01', 'LL', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('abbreviated', function () {
+ var result = parse('Nov', 'LLL', referenceDate)
+ assert.deepEqual(result, new Date(1986, 10 /* Nov */, 1))
+ })
+
+ it('wide', function () {
+ var result = parse('February', 'LLLL', referenceDate)
+ assert.deepEqual(result, new Date(1986, 1 /* Feb */, 1))
+ })
+
+ it('narrow', function () {
+ var result = parse('J', 'LLLLL', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when L is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} L`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`L\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('local week of year', function () {
+ it('numeric', function () {
+ var result = parse('49', 'w', referenceDate)
+ assert.deepEqual(result, new Date(1986, 10 /* Nov */, 30))
+ })
+
+ it('ordinal', function () {
+ var result = parse('49th', 'wo', referenceDate)
+ assert.deepEqual(result, new Date(1986, 10 /* Nov */, 30))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('01', 'ww', referenceDate)
+ assert.deepEqual(result, new Date(1985, 11 /* Dec */, 29))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in options', function () {
+ var result = parse('49', 'w', referenceDate, {
+ weekStartsOn: 1 /* Mon */,
+ firstWeekContainsDate: 4,
+ })
+ assert.deepEqual(result, new Date(1986, 11 /* Dec */, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['y', '2019'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['i', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when w is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} w`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`w\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('ISO week of year', function () {
+ it('numeric', function () {
+ var result = parse('49', 'I', referenceDate)
+ assert.deepEqual(result, new Date(1986, 11 /* Dec */, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('49th', 'Io', referenceDate)
+ assert.deepEqual(result, new Date(1986, 11 /* Dec */, 1))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('01', 'II', referenceDate)
+ assert.deepEqual(result, new Date(1985, 11 /* Dec */, 30))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['y', '2019'],
+ ['Y', '2019'],
+ ['u', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when I is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} I`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`I\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('day of month', function () {
+ it('numeric', function () {
+ var result = parse('28', 'd', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 28))
+ })
+
+ it('ordinal', function () {
+ var result = parse('28th', 'do', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 28))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('01', 'dd', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when d is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} d`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`d\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('day of year', function () {
+ it('numeric', function () {
+ var result = parse('200', 'D', referenceDate, {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(1986, 6 /* Jul */, 19))
+ })
+
+ it('ordinal', function () {
+ var result = parse('200th', 'Do', referenceDate)
+ assert.deepEqual(result, new Date(1986, 6 /* Jul */, 19))
+ })
+
+ it('two-digit zero-padding', function () {
+ var result = parse('01', 'DD', referenceDate, {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('three-digit zero-padding', function () {
+ var result = parse('001', 'DDD', referenceDate)
+ assert.deepEqual(result, new Date(1986, 0 /* Jan */, 1))
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse('000200', 'DDDDDD', referenceDate)
+ assert.deepEqual(result, new Date(1986, 6 /* Jul */, 19))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['Y', '2019'],
+ ['R', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1'],
+ ['E', 'Mon'],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, _options]) => {
+ it(`throws an error when D is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} D`,
+ referenceDate,
+ { useAdditionalDayOfYearTokens: true }
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`D\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('day of week (formatting)', function () {
+ it('abbreviated', function () {
+ var result = parse('Mon', 'E', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 31))
+ })
+
+ it('wide', function () {
+ var result = parse('Tuesday', 'EEEE', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 1))
+ })
+
+ it('narrow', function () {
+ var result = parse('W', 'EEEEE', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 2))
+ })
+
+ it('short', function () {
+ var result = parse('Th', 'EEEEEE', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 3))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = parse('Thursday', 'EEEE', referenceDate, {
+ weekStartsOn: /* Fri */ 5,
+ })
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 10))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['E', 'Mon'],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when E is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} Mon`,
+ `${token} E`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`E\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('ISO day of week (formatting)', function () {
+ it('numeric', function () {
+ var result = parse('1', 'i', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 31))
+ })
+
+ it('ordinal', function () {
+ var result = parse('1st', 'io', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 31))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('02', 'ii', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 1))
+ })
+
+ it('abbreviated', function () {
+ var result = parse('Wed', 'iii', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 2))
+ })
+
+ it('wide', function () {
+ var result = parse('Thursday', 'iiii', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 3))
+ })
+
+ it('narrow', function () {
+ var result = parse('S', 'iiiii', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 6))
+ })
+
+ it('short', function () {
+ var result = parse('Fr', 'iiiiii', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['y', '2019'],
+ ['Y', '2019'],
+ ['u', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['w', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['E', 'Mon'],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when i is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} i`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`i\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('local day of week (formatting)', function () {
+ it('numeric', function () {
+ var result = parse('2', 'e', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 31))
+ })
+
+ it('ordinal', function () {
+ var result = parse('2nd', 'eo', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 31))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('03', 'ee', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 1))
+ })
+
+ it('abbreviated', function () {
+ var result = parse('Wed', 'eee', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 2))
+ })
+
+ it('wide', function () {
+ var result = parse('Thursday', 'eeee', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 3))
+ })
+
+ it('narrow', function () {
+ var result = parse('S', 'eeeee', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 30))
+ })
+
+ it('short', function () {
+ var result = parse('Fr', 'eeeeee', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = parse('7th', 'eo', referenceDate, {
+ weekStartsOn: /* Fri */ 5,
+ })
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 10))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['y', '2019'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['E', 'Mon'],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when e is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} e`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`e\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('local day of week (stand-alone)', function () {
+ it('numeric', function () {
+ var result = parse('2', 'c', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 31))
+ })
+
+ it('ordinal', function () {
+ var result = parse('2nd', 'co', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 31))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('03', 'cc', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 1))
+ })
+
+ it('abbreviated', function () {
+ var result = parse('Wed', 'ccc', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 2))
+ })
+
+ it('wide', function () {
+ var result = parse('Thursday', 'cccc', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 3))
+ })
+
+ it('narrow', function () {
+ var result = parse('S', 'ccccc', referenceDate)
+ assert.deepEqual(result, new Date(1986, 2 /* Mar */, 30))
+ })
+
+ it('short', function () {
+ var result = parse('Fr', 'cccccc', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = parse('7th', 'co', referenceDate, {
+ weekStartsOn: /* Fri */ 5,
+ })
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 10))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['y', '2019'],
+ ['R', '2019'],
+ ['u', '2019'],
+ ['Q', '1'],
+ ['q', '1'],
+ ['M', '1'],
+ ['L', '1'],
+ ['I', '1'],
+ ['d', '1'],
+ ['D', '1', { useAdditionalDayOfYearTokens: true }],
+ ['E', 'Mon'],
+ ['i', '1'],
+ ['e', '1'],
+ ['c', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example, options]) => {
+ it(`throws an error when c is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} c`,
+ referenceDate,
+ options
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`c\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('AM, PM', function () {
+ it('abbreviated', function () {
+ var result = parse('5 AM', 'h a', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 5))
+ })
+
+ it('12 AM', function () {
+ var result = parse('12 AM', 'h aa', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 0))
+ })
+
+ it('12 PM', function () {
+ var result = parse('12 PM', 'h aaa', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 12))
+ })
+
+ it('wide', function () {
+ var result = parse('5 p.m.', 'h aaaa', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 17))
+ })
+
+ it('narrow', function () {
+ var result = parse('11 a', 'h aaaaa', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 11))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['a', 'AM'],
+ ['b', 'AM'],
+ ['B', 'in the morning'],
+ ['H', '1'],
+ ['K', '1'],
+ ['k', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when a is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} AM`,
+ `${token} a`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`a\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('AM, PM, noon, midnight', function () {
+ it('abbreviated', function () {
+ var result = parse('noon', 'b', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 12))
+ })
+
+ it('wide', function () {
+ var result = parse('midnight', 'bbbb', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 0))
+ })
+
+ it('narrow', function () {
+ var result = parse('mi', 'bbbbb', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 0))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['a', 'AM'],
+ ['b', 'AM'],
+ ['B', 'in the morning'],
+ ['H', '1'],
+ ['K', '1'],
+ ['k', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when b is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} AM`,
+ `${token} b`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`b\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('flexible day period', function () {
+ it('abbreviated', function () {
+ var result = parse('2 at night', 'h B', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 2))
+ })
+
+ it('wide', function () {
+ var result = parse('12 in the afternoon', 'h BBBB', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 12))
+ })
+
+ it('narrow', function () {
+ var result = parse('5 in the evening', 'h BBBBB', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 17))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['a', 'AM'],
+ ['b', 'AM'],
+ ['B', 'in the morning'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when B is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} in the morning`,
+ `${token} B`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`B\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('hour [1-12]', function () {
+ it('numeric', function () {
+ var result = parse('1', 'h', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('1st', 'ho', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 1))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('01', 'hh', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['h', '1'],
+ ['H', '1'],
+ ['K', '1'],
+ ['k', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when h is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} h`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`h\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('hour [0-23]', function () {
+ it('numeric', function () {
+ var result = parse('12', 'H', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 12))
+ })
+
+ it('ordinal', function () {
+ var result = parse('12th', 'Ho', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 12))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('00', 'HH', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 0))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['a', 'AM'],
+ ['b', 'AM'],
+ ['h', '1'],
+ ['H', '1'],
+ ['K', '1'],
+ ['k', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when H is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} H`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`H\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('hour [0-11]', function () {
+ it('numeric', function () {
+ var result = parse('1', 'K', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 1))
+ })
+
+ it('ordinal', function () {
+ var result = parse('1st', 'Ko', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 1))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('1', 'KK', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 1))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['a', 'AM'],
+ ['b', 'AM'],
+ ['h', '1'],
+ ['H', '1'],
+ ['K', '1'],
+ ['k', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when K is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} K`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`K\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('hour [1-24]', function () {
+ it('numeric', function () {
+ var result = parse('12', 'k', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 12))
+ })
+
+ it('ordinal', function () {
+ var result = parse('12th', 'ko', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 12))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('24', 'kk', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 0))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['a', 'AM'],
+ ['b', 'AM'],
+ ['h', '1'],
+ ['H', '1'],
+ ['K', '1'],
+ ['k', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when k is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} k`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`k\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('minute', function () {
+ it('numeric', function () {
+ var result = parse('25', 'm', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 25))
+ })
+
+ it('ordinal', function () {
+ var result = parse('25th', 'mo', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 25))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('05', 'mm', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 5))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['m', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when m is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} m`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`m\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('second', function () {
+ it('numeric', function () {
+ var result = parse('25', 's', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 32, 25))
+ })
+
+ it('ordinal', function () {
+ var result = parse('25th', 'so', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 32, 25))
+ })
+
+ it('zero-padding', function () {
+ var result = parse('05', 'ss', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 32, 5))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['s', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when s is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} s`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`s\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('fraction of second', function () {
+ it('1/10 of second', function () {
+ var result = parse('1', 'S', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 100))
+ })
+
+ it('1/100 of second', function () {
+ var result = parse('12', 'SS', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 120))
+ })
+
+ it('millisecond', function () {
+ var result = parse('123', 'SSS', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 123))
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse('567890', 'SSSSSS', referenceDate)
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 10, 32, 0, 567))
+ })
+
+ describe('validation', () => {
+ ;[
+ ['S', '1'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when S is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} 1`,
+ `${token} S`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`S\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('timezone (ISO-8601 w/ Z)', function () {
+ describe('X', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-0530',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123Z',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+
+ it('hours', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+05',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123+05:00'))
+ })
+ })
+
+ describe('XX', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-0530',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123Z',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+ })
+
+ describe('XXX', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-05:30',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123Z',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+ })
+
+ describe('XXXX', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-0530',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123Z',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+
+ it('hours, minutes and seconds', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+053045',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:37:53.123+05:30'))
+ })
+ })
+
+ describe('XXXXX', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-05:30',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123Z',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+
+ it('hours, minutes and seconds', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+05:30:45',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:37:53.123+05:30'))
+ })
+ })
+
+ describe('validation', () => {
+ ;[
+ ['X', '-0530'],
+ ['x', '-0530'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when X is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} -0530`,
+ `${token} X`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`X\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('timezone (ISO-8601 w/o Z)', function () {
+ describe('x', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-0530',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+0000',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+
+ it('hours', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+05',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123+05:00'))
+ })
+ })
+
+ describe('xx', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-0530',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+0000',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+ })
+
+ describe('xxx', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-05:30',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+00:00',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+ })
+
+ describe('xxxx', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-0530',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+0000',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+
+ it('hours, minutes and seconds', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+053045',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:37:53.123+05:30'))
+ })
+ })
+
+ describe('xxxxx', function () {
+ it('hours and minutes', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123-05:30',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123-05:30'))
+ })
+
+ it('GMT', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+00:00',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:38:38.123Z'))
+ })
+
+ it('hours, minutes and seconds', function () {
+ var result = parse(
+ '2016-11-25T16:38:38.123+05:30:45',
+ "yyyy-MM-dd'T'HH:mm:ss.SSSxxxxx",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date('2016-11-25T16:37:53.123+05:30'))
+ })
+ })
+
+ describe('validation', () => {
+ ;[
+ ['X', '-0530'],
+ ['x', '-0530'],
+ ['t', '512969520'],
+ ['T', '512969520900'],
+ ].forEach(([token, example]) => {
+ it(`throws an error when x is used after ${token}`, () => {
+ const block = parse.bind(
+ null,
+ `${example} -0530`,
+ `${token} x`,
+ referenceDate
+ )
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`${token}\` and \`x\` at the same time`
+ )
+ )
+ })
+ })
+ })
+ })
+
+ describe('seconds timestamp', function () {
+ it('numeric', function () {
+ var result = parse('512969520', 't', referenceDate)
+ assert.deepEqual(result, new Date(512969520000))
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse(
+ '00000000000512969520',
+ 'tttttttttttttttttttt',
+ referenceDate
+ )
+ assert.deepEqual(result, new Date(512969520000))
+ })
+
+ it(`throws an error when it is used after any token`, () => {
+ const block = parse.bind(null, `1 512969520`, `h t`, referenceDate)
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`t\` and any other token at the same time`
+ )
+ )
+ })
+ })
+
+ describe('milliseconds timestamp', function () {
+ it('numeric', function () {
+ var result = parse('512969520900', 'T', referenceDate)
+ assert.deepEqual(result, new Date(512969520900))
+ })
+
+ it('specified amount of digits', function () {
+ var result = parse(
+ '00000000512969520900',
+ 'TTTTTTTTTTTTTTTTTTTT',
+ referenceDate
+ )
+ assert.deepEqual(result, new Date(512969520900))
+ })
+
+ it(`throws an error when it is used after any token`, () => {
+ const block = parse.bind(null, `1 512969520900`, `h T`, referenceDate)
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ new RegExp(
+ `The format string mustn't contain \`T\` and any other token at the same time`
+ )
+ )
+ })
+ })
+
+ describe('common formats', function () {
+ it('ISO-8601', function () {
+ var result = parse('20161105T040404', "yyyyMMdd'T'HHmmss", referenceDate)
+ assert.deepEqual(result, new Date(2016, 10 /* Nov */, 5, 4, 4, 4, 0))
+ })
+
+ it('ISO week-numbering date', function () {
+ var result = parse(
+ '2016W474T153005',
+ "RRRR'W'IIi'T'HHmmss",
+ referenceDate
+ )
+ assert.deepEqual(result, new Date(2016, 10 /* Nov */, 24, 15, 30, 5, 0))
+ })
+
+ it('ISO day of year date', function () {
+ var result = parse('2010123T235959', "yyyyDDD'T'HHmmss", referenceDate)
+ assert.deepEqual(result, new Date(2010, 4 /* May */, 3, 23, 59, 59, 0))
+ })
+
+ it('Date.prototype.toString()', function () {
+ var dateString = 'Wed Jul 02 2014 05:30:15 GMT+0600'
+ var formatString = "EEE MMM dd yyyy HH:mm:ss 'GMT'xx"
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, new Date(dateString))
+ })
+
+ it('Date.prototype.toISOString()', function () {
+ var dateString = '2014-07-02T05:30:15.123+06:00'
+ var formatString = "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, new Date(dateString))
+ })
+
+ it('middle-endian', function () {
+ var result = parse(
+ '5 a.m. 07/02/2016',
+ 'h aaaa MM/dd/yyyy',
+ referenceDate
+ )
+ assert.deepEqual(result, new Date(2016, 6 /* Jul */, 2, 5, 0, 0, 0))
+ })
+
+ it('little-endian', function () {
+ var result = parse('02.07.1995', 'dd.MM.yyyy', referenceDate)
+ assert.deepEqual(result, new Date(1995, 6 /* Jul */, 2, 0, 0, 0, 0))
+ })
+ })
+
+ describe('priority', function () {
+ it("units of lower priority don't overwrite values of higher priority", function () {
+ var dateString = '+06:00 123 15 30 05 02 07 2014'
+ var formatString = 'xxx SSS ss mm HH dd MM yyyy'
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, new Date('2014-07-02T05:30:15.123+06:00'))
+ })
+ })
+
+ describe('implicit conversion of arguments', function () {
+ it('`dateString`', function () {
+ // eslint-disable-next-line no-new-wrappers
+ var dateString = new String('20161105T040404')
+ // $ExpectedMistake
+ var result = parse(dateString, "yyyyMMdd'T'HHmmss", referenceDate)
+ assert.deepEqual(result, new Date(2016, 10 /* Nov */, 5, 4, 4, 4, 0))
+ })
+
+ it('`formatString`', function () {
+ // eslint-disable-next-line no-new-wrappers
+ var formatString = new String("yyyyMMdd'T'HHmmss")
+ // $ExpectedMistake
+ var result = parse('20161105T040404', formatString, referenceDate)
+ assert.deepEqual(result, new Date(2016, 10 /* Nov */, 5, 4, 4, 4, 0))
+ })
+
+ it('`options.weekStartsOn`', function () {
+ // $ExpectedMistake
+ var result = parse('2018', 'Y', referenceDate, {
+ weekStartsOn: '1' /* Mon */,
+ firstWeekContainsDate: 4,
+ })
+ assert.deepEqual(result, new Date(2018, 0 /* Jan */, 1))
+ })
+
+ it('`options.firstWeekContainsDate`', function () {
+ // $ExpectedMistake
+ var result = parse('2018', 'Y', referenceDate, {
+ weekStartsOn: 1 /* Mon */,
+ firstWeekContainsDate: '4',
+ })
+ assert.deepEqual(result, new Date(2018, 0 /* Jan */, 1))
+ })
+ })
+
+ describe('with `options.strictValidation` = true', function () {
+ describe('calendar year', function () {
+ it('returns `Invalid Date` for year zero', function () {
+ var result = parse('0', 'y', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('works correctly for two-digit year zero', function () {
+ var result = parse('00', 'yy', referenceDate)
+ assert.deepEqual(result, new Date(2000, 0 /* Jan */, 1))
+ })
+ })
+
+ describe('local week-numbering year', function () {
+ it('returns `Invalid Date` for year zero', function () {
+ var result = parse('0', 'Y', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('works correctly for two-digit year zero', function () {
+ var result = parse('00', 'YY', referenceDate, {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(1999, 11 /* Dec */, 26))
+ })
+ })
+
+ describe('quarter (formatting)', function () {
+ it('returns `Invalid Date` for invalid quarter', function () {
+ var result = parse('0', 'Q', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('quarter (stand-alone)', function () {
+ it('returns `Invalid Date` for invalid quarter', function () {
+ var result = parse('5', 'q', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('month (formatting)', function () {
+ it('returns `Invalid Date` for invalid month', function () {
+ var result = parse('00', 'MM', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('month (stand-alone)', function () {
+ it('returns `Invalid Date` for invalid month', function () {
+ var result = parse('13', 'LL', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('local week of year', function () {
+ it('returns `Invalid Date` for invalid week', function () {
+ var result = parse('0', 'w', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('ISO week of year', function () {
+ it('returns `Invalid Date` for invalid week', function () {
+ var result = parse('54', 'II', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('day of month', function () {
+ it('returns `Invalid Date` for invalid day of the month', function () {
+ var result = parse('30', 'd', new Date(2012, 1 /* Feb */, 1))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` for 29th of February of non-leap year', function () {
+ var result = parse('29', 'd', new Date(2014, 1 /* Feb */, 1))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('parses 29th of February of leap year', function () {
+ var result = parse('29', 'd', new Date(2012, 1 /* Feb */, 1))
+ assert.deepEqual(result, new Date(2012, 1 /* Feb */, 29))
+ })
+ })
+
+ describe('day of year', function () {
+ it('returns `Invalid Date` for invalid day of the year', function () {
+ var result = parse('0', 'D', referenceDate, {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` for 366th day of non-leap year', function () {
+ var result = parse('366', 'D', new Date(2014, 1 /* Feb */, 1), {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('parses 366th day of leap year', function () {
+ var result = parse('366', 'D', new Date(2012, 1 /* Feb */, 1), {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(2012, 11 /* Dec */, 31))
+ })
+ })
+
+ describe('ISO day of week (formatting)', function () {
+ it('returns `Invalid Date` for day zero', function () {
+ var result = parse('0', 'i', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` for eight day of week', function () {
+ var result = parse('8', 'i', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('local day of week (formatting)', function () {
+ it('returns `Invalid Date` for day zero', function () {
+ var result = parse('0', 'e', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` for eight day of week', function () {
+ var result = parse('8', 'e', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('local day of week (stand-alone)', function () {
+ it('returns `Invalid Date` for day zero', function () {
+ var result = parse('0', 'c', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` for eight day of week', function () {
+ var result = parse('8', 'c', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('hour [1-12]', function () {
+ it('returns `Invalid Date` for hour zero', function () {
+ var result = parse('00', 'hh', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` for invalid hour', function () {
+ var result = parse('13', 'hh', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('hour [0-23]', function () {
+ it('returns `Invalid Date` for invalid hour', function () {
+ var result = parse('24', 'HH', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('hour [0-11]', function () {
+ it('returns `Invalid Date` for invalid hour', function () {
+ var result = parse('12', 'KK', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('hour [1-24]', function () {
+ it('returns `Invalid Date` for hour zero', function () {
+ var result = parse('00', 'kk', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` for invalid hour', function () {
+ var result = parse('25', 'kk', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('minute', function () {
+ it('returns `Invalid Date` for invalid minute', function () {
+ var result = parse('60', 'mm', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+
+ describe('second', function () {
+ it('returns `Invalid Date` for invalid second', function () {
+ var result = parse('60', 'ss', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+ })
+ })
+
+ describe('custom locale', function () {
+ it('allows to pass a custom locale', function () {
+ var customLocale = {
+ match: {
+ era: function () {
+ return {
+ value: 0,
+ rest: ' it works!',
+ }
+ },
+ },
+ }
+ // $ExpectedMistake
+ var result = parse('2018 foobar', "y G 'it works!'", referenceDate, {
+ locale: customLocale,
+ })
+ assert.deepEqual(result, new Date(-2017, 0 /* Jan */, 1))
+ })
+
+ it('throws `RangeError` if `options.locale` does not contain `match` property', function () {
+ var block = parse.bind(
+ null,
+ '2016-11-25 04 AM',
+ 'yyyy-MM-dd hh a',
+ referenceDate,
+ // $ExpectedMistake
+ { locale: {} }
+ )
+ assert.throws(block, RangeError)
+ })
+ })
+
+ it('accepts a timestamp as `referenceDate`', function () {
+ var dateString = '6 p.m.'
+ var formatString = 'h aaaa'
+ var result = parse(dateString, formatString, referenceDate.getTime())
+ assert.deepEqual(result, new Date(1986, 3 /* Apr */, 4, 18))
+ })
+
+ it('does not mutate `referenceDate`', function () {
+ var referenceDateClone1 = new Date(referenceDate.getTime())
+ var referenceDateClone2 = new Date(referenceDate.getTime())
+ var dateString = '6 p.m.'
+ var formatString = 'h aaaa'
+ parse(dateString, formatString, referenceDateClone1)
+ assert.deepEqual(referenceDateClone1, referenceDateClone2)
+ })
+
+ describe('failure', function () {
+ it('returns `referenceDate` if `dateString` and `formatString` are empty strings', function () {
+ var dateString = ''
+ var formatString = ''
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, referenceDate)
+ })
+
+ it('returns `referenceDate` if no tokens in `formatString` are provided', function () {
+ var dateString = 'not a token'
+ var formatString = "'not a token'"
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, referenceDate)
+ })
+
+ it("returns `Invalid Date` if `formatString` doesn't match `dateString`", function () {
+ var dateString = '2017-01-01'
+ var formatString = 'yyyy/MM/dd'
+ var result = parse(dateString, formatString, referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if `formatString` tokens failed to parse a value', function () {
+ var dateString = '2017-01-01'
+ var formatString = 'MMMM do yyyy'
+ var result = parse(dateString, formatString, referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if `formatString` is empty string but `dateString` is not', function () {
+ var dateString = '2017-01-01'
+ var formatString = ''
+ var result = parse(dateString, formatString, referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if `referenceDate` is `Invalid Date`', function () {
+ var dateString = '2014-07-02T05:30:15.123+06:00'
+ var formatString = "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"
+ var result = parse(dateString, formatString, new Date(NaN))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ var dateString = '2014-07-02T05:30:15.123+06:00'
+ var formatString = "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"
+ // $ExpectedMistake
+ var block = parse.bind(null, dateString, formatString, referenceDate, {
+ weekStartsOn: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function () {
+ var dateString = '2014-07-02T05:30:15.123+06:00'
+ var formatString = "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"
+ // $ExpectedMistake
+ var block = parse.bind(null, dateString, formatString, referenceDate, {
+ firstWeekContainsDate: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+ })
+
+ it('throws TypeError exception if passed less than 3 arguments', function () {
+ assert.throws(parse.bind(null), TypeError)
+ // $ExpectedMistake
+ assert.throws(parse.bind(null, 1), TypeError)
+ // $ExpectedMistake
+ assert.throws(parse.bind(null, 1, 2), TypeError)
+ })
+
+ describe('edge cases', function () {
+ it('returns Invalid Date if the string contains some remaining input after parsing', function () {
+ var result = parse('2016-11-05T040404', 'yyyy-MM-dd', referenceDate)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('parses normally if the remaining input is just whitespace', function () {
+ var result = parse('2016-11-05 \n', 'yyyy-MM-dd', referenceDate)
+ assert.deepEqual(result, new Date(2016, 10 /* Nov */, 5))
+ })
+
+ it('throws RangeError exception if the format string contains an unescaped latin alphabet character', function () {
+ assert.throws(
+ parse.bind(null, '2016-11-05-nnnn', 'yyyy-MM-dd-nnnn', referenceDate),
+ RangeError
+ )
+ })
+ })
+
+ describe('useAdditionalWeekYearTokens and useAdditionalDayOfYearTokens options', () => {
+ it('throws an error if D token is used', () => {
+ const block = parse.bind(null, '2016 5', 'yyyy D', referenceDate)
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /Use `d` instead of `D` \(in `yyyy D`\) for formatting days of the month to the input `2016 5`; see: https:\/\/git.io\/fxCyr/
+ )
+ })
+
+ it('allows D token if useAdditionalDayOfYearTokens is set to true', () => {
+ const result = parse('2016 5', 'yyyy D', referenceDate, {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(2016, 0, 5))
+ })
+
+ it('throws an error if DD token is used', () => {
+ const block = parse.bind(null, '2016 05', 'yyyy DD', referenceDate)
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /Use `dd` instead of `DD` \(in `yyyy DD`\) for formatting days of the month to the input `2016 05`; see: https:\/\/git.io\/fxCyr/
+ )
+ })
+
+ it('allows DD token if useAdditionalDayOfYearTokens is set to true', () => {
+ const result = parse('2016 05', 'yyyy DD', referenceDate, {
+ useAdditionalDayOfYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(2016, 0, 5))
+ })
+
+ it('throws an error if YY token is used', () => {
+ const block = parse.bind(null, '16 1', 'YY w', referenceDate)
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /Use `yy` instead of `YY` \(in `YY w`\) for formatting years to the input `16 1`; see: https:\/\/git.io\/fxCyr/
+ )
+ })
+
+ it('allows YY token if useAdditionalWeekYearTokens is set to true', () => {
+ const result = parse('16 1', 'YY w', referenceDate, {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(2015, 11, 27))
+ })
+
+ it('throws an error if YYYY token is used', () => {
+ const block = parse.bind(null, '2016 1', 'YYYY w', referenceDate)
+ assert.throws(block, RangeError)
+ assert.throws(
+ block,
+ /Use `yyyy` instead of `YYYY` \(in `YYYY w`\) for formatting years to the input `2016 1`; see: https:\/\/git.io\/fxCyr/
+ )
+ })
+
+ it('allows YYYY token if useAdditionalWeekYearTokens is set to true', () => {
+ const result = parse('2016 1', 'YYYY w', referenceDate, {
+ useAdditionalWeekYearTokens: true,
+ })
+ assert.deepEqual(result, new Date(2015, 11, 27))
+ })
+ })
+
+ describe('long format', function () {
+ it('short date', function () {
+ var expected = new Date(1995, 4 /* May */, 26)
+ var dateString = '05/26/1995'
+ var formatString = 'P'
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('medium date', function () {
+ var expected = new Date(1995, 4 /* May */, 26)
+ var dateString = 'May 26, 1995'
+ var formatString = 'PP'
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('long date', function () {
+ var expected = new Date(1995, 4 /* May */, 26)
+ var dateString = 'May 26th, 1995'
+ var formatString = 'PPP'
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('full date', function () {
+ var expected = new Date(1995, 4 /* May */, 26)
+ var dateString = 'Friday, May 26th, 1995'
+ var formatString = 'PPPP'
+ var result = parse(dateString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('short time', function () {
+ var expected = new Date(
+ referenceDate.getFullYear(),
+ referenceDate.getMonth(),
+ referenceDate.getDate(),
+ 10,
+ 32
+ )
+ var timeString = '10:32 AM'
+ var formatString = 'p'
+ var result = parse(timeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('medium time', function () {
+ var expected = new Date(
+ referenceDate.getFullYear(),
+ referenceDate.getMonth(),
+ referenceDate.getDate(),
+ 10,
+ 32,
+ 55
+ )
+ var timeString = '10:32:55 AM'
+ var formatString = 'pp'
+ var result = parse(timeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('short date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32)
+ var dateTimeString = '05/26/1995, 10:32 AM'
+ var formatString = 'Pp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('medium date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32)
+ var dateTimeString = 'May 26, 1995, 10:32 AM'
+ var formatString = 'PPp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('long date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32)
+ var dateTimeString = 'May 26th, 1995 at 10:32 AM'
+ var formatString = 'PPPp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('full date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32)
+ var dateTimeString = 'Friday, May 26th, 1995 at 10:32 AM'
+ var formatString = 'PPPPp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('short date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32, 55)
+ var dateTimeString = '05/26/1995, 10:32:55 AM'
+ var formatString = 'Ppp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('medium date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32, 55)
+ var dateTimeString = 'May 26, 1995, 10:32:55 AM'
+ var formatString = 'PPpp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('long date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32, 55)
+ var dateTimeString = 'May 26th, 1995 at 10:32:55 AM'
+ var formatString = 'PPPpp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+
+ it('full date + short time', function () {
+ var expected = new Date(1995, 4 /* May */, 26, 10, 32, 55)
+ var dateTimeString = 'Friday, May 26th, 1995 at 10:32:55 AM'
+ var formatString = 'PPPPpp'
+ var result = parse(dateTimeString, formatString, referenceDate)
+ assert.deepEqual(result, expected)
+ })
+ })
+})
diff --git a/date-fns/src/parseISO/benchmark.js b/date-fns/src/parseISO/benchmark.js
new file mode 100644
index 0000000..19405ed
--- /dev/null
+++ b/date-fns/src/parseISO/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import parseISO from '.'
+import moment from 'moment'
+
+suite('toDate', function() {
+ benchmark('date-fns', function() {
+ return parseISO('2014-10-25T13:46:20+07:00')
+ })
+
+ benchmark('Moment.js', function() {
+ return moment('2014-10-25T13:46:20+07:00')
+ })
+})
diff --git a/date-fns/src/parseISO/index.d.ts b/date-fns/src/parseISO/index.d.ts
new file mode 100644
index 0000000..ee06fe6
--- /dev/null
+++ b/date-fns/src/parseISO/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parseISO } from 'date-fns'
+export default parseISO
diff --git a/date-fns/src/parseISO/index.js b/date-fns/src/parseISO/index.js
new file mode 100644
index 0000000..4d4a0af
--- /dev/null
+++ b/date-fns/src/parseISO/index.js
@@ -0,0 +1,343 @@
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+var MILLISECONDS_IN_HOUR = 3600000
+var MILLISECONDS_IN_MINUTE = 60000
+var DEFAULT_ADDITIONAL_DIGITS = 2
+
+var patterns = {
+ dateTimeDelimiter: /[T ]/,
+ timeZoneDelimiter: /[Z ]/i,
+ timezone: /([Z+-].*)$/,
+}
+
+var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/
+var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/
+var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/
+
+/**
+ * @name parseISO
+ * @category Common Helpers
+ * @summary Parse ISO string
+ *
+ * @description
+ * Parse the given string in ISO 8601 format and return an instance of Date.
+ *
+ * Function accepts complete ISO 8601 formats as well as partial implementations.
+ * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
+ *
+ * If the argument isn't a string, the function cannot parse the string or
+ * the values are invalid, it returns Invalid Date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The previous `parse` implementation was renamed to `parseISO`.
+ *
+ * ```javascript
+ * // Before v2.0.0
+ * parse('2016-01-01')
+ *
+ * // v2.0.0 onward
+ * parseISO('2016-01-01')
+ * ```
+ *
+ * - `parseISO` now validates separate date and time values in ISO-8601 strings
+ * and returns `Invalid Date` if the date is invalid.
+ *
+ * ```javascript
+ * parseISO('2018-13-32')
+ * //=> Invalid Date
+ * ```
+ *
+ * - `parseISO` now doesn't fall back to `new Date` constructor
+ * if it fails to parse a string argument. Instead, it returns `Invalid Date`.
+ *
+ * @param {String} argument - the value to convert
+ * @param {Object} [options] - an object with options.
+ * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
+ * @returns {Date} the parsed date in the local time zone
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
+ *
+ * @example
+ * // Convert string '2014-02-11T11:30:30' to date:
+ * var result = parseISO('2014-02-11T11:30:30')
+ * //=> Tue Feb 11 2014 11:30:30
+ *
+ * @example
+ * // Convert string '+02014101' to date,
+ * // if the additional number of digits in the extended year format is 1:
+ * var result = parseISO('+02014101', { additionalDigits: 1 })
+ * //=> Fri Apr 11 2014 00:00:00
+ */
+export default function parseISO(argument, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ var options = dirtyOptions || {}
+
+ var additionalDigits =
+ options.additionalDigits == null
+ ? DEFAULT_ADDITIONAL_DIGITS
+ : toInteger(options.additionalDigits)
+ if (
+ additionalDigits !== 2 &&
+ additionalDigits !== 1 &&
+ additionalDigits !== 0
+ ) {
+ throw new RangeError('additionalDigits must be 0, 1 or 2')
+ }
+
+ if (
+ !(
+ typeof argument === 'string' ||
+ Object.prototype.toString.call(argument) === '[object String]'
+ )
+ ) {
+ return new Date(NaN)
+ }
+
+ var dateStrings = splitDateString(argument)
+
+ var date
+ if (dateStrings.date) {
+ var parseYearResult = parseYear(dateStrings.date, additionalDigits)
+ date = parseDate(parseYearResult.restDateString, parseYearResult.year)
+ }
+
+ if (isNaN(date) || !date) {
+ return new Date(NaN)
+ }
+
+ var timestamp = date.getTime()
+ var time = 0
+ var offset
+
+ if (dateStrings.time) {
+ time = parseTime(dateStrings.time)
+ if (isNaN(time) || time === null) {
+ return new Date(NaN)
+ }
+ }
+
+ if (dateStrings.timezone) {
+ offset = parseTimezone(dateStrings.timezone)
+ if (isNaN(offset)) {
+ return new Date(NaN)
+ }
+ } else {
+ var dirtyDate = new Date(timestamp + time)
+ // js parsed string assuming it's in UTC timezone
+ // but we need it to be parsed in our timezone
+ // so we use utc values to build date in our timezone.
+ // Year values from 0 to 99 map to the years 1900 to 1999
+ // so set year explicitly with setFullYear.
+ var result = new Date(0)
+ result.setFullYear(
+ dirtyDate.getUTCFullYear(),
+ dirtyDate.getUTCMonth(),
+ dirtyDate.getUTCDate()
+ )
+ result.setHours(
+ dirtyDate.getUTCHours(),
+ dirtyDate.getUTCMinutes(),
+ dirtyDate.getUTCSeconds(),
+ dirtyDate.getUTCMilliseconds()
+ )
+ return result
+ }
+
+ return new Date(timestamp + time + offset)
+}
+
+function splitDateString(dateString) {
+ var dateStrings = {}
+ var array = dateString.split(patterns.dateTimeDelimiter)
+ var timeString
+
+ // The regex match should only return at maximum two array elements.
+ // [date], [time], or [date, time].
+ if (array.length > 2) {
+ return dateStrings
+ }
+
+ if (/:/.test(array[0])) {
+ dateStrings.date = null
+ timeString = array[0]
+ } else {
+ dateStrings.date = array[0]
+ timeString = array[1]
+ if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
+ dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0]
+ timeString = dateString.substr(dateStrings.date.length, dateString.length)
+ }
+ }
+
+ if (timeString) {
+ var token = patterns.timezone.exec(timeString)
+ if (token) {
+ dateStrings.time = timeString.replace(token[1], '')
+ dateStrings.timezone = token[1]
+ } else {
+ dateStrings.time = timeString
+ }
+ }
+
+ return dateStrings
+}
+
+function parseYear(dateString, additionalDigits) {
+ var regex = new RegExp(
+ '^(?:(\\d{4}|[+-]\\d{' +
+ (4 + additionalDigits) +
+ '})|(\\d{2}|[+-]\\d{' +
+ (2 + additionalDigits) +
+ '})$)'
+ )
+
+ var captures = dateString.match(regex)
+ // Invalid ISO-formatted year
+ if (!captures) return { year: null }
+
+ var year = captures[1] && parseInt(captures[1])
+ var century = captures[2] && parseInt(captures[2])
+
+ return {
+ year: century == null ? year : century * 100,
+ restDateString: dateString.slice((captures[1] || captures[2]).length),
+ }
+}
+
+function parseDate(dateString, year) {
+ // Invalid ISO-formatted year
+ if (year === null) return null
+
+ var captures = dateString.match(dateRegex)
+ // Invalid ISO-formatted string
+ if (!captures) return null
+
+ var isWeekDate = !!captures[4]
+ var dayOfYear = parseDateUnit(captures[1])
+ var month = parseDateUnit(captures[2]) - 1
+ var day = parseDateUnit(captures[3])
+ var week = parseDateUnit(captures[4])
+ var dayOfWeek = parseDateUnit(captures[5]) - 1
+
+ if (isWeekDate) {
+ if (!validateWeekDate(year, week, dayOfWeek)) {
+ return new Date(NaN)
+ }
+ return dayOfISOWeekYear(year, week, dayOfWeek)
+ } else {
+ var date = new Date(0)
+ if (
+ !validateDate(year, month, day) ||
+ !validateDayOfYearDate(year, dayOfYear)
+ ) {
+ return new Date(NaN)
+ }
+ date.setUTCFullYear(year, month, Math.max(dayOfYear, day))
+ return date
+ }
+}
+
+function parseDateUnit(value) {
+ return value ? parseInt(value) : 1
+}
+
+function parseTime(timeString) {
+ var captures = timeString.match(timeRegex)
+ if (!captures) return null // Invalid ISO-formatted time
+
+ var hours = parseTimeUnit(captures[1])
+ var minutes = parseTimeUnit(captures[2])
+ var seconds = parseTimeUnit(captures[3])
+
+ if (!validateTime(hours, minutes, seconds)) {
+ return NaN
+ }
+
+ return (
+ hours * MILLISECONDS_IN_HOUR +
+ minutes * MILLISECONDS_IN_MINUTE +
+ seconds * 1000
+ )
+}
+
+function parseTimeUnit(value) {
+ return (value && parseFloat(value.replace(',', '.'))) || 0
+}
+
+function parseTimezone(timezoneString) {
+ if (timezoneString === 'Z') return 0
+
+ var captures = timezoneString.match(timezoneRegex)
+ if (!captures) return 0
+
+ var sign = captures[1] === '+' ? -1 : 1
+ var hours = parseInt(captures[2])
+ var minutes = (captures[3] && parseInt(captures[3])) || 0
+
+ if (!validateTimezone(hours, minutes)) {
+ return NaN
+ }
+
+ return (
+ sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE)
+ )
+}
+
+function dayOfISOWeekYear(isoWeekYear, week, day) {
+ var date = new Date(0)
+ date.setUTCFullYear(isoWeekYear, 0, 4)
+ var fourthOfJanuaryDay = date.getUTCDay() || 7
+ var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay
+ date.setUTCDate(date.getUTCDate() + diff)
+ return date
+}
+
+// Validation functions
+
+// February is null to handle the leap year (using ||)
+var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+
+function isLeapYearIndex(year) {
+ return year % 400 === 0 || (year % 4 === 0 && year % 100)
+}
+
+function validateDate(year, month, date) {
+ return (
+ month >= 0 &&
+ month <= 11 &&
+ date >= 1 &&
+ date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))
+ )
+}
+
+function validateDayOfYearDate(year, dayOfYear) {
+ return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365)
+}
+
+function validateWeekDate(_year, week, day) {
+ return week >= 1 && week <= 53 && day >= 0 && day <= 6
+}
+
+function validateTime(hours, minutes, seconds) {
+ if (hours === 24) {
+ return minutes === 0 && seconds === 0
+ }
+
+ return (
+ seconds >= 0 &&
+ seconds < 60 &&
+ minutes >= 0 &&
+ minutes < 60 &&
+ hours >= 0 &&
+ hours < 25
+ )
+}
+
+function validateTimezone(_hours, minutes) {
+ return minutes >= 0 && minutes <= 59
+}
diff --git a/date-fns/src/parseISO/index.js.flow b/date-fns/src/parseISO/index.js.flow
new file mode 100644
index 0000000..951a222
--- /dev/null
+++ b/date-fns/src/parseISO/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ argument: string,
+ options?: {
+ additionalDigits?: 0 | 1 | 2,
+ }
+) => Date
diff --git a/date-fns/src/parseISO/test.js b/date-fns/src/parseISO/test.js
new file mode 100644
index 0000000..36a8a90
--- /dev/null
+++ b/date-fns/src/parseISO/test.js
@@ -0,0 +1,452 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import parseISO from '.'
+
+describe('parseISO', () => {
+ describe('string argument', () => {
+ describe('centuries', () => {
+ it('parses YY', () => {
+ const result = parseISO('20')
+ assert.deepEqual(result, new Date(2000, 0 /* Jan */, 1))
+ })
+ })
+
+ describe('years', () => {
+ it('parses YYYY', () => {
+ const result = parseISO('2014')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 1))
+ })
+ })
+
+ describe('months', () => {
+ it('parses YYYY-MM', () => {
+ const result = parseISO('2014-02')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 1))
+ })
+ })
+
+ describe('weeks', () => {
+ it('parses YYYY-Www', () => {
+ const result = parseISO('2014-W02')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 6))
+ })
+
+ it('parses YYYYWww', () => {
+ const result = parseISO('2014W02')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 6))
+ })
+ })
+
+ describe('calendar dates', () => {
+ it('parses YYYY-MM-DD', () => {
+ const result = parseISO('2014-02-11')
+ assert.deepEqual(result, new Date(2014, 1, /* Feb */ 11))
+ })
+
+ it('parses YYYYMMDD', () => {
+ const result = parseISO('20140211')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 11))
+ })
+ })
+
+ describe('week dates', () => {
+ it('parses YYYY-Www-D', () => {
+ const result = parseISO('2014-W02-7')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 12))
+ })
+
+ it('parses YYYYWwwD', () => {
+ const result = parseISO('2014W027')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 12))
+ })
+
+ it('correctly handles years in which 4 January is Sunday', () => {
+ const result = parseISO('2009-W01-1')
+ assert.deepEqual(result, new Date(2008, 11 /* Dec */, 29))
+ })
+ })
+
+ describe('ordinal dates', () => {
+ it('parses YYYY-DDD', () => {
+ const result = parseISO('2014-026')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 26))
+ })
+
+ it('parses YYYYDDD', () => {
+ const result = parseISO('2014026')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 26))
+ })
+ })
+
+ describe('date and time combined', () => {
+ it('parses YYYY-MM-DDThh:mm', () => {
+ const result = parseISO('2014-02-11T11:30')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 11, 11, 30))
+ })
+
+ it('parses YYYY-MM-DDThhmm', () => {
+ const result = parseISO('2014-02-11T1130')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 11, 11, 30))
+ })
+ })
+
+ describe('extended century representation', () => {
+ it('parses century 101 BC - 2 BC', () => {
+ const result = parseISO('-0001')
+ const date = new Date(0)
+ date.setFullYear(-100, 0 /* Jan */, 1)
+ date.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, date)
+ })
+
+ it('parses century 1 BC - 99 AD', () => {
+ const result = parseISO('00')
+ const date = new Date(0)
+ date.setFullYear(0, 0 /* Jan */, 1)
+ date.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, date)
+ })
+
+ it('parses centuries after 9999 AD', () => {
+ const result = parseISO('+0123')
+ assert.deepEqual(result, new Date(12300, 0 /* Jan */, 1))
+ })
+
+ it('allows to specify the number of additional digits', () => {
+ const result = parseISO('-20', { additionalDigits: 0 })
+ const date = new Date(0)
+ date.setFullYear(-2000, 0 /* Jan */, 1)
+ date.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, date)
+ })
+ })
+
+ describe('extended year representation', () => {
+ it('correctly parses years from 1 AD to 99 AD', () => {
+ const result = parseISO('0095-07-02')
+ const date = new Date(0)
+ date.setFullYear(95, 6 /* Jul */, 2)
+ date.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, date)
+ })
+
+ it('parses years after 9999 AD', () => {
+ const result = parseISO('+012345-07-02')
+ assert.deepEqual(result, new Date(12345, 6 /* Jul */, 2))
+ })
+
+ it('allows to specify the number of additional digits', () => {
+ const result = parseISO('+12340702', { additionalDigits: 0 })
+ assert.deepEqual(result, new Date(1234, 6 /* Jul */, 2))
+ })
+
+ it('parses year 1 BC', () => {
+ const result = parseISO('0000-07-02')
+ const date = new Date(0)
+ date.setFullYear(0, 6 /* Jul */, 2)
+ date.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, date)
+ })
+
+ it('parses years less than 1 BC', () => {
+ const result = parseISO('-000001-07-02')
+ const date = new Date(0)
+ date.setFullYear(-1, 6 /* Jul */, 2)
+ date.setHours(0, 0, 0, 0)
+ assert.deepEqual(result, date)
+ })
+ })
+
+ describe('float time', () => {
+ it('parses float hours', () => {
+ const result = parseISO('2014-02-11T11.5')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 11, 11, 30))
+ })
+
+ it('parses float minutes', () => {
+ const result = parseISO('2014-02-11T11:30.5')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 11, 11, 30, 30))
+ })
+
+ it('parses float seconds', () => {
+ const result = parseISO('2014-02-11T11:30:30.768')
+ assert.deepEqual(
+ result,
+ new Date(2014, 1 /* Feb */, 11, 11, 30, 30, 768)
+ )
+ })
+
+ it('parses , as decimal mark', () => {
+ const result = parseISO('2014-02-11T11,5')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 11, 11, 30))
+ })
+ })
+
+ describe('timezones', () => {
+ describe('when the date and the time are specified', () => {
+ it('parses Z', () => {
+ const result = parseISO('2014-10-25T06:46:20Z')
+ assert.deepEqual(result, new Date('2014-10-25T13:46:20+07:00'))
+ })
+
+ it('parses ±hh:mm', () => {
+ const result = parseISO('2014-10-25T13:46:20+07:00')
+ assert.deepEqual(result, new Date('2014-10-25T13:46:20+07:00'))
+ })
+
+ it('parses ±hhmm', () => {
+ const result = parseISO('2014-10-25T03:46:20-0300')
+ assert.deepEqual(result, new Date('2014-10-25T13:46:20+07:00'))
+ })
+
+ it('parses ±hh', () => {
+ const result = parseISO('2014-10-25T13:46:20+07')
+ assert.deepEqual(result, new Date('2014-10-25T13:46:20+07:00'))
+ })
+ })
+ describe('when the year and the month are specified', () => {
+ it('sets timezone correctly on yyyy-MMZ format', () => {
+ const result = parseISO('2012-01Z')
+ assert.deepEqual(result, new Date('2012-01-01T00:00:00+00:00'))
+ })
+ })
+ })
+
+ describe('failure', () => {
+ it('returns `Invalid Date` if the string is not an ISO formatted date', () => {
+ const result = parseISO(new Date(2014, 8 /* Sep */, 1, 11).toString())
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+ })
+
+ describe('validation', () => {
+ describe('months', () => {
+ it('returns `Invalid Date` for invalid month', () => {
+ const result = parseISO('2014-00')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+
+ describe('weeks', () => {
+ it('returns `Invalid Date` for invalid week', () => {
+ const result = parseISO('2014-W00')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` for 54th week', () => {
+ const result = parseISO('2014-W54')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+
+ describe('calendar dates', () => {
+ it('returns `Invalid Date` for invalid day of the month', () => {
+ const result = parseISO('2012-02-30')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` for 29th of February of non-leap year', () => {
+ const result = parseISO('2014-02-29')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('parses 29th of February of leap year', () => {
+ const result = parseISO('2012-02-29')
+ assert.deepEqual(result, new Date(2012, 1, /* Feb */ 29))
+ })
+ })
+
+ describe('week dates', () => {
+ it('returns `Invalid Date` for invalid day of the week', () => {
+ const result = parseISO('2014-W02-0')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+
+ describe('ordinal dates', () => {
+ it('returns `Invalid Date` for invalid day of the year', () => {
+ const result = parseISO('2012-000')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` for 366th day of non-leap year', () => {
+ const result = parseISO('2014-366')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('parses 366th day of leap year', () => {
+ const result = parseISO('2012-366')
+ assert.deepEqual(result, new Date(2012, 11, /* Dec */ 31))
+ })
+ })
+
+ describe('date', () => {
+ it('returns `Invalid Date` when it contains spaces after the date', () => {
+ const result = parseISO('2014-02-11 basketball')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+
+ describe('time', () => {
+ it('parses 24:00 as midnight of the next day', () => {
+ const result = parseISO('2014-02-11T24:00')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 12, 0, 0))
+ })
+
+ it('returns `Invalid Date` for anything after 24:00', () => {
+ const result = parseISO('2014-02-11T24:01')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` for invalid hours', () => {
+ const result = parseISO('2014-02-11T25')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` for invalid minutes', () => {
+ const result = parseISO('2014-02-11T21:60')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` for invalid seconds', () => {
+ const result = parseISO('2014-02-11T21:59:60')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` for invalid time', () => {
+ const result = parseISO('2014-02-11T21:basketball')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns `Invalid Date` when it contains spaces after the time', () => {
+ const result = parseISO('2014-02-11T21:59:00 basketball')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+
+ describe('timezones', () => {
+ it('returns `Invalid Date` for invalid timezone minutes', () => {
+ const result = parseISO('2014-02-11T21:35:45+04:60')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+ })
+
+ describe('invalid argument', () => {
+ it('returns Invalid Date for date argument', () => {
+ // $ExpectedMistake
+ const date = new Date(2016, 0, 1)
+ const result = parseISO(date)
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date for timestamp argument', () => {
+ const timestamp = new Date(2016, 0, 1, 23, 30, 45, 123).getTime()
+ // $ExpectedMistake
+ const result = parseISO(timestamp)
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is non-date string', () => {
+ const result = parseISO('abc')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is non-date string containing a colon', () => {
+ const result = parseISO('00:00')
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is NaN', () => {
+ // $ExpectedMistake
+ const result = parseISO(NaN)
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is Invalid Date', () => {
+ // $ExpectedMistake
+ const result = parseISO(new Date(NaN))
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is null', () => {
+ // $ExpectedMistake
+ const result = parseISO(null)
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is undefined', () => {
+ // $ExpectedMistake
+ const result = parseISO(undefined)
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is false', () => {
+ // $ExpectedMistake
+ const result = parseISO(false)
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is true', () => {
+ // $ExpectedMistake
+ const result = parseISO(true)
+ assert(result instanceof Date)
+ assert(isNaN(result))
+ })
+ })
+
+ describe('argument conversion', () => {
+ it('implicitly converts instance of String into a string', () => {
+ // eslint-disable-next-line no-new-wrappers
+ const dateString = new String('2014-02-11')
+ // $ExpectedMistake
+ const result = parseISO(dateString)
+ assert.deepEqual(result, new Date(2014, 1, /* Feb */ 11))
+ })
+
+ it('implicitly converts options', () => {
+ // $ExpectedMistake
+ const result = parseISO('+12340702', { additionalDigits: '0' })
+ assert.deepEqual(result, new Date(1234, 6 /* Jul */, 2))
+ })
+
+ it('throws `RangeError` if `options.additionalDigits` is not convertable to 0, 1, 2 or undefined`', () => {
+ // $ExpectedMistake
+ const block = parseISO.bind(null, '+12340702', { additionalDigits: 3 })
+ assert.throws(block, RangeError)
+ })
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ assert.throws(parseISO.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/parseJSON/benchmark.js b/date-fns/src/parseJSON/benchmark.js
new file mode 100644
index 0000000..f6b1c0b
--- /dev/null
+++ b/date-fns/src/parseJSON/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import parseJSON from '.'
+import moment from 'moment'
+
+suite('toDate', function() {
+ benchmark('date-fns', function() {
+ return parseJSON('2014-10-25T13:46:20+00:00')
+ })
+
+ benchmark('Moment.js', function() {
+ return moment('2014-10-25T13:46:20+00:00')
+ })
+})
diff --git a/date-fns/src/parseJSON/index.d.ts b/date-fns/src/parseJSON/index.d.ts
new file mode 100644
index 0000000..b6b186d
--- /dev/null
+++ b/date-fns/src/parseJSON/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { parseJSON } from 'date-fns'
+export default parseJSON
diff --git a/date-fns/src/parseJSON/index.js.flow b/date-fns/src/parseJSON/index.js.flow
new file mode 100644
index 0000000..c4801bf
--- /dev/null
+++ b/date-fns/src/parseJSON/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (argument: string | number | Date) => Date
diff --git a/date-fns/src/parseJSON/index.ts b/date-fns/src/parseJSON/index.ts
new file mode 100644
index 0000000..6af1eda
--- /dev/null
+++ b/date-fns/src/parseJSON/index.ts
@@ -0,0 +1,62 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name parseJSON
+ * @category Common Helpers
+ * @summary Parse a JSON date string
+ *
+ * @description
+ * Converts a complete ISO date string in UTC time, the typical format for transmitting
+ * a date in JSON, to a JavaScript `Date` instance.
+ *
+ * This is a minimal implementation for converting dates retrieved from a JSON API to
+ * a `Date` instance which can be used with other functions in the `date-fns` library.
+ * The following formats are supported:
+ *
+ * - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())`
+ * - `2000-03-15T05:20:10Z`: Without milliseconds
+ * - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages
+ * - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages
+ * - `2000-03-15T05:20:10+0000`: With a zero offset without a colon
+ * - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol
+ * - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds
+ * - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting
+ *
+ * For convenience and ease of use these other input types are also supported
+ * via [toDate]{@link https://date-fns.org/docs/toDate}:
+ *
+ * - A `Date` instance will be cloned
+ * - A `number` will be treated as a timestamp
+ *
+ * Any other input type or invalid date strings will return an `Invalid Date`.
+ *
+ * @param {String|Number|Date} argument A fully formed ISO8601 date string to convert
+ * @returns {Date} the parsed date in the local time zone
+ * @throws {TypeError} 1 argument required
+ */
+export default function parseJSON(argument: string): Date {
+ requiredArgs(1, arguments)
+
+ if (typeof argument === 'string') {
+ const parts = argument.match(
+ /(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/
+ )
+ if (parts) {
+ // Group 8 matches the sign
+ return new Date(
+ Date.UTC(
+ +parts[1],
+ +parts[2] - 1,
+ +parts[3],
+ +parts[4] - (+parts[9] || 0) * (parts[8] == '-' ? -1 : 1),
+ +parts[5] - (+parts[10] || 0) * (parts[8] == '-' ? -1 : 1),
+ +parts[6],
+ +((parts[7] || '0') + '00').substring(0, 3)
+ )
+ )
+ }
+ return new Date(NaN)
+ }
+ return toDate(argument)
+}
diff --git a/date-fns/src/parseJSON/test.ts b/date-fns/src/parseJSON/test.ts
new file mode 100644
index 0000000..ffb348f
--- /dev/null
+++ b/date-fns/src/parseJSON/test.ts
@@ -0,0 +1,132 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import parseJSON from '.'
+import format from '../format/index'
+
+describe('parseJSON', function () {
+ it('parses a formatted new Date() back to UTC - issue 2149', () => {
+ const date = new Date()
+ const jsonFormat = format(date, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
+ const parsedDate = parseJSON(jsonFormat)
+ assert.equal(parsedDate.toISOString(), date.toISOString())
+ })
+
+ it('parses a formatted date with an hour of offset back to UTC - issue 2149', () => {
+ const date = '2021-01-09T13:18:10.873+01:00'
+ const expectedDate = new Date('2021-01-09T12:18:10.873Z')
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate.toISOString())
+ })
+
+ it('parses a formatted date with 2 hours of offset back to UTC - issue 2149', () => {
+ const date = '2021-01-09T13:18:10.873+02:00'
+ const expectedDate = new Date('2021-01-09T11:18:10.873Z')
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate.toISOString())
+ })
+
+ it('parses a formatted date with -2 hours of offset back to UTC - issue 2149', () => {
+ const date = '2021-01-09T13:18:10.873-02:00'
+ const expectedDate = new Date('2021-01-09T15:18:10.873Z')
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate.toISOString())
+ })
+
+ it('parses a formatted Indian Standart Time in Asia/Kolkata with +5:30 hours of offset back to UTC - issue 2149', () => {
+ const date = '2021-02-15T02:56:04.678+05:30'
+ const expectedDate = new Date('2021-02-14T21:26:04.678Z')
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate.toISOString())
+ })
+
+ it('parses a formatted time in Asia/Kathmandu with +5:45 hours of offset back to UTC - issue 2149', () => {
+ const date = '2021-02-15T17:45:00.900+05:45'
+ const expectedDate = new Date('2021-02-15T12:00:00.900Z')
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate.toISOString())
+ })
+
+ it('parses a fully formed ISO date with Z', () => {
+ const date = '2000-03-15T05:20:10.123Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), date)
+ })
+
+ it('parses a fully formed ISO date with Z without ms', () => {
+ const date = '2000-03-15T05:20:10Z'
+ const expectedDate = '2000-03-15T05:20:10.000Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses a fully formed ISO date with zero offset', () => {
+ const zeroOffset = '2000-03-15T05:20:10+00:00'
+ const expectedDate = '2000-03-15T05:20:10.000Z'
+ const parsedDate = parseJSON(zeroOffset)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses a fully formed ISO date with zero offset without colon', () => {
+ const zeroOffset = '2000-03-15T05:20:10+0000'
+ const expectedDate = '2000-03-15T05:20:10.000Z'
+ const parsedDate = parseJSON(zeroOffset)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses a fully formed ISO date without Z', () => {
+ const date = '2000-03-15T05:20:10.123'
+ const expectedDate = '2000-03-15T05:20:10.123Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses a fully formed ISO date without Z and with 6-digit millisecond part', () => {
+ const date = '2000-03-15T05:20:10.123456'
+ const expectedDate = '2000-03-15T05:20:10.123Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses a fully formed ISO with 1-digit millisecond part', () => {
+ const date = '2000-03-15T05:20:10.1Z'
+ const expectedDate = '2000-03-15T05:20:10.100Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses a fully formed ISO with 2-digit millisecond part', () => {
+ const date = '2000-03-15T05:20:10.12Z'
+ const expectedDate = '2000-03-15T05:20:10.120Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses supported formats with a space time separator instead of a T', () => {
+ const date = '2000-03-15 05:20:10.123Z'
+ const expectedDate = '2000-03-15T05:20:10.123Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses the SQL datetime format without milliseconds', () => {
+ const date = '2000-03-15 05:20:10'
+ const expectedDate = '2000-03-15T05:20:10.000Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('parses the SQL datetime format with up to 7 millisecond digits', () => {
+ const date = '2000-03-15 05:20:10.1234567'
+ const expectedDate = '2000-03-15T05:20:10.123Z'
+ const parsedDate = parseJSON(date)
+ assert.equal(parsedDate.toISOString(), expectedDate)
+ })
+
+ it('returns an invalid date for anything else', () => {
+ assert.equal(parseJSON('').toString(), 'Invalid Date')
+ assert.equal(parseJSON('invalid').toString(), 'Invalid Date')
+ assert.equal(parseJSON('2020-10-10').toString(), 'Invalid Date')
+ })
+})
diff --git a/date-fns/src/quartersToMonths/index.d.ts b/date-fns/src/quartersToMonths/index.d.ts
new file mode 100644
index 0000000..d2df2e1
--- /dev/null
+++ b/date-fns/src/quartersToMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { quartersToMonths } from 'date-fns'
+export default quartersToMonths
diff --git a/date-fns/src/quartersToMonths/index.js.flow b/date-fns/src/quartersToMonths/index.js.flow
new file mode 100644
index 0000000..8225923
--- /dev/null
+++ b/date-fns/src/quartersToMonths/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (quarters: number) => number
diff --git a/date-fns/src/quartersToMonths/index.ts b/date-fns/src/quartersToMonths/index.ts
new file mode 100644
index 0000000..1e52b8e
--- /dev/null
+++ b/date-fns/src/quartersToMonths/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { monthsInQuarter } from '../constants/index'
+
+/**
+ * @name quartersToMonths
+ * @category Conversion Helpers
+ * @summary Convert number of quarters to months.
+ *
+ * @description
+ * Convert a number of quarters to a full number of months.
+ *
+ * @param {number} quarters - number of quarters to be converted
+ *
+ * @returns {number} the number of quarters converted in months
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 quarters to months
+ * const result = quartersToMonths(2)
+ * //=> 6
+ */
+export default function quartersToMonths(quarters: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(quarters * monthsInQuarter)
+}
diff --git a/date-fns/src/quartersToMonths/test.ts b/date-fns/src/quartersToMonths/test.ts
new file mode 100644
index 0000000..8fb7f41
--- /dev/null
+++ b/date-fns/src/quartersToMonths/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import quartersToMonths from '.'
+
+describe('quartersToMonths', function () {
+ it('converts quarters to months', function () {
+ assert(quartersToMonths(1) === 3)
+ assert(quartersToMonths(2) === 6)
+ })
+
+ it('uses floor rounding', () => {
+ assert(quartersToMonths(1.5) === 4)
+ assert(quartersToMonths(0.3) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(quartersToMonths(0.4) === 1)
+ assert(quartersToMonths(0) === 0)
+ })
+})
diff --git a/date-fns/src/quartersToYears/index.d.ts b/date-fns/src/quartersToYears/index.d.ts
new file mode 100644
index 0000000..1249037
--- /dev/null
+++ b/date-fns/src/quartersToYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { quartersToYears } from 'date-fns'
+export default quartersToYears
diff --git a/date-fns/src/quartersToYears/index.js.flow b/date-fns/src/quartersToYears/index.js.flow
new file mode 100644
index 0000000..8225923
--- /dev/null
+++ b/date-fns/src/quartersToYears/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (quarters: number) => number
diff --git a/date-fns/src/quartersToYears/index.ts b/date-fns/src/quartersToYears/index.ts
new file mode 100644
index 0000000..8f3d0e9
--- /dev/null
+++ b/date-fns/src/quartersToYears/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { quartersInYear } from '../constants/index'
+
+/**
+ * @name quartersToYears
+ * @category Conversion Helpers
+ * @summary Convert number of quarters to years.
+ *
+ * @description
+ * Convert a number of quarters to a full number of years.
+ *
+ * @param {number} quarters - number of quarters to be converted
+ *
+ * @returns {number} the number of quarters converted in years
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 8 quarters to years
+ * const result = quartersToYears(8)
+ * //=> 2
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = quartersToYears(11)
+ * //=> 2
+ */
+export default function quartersToYears(quarters: number): number {
+ requiredArgs(1, arguments)
+ const years = quarters / quartersInYear
+ return Math.floor(years)
+}
diff --git a/date-fns/src/quartersToYears/test.ts b/date-fns/src/quartersToYears/test.ts
new file mode 100644
index 0000000..7fe9f6f
--- /dev/null
+++ b/date-fns/src/quartersToYears/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import quartersToYears from '.'
+
+describe('quartersToYears', function () {
+ it('converts quarters to years', function () {
+ assert(quartersToYears(4) === 1)
+ assert(quartersToYears(8) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(quartersToYears(5) === 1)
+ assert(quartersToYears(3) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(quartersToYears(4.5) === 1)
+ assert(quartersToYears(0) === 0)
+ })
+})
diff --git a/date-fns/src/roundToNearestMinutes/index.d.ts b/date-fns/src/roundToNearestMinutes/index.d.ts
new file mode 100644
index 0000000..8e56491
--- /dev/null
+++ b/date-fns/src/roundToNearestMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { roundToNearestMinutes } from 'date-fns'
+export default roundToNearestMinutes
diff --git a/date-fns/src/roundToNearestMinutes/index.js b/date-fns/src/roundToNearestMinutes/index.js
new file mode 100644
index 0000000..4a94c75
--- /dev/null
+++ b/date-fns/src/roundToNearestMinutes/index.js
@@ -0,0 +1,61 @@
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+
+/**
+ * @name roundToNearestMinutes
+ * @category Minute Helpers
+ * @summary Rounds the given date to the nearest minute
+ *
+ * @description
+ * Rounds the given date to the nearest minute (or number of minutes).
+ * Rounds up when the given date is exactly between the nearest round minutes.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to round
+ * @param {Object} [options] - an object with options.
+ * @param {Number} [options.nearestTo=1] - nearest number of minutes to round to. E.g. `15` to round to quarter hours.
+ * @returns {Date} the new date rounded to the closest minute
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.nearestTo` must be between 1 and 30
+ *
+ * @example
+ * // Round 10 July 2014 12:12:34 to nearest minute:
+ * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))
+ * //=> Thu Jul 10 2014 12:13:00
+ *
+ * @example
+ * // Round 10 July 2014 12:07:30 to nearest quarter hour:
+ * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })
+ * // rounds up because given date is exactly between 12:00:00 and 12:15:00
+ * //=> Thu Jul 10 2014 12:15:00
+ */
+export default function roundToNearestMinutes(dirtyDate, options) {
+ if (arguments.length < 1) {
+ throw new TypeError('1 argument required, but only none provided present')
+ }
+
+ var nearestTo =
+ options && 'nearestTo' in options ? toInteger(options.nearestTo) : 1
+
+ if (nearestTo < 1 || nearestTo > 30) {
+ throw new RangeError('`options.nearestTo` must be between 1 and 30')
+ }
+
+ var date = toDate(dirtyDate)
+ var seconds = date.getSeconds() // relevant if nearestTo is 1, which is the default case
+ var minutes = date.getMinutes() + seconds / 60
+ var roundedMinutes = Math.floor(minutes / nearestTo) * nearestTo
+ var remainderMinutes = minutes % nearestTo
+ var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo
+
+ return new Date(
+ date.getFullYear(),
+ date.getMonth(),
+ date.getDate(),
+ date.getHours(),
+ roundedMinutes + addedMinutes
+ )
+}
diff --git a/date-fns/src/roundToNearestMinutes/index.js.flow b/date-fns/src/roundToNearestMinutes/index.js.flow
new file mode 100644
index 0000000..8e6f0ec
--- /dev/null
+++ b/date-fns/src/roundToNearestMinutes/index.js.flow
@@ -0,0 +1,57 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ nearestTo?: number,
+ }
+) => Date
diff --git a/date-fns/src/roundToNearestMinutes/test.js b/date-fns/src/roundToNearestMinutes/test.js
new file mode 100644
index 0000000..e4f7c04
--- /dev/null
+++ b/date-fns/src/roundToNearestMinutes/test.js
@@ -0,0 +1,70 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import roundToNearestMinutes from '.'
+
+describe('roundToNearestMinutes', function() {
+ it('rounds given date to the nearest minute by default', function() {
+ var result = roundToNearestMinutes(
+ new Date(2014, 6 /* Jul */, 10, 12, 16, 16)
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 16, 0))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = roundToNearestMinutes(
+ new Date(2014, 6 /* Jul */, 10, 12, 13, 16).getTime()
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 13, 0))
+ })
+
+ it('rounds to the closest x minutes if nearestTo is provided', function() {
+ var result = roundToNearestMinutes(
+ new Date(2014, 6 /* Jul */, 10, 12, 10, 30),
+ { nearestTo: 4 }
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 12, 0))
+ })
+
+ it('rounds up >=30 seconds for nearestTo=1', function() {
+ var result = roundToNearestMinutes(
+ new Date(2014, 6 /* Jul */, 10, 12, 13, 30)
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 14, 0))
+ })
+
+ it('rounds down <30 seconds for nearestTo=1', function() {
+ var result = roundToNearestMinutes(
+ new Date(2014, 6 /* Jul */, 10, 12, 13, 29, 999)
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 13, 0))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 6 /* Jul */, 10, 12, 10, 10, 99)
+ roundToNearestMinutes(date)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 10, 12, 10, 10, 99))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = roundToNearestMinutes(new Date(NaN))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws `TypeError` exception if passed less than 1 argument', function() {
+ assert.throws(roundToNearestMinutes.bind(null), TypeError)
+ })
+
+ it('throws `RangeError` if nearestTo is not between 1 and 30', function() {
+ var date = new Date(2014, 6 /* Jul */, 10, 12, 10, 30)
+ assert.throws(
+ roundToNearestMinutes.bind(null, date, { nearestTo: 31 }),
+ RangeError
+ )
+ assert.throws(
+ roundToNearestMinutes.bind(null, date, { nearestTo: 0 }),
+ RangeError
+ )
+ })
+})
diff --git a/date-fns/src/secondsToHours/index.d.ts b/date-fns/src/secondsToHours/index.d.ts
new file mode 100644
index 0000000..89fcc9a
--- /dev/null
+++ b/date-fns/src/secondsToHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { secondsToHours } from 'date-fns'
+export default secondsToHours
diff --git a/date-fns/src/secondsToHours/index.js.flow b/date-fns/src/secondsToHours/index.js.flow
new file mode 100644
index 0000000..371c79a
--- /dev/null
+++ b/date-fns/src/secondsToHours/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (seconds: number) => number
diff --git a/date-fns/src/secondsToHours/index.ts b/date-fns/src/secondsToHours/index.ts
new file mode 100644
index 0000000..ba87b10
--- /dev/null
+++ b/date-fns/src/secondsToHours/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { secondsInHour } from '../constants/index'
+
+/**
+ * @name secondsToHours
+ * @category Conversion Helpers
+ * @summary Convert seconds to hours.
+ *
+ * @description
+ * Convert a number of seconds to a full number of hours.
+ *
+ * @param {number} seconds - number of seconds to be converted
+ *
+ * @returns {number} the number of seconds converted in hours
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 7200 seconds into hours
+ * const result = secondsToHours(7200)
+ * //=> 2
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = secondsToHours(7199)
+ * //=> 1
+ */
+export default function secondsToHours(seconds: number): number {
+ requiredArgs(1, arguments)
+ const hours = seconds / secondsInHour
+ return Math.floor(hours)
+}
diff --git a/date-fns/src/secondsToHours/test.ts b/date-fns/src/secondsToHours/test.ts
new file mode 100644
index 0000000..12b3ecf
--- /dev/null
+++ b/date-fns/src/secondsToHours/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import secondsToHours from '.'
+
+describe('secondsToHours', function () {
+ it('converts seconds to hours', function () {
+ assert(secondsToHours(3600) === 1)
+ assert(secondsToHours(7200) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(secondsToHours(3601) === 1)
+ assert(secondsToHours(3599) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(secondsToHours(3600.5) === 1)
+ assert(secondsToHours(0) === 0)
+ })
+})
diff --git a/date-fns/src/secondsToMilliseconds/index.d.ts b/date-fns/src/secondsToMilliseconds/index.d.ts
new file mode 100644
index 0000000..a208037
--- /dev/null
+++ b/date-fns/src/secondsToMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { secondsToMilliseconds } from 'date-fns'
+export default secondsToMilliseconds
diff --git a/date-fns/src/secondsToMilliseconds/index.js.flow b/date-fns/src/secondsToMilliseconds/index.js.flow
new file mode 100644
index 0000000..371c79a
--- /dev/null
+++ b/date-fns/src/secondsToMilliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (seconds: number) => number
diff --git a/date-fns/src/secondsToMilliseconds/index.ts b/date-fns/src/secondsToMilliseconds/index.ts
new file mode 100644
index 0000000..2e4a663
--- /dev/null
+++ b/date-fns/src/secondsToMilliseconds/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { millisecondsInSecond } from '../constants/index'
+
+/**
+ * @name secondsToMilliseconds
+ * @category Conversion Helpers
+ * @summary Convert seconds to milliseconds.
+ *
+ * @description
+ * Convert a number of seconds to a full number of milliseconds.
+ *
+ * @param {number} seconds - number of seconds to be converted
+ *
+ * @returns {number} the number of seconds converted in milliseconds
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 seconds into milliseconds
+ * const result = secondsToMilliseconds(2)
+ * //=> 2000
+ */
+export default function secondsToMilliseconds(seconds: number): number {
+ requiredArgs(1, arguments)
+ return seconds * millisecondsInSecond
+}
diff --git a/date-fns/src/secondsToMilliseconds/test.ts b/date-fns/src/secondsToMilliseconds/test.ts
new file mode 100644
index 0000000..26bc2eb
--- /dev/null
+++ b/date-fns/src/secondsToMilliseconds/test.ts
@@ -0,0 +1,16 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import secondsToMilliseconds from '.'
+
+describe('secondsToMilliseconds', function () {
+ it('converts seconds to milliseconds', function () {
+ assert(secondsToMilliseconds(1) === 1000)
+ assert(secondsToMilliseconds(2) === 2000)
+ })
+
+ it('handles border values', () => {
+ assert(secondsToMilliseconds(1.5) === 1500)
+ assert(secondsToMilliseconds(0) === 0)
+ })
+})
diff --git a/date-fns/src/secondsToMinutes/index.d.ts b/date-fns/src/secondsToMinutes/index.d.ts
new file mode 100644
index 0000000..22846dd
--- /dev/null
+++ b/date-fns/src/secondsToMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { secondsToMinutes } from 'date-fns'
+export default secondsToMinutes
diff --git a/date-fns/src/secondsToMinutes/index.js.flow b/date-fns/src/secondsToMinutes/index.js.flow
new file mode 100644
index 0000000..371c79a
--- /dev/null
+++ b/date-fns/src/secondsToMinutes/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (seconds: number) => number
diff --git a/date-fns/src/secondsToMinutes/index.ts b/date-fns/src/secondsToMinutes/index.ts
new file mode 100644
index 0000000..530c21e
--- /dev/null
+++ b/date-fns/src/secondsToMinutes/index.ts
@@ -0,0 +1,31 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { secondsInMinute } from '../constants/index'
+
+/**
+ * @name secondsToMinutes
+ * @category Conversion Helpers
+ * @summary Convert seconds to minutes.
+ *
+ * @description
+ * Convert a number of seconds to a full number of minutes.
+ *
+ * @param {number} seconds - number of seconds to be converted
+ *
+ * @returns {number} the number of seconds converted in minutes
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 120 seconds into minutes
+ * const result = secondsToMinutes(120)
+ * //=> 2
+ *
+ * @example
+ * // It uses floor rounding:
+ * const result = secondsToMinutes(119)
+ * //=> 1
+ */
+export default function secondsToMinutes(seconds: number): number {
+ requiredArgs(1, arguments)
+ const minutes = seconds / secondsInMinute
+ return Math.floor(minutes)
+}
diff --git a/date-fns/src/secondsToMinutes/test.ts b/date-fns/src/secondsToMinutes/test.ts
new file mode 100644
index 0000000..3cf59e9
--- /dev/null
+++ b/date-fns/src/secondsToMinutes/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import secondsToMinutes from '.'
+
+describe('secondsToMinutes', function () {
+ it('converts seconds to minutes', function () {
+ assert(secondsToMinutes(60) === 1)
+ assert(secondsToMinutes(120) === 2)
+ })
+
+ it('uses floor rounding', () => {
+ assert(secondsToMinutes(61) === 1)
+ assert(secondsToMinutes(59) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(secondsToMinutes(60.5) === 1)
+ assert(secondsToMinutes(0) === 0)
+ })
+})
diff --git a/date-fns/src/set/benchmark.js b/date-fns/src/set/benchmark.js
new file mode 100644
index 0000000..55e2c16
--- /dev/null
+++ b/date-fns/src/set/benchmark.js
@@ -0,0 +1,25 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import set from '.'
+import moment from 'moment'
+
+suite(
+ 'set',
+ function() {
+ benchmark('date-fns', function() {
+ return set(this.date, { year: 2014, month: 8 })
+ })
+
+ benchmark('Moment.js', function() {
+ return this.moment.set({ year: 2014, month: 3 })
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date(2013, 7)
+ this.moment = moment()
+ }
+ }
+)
diff --git a/date-fns/src/set/index.d.ts b/date-fns/src/set/index.d.ts
new file mode 100644
index 0000000..d30347b
--- /dev/null
+++ b/date-fns/src/set/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { set } from 'date-fns'
+export default set
diff --git a/date-fns/src/set/index.js.flow b/date-fns/src/set/index.js.flow
new file mode 100644
index 0000000..384f137
--- /dev/null
+++ b/date-fns/src/set/index.js.flow
@@ -0,0 +1,63 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ values: {
+ year?: number,
+ month?: number,
+ date?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+ milliseconds?: number,
+ }
+) => Date
diff --git a/date-fns/src/set/index.ts b/date-fns/src/set/index.ts
new file mode 100644
index 0000000..e7c692e
--- /dev/null
+++ b/date-fns/src/set/index.ts
@@ -0,0 +1,89 @@
+import toDate from '../toDate/index'
+import setMonth from '../setMonth/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import { DateValues } from '../types';
+
+/**
+ * @name set
+ * @category Common Helpers
+ * @summary Set date values to a given date.
+ *
+ * @description
+ * Set date values to a given date.
+ *
+ * Sets time values to date from object `values`.
+ * A value is not set if it is undefined or null or doesn't exist in `values`.
+ *
+ * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
+ * to use native `Date#setX` methods. If you use this function, you may not want to include the
+ * other `setX` functions that date-fns provides if you are concerned about the bundle size.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Object} values - an object with options
+ * @param {Number} [values.year] - the number of years to be set
+ * @param {Number} [values.month] - the number of months to be set
+ * @param {Number} [values.date] - the number of days to be set
+ * @param {Number} [values.hours] - the number of hours to be set
+ * @param {Number} [values.minutes] - the number of minutes to be set
+ * @param {Number} [values.seconds] - the number of seconds to be set
+ * @param {Number} [values.milliseconds] - the number of milliseconds to be set
+ * @returns {Date} the new date with options set
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `values` must be an object
+ *
+ * @example
+ * // Transform 1 September 2014 into 20 October 2015 in a single line:
+ * var result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
+ * //=> Tue Oct 20 2015 00:00:00
+ *
+ * @example
+ * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
+ * var result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
+ * //=> Mon Sep 01 2014 12:23:45
+ */
+
+export default function set(dirtyDate: Date | number, values: DateValues): Date {
+ requiredArgs(2, arguments)
+
+ if (typeof values !== 'object' || values === null) {
+ throw new RangeError('values parameter must be an object')
+ }
+
+ let date = toDate(dirtyDate)
+
+ // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
+ if (isNaN(date.getTime())) {
+ return new Date(NaN)
+ }
+
+ if (values.year != null) {
+ date.setFullYear(values.year)
+ }
+
+ if (values.month != null) {
+ date = setMonth(date, values.month)
+ }
+
+ if (values.date != null) {
+ date.setDate(toInteger(values.date))
+ }
+
+ if (values.hours != null) {
+ date.setHours(toInteger(values.hours))
+ }
+
+ if (values.minutes != null) {
+ date.setMinutes(toInteger(values.minutes))
+ }
+
+ if (values.seconds != null) {
+ date.setSeconds(toInteger(values.seconds))
+ }
+
+ if (values.milliseconds != null) {
+ date.setMilliseconds(toInteger(values.milliseconds))
+ }
+
+ return date
+}
diff --git a/date-fns/src/set/test.ts b/date-fns/src/set/test.ts
new file mode 100644
index 0000000..52e0f23
--- /dev/null
+++ b/date-fns/src/set/test.ts
@@ -0,0 +1,143 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import set from '.'
+
+describe('set', function() {
+ it('sets all values', function() {
+ const result = set(new Date(2013, 0 /* Jan */), {
+ year: 2014,
+ month: 8, // Sep
+ date: 20,
+ hours: 12,
+ minutes: 12,
+ seconds: 12,
+ milliseconds: 12
+ })
+ assert.deepEqual(
+ result.toString(),
+ new Date(2014, 8 /* Sep */, 20, 12, 12, 12, 12).toString()
+ )
+ })
+
+ it('sets year', function() {
+ const result = set(new Date(2013, 8 /* Sep */), { year: 2014 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */))
+ })
+
+ it('sets month', function() {
+ const result = set(new Date(2014, 8 /* Sep */), { month: 9 /* Oct */ })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */))
+ })
+
+ it('sets day of month', function() {
+ const result = set(new Date(2014, 8 /* Sep */), { date: 20 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 20))
+ })
+
+ it('sets hours', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 1), { hours: 12 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 12))
+ })
+
+ it('sets minutes', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 1, 1), { minutes: 12 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 1, 12))
+ })
+
+ it('sets seconds', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 1, 1, 1), { seconds: 12 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 1, 1, 12))
+ })
+
+ it('sets milliseconds', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 1, 1, 1, 1), {
+ milliseconds: 500
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 1, 1, 1, 500))
+ })
+
+ describe('value overflow', function() {
+ it('months overflow into years', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 1), {
+ month: 12 /* 13th month */
+ })
+ assert.deepEqual(result, new Date(2015, 0 /* Jan */, 1))
+ })
+
+ it('days of months overflow into months', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 1), { date: 31 })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 1))
+ })
+
+ it('hours overflow into days', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 19), { hours: 24 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 20))
+ })
+
+ it('minutes overflow into hours', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 20, 11), { minutes: 60 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 20, 12))
+ })
+
+ it('seconds overflow into minutes', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 20, 12, 58), { seconds: 60 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 20, 12, 59))
+ })
+
+ it('milliseconds overflow into seconds', function() {
+ const result = set(new Date(2014, 8 /* Sep */, 20, 12, 58, 30), {
+ milliseconds: 1000
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 20, 12, 58, 31))
+ })
+ })
+
+ describe('edge cases', function() {
+ it('sets January', function() {
+ const result = set(new Date(2014, 8 /* Sep */), { month: 0 /* Jan */ })
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */))
+ })
+
+ it('sets the last day of new month if the initial date was the last day of a longer month', function() {
+ const result = set(new Date(2014, 7 /* Aug */, 31), { month: 8 /* Sep */ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('ignores undefined values', function() {
+ const result = set(new Date(2014, 8 /* Sep */), { year: undefined })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */))
+ })
+
+ it('ignores null values', function() {
+ // @ts-expect-error
+ const result = set(new Date(2014, 8 /* Sep */), { year: null })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(set.bind(null), TypeError)
+ })
+
+ it('returns Invalid Date if any value in values is NaN', function() {
+ const result = set(new Date(2014, 8 /* Sep */), { year: NaN })
+ assert.deepEqual(isNaN(result.getTime()), isNaN((new Date(NaN)).getTime()))
+ })
+
+ it('returns Invalid Date the initial date was Invalid Date as well', function() {
+ const result = set(new Date(NaN), { year: 2019 })
+ assert.deepEqual(isNaN(result.getTime()), isNaN((new Date(NaN)).getTime()))
+ })
+
+ it('throws RangeError exception if `values` is not an object', function() {
+ // @ts-expect-error
+ assert.throws(set.bind(null, new Date(), true), RangeError)
+ })
+
+ it('throws RangeError exception if `values` is null', function() {
+ // @ts-expect-error
+ assert.throws(set.bind(null, new Date(), null), RangeError)
+ })
+ })
+})
diff --git a/date-fns/src/setDate/benchmark.js b/date-fns/src/setDate/benchmark.js
new file mode 100644
index 0000000..3145d0d
--- /dev/null
+++ b/date-fns/src/setDate/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setDate from '.'
+import moment from 'moment'
+
+suite('setDate', function () {
+ benchmark('date-fns', function () {
+ return setDate(this.date, 15)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.date(15)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setDate/index.d.ts b/date-fns/src/setDate/index.d.ts
new file mode 100644
index 0000000..677ea30
--- /dev/null
+++ b/date-fns/src/setDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setDate } from 'date-fns'
+export default setDate
diff --git a/date-fns/src/setDate/index.js.flow b/date-fns/src/setDate/index.js.flow
new file mode 100644
index 0000000..8c9b807
--- /dev/null
+++ b/date-fns/src/setDate/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, dayOfMonth: number) => Date
diff --git a/date-fns/src/setDate/index.ts b/date-fns/src/setDate/index.ts
new file mode 100644
index 0000000..ab757f3
--- /dev/null
+++ b/date-fns/src/setDate/index.ts
@@ -0,0 +1,34 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setDate
+ * @category Day Helpers
+ * @summary Set the day of the month to the given date.
+ *
+ * @description
+ * Set the day of the month to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} dayOfMonth - the day of the month of the new date
+ * @returns {Date} the new date with the day of the month set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set the 30th day of the month to 1 September 2014:
+ * var result = setDate(new Date(2014, 8, 1), 30)
+ * //=> Tue Sep 30 2014 00:00:00
+ */
+export default function setDate(dirtyDate: Date | number, dirtyDayOfMonth: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const dayOfMonth = toInteger(dirtyDayOfMonth)
+ date.setDate(dayOfMonth)
+ return date
+}
diff --git a/date-fns/src/setDate/test.ts b/date-fns/src/setDate/test.ts
new file mode 100644
index 0000000..7c07ff5
--- /dev/null
+++ b/date-fns/src/setDate/test.ts
@@ -0,0 +1,49 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setDate from '.'
+
+describe('setDate', function() {
+ it('sets the day of the month', function() {
+ const result = setDate(new Date(2014, 8 /* Sep */, 1), 30)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setDate(new Date(2014, 8 /* Sep */, 1).getTime(), 25)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 25))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setDate(new Date(2014, 8 /* Sep */, 1), 30.3)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = setDate(new Date(2014, 8 /* Sep */, 1), '30')
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ setDate(date, 20)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setDate(new Date(NaN), 30)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setDate(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setDate.bind(null), TypeError)
+ assert.throws(setDate.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setDay/benchmark.js b/date-fns/src/setDay/benchmark.js
new file mode 100644
index 0000000..4c60c7f
--- /dev/null
+++ b/date-fns/src/setDay/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setDay from '.'
+import moment from 'moment'
+
+suite('setDay', function () {
+ benchmark('date-fns', function () {
+ return setDay(this.date, 3)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.day(3)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setDay/index.d.ts b/date-fns/src/setDay/index.d.ts
new file mode 100644
index 0000000..5b3d9d1
--- /dev/null
+++ b/date-fns/src/setDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setDay } from 'date-fns'
+export default setDay
diff --git a/date-fns/src/setDay/index.js b/date-fns/src/setDay/index.js
new file mode 100644
index 0000000..9d21367
--- /dev/null
+++ b/date-fns/src/setDay/index.js
@@ -0,0 +1,69 @@
+import addDays from '../addDays/index'
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setDay
+ * @category Weekday Helpers
+ * @summary Set the day of the week to the given date.
+ *
+ * @description
+ * Set the day of the week to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} day - the day of the week of the new date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Date} the new date with the day of the week set
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // Set week day to Sunday, with the default weekStartsOn of Sunday:
+ * var result = setDay(new Date(2014, 8, 1), 0)
+ * //=> Sun Aug 31 2014 00:00:00
+ *
+ * @example
+ * // Set week day to Sunday, with a weekStartsOn of Monday:
+ * var result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
+ * //=> Sun Sep 07 2014 00:00:00
+ */
+export default function setDay(dirtyDate, dirtyDay, dirtyOptions) {
+ requiredArgs(2, arguments)
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeWeekStartsOn =
+ locale && locale.options && locale.options.weekStartsOn
+ var defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ var weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ var date = toDate(dirtyDate, options)
+ var day = toInteger(dirtyDay)
+ var currentDay = date.getDay()
+
+ var remainder = day % 7
+ var dayIndex = (remainder + 7) % 7
+
+ var delta = 7 - weekStartsOn
+ var diff =
+ day < 0 || day > 6
+ ? day - ((currentDay + delta) % 7)
+ : ((dayIndex + delta) % 7) - ((currentDay + delta) % 7)
+ return addDays(date, diff, options)
+}
diff --git a/date-fns/src/setDay/index.js.flow b/date-fns/src/setDay/index.js.flow
new file mode 100644
index 0000000..4a2d43d
--- /dev/null
+++ b/date-fns/src/setDay/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ day: number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => Date
diff --git a/date-fns/src/setDay/test.js b/date-fns/src/setDay/test.js
new file mode 100644
index 0000000..552b0a9
--- /dev/null
+++ b/date-fns/src/setDay/test.js
@@ -0,0 +1,147 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setDay from '.'
+
+describe('setDay', function () {
+ it('sets the day of the week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 0)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 0, { weekStartsOn: 1 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 0, {
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 0, {
+ weekStartsOn: 1,
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('converts a fractional number to an integer', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 0.5)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
+ })
+
+ it('implicitly converts options', function () {
+ // $ExpectedMistake
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 0, {
+ weekStartsOn: '1',
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ it('specifies Monday as the first day of the week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 6), 1, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('specifies Tuesday as the first day of the week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 6), 1, {
+ weekStartsOn: 2,
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 8))
+ })
+
+ describe('the day index is more than 6', function () {
+ it('sets the day of the next week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 8)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 8))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 7, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 8))
+ })
+
+ it('sets the day of another week in the future', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), 14, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 15))
+ })
+ })
+
+ describe('the day index is less than 0', function () {
+ it('sets the day of the last week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), -6)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 25))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), -7, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 25))
+ })
+
+ it('set the day of another week in the past', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), -14, {
+ weekStartsOn: 1,
+ })
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 18))
+ })
+ })
+
+ it('accepts a timestamp', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1).getTime(), 3)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
+ })
+
+ it('implicitly converts number arguments', function () {
+ // $ExpectedMistake
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), '5')
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 5))
+ })
+
+ it('does not mutate the original date', function () {
+ var date = new Date(2014, 8 /* Sep */, 1)
+ setDay(date, 3)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ var result = setDay(new Date(NaN), 0)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function () {
+ var result = setDay(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ // $ExpectedMistake
+ var block = setDay.bind(null, new Date(2014, 8 /* Sep */, 1), 0, {
+ weekStartsOn: NaN,
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(setDay.bind(null), TypeError)
+ assert.throws(setDay.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setDayOfYear/benchmark.js b/date-fns/src/setDayOfYear/benchmark.js
new file mode 100644
index 0000000..8127098
--- /dev/null
+++ b/date-fns/src/setDayOfYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setDayOfYear from '.'
+import moment from 'moment'
+
+suite('setDayOfYear', function () {
+ benchmark('date-fns', function () {
+ return setDayOfYear(this.date, 150)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.dayOfYear(150)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setDayOfYear/index.d.ts b/date-fns/src/setDayOfYear/index.d.ts
new file mode 100644
index 0000000..5536c57
--- /dev/null
+++ b/date-fns/src/setDayOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setDayOfYear } from 'date-fns'
+export default setDayOfYear
diff --git a/date-fns/src/setDayOfYear/index.js.flow b/date-fns/src/setDayOfYear/index.js.flow
new file mode 100644
index 0000000..fc974d4
--- /dev/null
+++ b/date-fns/src/setDayOfYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, dayOfYear: number) => Date
diff --git a/date-fns/src/setDayOfYear/index.ts b/date-fns/src/setDayOfYear/index.ts
new file mode 100644
index 0000000..d7b5421
--- /dev/null
+++ b/date-fns/src/setDayOfYear/index.ts
@@ -0,0 +1,38 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setDayOfYear
+ * @category Day Helpers
+ * @summary Set the day of the year to the given date.
+ *
+ * @description
+ * Set the day of the year to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} dayOfYear - the day of the year of the new date
+ * @returns {Date} the new date with the day of the year set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set the 2nd day of the year to 2 July 2014:
+ * var result = setDayOfYear(new Date(2014, 6, 2), 2)
+ * //=> Thu Jan 02 2014 00:00:00
+ */
+export default function setDayOfYear(
+ dirtyDate: Date | number,
+ dirtyDayOfYear: number
+): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const dayOfYear = toInteger(dirtyDayOfYear)
+ date.setMonth(0)
+ date.setDate(dayOfYear)
+ return date
+}
diff --git a/date-fns/src/setDayOfYear/test.ts b/date-fns/src/setDayOfYear/test.ts
new file mode 100644
index 0000000..a58990b
--- /dev/null
+++ b/date-fns/src/setDayOfYear/test.ts
@@ -0,0 +1,50 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setDayOfYear from '.'
+
+describe('setDayOfYear', function() {
+ it('sets the day of the year', function() {
+ const result = setDayOfYear(new Date(2014, 6 /* Jul */, 2), 2)
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setDayOfYear(new Date(2014, 6 /* Jul */, 2).getTime(), 60)
+ assert.deepEqual(result, new Date(2014, 2 /* Mar */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setDayOfYear(new Date(2014, 6 /* Jul */, 2), 2.75)
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = setDayOfYear(new Date(2014, 6 /* Jul */, 2), '2')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 2)
+ setDayOfYear(date, 365)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setDayOfYear(new Date(NaN), 2)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setDayOfYear(new Date(2014, 6 /* Jul */, 2), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setDayOfYear.bind(null), TypeError)
+ assert.throws(setDayOfYear.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setHours/benchmark.js b/date-fns/src/setHours/benchmark.js
new file mode 100644
index 0000000..bb59134
--- /dev/null
+++ b/date-fns/src/setHours/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setHours from '.'
+import moment from 'moment'
+
+suite('setHours', function () {
+ benchmark('date-fns', function () {
+ return setHours(this.date, 14)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.hours(14)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setHours/index.d.ts b/date-fns/src/setHours/index.d.ts
new file mode 100644
index 0000000..2709a32
--- /dev/null
+++ b/date-fns/src/setHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setHours } from 'date-fns'
+export default setHours
diff --git a/date-fns/src/setHours/index.js b/date-fns/src/setHours/index.js
new file mode 100644
index 0000000..d699831
--- /dev/null
+++ b/date-fns/src/setHours/index.js
@@ -0,0 +1,34 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setHours
+ * @category Hour Helpers
+ * @summary Set the hours to the given date.
+ *
+ * @description
+ * Set the hours to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} hours - the hours of the new date
+ * @returns {Date} the new date with the hours set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set 4 hours to 1 September 2014 11:30:00:
+ * var result = setHours(new Date(2014, 8, 1, 11, 30), 4)
+ * //=> Mon Sep 01 2014 04:30:00
+ */
+export default function setHours(dirtyDate, dirtyHours) {
+ requiredArgs(2, arguments)
+
+ var date = toDate(dirtyDate)
+ var hours = toInteger(dirtyHours)
+ date.setHours(hours)
+ return date
+}
diff --git a/date-fns/src/setHours/index.js.flow b/date-fns/src/setHours/index.js.flow
new file mode 100644
index 0000000..c9003bc
--- /dev/null
+++ b/date-fns/src/setHours/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, hours: number) => Date
diff --git a/date-fns/src/setHours/test.js b/date-fns/src/setHours/test.js
new file mode 100644
index 0000000..a89f1a0
--- /dev/null
+++ b/date-fns/src/setHours/test.js
@@ -0,0 +1,49 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setHours from '.'
+
+describe('setHours', function() {
+ it('sets the amount of hours', function() {
+ var result = setHours(new Date(2014, 8 /* Sep */, 1, 11, 30), 4)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 4, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = setHours(new Date(2014, 8 /* Sep */, 1, 11).getTime(), 5)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 5))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ var result = setHours(new Date(2014, 8 /* Sep */, 1, 11, 30), 4.123)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 4, 30))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ var result = setHours(new Date(2014, 8 /* Sep */, 1, 11, 30), '4')
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 4, 30))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 8 /* Sep */, 1, 11)
+ setHours(date, 12)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1, 11))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = setHours(new Date(NaN), 4)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ var result = setHours(new Date(2014, 8 /* Sep */, 1, 11, 30), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setHours.bind(null), TypeError)
+ assert.throws(setHours.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setISODay/benchmark.js b/date-fns/src/setISODay/benchmark.js
new file mode 100644
index 0000000..b7888ff
--- /dev/null
+++ b/date-fns/src/setISODay/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setISODay from '.'
+import moment from 'moment'
+
+suite('setISODay', function () {
+ benchmark('date-fns', function () {
+ return setISODay(this.date, 5)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isoWeekday(5)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setISODay/index.d.ts b/date-fns/src/setISODay/index.d.ts
new file mode 100644
index 0000000..63fb67a
--- /dev/null
+++ b/date-fns/src/setISODay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setISODay } from 'date-fns'
+export default setISODay
diff --git a/date-fns/src/setISODay/index.js.flow b/date-fns/src/setISODay/index.js.flow
new file mode 100644
index 0000000..07b0629
--- /dev/null
+++ b/date-fns/src/setISODay/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, day: number) => Date
diff --git a/date-fns/src/setISODay/index.ts b/date-fns/src/setISODay/index.ts
new file mode 100644
index 0000000..ef76348
--- /dev/null
+++ b/date-fns/src/setISODay/index.ts
@@ -0,0 +1,39 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import addDays from '../addDays/index'
+import getISODay from '../getISODay/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setISODay
+ * @category Weekday Helpers
+ * @summary Set the day of the ISO week to the given date.
+ *
+ * @description
+ * Set the day of the ISO week to the given date.
+ * ISO week starts with Monday.
+ * 7 is the index of Sunday, 1 is the index of Monday etc.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} day - the day of the ISO week of the new date
+ * @returns {Date} the new date with the day of the ISO week set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set Sunday to 1 September 2014:
+ * const result = setISODay(new Date(2014, 8, 1), 7)
+ * //=> Sun Sep 07 2014 00:00:00
+ */
+export default function setISODay(dirtyDate: Date | number, dirtyDay: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const day = toInteger(dirtyDay)
+ const currentDay = getISODay(date)
+ const diff = day - currentDay
+ return addDays(date, diff)
+}
diff --git a/date-fns/src/setISODay/test.ts b/date-fns/src/setISODay/test.ts
new file mode 100644
index 0000000..0b8144a
--- /dev/null
+++ b/date-fns/src/setISODay/test.ts
@@ -0,0 +1,78 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setISODay from '.'
+
+describe('setISODay', function () {
+ it('sets the day of the ISO week', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), 3)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
+ })
+
+ it('sets the day to Sunday of this ISO week if the index is 7', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), 7)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 7))
+ })
+
+ describe('the day index is more than 7', function () {
+ it('sets the day of the next ISO week', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), 8)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 8))
+ })
+
+ it('sets the day of another ISO week in the future', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), 21)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 21))
+ })
+ })
+
+ describe('the day index is less than 1', function () {
+ it('sets the day of the last ISO week', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), 0)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
+ })
+
+ it('set the day of another ISO week in the past', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), -13)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 18))
+ })
+ })
+
+ it('accepts a timestamp', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1).getTime(), 3)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
+ })
+
+ it('converts a fractional number to an integer', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), 3.33)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
+ })
+
+ it('implicitly converts number arguments', function () {
+ // @ts-expect-error
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), '3')
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 3))
+ })
+
+ it('does not mutate the original date', function () {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ setISODay(date, 3)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ const result = setISODay(new Date(NaN), 3)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function () {
+ const result = setISODay(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function () {
+ assert.throws(setISODay.bind(null), TypeError)
+ assert.throws(setISODay.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setISOWeek/benchmark.js b/date-fns/src/setISOWeek/benchmark.js
new file mode 100644
index 0000000..27409fc
--- /dev/null
+++ b/date-fns/src/setISOWeek/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setISOWeek from '.'
+import moment from 'moment'
+
+suite('setISOWeek', function () {
+ benchmark('date-fns', function () {
+ return setISOWeek(this.date, 10)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isoWeek(10)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setISOWeek/index.d.ts b/date-fns/src/setISOWeek/index.d.ts
new file mode 100644
index 0000000..a2e7970
--- /dev/null
+++ b/date-fns/src/setISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setISOWeek } from 'date-fns'
+export default setISOWeek
diff --git a/date-fns/src/setISOWeek/index.js.flow b/date-fns/src/setISOWeek/index.js.flow
new file mode 100644
index 0000000..cf1ccb8
--- /dev/null
+++ b/date-fns/src/setISOWeek/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, isoWeek: number) => Date
diff --git a/date-fns/src/setISOWeek/index.ts b/date-fns/src/setISOWeek/index.ts
new file mode 100644
index 0000000..82170f9
--- /dev/null
+++ b/date-fns/src/setISOWeek/index.ts
@@ -0,0 +1,38 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import getISOWeek from '../getISOWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setISOWeek
+ * @category ISO Week Helpers
+ * @summary Set the ISO week to the given date.
+ *
+ * @description
+ * Set the ISO week to the given date, saving the weekday number.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} isoWeek - the ISO week of the new date
+ * @returns {Date} the new date with the ISO week set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set the 53rd ISO week to 7 August 2004:
+ * const result = setISOWeek(new Date(2004, 7, 7), 53)
+ * //=> Sat Jan 01 2005 00:00:00
+ */
+export default function setISOWeek(dirtyDate: Date | number, dirtyISOWeek: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const isoWeek = toInteger(dirtyISOWeek)
+ const diff = getISOWeek(date) - isoWeek
+ date.setDate(date.getDate() - diff * 7)
+ return date
+}
diff --git a/date-fns/src/setISOWeek/test.ts b/date-fns/src/setISOWeek/test.ts
new file mode 100644
index 0000000..fe481e0
--- /dev/null
+++ b/date-fns/src/setISOWeek/test.ts
@@ -0,0 +1,60 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setISOWeek from '.'
+
+describe('setISOWeek', function() {
+ it('sets the ISO week', function() {
+ const result = setISOWeek(new Date(2004, 7 /* Aug */, 7), 53)
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setISOWeek(new Date(2009, 11 /* Dec */, 2).getTime(), 1)
+ assert.deepEqual(result, new Date(2008, 11 /* Dec */, 31))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setISOWeek(new Date(2004, 7 /* Aug */, 7), 53.53)
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = setISOWeek(new Date(2004, 7 /* Aug */, 7), '53')
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ setISOWeek(date, 52)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(4, 0 /* Jan */, 4)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(4, 11 /* Dec */, 26)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = setISOWeek(initialDate, 52)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setISOWeek(new Date(NaN), 53)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setISOWeek(new Date(2004, 7 /* Aug */, 7), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setISOWeek.bind(null), TypeError)
+ assert.throws(setISOWeek.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setISOWeekYear/benchmark.js b/date-fns/src/setISOWeekYear/benchmark.js
new file mode 100644
index 0000000..1f93381
--- /dev/null
+++ b/date-fns/src/setISOWeekYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setISOWeekYear from '.'
+import moment from 'moment'
+
+suite('setISOWeekYear', function () {
+ benchmark('date-fns', function () {
+ return setISOWeekYear(this.date, 2008)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.isoWeekYear(2008)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setISOWeekYear/index.d.ts b/date-fns/src/setISOWeekYear/index.d.ts
new file mode 100644
index 0000000..ab8ea95
--- /dev/null
+++ b/date-fns/src/setISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setISOWeekYear } from 'date-fns'
+export default setISOWeekYear
diff --git a/date-fns/src/setISOWeekYear/index.js.flow b/date-fns/src/setISOWeekYear/index.js.flow
new file mode 100644
index 0000000..43beb65
--- /dev/null
+++ b/date-fns/src/setISOWeekYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, isoWeekYear: number) => Date
diff --git a/date-fns/src/setISOWeekYear/index.ts b/date-fns/src/setISOWeekYear/index.ts
new file mode 100644
index 0000000..20d0051
--- /dev/null
+++ b/date-fns/src/setISOWeekYear/index.ts
@@ -0,0 +1,49 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import startOfISOWeekYear from '../startOfISOWeekYear/index'
+import differenceInCalendarDays from '../differenceInCalendarDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Set the ISO week-numbering year to the given date.
+ *
+ * @description
+ * Set the ISO week-numbering year to the given date,
+ * saving the week number and the weekday number.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `setISOYear` to `setISOWeekYear`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} isoWeekYear - the ISO week-numbering year of the new date
+ * @returns {Date} the new date with the ISO week-numbering year set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set ISO week-numbering year 2007 to 29 December 2008:
+ * const result = setISOWeekYear(new Date(2008, 11, 29), 2007)
+ * //=> Mon Jan 01 2007 00:00:00
+ */
+export default function setISOWeekYear(dirtyDate: Date | number, dirtyISOWeekYear: number): Date {
+ requiredArgs(2, arguments)
+
+ let date = toDate(dirtyDate)
+ const isoWeekYear = toInteger(dirtyISOWeekYear)
+ const diff = differenceInCalendarDays(date, startOfISOWeekYear(date))
+ const fourthOfJanuary = new Date(0)
+ fourthOfJanuary.setFullYear(isoWeekYear, 0, 4)
+ fourthOfJanuary.setHours(0, 0, 0, 0)
+ date = startOfISOWeekYear(fourthOfJanuary)
+ date.setDate(date.getDate() + diff)
+ return date
+}
diff --git a/date-fns/src/setISOWeekYear/test.ts b/date-fns/src/setISOWeekYear/test.ts
new file mode 100644
index 0000000..c5ea154
--- /dev/null
+++ b/date-fns/src/setISOWeekYear/test.ts
@@ -0,0 +1,69 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setISOWeekYear from '.'
+
+describe('setISOWeekYear', function() {
+ it('sets the ISO week-numbering year, saving the ISO week and the day of the week', function() {
+ const result = setISOWeekYear(new Date(2008, 11 /* Dec */, 29), 2007)
+ assert.deepEqual(result, new Date(2007, 0 /* Jan */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setISOWeekYear(new Date(2010, 0 /* Jan */, 2).getTime(), 2004)
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setISOWeekYear(new Date(2008, 11 /* Dec */, 29), 2007.7002)
+ assert.deepEqual(result, new Date(2007, 0 /* Jan */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = setISOWeekYear(new Date(2008, 11 /* Dec */, 29), '2007')
+ assert.deepEqual(result, new Date(2007, 0 /* Jan */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2008, 11 /* Dec */, 29)
+ setISOWeekYear(date, 2000)
+ assert.deepEqual(date, new Date(2008, 11 /* Dec */, 29))
+ })
+
+ it('sets ISO week-numbering years less than 100', function() {
+ const initialDate = new Date(2008, 11 /* Dec */, 29)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(7, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = setISOWeekYear(initialDate, 7)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(8, 11 /* Dec */, 29)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(7, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = setISOWeekYear(initialDate, 7)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setISOWeekYear(new Date(NaN), 2007)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setISOWeekYear(new Date(2008, 11 /* Dec */, 29), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setISOWeekYear.bind(null), TypeError)
+ assert.throws(setISOWeekYear.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setMilliseconds/benchmark.js b/date-fns/src/setMilliseconds/benchmark.js
new file mode 100644
index 0000000..e292c6c
--- /dev/null
+++ b/date-fns/src/setMilliseconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setMilliseconds from '.'
+import moment from 'moment'
+
+suite('setMilliseconds', function () {
+ benchmark('date-fns', function () {
+ return setMilliseconds(this.date, 400)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.milliseconds(400)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setMilliseconds/index.d.ts b/date-fns/src/setMilliseconds/index.d.ts
new file mode 100644
index 0000000..04743a0
--- /dev/null
+++ b/date-fns/src/setMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setMilliseconds } from 'date-fns'
+export default setMilliseconds
diff --git a/date-fns/src/setMilliseconds/index.js.flow b/date-fns/src/setMilliseconds/index.js.flow
new file mode 100644
index 0000000..d9bc57f
--- /dev/null
+++ b/date-fns/src/setMilliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, milliseconds: number) => Date
diff --git a/date-fns/src/setMilliseconds/index.ts b/date-fns/src/setMilliseconds/index.ts
new file mode 100644
index 0000000..2c55c65
--- /dev/null
+++ b/date-fns/src/setMilliseconds/index.ts
@@ -0,0 +1,34 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setMilliseconds
+ * @category Millisecond Helpers
+ * @summary Set the milliseconds to the given date.
+ *
+ * @description
+ * Set the milliseconds to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} milliseconds - the milliseconds of the new date
+ * @returns {Date} the new date with the milliseconds set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set 300 milliseconds to 1 September 2014 11:30:40.500:
+ * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)
+ * //=> Mon Sep 01 2014 11:30:40.300
+ */
+export default function setMilliseconds(dirtyDate: Date | number, dirtyMilliseconds: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const milliseconds = toInteger(dirtyMilliseconds)
+ date.setMilliseconds(milliseconds)
+ return date
+}
diff --git a/date-fns/src/setMilliseconds/test.ts b/date-fns/src/setMilliseconds/test.ts
new file mode 100644
index 0000000..6becea2
--- /dev/null
+++ b/date-fns/src/setMilliseconds/test.ts
@@ -0,0 +1,64 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setMilliseconds from '.'
+
+describe('setMilliseconds', function() {
+ it('sets the milliseconds', function() {
+ const result = setMilliseconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500),
+ 300
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 300))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setMilliseconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 15, 750).getTime(),
+ 755
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 15, 755))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setMilliseconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500),
+ 300.999
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 300))
+ })
+
+ it('implicitly converts number arguments', function() {
+ const result = setMilliseconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500),
+ // @ts-expect-error
+ '300'
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 300))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500)
+ setMilliseconds(date, 137)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setMilliseconds(new Date(NaN), 300)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setMilliseconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500),
+ NaN
+ )
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setMilliseconds.bind(null), TypeError)
+ assert.throws(setMilliseconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setMinutes/benchmark.js b/date-fns/src/setMinutes/benchmark.js
new file mode 100644
index 0000000..679c428
--- /dev/null
+++ b/date-fns/src/setMinutes/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setMinutes from '.'
+import moment from 'moment'
+
+suite('setMinutes', function () {
+ benchmark('date-fns', function () {
+ return setMinutes(this.date, 45)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.minutes(45)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setMinutes/index.d.ts b/date-fns/src/setMinutes/index.d.ts
new file mode 100644
index 0000000..2732d47
--- /dev/null
+++ b/date-fns/src/setMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setMinutes } from 'date-fns'
+export default setMinutes
diff --git a/date-fns/src/setMinutes/index.js b/date-fns/src/setMinutes/index.js
new file mode 100644
index 0000000..2ee7f4b
--- /dev/null
+++ b/date-fns/src/setMinutes/index.js
@@ -0,0 +1,34 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setMinutes
+ * @category Minute Helpers
+ * @summary Set the minutes to the given date.
+ *
+ * @description
+ * Set the minutes to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} minutes - the minutes of the new date
+ * @returns {Date} the new date with the minutes set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set 45 minutes to 1 September 2014 11:30:40:
+ * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)
+ * //=> Mon Sep 01 2014 11:45:40
+ */
+export default function setMinutes(dirtyDate, dirtyMinutes) {
+ requiredArgs(2, arguments)
+
+ var date = toDate(dirtyDate)
+ var minutes = toInteger(dirtyMinutes)
+ date.setMinutes(minutes)
+ return date
+}
diff --git a/date-fns/src/setMinutes/index.js.flow b/date-fns/src/setMinutes/index.js.flow
new file mode 100644
index 0000000..5231232
--- /dev/null
+++ b/date-fns/src/setMinutes/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, minutes: number) => Date
diff --git a/date-fns/src/setMinutes/test.js b/date-fns/src/setMinutes/test.js
new file mode 100644
index 0000000..0a1819c
--- /dev/null
+++ b/date-fns/src/setMinutes/test.js
@@ -0,0 +1,49 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setMinutes from '.'
+
+describe('setMinutes', function() {
+ it('sets the minutes', function() {
+ var result = setMinutes(new Date(2014, 8 /* Sep */, 1, 11, 30, 40), 45)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 45, 40))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = setMinutes(new Date(2014, 8 /* Sep */, 1, 11, 30).getTime(), 5)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 5))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ var result = setMinutes(new Date(2014, 8 /* Sep */, 1, 11, 30, 40), 45.54)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 45, 40))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ var result = setMinutes(new Date(2014, 8 /* Sep */, 1, 11, 30, 40), '45')
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 45, 40))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 8 /* Sep */, 1, 11, 30)
+ setMinutes(date, 15)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1, 11, 30))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = setMinutes(new Date(NaN), 45)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ var result = setMinutes(new Date(2014, 8 /* Sep */, 1, 11, 30, 40), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setMinutes.bind(null), TypeError)
+ assert.throws(setMinutes.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setMonth/benchmark.js b/date-fns/src/setMonth/benchmark.js
new file mode 100644
index 0000000..0113f1f
--- /dev/null
+++ b/date-fns/src/setMonth/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setMonth from '.'
+import moment from 'moment'
+
+suite('setMonth', function () {
+ benchmark('date-fns', function () {
+ return setMonth(this.date, 6)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.month(6)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setMonth/index.d.ts b/date-fns/src/setMonth/index.d.ts
new file mode 100644
index 0000000..720d61c
--- /dev/null
+++ b/date-fns/src/setMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setMonth } from 'date-fns'
+export default setMonth
diff --git a/date-fns/src/setMonth/index.js.flow b/date-fns/src/setMonth/index.js.flow
new file mode 100644
index 0000000..29bd4de
--- /dev/null
+++ b/date-fns/src/setMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, month: number) => Date
diff --git a/date-fns/src/setMonth/index.ts b/date-fns/src/setMonth/index.ts
new file mode 100644
index 0000000..c625378
--- /dev/null
+++ b/date-fns/src/setMonth/index.ts
@@ -0,0 +1,44 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import getDaysInMonth from '../getDaysInMonth/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setMonth
+ * @category Month Helpers
+ * @summary Set the month to the given date.
+ *
+ * @description
+ * Set the month to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} month - the month of the new date
+ * @returns {Date} the new date with the month set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set February to 1 September 2014:
+ * const result = setMonth(new Date(2014, 8, 1), 1)
+ * //=> Sat Feb 01 2014 00:00:00
+ */
+export default function setMonth(dirtyDate: Date | number, dirtyMonth: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const month = toInteger(dirtyMonth)
+ const year = date.getFullYear()
+ const day = date.getDate()
+
+ const dateWithDesiredMonth = new Date(0)
+ dateWithDesiredMonth.setFullYear(year, month, 15)
+ dateWithDesiredMonth.setHours(0, 0, 0, 0)
+ const daysInMonth = getDaysInMonth(dateWithDesiredMonth)
+ // Set the last day of the new month
+ // if the original date was the last day of the longer month
+ date.setMonth(month, Math.min(day, daysInMonth))
+ return date
+}
diff --git a/date-fns/src/setMonth/test.ts b/date-fns/src/setMonth/test.ts
new file mode 100644
index 0000000..75d61db
--- /dev/null
+++ b/date-fns/src/setMonth/test.ts
@@ -0,0 +1,65 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setMonth from '.'
+
+describe('setMonth', function() {
+ it('sets the month', function() {
+ const result = setMonth(new Date(2014, 8 /* Sep */, 1), 1)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 1))
+ })
+
+ it('sets the last day of the month if the original date was the last day of a longer month', function() {
+ const result = setMonth(new Date(2014, 11 /* Dec */, 31), 1)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 28))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setMonth(new Date(2014, 8 /* Sep */, 1).getTime(), 11)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setMonth(new Date(2014, 8 /* Sep */, 1), 1.5)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = setMonth(new Date(2014, 8 /* Sep */, 1), '1')
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ setMonth(date, 5)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(0, 11 /* Dec */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 1 /* Feb */, 29)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = setMonth(initialDate, 1)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setMonth(new Date(NaN), 1)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setMonth(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setMonth.bind(null), TypeError)
+ assert.throws(setMonth.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setQuarter/benchmark.js b/date-fns/src/setQuarter/benchmark.js
new file mode 100644
index 0000000..695a480
--- /dev/null
+++ b/date-fns/src/setQuarter/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setQuarter from '.'
+import moment from 'moment'
+
+suite('setQuarter', function () {
+ benchmark('date-fns', function () {
+ return setQuarter(this.date, 3)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.quarter(3)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setQuarter/index.d.ts b/date-fns/src/setQuarter/index.d.ts
new file mode 100644
index 0000000..7e98fc9
--- /dev/null
+++ b/date-fns/src/setQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setQuarter } from 'date-fns'
+export default setQuarter
diff --git a/date-fns/src/setQuarter/index.js.flow b/date-fns/src/setQuarter/index.js.flow
new file mode 100644
index 0000000..d0e4d51
--- /dev/null
+++ b/date-fns/src/setQuarter/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, quarter: number) => Date
diff --git a/date-fns/src/setQuarter/index.ts b/date-fns/src/setQuarter/index.ts
new file mode 100644
index 0000000..3fb765d
--- /dev/null
+++ b/date-fns/src/setQuarter/index.ts
@@ -0,0 +1,36 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import setMonth from '../setMonth/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setQuarter
+ * @category Quarter Helpers
+ * @summary Set the year quarter to the given date.
+ *
+ * @description
+ * Set the year quarter to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} quarter - the quarter of the new date
+ * @returns {Date} the new date with the quarter set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set the 2nd quarter to 2 July 2014:
+ * const result = setQuarter(new Date(2014, 6, 2), 2)
+ * //=> Wed Apr 02 2014 00:00:00
+ */
+export default function setQuarter(dirtyDate: Date | number, dirtyQuarter: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const quarter = toInteger(dirtyQuarter)
+ const oldQuarter = Math.floor(date.getMonth() / 3) + 1
+ const diff = quarter - oldQuarter
+ return setMonth(date, date.getMonth() + diff * 3)
+}
diff --git a/date-fns/src/setQuarter/test.ts b/date-fns/src/setQuarter/test.ts
new file mode 100644
index 0000000..dc47195
--- /dev/null
+++ b/date-fns/src/setQuarter/test.ts
@@ -0,0 +1,65 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setQuarter from '.'
+
+describe('setQuarter', function() {
+ it('sets the quarter of the year', function() {
+ const result = setQuarter(new Date(2014, 6 /* Jul */, 2), 1)
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
+ })
+
+ it('sets the last day of the month if the original date was the last day of a longer month', function() {
+ const result = setQuarter(new Date(2014, 10 /* Nov */, 30), 1)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 28))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setQuarter(new Date(2014, 6 /* Jul */, 1).getTime(), 4)
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setQuarter(new Date(2014, 6 /* Jul */, 2), 1.951)
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = setQuarter(new Date(2014, 6 /* Jul */, 2), '1')
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 2))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 1)
+ setQuarter(date, 2)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 1))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(0, 10 /* Nov */, 30)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 1 /* Feb */, 29)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = setQuarter(initialDate, 1)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setQuarter(new Date(NaN), 1)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setQuarter(new Date(2014, 6 /* Jul */, 2), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setQuarter.bind(null), TypeError)
+ assert.throws(setQuarter.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setSeconds/benchmark.js b/date-fns/src/setSeconds/benchmark.js
new file mode 100644
index 0000000..41733f2
--- /dev/null
+++ b/date-fns/src/setSeconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setSeconds from '.'
+import moment from 'moment'
+
+suite('setSeconds', function () {
+ benchmark('date-fns', function () {
+ return setSeconds(this.date, 15)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.seconds(15)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setSeconds/index.d.ts b/date-fns/src/setSeconds/index.d.ts
new file mode 100644
index 0000000..a67a07f
--- /dev/null
+++ b/date-fns/src/setSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setSeconds } from 'date-fns'
+export default setSeconds
diff --git a/date-fns/src/setSeconds/index.js.flow b/date-fns/src/setSeconds/index.js.flow
new file mode 100644
index 0000000..056c068
--- /dev/null
+++ b/date-fns/src/setSeconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, seconds: number) => Date
diff --git a/date-fns/src/setSeconds/index.ts b/date-fns/src/setSeconds/index.ts
new file mode 100644
index 0000000..5ed16a0
--- /dev/null
+++ b/date-fns/src/setSeconds/index.ts
@@ -0,0 +1,34 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setSeconds
+ * @category Second Helpers
+ * @summary Set the seconds to the given date.
+ *
+ * @description
+ * Set the seconds to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} seconds - the seconds of the new date
+ * @returns {Date} the new date with the seconds set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set 45 seconds to 1 September 2014 11:30:40:
+ * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
+ * //=> Mon Sep 01 2014 11:30:45
+ */
+export default function setSeconds(dirtyDate: Date | number, dirtySeconds: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const seconds = toInteger(dirtySeconds)
+ date.setSeconds(seconds)
+ return date
+}
diff --git a/date-fns/src/setSeconds/test.ts b/date-fns/src/setSeconds/test.ts
new file mode 100644
index 0000000..855398d
--- /dev/null
+++ b/date-fns/src/setSeconds/test.ts
@@ -0,0 +1,61 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setSeconds from '.'
+
+describe('setSeconds', function() {
+ it('sets the seconds', function() {
+ const result = setSeconds(new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500), 45)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 45, 500))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setSeconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 15).getTime(),
+ 45
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 45))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setSeconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500),
+ 45.54
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 45, 500))
+ })
+
+ it('implicitly converts number arguments', function() {
+ const result = setSeconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500),
+ // @ts-expect-error
+ '45'
+ )
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 11, 30, 45, 500))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1, 11, 30, 40)
+ setSeconds(date, 15)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1, 11, 30, 40))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setSeconds(new Date(NaN), 45)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setSeconds(
+ new Date(2014, 8 /* Sep */, 1, 11, 30, 40, 500),
+ NaN
+ )
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setSeconds.bind(null), TypeError)
+ assert.throws(setSeconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setWeek/index.d.ts b/date-fns/src/setWeek/index.d.ts
new file mode 100644
index 0000000..b6c90f3
--- /dev/null
+++ b/date-fns/src/setWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setWeek } from 'date-fns'
+export default setWeek
diff --git a/date-fns/src/setWeek/index.js b/date-fns/src/setWeek/index.js
new file mode 100644
index 0000000..568d088
--- /dev/null
+++ b/date-fns/src/setWeek/index.js
@@ -0,0 +1,58 @@
+import getWeek from '../getWeek/index'
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setWeek
+ * @category Week Helpers
+ * @summary Set the local week to the given date.
+ *
+ * @description
+ * Set the local week to the given date, saving the weekday number.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} week - the week of the new date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
+ * @returns {Date} the new date with the local week set
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ *
+ * @example
+ * // Set the 1st week to 2 January 2005 with default options:
+ * var result = setWeek(new Date(2005, 0, 2), 1)
+ * //=> Sun Dec 26 2004 00:00:00
+ *
+ * @example
+ * // Set the 1st week to 2 January 2005,
+ * // if Monday is the first day of the week,
+ * // and the first week of the year always contains 4 January:
+ * var result = setWeek(new Date(2005, 0, 2), 1, {
+ * weekStartsOn: 1,
+ * firstWeekContainsDate: 4
+ * })
+ * //=> Sun Jan 4 2004 00:00:00
+ */
+export default function setWeek(dirtyDate, dirtyWeek, dirtyOptions) {
+ requiredArgs(2, arguments)
+
+ var date = toDate(dirtyDate)
+ var week = toInteger(dirtyWeek)
+ var diff = getWeek(date, dirtyOptions) - week
+ date.setDate(date.getDate() - diff * 7)
+ return date
+}
diff --git a/date-fns/src/setWeek/index.js.flow b/date-fns/src/setWeek/index.js.flow
new file mode 100644
index 0000000..59b7eb3
--- /dev/null
+++ b/date-fns/src/setWeek/index.js.flow
@@ -0,0 +1,60 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ week: number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+) => Date
diff --git a/date-fns/src/setWeek/test.js b/date-fns/src/setWeek/test.js
new file mode 100644
index 0000000..dbf30d6
--- /dev/null
+++ b/date-fns/src/setWeek/test.js
@@ -0,0 +1,100 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setWeek from '.'
+
+describe('setWeek', function() {
+ it('sets the local week', function() {
+ var result = setWeek(new Date(2005, 0 /* Jan */, 2), 1)
+ assert.deepEqual(result, new Date(2004, 11 /* Dec */, 26))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = setWeek(new Date(2009, 11 /* Dec */, 2).getTime(), 1)
+ assert.deepEqual(result, new Date(2008, 11 /* Dec */, 31))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ var result = setWeek(new Date(2005, 0 /* Jan */, 2), 1.9)
+ assert.deepEqual(result, new Date(2004, 11 /* Dec */, 26))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ var result = setWeek(new Date(2004, 7 /* Aug */, 7), '53')
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ setWeek(date, 52)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setFullYear(4, 0 /* Jan */, 4)
+ initialDate.setHours(0, 0, 0, 0)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(4, 11 /* Dec */, 19)
+ expectedResult.setHours(0, 0, 0, 0)
+ var result = setWeek(initialDate, 52)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = setWeek(new Date(NaN), 53)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ var result = setWeek(new Date(2004, 7 /* Aug */, 7), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function() {
+ var date = new Date(2005, 0 /* Jan */, 2)
+ var result = setWeek(date, 1, {
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert.deepEqual(result, new Date(2004, 0 /* Jan */, 4))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var date = new Date(2005, 0 /* Jan */, 2)
+ var result = setWeek(date, 1, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert.deepEqual(result, new Date(2004, 0 /* Jan */, 4))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ // $ExpectedMistake
+ var block = setWeek.bind(null, new Date(2004, 7 /* Aug */, 7), 53, {
+ weekStartsOn: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function() {
+ // $ExpectedMistake
+ var block = setWeek.bind(null, new Date(2004, 7 /* Aug */, 7), 53, {
+ firstWeekContainsDate: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setWeek.bind(null), TypeError)
+ assert.throws(setWeek.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setWeekYear/index.d.ts b/date-fns/src/setWeekYear/index.d.ts
new file mode 100644
index 0000000..af02252
--- /dev/null
+++ b/date-fns/src/setWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setWeekYear } from 'date-fns'
+export default setWeekYear
diff --git a/date-fns/src/setWeekYear/index.js b/date-fns/src/setWeekYear/index.js
new file mode 100644
index 0000000..2699706
--- /dev/null
+++ b/date-fns/src/setWeekYear/index.js
@@ -0,0 +1,77 @@
+import differenceInCalendarDays from '../differenceInCalendarDays/index'
+import startOfWeekYear from '../startOfWeekYear/index'
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setWeekYear
+ * @category Week-Numbering Year Helpers
+ * @summary Set the local week-numbering year to the given date.
+ *
+ * @description
+ * Set the local week-numbering year to the given date,
+ * saving the week number and the weekday number.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} weekYear - the local week-numbering year of the new date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
+ * @returns {Date} the new date with the local week-numbering year set
+ * @throws {TypeError} 2 arguments required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ *
+ * @example
+ * // Set the local week-numbering year 2004 to 2 January 2010 with default options:
+ * var result = setWeekYear(new Date(2010, 0, 2), 2004)
+ * //=> Sat Jan 03 2004 00:00:00
+ *
+ * @example
+ * // Set the local week-numbering year 2004 to 2 January 2010,
+ * // if Monday is the first day of week
+ * // and 4 January is always in the first week of the year:
+ * var result = setWeekYear(new Date(2010, 0, 2), 2004, {
+ * weekStartsOn: 1,
+ * firstWeekContainsDate: 4
+ * })
+ * //=> Sat Jan 01 2005 00:00:00
+ */
+export default function setWeekYear(dirtyDate, dirtyWeekYear, dirtyOptions) {
+ requiredArgs(2, arguments)
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeFirstWeekContainsDate =
+ locale && locale.options && locale.options.firstWeekContainsDate
+ var defaultFirstWeekContainsDate =
+ localeFirstWeekContainsDate == null
+ ? 1
+ : toInteger(localeFirstWeekContainsDate)
+ var firstWeekContainsDate =
+ options.firstWeekContainsDate == null
+ ? defaultFirstWeekContainsDate
+ : toInteger(options.firstWeekContainsDate)
+
+ var date = toDate(dirtyDate)
+ var weekYear = toInteger(dirtyWeekYear)
+ var diff = differenceInCalendarDays(date, startOfWeekYear(date, dirtyOptions))
+ var firstWeek = new Date(0)
+ firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate)
+ firstWeek.setHours(0, 0, 0, 0)
+ date = startOfWeekYear(firstWeek, dirtyOptions)
+ date.setDate(date.getDate() + diff)
+ return date
+}
diff --git a/date-fns/src/setWeekYear/index.js.flow b/date-fns/src/setWeekYear/index.js.flow
new file mode 100644
index 0000000..12a9d84
--- /dev/null
+++ b/date-fns/src/setWeekYear/index.js.flow
@@ -0,0 +1,60 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ weekYear: number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+) => Date
diff --git a/date-fns/src/setWeekYear/test.js b/date-fns/src/setWeekYear/test.js
new file mode 100644
index 0000000..a493412
--- /dev/null
+++ b/date-fns/src/setWeekYear/test.js
@@ -0,0 +1,109 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setWeekYear from '.'
+
+describe('setWeekYear', function() {
+ it('sets the local week-numbering year, saving the week and the day of the week', function() {
+ var result = setWeekYear(new Date(2010, 0 /* Jan */, 2), 2004)
+ assert.deepEqual(result, new Date(2004, 0 /* Jan */, 3))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = setWeekYear(new Date(2008, 11 /* Dec */, 29).getTime(), 2007)
+ assert.deepEqual(result, new Date(2007, 0 /* Jan */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ var result = setWeekYear(new Date(2010, 0 /* Jan */, 2), 2004.2004)
+ assert.deepEqual(result, new Date(2004, 0 /* Jan */, 3))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ var result = setWeekYear(new Date(2008, 11 /* Dec */, 29), '2007')
+ assert.deepEqual(result, new Date(2007, 0 /* Jan */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2008, 11 /* Dec */, 29)
+ setWeekYear(date, 2000)
+ assert.deepEqual(date, new Date(2008, 11 /* Dec */, 29))
+ })
+
+ it('sets local week-numbering years less than 100', function() {
+ var initialDate = new Date(2008, 11 /* Dec */, 29)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(7, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ var result = setWeekYear(initialDate, 7)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setFullYear(8, 11 /* Dec */, 29)
+ initialDate.setHours(0, 0, 0, 0)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(7, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ var result = setWeekYear(initialDate, 7)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = setWeekYear(new Date(NaN), 2007)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ var result = setWeekYear(new Date(2008, 11 /* Dec */, 29), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function() {
+ var date = new Date(2010, 0 /* Jan */, 2)
+ var result = setWeekYear(date, 2004, {
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var date = new Date(2010, 0 /* Jan */, 2)
+ var result = setWeekYear(date, 2004, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 1))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ // $ExpectedMistake
+ var block = setWeekYear.bind(null, new Date(2004, 7 /* Aug */, 7), 2018, {
+ weekStartsOn: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function() {
+ // $ExpectedMistake
+ var block = setWeekYear.bind(null, new Date(2004, 7 /* Aug */, 7), 2018, {
+ firstWeekContainsDate: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setWeekYear.bind(null), TypeError)
+ assert.throws(setWeekYear.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/setYear/benchmark.js b/date-fns/src/setYear/benchmark.js
new file mode 100644
index 0000000..8d20c7e
--- /dev/null
+++ b/date-fns/src/setYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import setYear from '.'
+import moment from 'moment'
+
+suite('setYear', function () {
+ benchmark('date-fns', function () {
+ return setYear(this.date, 2014)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.year(2014)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/setYear/index.d.ts b/date-fns/src/setYear/index.d.ts
new file mode 100644
index 0000000..e0a76fb
--- /dev/null
+++ b/date-fns/src/setYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { setYear } from 'date-fns'
+export default setYear
diff --git a/date-fns/src/setYear/index.js.flow b/date-fns/src/setYear/index.js.flow
new file mode 100644
index 0000000..ebdcafe
--- /dev/null
+++ b/date-fns/src/setYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, year: number) => Date
diff --git a/date-fns/src/setYear/index.ts b/date-fns/src/setYear/index.ts
new file mode 100644
index 0000000..729fcd0
--- /dev/null
+++ b/date-fns/src/setYear/index.ts
@@ -0,0 +1,40 @@
+import toInteger from '../_lib/toInteger/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name setYear
+ * @category Year Helpers
+ * @summary Set the year to the given date.
+ *
+ * @description
+ * Set the year to the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} year - the year of the new date
+ * @returns {Date} the new date with the year set
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Set year 2013 to 1 September 2014:
+ * const result = setYear(new Date(2014, 8, 1), 2013)
+ * //=> Sun Sep 01 2013 00:00:00
+ */
+export default function setYear(dirtyDate: Date | number, dirtyYear: number): Date {
+ requiredArgs(2, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = toInteger(dirtyYear)
+
+ // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
+ if (isNaN(date.getTime())) {
+ return new Date(NaN)
+ }
+
+ date.setFullYear(year)
+ return date
+}
diff --git a/date-fns/src/setYear/test.ts b/date-fns/src/setYear/test.ts
new file mode 100644
index 0000000..d30a712
--- /dev/null
+++ b/date-fns/src/setYear/test.ts
@@ -0,0 +1,49 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import setYear from '.'
+
+describe('setYear', function() {
+ it('sets the year', function() {
+ const result = setYear(new Date(2014, 8 /* Sep */, 1), 2013)
+ assert.deepEqual(result, new Date(2013, 8 /* Sep */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = setYear(new Date(2014, 8 /* Sep */, 1).getTime(), 2016)
+ assert.deepEqual(result, new Date(2016, 8 /* Sep */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = setYear(new Date(2014, 8 /* Sep */, 1), 2013.987654321)
+ assert.deepEqual(result, new Date(2013, 8 /* Sep */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // @ts-expect-error
+ const result = setYear(new Date(2014, 8 /* Sep */, 1), '2013')
+ assert.deepEqual(result, new Date(2013, 8 /* Sep */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 8 /* Sep */, 1)
+ setYear(date, 2011)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = setYear(new Date(NaN), 2013)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = setYear(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result.getTime()))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(setYear.bind(null), TypeError)
+ assert.throws(setYear.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfDay/benchmark.js b/date-fns/src/startOfDay/benchmark.js
new file mode 100644
index 0000000..580f043
--- /dev/null
+++ b/date-fns/src/startOfDay/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfDay from '.'
+import moment from 'moment'
+
+suite('startOfDay', function () {
+ benchmark('date-fns', function () {
+ return startOfDay(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('day')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfDay/index.d.ts b/date-fns/src/startOfDay/index.d.ts
new file mode 100644
index 0000000..4463069
--- /dev/null
+++ b/date-fns/src/startOfDay/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfDay } from 'date-fns'
+export default startOfDay
diff --git a/date-fns/src/startOfDay/index.js.flow b/date-fns/src/startOfDay/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfDay/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfDay/index.ts b/date-fns/src/startOfDay/index.ts
new file mode 100644
index 0000000..0292c47
--- /dev/null
+++ b/date-fns/src/startOfDay/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfDay
+ * @category Day Helpers
+ * @summary Return the start of a day for the given date.
+ *
+ * @description
+ * Return the start of a day for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of a day
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of a day for 2 September 2014 11:55:00:
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Sep 02 2014 00:00:00
+ */
+export default function startOfDay(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfDay/test.ts b/date-fns/src/startOfDay/test.ts
new file mode 100644
index 0000000..a699302
--- /dev/null
+++ b/date-fns/src/startOfDay/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfDay from '.'
+
+describe('startOfDay', function() {
+ it('returns the date with the time set to 00:00:00', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfDay(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 0, 0, 0, 0))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = startOfDay(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 0, 0, 0, 0))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ startOfDay(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfDay(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfDay.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfDecade/benchmark.js b/date-fns/src/startOfDecade/benchmark.js
new file mode 100644
index 0000000..2f3acb5
--- /dev/null
+++ b/date-fns/src/startOfDecade/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfDecade from '.'
+
+suite('startOfDecade', function () {
+ benchmark('date-fns', function () {
+ return startOfDecade(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/startOfDecade/index.d.ts b/date-fns/src/startOfDecade/index.d.ts
new file mode 100644
index 0000000..c4309c3
--- /dev/null
+++ b/date-fns/src/startOfDecade/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfDecade } from 'date-fns'
+export default startOfDecade
diff --git a/date-fns/src/startOfDecade/index.js.flow b/date-fns/src/startOfDecade/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfDecade/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfDecade/index.ts b/date-fns/src/startOfDecade/index.ts
new file mode 100644
index 0000000..fc6c0ac
--- /dev/null
+++ b/date-fns/src/startOfDecade/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfDecade
+ * @category Decade Helpers
+ * @summary Return the start of a decade for the given date.
+ *
+ * @description
+ * Return the start of a decade for the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of a decade
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of a decade for 21 October 2015 00:00:00:
+ * const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00))
+ * //=> Jan 01 2010 00:00:00
+ */
+export default function startOfDecade(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const year = date.getFullYear()
+ const decade = Math.floor(year / 10) * 10
+ date.setFullYear(decade, 0, 1)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfDecade/test.ts b/date-fns/src/startOfDecade/test.ts
new file mode 100644
index 0000000..b9f7dee
--- /dev/null
+++ b/date-fns/src/startOfDecade/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfDecade from '.'
+
+describe('startOfDecade', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a year', function() {
+ const date = new Date(1953, 3 /* Apr */, 13)
+ const result = startOfDecade(date)
+ assert.deepEqual(result, new Date(1950, 0 /* Jan */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(1984, 9 /* Oct */, 14).getTime()
+ const result = startOfDecade(date)
+ assert.deepEqual(result, new Date(1980, 0 /* Jan */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(1978, 10 /* Nov */, 14)
+ startOfDecade(date)
+ assert.deepEqual(date, new Date(1978, 10 /* Nov */, 14))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfDecade(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfDecade.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfHour/benchmark.js b/date-fns/src/startOfHour/benchmark.js
new file mode 100644
index 0000000..3832c48
--- /dev/null
+++ b/date-fns/src/startOfHour/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfHour from '.'
+import moment from 'moment'
+
+suite('startOfHour', function () {
+ benchmark('date-fns', function () {
+ return startOfHour(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('hour')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfHour/index.d.ts b/date-fns/src/startOfHour/index.d.ts
new file mode 100644
index 0000000..d1cc503
--- /dev/null
+++ b/date-fns/src/startOfHour/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfHour } from 'date-fns'
+export default startOfHour
diff --git a/date-fns/src/startOfHour/index.js.flow b/date-fns/src/startOfHour/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfHour/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfHour/index.ts b/date-fns/src/startOfHour/index.ts
new file mode 100644
index 0000000..5221e61
--- /dev/null
+++ b/date-fns/src/startOfHour/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfHour
+ * @category Hour Helpers
+ * @summary Return the start of an hour for the given date.
+ *
+ * @description
+ * Return the start of an hour for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of an hour
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of an hour for 2 September 2014 11:55:00:
+ * const result = startOfHour(new Date(2014, 8, 2, 11, 55))
+ * //=> Tue Sep 02 2014 11:00:00
+ */
+export default function startOfHour(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setMinutes(0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfHour/test.ts b/date-fns/src/startOfHour/test.ts
new file mode 100644
index 0000000..61dcff9
--- /dev/null
+++ b/date-fns/src/startOfHour/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfHour from '.'
+
+describe('startOfHour', function() {
+ it('returns the date with the time set to the first millisecond of an hour', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55)
+ const result = startOfHour(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 11))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55)
+ startOfHour(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55).getTime()
+ const result = startOfHour(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 2, 11))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfHour(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfHour.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfISOWeek/benchmark.js b/date-fns/src/startOfISOWeek/benchmark.js
new file mode 100644
index 0000000..2ddb09b
--- /dev/null
+++ b/date-fns/src/startOfISOWeek/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfISOWeek from '.'
+import moment from 'moment'
+
+suite('startOfISOWeek', function () {
+ benchmark('date-fns', function () {
+ return startOfISOWeek(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('isoWeek')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfISOWeek/index.d.ts b/date-fns/src/startOfISOWeek/index.d.ts
new file mode 100644
index 0000000..93e573a
--- /dev/null
+++ b/date-fns/src/startOfISOWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfISOWeek } from 'date-fns'
+export default startOfISOWeek
diff --git a/date-fns/src/startOfISOWeek/index.js.flow b/date-fns/src/startOfISOWeek/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfISOWeek/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfISOWeek/index.ts b/date-fns/src/startOfISOWeek/index.ts
new file mode 100644
index 0000000..e4d8718
--- /dev/null
+++ b/date-fns/src/startOfISOWeek/index.ts
@@ -0,0 +1,32 @@
+import startOfWeek from '../startOfWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfISOWeek
+ * @category ISO Week Helpers
+ * @summary Return the start of an ISO week for the given date.
+ *
+ * @description
+ * Return the start of an ISO week for the given date.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of an ISO week
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of an ISO week for 2 September 2014 11:55:00:
+ * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+export default function startOfISOWeek(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ return startOfWeek(dirtyDate, { weekStartsOn: 1 })
+}
diff --git a/date-fns/src/startOfISOWeek/test.ts b/date-fns/src/startOfISOWeek/test.ts
new file mode 100644
index 0000000..6e96187
--- /dev/null
+++ b/date-fns/src/startOfISOWeek/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfISOWeek from '.'
+
+describe('startOfISOWeek', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of an ISO week', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfISOWeek(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 1 /* Feb */, 11, 11, 55, 0).getTime()
+ const result = startOfISOWeek(date)
+ assert.deepEqual(result, new Date(2014, 1 /* Feb */, 10))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ startOfISOWeek(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfISOWeek(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfISOWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfISOWeekYear/benchmark.js b/date-fns/src/startOfISOWeekYear/benchmark.js
new file mode 100644
index 0000000..754d6c9
--- /dev/null
+++ b/date-fns/src/startOfISOWeekYear/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfISOWeekYear from '.'
+
+suite('startOfISOWeekYear', function () {
+ benchmark('date-fns', function () {
+ return startOfISOWeekYear(this.date)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/startOfISOWeekYear/index.d.ts b/date-fns/src/startOfISOWeekYear/index.d.ts
new file mode 100644
index 0000000..c29d7d0
--- /dev/null
+++ b/date-fns/src/startOfISOWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfISOWeekYear } from 'date-fns'
+export default startOfISOWeekYear
diff --git a/date-fns/src/startOfISOWeekYear/index.js.flow b/date-fns/src/startOfISOWeekYear/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfISOWeekYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfISOWeekYear/index.ts b/date-fns/src/startOfISOWeekYear/index.ts
new file mode 100644
index 0000000..9417ed4
--- /dev/null
+++ b/date-fns/src/startOfISOWeekYear/index.ts
@@ -0,0 +1,39 @@
+import getISOWeekYear from '../getISOWeekYear/index'
+import startOfISOWeek from '../startOfISOWeek/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfISOWeekYear
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Return the start of an ISO week-numbering year for the given date.
+ *
+ * @description
+ * Return the start of an ISO week-numbering year,
+ * which always starts 3 days before the year's first Thursday.
+ * The result will be in the local timezone.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of an ISO week-numbering year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of an ISO week-numbering year for 2 July 2005:
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
+ * //=> Mon Jan 03 2005 00:00:00
+ */
+export default function startOfISOWeekYear(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const year = getISOWeekYear(dirtyDate)
+ const fourthOfJanuary = new Date(0)
+ fourthOfJanuary.setFullYear(year, 0, 4)
+ fourthOfJanuary.setHours(0, 0, 0, 0)
+ const date = startOfISOWeek(fourthOfJanuary)
+ return date
+}
diff --git a/date-fns/src/startOfISOWeekYear/test.ts b/date-fns/src/startOfISOWeekYear/test.ts
new file mode 100644
index 0000000..104c632
--- /dev/null
+++ b/date-fns/src/startOfISOWeekYear/test.ts
@@ -0,0 +1,51 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfISOWeekYear from '.'
+
+describe('startOfISOWeekYear', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of an ISO year', function() {
+ const result = startOfISOWeekYear(new Date(2009, 0 /* Jan */, 1, 16, 0))
+ assert.deepEqual(result, new Date(2008, 11 /* Dec */, 29, 0, 0, 0, 0))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = startOfISOWeekYear(
+ new Date(2005, 0 /* Jan */, 1, 6, 0).getTime()
+ )
+ assert.deepEqual(result, new Date(2003, 11 /* Dec */, 29, 0, 0, 0, 0))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 2)
+ startOfISOWeekYear(date)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(9, 0 /* Jan */, 1)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(8, 11 /* Dec */, 29)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = startOfISOWeekYear(initialDate)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('correctly handles years in which 4 January is Sunday', function() {
+ const result = startOfISOWeekYear(new Date(2009, 6 /* Jul */, 2))
+ assert.deepEqual(result, new Date(2008, 11 /* Dec */, 29))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfISOWeekYear(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfISOWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfMinute/benchmark.js b/date-fns/src/startOfMinute/benchmark.js
new file mode 100644
index 0000000..af501d4
--- /dev/null
+++ b/date-fns/src/startOfMinute/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfMinute from '.'
+import moment from 'moment'
+
+suite('startOfMinute', function () {
+ benchmark('date-fns', function () {
+ return startOfMinute(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('minute')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfMinute/index.d.ts b/date-fns/src/startOfMinute/index.d.ts
new file mode 100644
index 0000000..1b96683
--- /dev/null
+++ b/date-fns/src/startOfMinute/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfMinute } from 'date-fns'
+export default startOfMinute
diff --git a/date-fns/src/startOfMinute/index.js.flow b/date-fns/src/startOfMinute/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfMinute/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfMinute/index.ts b/date-fns/src/startOfMinute/index.ts
new file mode 100644
index 0000000..87d6a12
--- /dev/null
+++ b/date-fns/src/startOfMinute/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfMinute
+ * @category Minute Helpers
+ * @summary Return the start of a minute for the given date.
+ *
+ * @description
+ * Return the start of a minute for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of a minute
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of a minute for 1 December 2014 22:15:45.400:
+ * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))
+ * //=> Mon Dec 01 2014 22:15:00
+ */
+export default function startOfMinute(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setSeconds(0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfMinute/test.ts b/date-fns/src/startOfMinute/test.ts
new file mode 100644
index 0000000..b362e36
--- /dev/null
+++ b/date-fns/src/startOfMinute/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfMinute from '.'
+
+describe('startOfMinute', function() {
+ it('returns the date with the time set to the first millisecond of a minute', function() {
+ const date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
+ const result = startOfMinute(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 11 /* Dec */, 1, 22, 15).getTime()
+ const result = startOfMinute(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
+ startOfMinute(date)
+ assert.deepEqual(date, new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfMinute(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfMinute.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfMonth/benchmark.js b/date-fns/src/startOfMonth/benchmark.js
new file mode 100644
index 0000000..d8caa25
--- /dev/null
+++ b/date-fns/src/startOfMonth/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfMonth from '.'
+import moment from 'moment'
+
+suite('startOfMonth', function () {
+ benchmark('date-fns', function () {
+ return startOfMonth(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('month')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfMonth/index.d.ts b/date-fns/src/startOfMonth/index.d.ts
new file mode 100644
index 0000000..08de436
--- /dev/null
+++ b/date-fns/src/startOfMonth/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfMonth } from 'date-fns'
+export default startOfMonth
diff --git a/date-fns/src/startOfMonth/index.js.flow b/date-fns/src/startOfMonth/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfMonth/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfMonth/index.ts b/date-fns/src/startOfMonth/index.ts
new file mode 100644
index 0000000..1a64f6c
--- /dev/null
+++ b/date-fns/src/startOfMonth/index.ts
@@ -0,0 +1,33 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfMonth
+ * @category Month Helpers
+ * @summary Return the start of a month for the given date.
+ *
+ * @description
+ * Return the start of a month for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of a month
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of a month for 2 September 2014 11:55:00:
+ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+export default function startOfMonth(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setDate(1)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfMonth/test.ts b/date-fns/src/startOfMonth/test.ts
new file mode 100644
index 0000000..0251552
--- /dev/null
+++ b/date-fns/src/startOfMonth/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfMonth from '.'
+
+describe('startOfMonth', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a month', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = startOfMonth(date)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ startOfMonth(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfMonth(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfMonth.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfQuarter/benchmark.js b/date-fns/src/startOfQuarter/benchmark.js
new file mode 100644
index 0000000..fc99fa0
--- /dev/null
+++ b/date-fns/src/startOfQuarter/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfQuarter from '.'
+import moment from 'moment'
+
+suite('startOfQuarter', function () {
+ benchmark('date-fns', function () {
+ return startOfQuarter(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('quarter')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfQuarter/index.d.ts b/date-fns/src/startOfQuarter/index.d.ts
new file mode 100644
index 0000000..7afa727
--- /dev/null
+++ b/date-fns/src/startOfQuarter/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfQuarter } from 'date-fns'
+export default startOfQuarter
diff --git a/date-fns/src/startOfQuarter/index.js.flow b/date-fns/src/startOfQuarter/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfQuarter/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfQuarter/index.ts b/date-fns/src/startOfQuarter/index.ts
new file mode 100644
index 0000000..c61c2a0
--- /dev/null
+++ b/date-fns/src/startOfQuarter/index.ts
@@ -0,0 +1,35 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfQuarter
+ * @category Quarter Helpers
+ * @summary Return the start of a year quarter for the given date.
+ *
+ * @description
+ * Return the start of a year quarter for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of a quarter
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of a quarter for 2 September 2014 11:55:00:
+ * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Tue Jul 01 2014 00:00:00
+ */
+export default function startOfQuarter(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ const currentMonth = date.getMonth()
+ const month = currentMonth - (currentMonth % 3)
+ date.setMonth(month, 1)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfQuarter/test.ts b/date-fns/src/startOfQuarter/test.ts
new file mode 100644
index 0000000..311e60d
--- /dev/null
+++ b/date-fns/src/startOfQuarter/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfQuarter from '.'
+
+describe('startOfQuarter', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a quarter', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfQuarter(date)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = startOfQuarter(date)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ startOfQuarter(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfQuarter(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfQuarter.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfSecond/benchmark.js b/date-fns/src/startOfSecond/benchmark.js
new file mode 100644
index 0000000..5d2aeee
--- /dev/null
+++ b/date-fns/src/startOfSecond/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfSecond from '.'
+import moment from 'moment'
+
+suite('startOfSecond', function () {
+ benchmark('date-fns', function () {
+ return startOfSecond(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('second')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfSecond/index.d.ts b/date-fns/src/startOfSecond/index.d.ts
new file mode 100644
index 0000000..b3b4017
--- /dev/null
+++ b/date-fns/src/startOfSecond/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfSecond } from 'date-fns'
+export default startOfSecond
diff --git a/date-fns/src/startOfSecond/index.js.flow b/date-fns/src/startOfSecond/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfSecond/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfSecond/index.ts b/date-fns/src/startOfSecond/index.ts
new file mode 100644
index 0000000..bc3e4a3
--- /dev/null
+++ b/date-fns/src/startOfSecond/index.ts
@@ -0,0 +1,32 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfSecond
+ * @category Second Helpers
+ * @summary Return the start of a second for the given date.
+ *
+ * @description
+ * Return the start of a second for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of a second
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of a second for 1 December 2014 22:15:45.400:
+ * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))
+ * //=> Mon Dec 01 2014 22:15:45.000
+ */
+export default function startOfSecond(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const date = toDate(dirtyDate)
+ date.setMilliseconds(0)
+ return date
+}
diff --git a/date-fns/src/startOfSecond/test.ts b/date-fns/src/startOfSecond/test.ts
new file mode 100644
index 0000000..a7444c1
--- /dev/null
+++ b/date-fns/src/startOfSecond/test.ts
@@ -0,0 +1,35 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfSecond from '.'
+
+describe('startOfSecond', function() {
+ it('returns the date with the time set to the first millisecond of a second', function() {
+ const date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
+ const result = startOfSecond(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15, 45))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400).getTime()
+ const result = startOfSecond(date)
+ assert.deepEqual(result, new Date(2014, 11 /* Dec */, 1, 22, 15, 45))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400)
+ startOfSecond(date)
+ assert.deepEqual(date, new Date(2014, 11 /* Dec */, 1, 22, 15, 45, 400))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfSecond(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfSecond.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfToday/benchmark.js b/date-fns/src/startOfToday/benchmark.js
new file mode 100644
index 0000000..c479df5
--- /dev/null
+++ b/date-fns/src/startOfToday/benchmark.js
@@ -0,0 +1,9 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfToday from '.'
+
+suite('startOfToday', () => {
+ benchmark('date-fns', () => startOfToday())
+})
diff --git a/date-fns/src/startOfToday/index.d.ts b/date-fns/src/startOfToday/index.d.ts
new file mode 100644
index 0000000..8a0615e
--- /dev/null
+++ b/date-fns/src/startOfToday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfToday } from 'date-fns'
+export default startOfToday
diff --git a/date-fns/src/startOfToday/index.js.flow b/date-fns/src/startOfToday/index.js.flow
new file mode 100644
index 0000000..26bde32
--- /dev/null
+++ b/date-fns/src/startOfToday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: () => Date
diff --git a/date-fns/src/startOfToday/index.ts b/date-fns/src/startOfToday/index.ts
new file mode 100644
index 0000000..60eca49
--- /dev/null
+++ b/date-fns/src/startOfToday/index.ts
@@ -0,0 +1,28 @@
+import startOfDay from '../startOfDay/index'
+
+/**
+ * @name startOfToday
+ * @category Day Helpers
+ * @summary Return the start of today.
+ * @pure false
+ *
+ * @description
+ * Return the start of today.
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `Date.now()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @returns {Date} the start of today
+ *
+ * @example
+ * // If today is 6 October 2014:
+ * var result = startOfToday()
+ * //=> Mon Oct 6 2014 00:00:00
+ */
+export default function startOfToday(): Date {
+ return startOfDay(Date.now())
+}
diff --git a/date-fns/src/startOfToday/test.ts b/date-fns/src/startOfToday/test.ts
new file mode 100644
index 0000000..1b2f691
--- /dev/null
+++ b/date-fns/src/startOfToday/test.ts
@@ -0,0 +1,24 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import sinon from 'sinon'
+import startOfToday from '.'
+
+describe('startOfToday', function() {
+ let clock
+ beforeEach(function() {
+ clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 14, 30, 45, 500).getTime()
+ )
+ })
+
+ afterEach(function() {
+ clock.restore()
+ })
+
+ it('returns the current date with the time setted to 00:00:00', function() {
+ var result = startOfToday()
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 25))
+ })
+})
diff --git a/date-fns/src/startOfTomorrow/benchmark.js b/date-fns/src/startOfTomorrow/benchmark.js
new file mode 100644
index 0000000..a550b46
--- /dev/null
+++ b/date-fns/src/startOfTomorrow/benchmark.js
@@ -0,0 +1,9 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfTomorrow from '.'
+
+suite('startOfTomorrow', () => {
+ benchmark('date-fns', () => startOfTomorrow())
+})
diff --git a/date-fns/src/startOfTomorrow/index.d.ts b/date-fns/src/startOfTomorrow/index.d.ts
new file mode 100644
index 0000000..464ad5b
--- /dev/null
+++ b/date-fns/src/startOfTomorrow/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfTomorrow } from 'date-fns'
+export default startOfTomorrow
diff --git a/date-fns/src/startOfTomorrow/index.js.flow b/date-fns/src/startOfTomorrow/index.js.flow
new file mode 100644
index 0000000..26bde32
--- /dev/null
+++ b/date-fns/src/startOfTomorrow/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: () => Date
diff --git a/date-fns/src/startOfTomorrow/index.ts b/date-fns/src/startOfTomorrow/index.ts
new file mode 100644
index 0000000..1d18b5f
--- /dev/null
+++ b/date-fns/src/startOfTomorrow/index.ts
@@ -0,0 +1,34 @@
+/**
+ * @name startOfTomorrow
+ * @category Day Helpers
+ * @summary Return the start of tomorrow.
+ * @pure false
+ *
+ * @description
+ * Return the start of tomorrow.
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `new Date()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @returns {Date} the start of tomorrow
+ *
+ * @example
+ * // If today is 6 October 2014:
+ * const result = startOfTomorrow()
+ * //=> Tue Oct 7 2014 00:00:00
+ */
+export default function startOfTomorrow() {
+ const now = new Date()
+ const year = now.getFullYear()
+ const month = now.getMonth()
+ const day = now.getDate()
+
+ const date = new Date(0)
+ date.setFullYear(year, month, day + 1)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfTomorrow/test.ts b/date-fns/src/startOfTomorrow/test.ts
new file mode 100644
index 0000000..aab3aba
--- /dev/null
+++ b/date-fns/src/startOfTomorrow/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import startOfTomorrow from '.'
+
+describe('startOfTomorrow', function() {
+ it('returns the start of tomorrow', function() {
+ const clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 14, 30, 45, 500).getTime()
+ )
+
+ const result = startOfTomorrow()
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 26))
+
+ clock.restore()
+ })
+
+ it('handles dates before 100 AD', function() {
+ const now = new Date(0)
+ now.setFullYear(14, 8 /* Sep */, 25)
+ now.setHours(0, 0, 0, 0)
+ const clock = sinon.useFakeTimers(now.getTime())
+
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(14, 8 /* Sep */, 26)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = startOfTomorrow()
+ assert.deepEqual(result, expectedResult)
+
+ clock.restore()
+ })
+})
diff --git a/date-fns/src/startOfWeek/benchmark.js b/date-fns/src/startOfWeek/benchmark.js
new file mode 100644
index 0000000..cebde9f
--- /dev/null
+++ b/date-fns/src/startOfWeek/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfWeek from '.'
+import moment from 'moment'
+
+suite('startOfWeek', function () {
+ benchmark('date-fns', function () {
+ return startOfWeek(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('week')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfWeek/index.d.ts b/date-fns/src/startOfWeek/index.d.ts
new file mode 100644
index 0000000..4a45d11
--- /dev/null
+++ b/date-fns/src/startOfWeek/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfWeek } from 'date-fns'
+export default startOfWeek
diff --git a/date-fns/src/startOfWeek/index.js.flow b/date-fns/src/startOfWeek/index.js.flow
new file mode 100644
index 0000000..9285b67
--- /dev/null
+++ b/date-fns/src/startOfWeek/index.js.flow
@@ -0,0 +1,58 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ }
+) => Date
diff --git a/date-fns/src/startOfWeek/index.ts b/date-fns/src/startOfWeek/index.ts
new file mode 100644
index 0000000..ab33312
--- /dev/null
+++ b/date-fns/src/startOfWeek/index.ts
@@ -0,0 +1,66 @@
+import { LocaleOptions, WeekStartOptions } from '../types'
+import toDate from '../toDate/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfWeek
+ * @category Week Helpers
+ * @summary Return the start of a week for the given date.
+ *
+ * @description
+ * Return the start of a week for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @returns {Date} the start of a week
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ *
+ * @example
+ * // The start of a week for 2 September 2014 11:55:00:
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
+ * //=> Sun Aug 31 2014 00:00:00
+ *
+ * @example
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+export default function startOfWeek(
+ dirtyDate: Date | number,
+ dirtyOptions?: LocaleOptions & WeekStartOptions
+): Date {
+ requiredArgs(1, arguments)
+
+ const options = dirtyOptions || {}
+ const locale = options.locale
+ const localeWeekStartsOn =
+ locale && locale.options && locale.options.weekStartsOn
+ const defaultWeekStartsOn =
+ localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn)
+ const weekStartsOn =
+ options.weekStartsOn == null
+ ? defaultWeekStartsOn
+ : toInteger(options.weekStartsOn)
+
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively')
+ }
+
+ const date = toDate(dirtyDate)
+ const day = date.getDay()
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn
+
+ date.setDate(date.getDate() - diff)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfWeek/test.ts b/date-fns/src/startOfWeek/test.ts
new file mode 100644
index 0000000..d5d2cb6
--- /dev/null
+++ b/date-fns/src/startOfWeek/test.ts
@@ -0,0 +1,113 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import startOfWeek from '.'
+
+describe('startOfWeek', function () {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a week', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfWeek(date)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
+ })
+
+ it('allows to specify which day is the first day of the week', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfWeek(date, { weekStartsOn: 1 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('allows to specify which day is the first day of the week in locale', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfWeek(date, {
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 1 },
+ },
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfWeek(date, {
+ weekStartsOn: 1,
+ // @ts-expect-error
+ locale: {
+ options: { weekStartsOn: 0 },
+ },
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('implicitly converts options', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ // @ts-expect-error
+ const result = startOfWeek(date, { weekStartsOn: '1' })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('accepts a timestamp', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = startOfWeek(date)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 31))
+ })
+
+ it('does not mutate the original date', function () {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ startOfWeek(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ describe('edge cases', function () {
+ describe('when the given day is before the start of a week', function () {
+ it('it returns the start of a week', function () {
+ const date = new Date(2014, 9 /* Oct */, 6)
+ const result = startOfWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 1))
+ })
+ })
+
+ describe('when the given day is the start of a week', function () {
+ it('it returns the start of a week', function () {
+ const date = new Date(2014, 9 /* Oct */, 8)
+ const result = startOfWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 8))
+ })
+ })
+
+ describe('when the given day is after the start of a week', function () {
+ it('it returns the start of a week', function () {
+ const date = new Date(2014, 9 /* Oct */, 10)
+ const result = startOfWeek(date, { weekStartsOn: 3 })
+ assert.deepEqual(result, new Date(2014, 9 /* Oct */, 8))
+ })
+ })
+
+ it('handles the week at the start of a year', function () {
+ const date = new Date(2014, 0 /* Jan */, 1)
+ const result = startOfWeek(date)
+ assert.deepEqual(result, new Date(2013, 11 /* Dec */, 29))
+ })
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function () {
+ const result = startOfWeek(new Date(NaN))
+ assert(result instanceof Date && isNaN(Number(result)))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function () {
+ const block = () =>
+ startOfWeek(
+ new Date(2014, 8 /* Sep */, 2, 11, 55, 0),
+ // @ts-expect-error
+ { weekStartsOn: NaN }
+ )
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function () {
+ // @ts-expect-error
+ assert.throws(startOfWeek.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfWeekYear/index.d.ts b/date-fns/src/startOfWeekYear/index.d.ts
new file mode 100644
index 0000000..95b4851
--- /dev/null
+++ b/date-fns/src/startOfWeekYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfWeekYear } from 'date-fns'
+export default startOfWeekYear
diff --git a/date-fns/src/startOfWeekYear/index.js b/date-fns/src/startOfWeekYear/index.js
new file mode 100644
index 0000000..a35fdde
--- /dev/null
+++ b/date-fns/src/startOfWeekYear/index.js
@@ -0,0 +1,71 @@
+import getWeekYear from '../getWeekYear/index'
+import startOfWeek from '../startOfWeek/index'
+import toInteger from '../_lib/toInteger/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfWeekYear
+ * @category Week-Numbering Year Helpers
+ * @summary Return the start of a local week-numbering year for the given date.
+ *
+ * @description
+ * Return the start of a local week-numbering year.
+ * The exact calculation depends on the values of
+ * `options.weekStartsOn` (which is the index of the first day of the week)
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
+ * the first week of the week-numbering year)
+ *
+ * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @param {Object} [options] - an object with options.
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
+ * @returns {Date} the start of a week-numbering year
+ * @throws {TypeError} 1 argument required
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
+ *
+ * @example
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
+ * var result = startOfWeekYear(new Date(2005, 6, 2))
+ * //=> Sun Dec 26 2004 00:00:00
+ *
+ * @example
+ * // The start of a week-numbering year for 2 July 2005
+ * // if Monday is the first day of week
+ * // and 4 January is always in the first week of the year:
+ * var result = startOfWeekYear(new Date(2005, 6, 2), {
+ * weekStartsOn: 1,
+ * firstWeekContainsDate: 4
+ * })
+ * //=> Mon Jan 03 2005 00:00:00
+ */
+export default function startOfWeekYear(dirtyDate, dirtyOptions) {
+ requiredArgs(1, arguments)
+
+ var options = dirtyOptions || {}
+ var locale = options.locale
+ var localeFirstWeekContainsDate =
+ locale && locale.options && locale.options.firstWeekContainsDate
+ var defaultFirstWeekContainsDate =
+ localeFirstWeekContainsDate == null
+ ? 1
+ : toInteger(localeFirstWeekContainsDate)
+ var firstWeekContainsDate =
+ options.firstWeekContainsDate == null
+ ? defaultFirstWeekContainsDate
+ : toInteger(options.firstWeekContainsDate)
+
+ var year = getWeekYear(dirtyDate, dirtyOptions)
+ var firstWeek = new Date(0)
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate)
+ firstWeek.setHours(0, 0, 0, 0)
+ var date = startOfWeek(firstWeek, dirtyOptions)
+ return date
+}
diff --git a/date-fns/src/startOfWeekYear/index.js.flow b/date-fns/src/startOfWeekYear/index.js.flow
new file mode 100644
index 0000000..49cecb6
--- /dev/null
+++ b/date-fns/src/startOfWeekYear/index.js.flow
@@ -0,0 +1,59 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (
+ date: Date | number,
+ options?: {
+ locale?: Locale,
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ }
+) => Date
diff --git a/date-fns/src/startOfWeekYear/test.js b/date-fns/src/startOfWeekYear/test.js
new file mode 100644
index 0000000..c01bfa7
--- /dev/null
+++ b/date-fns/src/startOfWeekYear/test.js
@@ -0,0 +1,83 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfWeekYear from '.'
+
+describe('startOfWeekYear', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a week year', function() {
+ var result = startOfWeekYear(new Date(2005, 6 /* Jul */, 2))
+ assert.deepEqual(result, new Date(2004, 11 /* Dec */, 26, 0, 0, 0, 0))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = startOfWeekYear(new Date(2005, 0 /* Jan */, 1, 6, 0).getTime())
+ assert.deepEqual(result, new Date(2004, 11 /* Dec */, 26, 0, 0, 0, 0))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 6 /* Jul */, 2)
+ startOfWeekYear(date)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 2))
+ })
+
+ it('handles dates before 100 AD', function() {
+ var initialDate = new Date(0)
+ initialDate.setFullYear(9, 0 /* Jan */, 1)
+ initialDate.setHours(0, 0, 0, 0)
+ var expectedResult = new Date(0)
+ expectedResult.setFullYear(8, 11 /* Dec */, 28)
+ expectedResult.setHours(0, 0, 0, 0)
+ var result = startOfWeekYear(initialDate)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = startOfWeekYear(new Date(NaN))
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('allows to specify `weekStartsOn` and `firstWeekContainsDate` in locale', function() {
+ var date = new Date(2005, 6 /* Jul */, 2)
+ var result = startOfWeekYear(date, {
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 1, firstWeekContainsDate: 4 }
+ }
+ })
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 3, 0, 0, 0, 0))
+ })
+
+ it('`options.weekStartsOn` overwrites the first day of the week specified in locale', function() {
+ var date = new Date(2005, 6 /* Jul */, 2)
+ var result = startOfWeekYear(date, {
+ weekStartsOn: 1,
+ firstWeekContainsDate: 4,
+ // $ExpectedMistake
+ locale: {
+ options: { weekStartsOn: 0, firstWeekContainsDate: 1 }
+ }
+ })
+ assert.deepEqual(result, new Date(2005, 0 /* Jan */, 3, 0, 0, 0, 0))
+ })
+
+ it('throws `RangeError` if `options.weekStartsOn` is not convertable to 0, 1, ..., 6 or undefined', function() {
+ // $ExpectedMistake
+ var block = startOfWeekYear.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ weekStartsOn: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws `RangeError` if `options.firstWeekContainsDate` is not convertable to 1, 2, ..., 7 or undefined', function() {
+ // $ExpectedMistake
+ var block = startOfWeekYear.bind(null, new Date(2007, 11 /* Dec */, 31), {
+ firstWeekContainsDate: NaN
+ })
+ assert.throws(block, RangeError)
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfWeekYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfYear/benchmark.js b/date-fns/src/startOfYear/benchmark.js
new file mode 100644
index 0000000..4a2893e
--- /dev/null
+++ b/date-fns/src/startOfYear/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfYear from '.'
+import moment from 'moment'
+
+suite('startOfYear', function () {
+ benchmark('date-fns', function () {
+ return startOfYear(this.date)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.startOf('year')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/startOfYear/index.d.ts b/date-fns/src/startOfYear/index.d.ts
new file mode 100644
index 0000000..669ffc9
--- /dev/null
+++ b/date-fns/src/startOfYear/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfYear } from 'date-fns'
+export default startOfYear
diff --git a/date-fns/src/startOfYear/index.js.flow b/date-fns/src/startOfYear/index.js.flow
new file mode 100644
index 0000000..4b7c616
--- /dev/null
+++ b/date-fns/src/startOfYear/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number) => Date
diff --git a/date-fns/src/startOfYear/index.ts b/date-fns/src/startOfYear/index.ts
new file mode 100644
index 0000000..b72be94
--- /dev/null
+++ b/date-fns/src/startOfYear/index.ts
@@ -0,0 +1,34 @@
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name startOfYear
+ * @category Year Helpers
+ * @summary Return the start of a year for the given date.
+ *
+ * @description
+ * Return the start of a year for the given date.
+ * The result will be in the local timezone.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the original date
+ * @returns {Date} the start of a year
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // The start of a year for 2 September 2014 11:55:00:
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
+ * //=> Wed Jan 01 2014 00:00:00
+ */
+export default function startOfYear(dirtyDate: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const cleanDate = toDate(dirtyDate)
+ const date = new Date(0)
+ date.setFullYear(cleanDate.getFullYear(), 0, 1)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfYear/test.ts b/date-fns/src/startOfYear/test.ts
new file mode 100644
index 0000000..bff3352
--- /dev/null
+++ b/date-fns/src/startOfYear/test.ts
@@ -0,0 +1,46 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import startOfYear from '.'
+
+describe('startOfYear', function() {
+ it('returns the date with the time set to 00:00:00 and the date set to the first day of a year', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ const result = startOfYear(date)
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 1, 0, 0, 0, 0))
+ })
+
+ it('accepts a timestamp', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0).getTime()
+ const result = startOfYear(date)
+ assert.deepEqual(result, new Date(2014, 0 /* Dec */, 1, 0, 0, 0, 0))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 2, 11, 55, 0)
+ startOfYear(date)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 2, 11, 55, 0))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(9, 0 /* Jan */, 5)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(9, 0 /* Jan */, 1)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = startOfYear(initialDate)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = startOfYear(new Date(NaN))
+ //@ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', function() {
+ assert.throws(startOfYear.bind(null), TypeError)
+ })
+})
diff --git a/date-fns/src/startOfYesterday/benchmark.js b/date-fns/src/startOfYesterday/benchmark.js
new file mode 100644
index 0000000..4c37877
--- /dev/null
+++ b/date-fns/src/startOfYesterday/benchmark.js
@@ -0,0 +1,9 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import startOfToday from '.'
+
+suite('startOfYesterday', () => {
+ benchmark('date-fns', () => startOfToday())
+})
diff --git a/date-fns/src/startOfYesterday/index.d.ts b/date-fns/src/startOfYesterday/index.d.ts
new file mode 100644
index 0000000..0342a28
--- /dev/null
+++ b/date-fns/src/startOfYesterday/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { startOfYesterday } from 'date-fns'
+export default startOfYesterday
diff --git a/date-fns/src/startOfYesterday/index.js.flow b/date-fns/src/startOfYesterday/index.js.flow
new file mode 100644
index 0000000..26bde32
--- /dev/null
+++ b/date-fns/src/startOfYesterday/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: () => Date
diff --git a/date-fns/src/startOfYesterday/index.ts b/date-fns/src/startOfYesterday/index.ts
new file mode 100644
index 0000000..d0a793d
--- /dev/null
+++ b/date-fns/src/startOfYesterday/index.ts
@@ -0,0 +1,34 @@
+/**
+ * @name startOfYesterday
+ * @category Day Helpers
+ * @summary Return the start of yesterday.
+ * @pure false
+ *
+ * @description
+ * Return the start of yesterday.
+ *
+ * > ⚠️ Please note that this function is not present in the FP submodule as
+ * > it uses `new Date()` internally hence impure and can't be safely curried.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @returns {Date} the start of yesterday
+ *
+ * @example
+ * // If today is 6 October 2014:
+ * const result = startOfYesterday()
+ * //=> Sun Oct 5 2014 00:00:00
+ */
+export default function startOfYesterday() {
+ const now = new Date()
+ const year = now.getFullYear()
+ const month = now.getMonth()
+ const day = now.getDate()
+
+ const date = new Date(0)
+ date.setFullYear(year, month, day - 1)
+ date.setHours(0, 0, 0, 0)
+ return date
+}
diff --git a/date-fns/src/startOfYesterday/test.ts b/date-fns/src/startOfYesterday/test.ts
new file mode 100644
index 0000000..5847393
--- /dev/null
+++ b/date-fns/src/startOfYesterday/test.ts
@@ -0,0 +1,34 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'assert'
+import sinon from 'sinon'
+import startOfYesterday from '.'
+
+describe('startOfYesterday', function() {
+ it('returns the start of yesterday', function() {
+ const clock = sinon.useFakeTimers(
+ new Date(2014, 8 /* Sep */, 25, 14, 30, 45, 500).getTime()
+ )
+
+ const result = startOfYesterday()
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 24))
+
+ clock.restore()
+ })
+
+ it('handles dates before 100 AD', function() {
+ const now = new Date(0)
+ now.setFullYear(14, 8 /* Sep */, 25)
+ now.setHours(0, 0, 0, 0)
+ const clock = sinon.useFakeTimers(now.getTime())
+
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(14, 8 /* Sep */, 24)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = startOfYesterday()
+ assert.deepEqual(result, expectedResult)
+
+ clock.restore()
+ })
+})
diff --git a/date-fns/src/sub/benchmark.js b/date-fns/src/sub/benchmark.js
new file mode 100644
index 0000000..8b96341
--- /dev/null
+++ b/date-fns/src/sub/benchmark.js
@@ -0,0 +1,25 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import sub from '.'
+import moment from 'moment'
+
+suite(
+ 'add',
+ function() {
+ benchmark('date-fns', function() {
+ return sub(this.date, { hours: 5, minutes: 10 })
+ })
+
+ benchmark('Moment.js', function() {
+ return this.moment.subtract({ hours: 5, minutes: 10 })
+ })
+ },
+ {
+ setup: function() {
+ this.date = new Date()
+ this.moment = moment()
+ }
+ }
+)
diff --git a/date-fns/src/sub/index.d.ts b/date-fns/src/sub/index.d.ts
new file mode 100644
index 0000000..7a4f3ec
--- /dev/null
+++ b/date-fns/src/sub/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { sub } from 'date-fns'
+export default sub
diff --git a/date-fns/src/sub/index.js b/date-fns/src/sub/index.js
new file mode 100644
index 0000000..fa5f30f
--- /dev/null
+++ b/date-fns/src/sub/index.js
@@ -0,0 +1,72 @@
+import subDays from '../subDays/index'
+import subMonths from '../subMonths/index'
+import toDate from '../toDate/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+import toInteger from '../_lib/toInteger/index'
+
+/**
+ * @name sub
+ * @category Common Helpers
+ * @summary Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date.
+ *
+ * @description
+ * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be subtracted
+ *
+ * | Key | Description |
+ * |---------|------------------------------------|
+ * | years | Amount of years to be subtracted |
+ * | months | Amount of months to be subtracted |
+ * | weeks | Amount of weeks to be subtracted |
+ * | days | Amount of days to be subtracted |
+ * | hours | Amount of hours to be subtracted |
+ * | minutes | Amount of minutes to be subtracted |
+ * | seconds | Amount of seconds to be subtracted |
+ *
+ * All values default to 0
+ *
+ * @returns {Date} the new date with the seconds subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract the following duration from 15 June 2017 15:29:20
+ * const result = sub(new Date(2017, 5, 15, 15, 29, 20), {
+ * years: 2,
+ * months: 9,
+ * weeks: 1,
+ * days: 7,
+ * hours: 5,
+ * minutes: 9,
+ * seconds: 30
+ * })
+ * //=> Mon Sep 1 2014 10:19:50
+ */
+export default function sub(dirtyDate, duration) {
+ requiredArgs(2, arguments)
+
+ if (!duration || typeof duration !== 'object') return new Date(NaN)
+
+ const years = 'years' in duration ? toInteger(duration.years) : 0
+ const months = 'months' in duration ? toInteger(duration.months) : 0
+ const weeks = 'weeks' in duration ? toInteger(duration.weeks) : 0
+ const days = 'days' in duration ? toInteger(duration.days) : 0
+ const hours = 'hours' in duration ? toInteger(duration.hours) : 0
+ const minutes = 'minutes' in duration ? toInteger(duration.minutes) : 0
+ const seconds = 'seconds' in duration ? toInteger(duration.seconds) : 0
+
+ // Subtract years and months
+ const dateWithoutMonths = subMonths(toDate(dirtyDate), months + years * 12)
+
+ // Subtract weeks and days
+ const dateWithoutDays = subDays(dateWithoutMonths, days + weeks * 7)
+
+ // Subtract hours, minutes and seconds
+ const minutestoSub = minutes + hours * 60
+ const secondstoSub = seconds + minutestoSub * 60
+ const mstoSub = secondstoSub * 1000
+ const finalDate = new Date(dateWithoutDays.getTime() - mstoSub)
+
+ return finalDate
+}
diff --git a/date-fns/src/sub/index.js.flow b/date-fns/src/sub/index.js.flow
new file mode 100644
index 0000000..e79df7c
--- /dev/null
+++ b/date-fns/src/sub/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, duration: Duration) => Date
diff --git a/date-fns/src/sub/test.js b/date-fns/src/sub/test.js
new file mode 100644
index 0000000..016accc
--- /dev/null
+++ b/date-fns/src/sub/test.js
@@ -0,0 +1,82 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import sub from '.'
+
+describe('sub', () => {
+ it('subtracts the duration from the given date', () => {
+ const result = sub(new Date(2017, 5 /* June */, 15, 15, 29, 20), {
+ years: 2,
+ months: 9,
+ weeks: 1,
+ days: 7,
+ hours: 5,
+ minutes: 9,
+ seconds: 30
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 10, 19, 50))
+ })
+
+ it('returns same date object when passed empty duration', () => {
+ const result = sub(new Date(2014, 8 /* Sep */, 1, 10).getTime(), {})
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 10))
+ })
+
+ it('accepts a timestamp', () => {
+ const result = sub(new Date(2014, 8 /* Sep */, 1, 14).getTime(), {
+ hours: 4
+ })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 10))
+ })
+
+ it('converts a fractional number to an integer', () => {
+ const result = sub(new Date(2014, 8 /* Sep */, 1, 14), { hours: 4.2 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 10))
+ })
+
+ it('implicitly converts number arguments', () => {
+ // $ExpectedMistake
+ const result = sub(new Date(2014, 8 /* Sep */, 1, 14), { hours: '4.2' })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1, 10))
+ })
+
+ it('does not mutate the original date', () => {
+ const date = new Date(2014, 8 /* Sep */, 1, 10)
+ sub(date, { hours: 4 })
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1, 10))
+ })
+
+ it('works well if the desired month has fewer days and the provided date is in the last day of a month', () => {
+ const date = new Date(2014, 11 /* Dec */, 31)
+ const result = sub(date, { months: 3 })
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('handles dates before 100 AD', () => {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(1, 2 /* Mar */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(1, 1 /* Feb */, 28)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = sub(initialDate, { months: 1 })
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', () => {
+ const result = sub(new Date(NaN), { hours: 5 })
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws RangeError exception if passed Number as duration', () => {
+ // $ExpectedMistake
+ const result = sub(new Date(2014, 8, 1), 'wut')
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', () => {
+ assert.throws(sub.bind(null), TypeError)
+ assert.throws(sub.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subBusinessDays/index.d.ts b/date-fns/src/subBusinessDays/index.d.ts
new file mode 100644
index 0000000..7a0549a
--- /dev/null
+++ b/date-fns/src/subBusinessDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subBusinessDays } from 'date-fns'
+export default subBusinessDays
diff --git a/date-fns/src/subBusinessDays/index.js b/date-fns/src/subBusinessDays/index.js
new file mode 100644
index 0000000..dbfa505
--- /dev/null
+++ b/date-fns/src/subBusinessDays/index.js
@@ -0,0 +1,28 @@
+import toInteger from '../_lib/toInteger/index'
+import addBusinessDays from '../addBusinessDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subBusinessDays
+ * @category Day Helpers
+ * @summary Substract the specified number of business days (mon - fri) to the given date.
+ *
+ * @description
+ * Substract the specified number of business days (mon - fri) to the given date, ignoring weekends.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of business days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the business days subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Substract 10 business days from 1 September 2014:
+ * var result = subBusinessDays(new Date(2014, 8, 1), 10)
+ * //=> Mon Aug 18 2014 00:00:00 (skipped weekend days)
+ */
+export default function subBusinessDays(dirtyDate, dirtyAmount) {
+ requiredArgs(2, arguments)
+
+ var amount = toInteger(dirtyAmount)
+ return addBusinessDays(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subBusinessDays/index.js.flow b/date-fns/src/subBusinessDays/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subBusinessDays/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subBusinessDays/test.js b/date-fns/src/subBusinessDays/test.js
new file mode 100644
index 0000000..96564a1
--- /dev/null
+++ b/date-fns/src/subBusinessDays/test.js
@@ -0,0 +1,63 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subBusinessDays from '.'
+
+describe('subBusinessDays', function() {
+ it('substract the given number of business days', function() {
+ const result = subBusinessDays(new Date(2014, 8 /* Sep */, 1), 10)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 18))
+ })
+
+ it('handles negative amount', function() {
+ var result = subBusinessDays(new Date(2014, 7 /* Sep */, 18), -10)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('can handle a large number of business days', function() {
+ if (typeof this.timeout === 'function') {
+ this.timeout(500 /* 500 ms test timeout */)
+ }
+
+ var result = subBusinessDays(new Date(15000, 0 /* Jan */, 1), 3387885)
+ assert.deepEqual(result, new Date(2014, 0 /* Jan */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ var result = subBusinessDays(new Date(2014, 8 /* Sep */, 1).getTime(), 10)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 18))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ var result = subBusinessDays(new Date(2014, 8 /* Sep */, 1), 10.5)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 18))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ var result = subBusinessDays(new Date(2014, 8 /* Sep */, 1), '10')
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 18))
+ })
+
+ it('does not mutate the original date', function() {
+ var date = new Date(2014, 8 /* Sep */, 1)
+ subBusinessDays(date, 11)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ var result = subBusinessDays(new Date(NaN), 10)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ var result = subBusinessDays(new Date(2014, 8 /* Sep */, 1), NaN)
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subBusinessDays.bind(null), TypeError)
+ assert.throws(subBusinessDays.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subDays/benchmark.js b/date-fns/src/subDays/benchmark.js
new file mode 100644
index 0000000..032cd9a
--- /dev/null
+++ b/date-fns/src/subDays/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subDays from '.'
+import moment from 'moment'
+
+suite('subDays', function () {
+ benchmark('date-fns', function () {
+ return subDays(this.date, 14)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(14, 'days')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subDays/index.d.ts b/date-fns/src/subDays/index.d.ts
new file mode 100644
index 0000000..0b2fe65
--- /dev/null
+++ b/date-fns/src/subDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subDays } from 'date-fns'
+export default subDays
diff --git a/date-fns/src/subDays/index.js.flow b/date-fns/src/subDays/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subDays/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subDays/index.ts b/date-fns/src/subDays/index.ts
new file mode 100644
index 0000000..7c706c3
--- /dev/null
+++ b/date-fns/src/subDays/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addDays from '../addDays/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subDays
+ * @category Day Helpers
+ * @summary Subtract the specified number of days from the given date.
+ *
+ * @description
+ * Subtract the specified number of days from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the days subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 10 days from 1 September 2014:
+ * const result = subDays(new Date(2014, 8, 1), 10)
+ * //=> Fri Aug 22 2014 00:00:00
+ */
+export default function subDays(dirtyDate: Date | number, dirtyAmount: number) {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addDays(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subDays/test.ts b/date-fns/src/subDays/test.ts
new file mode 100644
index 0000000..fadc101
--- /dev/null
+++ b/date-fns/src/subDays/test.ts
@@ -0,0 +1,52 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subDays from '.'
+
+describe('subDays', function() {
+ it('subtracts the given number of days', function() {
+ const result = subDays(new Date(2014, 8 /* Sep */, 1), 10)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 22))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subDays(new Date(2014, 8 /* Sep */, 1).getTime(), 10)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 22))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subDays(new Date(2014, 8 /* Sep */, 1), 10.85)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 22))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = subDays(new Date(2014, 8 /* Sep */, 1), '10')
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 22))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ subDays(date, 11)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subDays(new Date(NaN), 10)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subDays(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subDays.bind(null), TypeError)
+ assert.throws(subDays.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subHours/benchmark.js b/date-fns/src/subHours/benchmark.js
new file mode 100644
index 0000000..ae77136
--- /dev/null
+++ b/date-fns/src/subHours/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subHours from '.'
+import moment from 'moment'
+
+suite('subHours', function () {
+ benchmark('date-fns', function () {
+ return subHours(this.date, 32)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(32, 'hours')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subHours/index.d.ts b/date-fns/src/subHours/index.d.ts
new file mode 100644
index 0000000..9b9a0d2
--- /dev/null
+++ b/date-fns/src/subHours/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subHours } from 'date-fns'
+export default subHours
diff --git a/date-fns/src/subHours/index.js.flow b/date-fns/src/subHours/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subHours/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subHours/index.ts b/date-fns/src/subHours/index.ts
new file mode 100644
index 0000000..2db706a
--- /dev/null
+++ b/date-fns/src/subHours/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addHours from '../addHours/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subHours
+ * @category Hour Helpers
+ * @summary Subtract the specified number of hours from the given date.
+ *
+ * @description
+ * Subtract the specified number of hours from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of hours to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the hours subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 2 hours from 11 July 2014 01:00:00:
+ * const result = subHours(new Date(2014, 6, 11, 1, 0), 2)
+ * //=> Thu Jul 10 2014 23:00:00
+ */
+export default function subHours(dirtyDate: Date | number, dirtyAmount: number) {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addHours(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subHours/test.ts b/date-fns/src/subHours/test.ts
new file mode 100644
index 0000000..7423288
--- /dev/null
+++ b/date-fns/src/subHours/test.ts
@@ -0,0 +1,52 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subHours from '.'
+
+describe('subHours', function() {
+ it('subtracts the given numbers of hours', function() {
+ const result = subHours(new Date(2014, 6 /* Jul */, 11, 1, 0), 2)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 23, 0))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subHours(new Date(2014, 6 /* Jul */, 12, 1, 0).getTime(), 26)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 23, 0))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subHours(new Date(2014, 6 /* Jul */, 11, 1, 0), 2.22)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 23, 0))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = subHours(new Date(2014, 6 /* Jul */, 11, 1, 0), '2')
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 23, 0))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 23, 0)
+ subHours(date, 10)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 10, 23, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subHours(new Date(NaN), 2)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subHours(new Date(2014, 6 /* Jul */, 11, 1, 0), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subHours.bind(null), TypeError)
+ assert.throws(subHours.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subISOWeekYears/benchmark.js b/date-fns/src/subISOWeekYears/benchmark.js
new file mode 100644
index 0000000..f8b615c
--- /dev/null
+++ b/date-fns/src/subISOWeekYears/benchmark.js
@@ -0,0 +1,15 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subISOWeekYears from '.'
+
+suite('subISOWeekYears', function () {
+ benchmark('date-fns', function () {
+ return subISOWeekYears(this.date, 7)
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ }
+})
diff --git a/date-fns/src/subISOWeekYears/index.d.ts b/date-fns/src/subISOWeekYears/index.d.ts
new file mode 100644
index 0000000..78018ea
--- /dev/null
+++ b/date-fns/src/subISOWeekYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subISOWeekYears } from 'date-fns'
+export default subISOWeekYears
diff --git a/date-fns/src/subISOWeekYears/index.js.flow b/date-fns/src/subISOWeekYears/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subISOWeekYears/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subISOWeekYears/index.ts b/date-fns/src/subISOWeekYears/index.ts
new file mode 100644
index 0000000..bbd396c
--- /dev/null
+++ b/date-fns/src/subISOWeekYears/index.ts
@@ -0,0 +1,39 @@
+import toInteger from '../_lib/toInteger/index'
+import addISOWeekYears from '../addISOWeekYears/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subISOWeekYears
+ * @category ISO Week-Numbering Year Helpers
+ * @summary Subtract the specified number of ISO week-numbering years from the given date.
+ *
+ * @description
+ * Subtract the specified number of ISO week-numbering years from the given date.
+ *
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * - The function was renamed from `subISOYears` to `subISOWeekYears`.
+ * "ISO week year" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).
+ * This change makes the name consistent with
+ * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of ISO week-numbering years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the ISO week-numbering years subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 5 ISO week-numbering years from 1 September 2014:
+ * const result = subISOWeekYears(new Date(2014, 8, 1), 5)
+ * //=> Mon Aug 31 2009 00:00:00
+ */
+export default function subISOWeekYears(dirtyDate: Date | number, dirtyAmount: number) {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addISOWeekYears(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subISOWeekYears/test.ts b/date-fns/src/subISOWeekYears/test.ts
new file mode 100644
index 0000000..dbb4213
--- /dev/null
+++ b/date-fns/src/subISOWeekYears/test.ts
@@ -0,0 +1,62 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subISOWeekYears from '.'
+
+describe('subISOWeekYears', function() {
+ it('subtracts the given number of ISO week-numbering years', function() {
+ const result = subISOWeekYears(new Date(2014, 8 /* Sep */, 1), 5)
+ assert.deepEqual(result, new Date(2009, 7 /* Aug */, 31))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subISOWeekYears(new Date(2014, 8 /* Sep */, 1).getTime(), 12)
+ assert.deepEqual(result, new Date(2002, 8 /* Sep */, 2))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subISOWeekYears(new Date(2014, 8 /* Sep */, 1), 5.555)
+ assert.deepEqual(result, new Date(2009, 7 /* Aug */, 31))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ const result = subISOWeekYears(new Date(2014, 8 /* Sep */, 1), '5')
+ assert.deepEqual(result, new Date(2009, 7 /* Aug */, 31))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ subISOWeekYears(date, 12)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(15, 5 /* Jun */, 26)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(10, 6 /* Jul */, 2)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = subISOWeekYears(initialDate, 5)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subISOWeekYears(new Date(NaN), 5)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subISOWeekYears(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subISOWeekYears.bind(null), TypeError)
+ assert.throws(subISOWeekYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subMilliseconds/benchmark.js b/date-fns/src/subMilliseconds/benchmark.js
new file mode 100644
index 0000000..597dac4
--- /dev/null
+++ b/date-fns/src/subMilliseconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subMilliseconds from '.'
+import moment from 'moment'
+
+suite('subMilliseconds', function () {
+ benchmark('date-fns', function () {
+ return subMilliseconds(this.date, 800)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(800, 'milliseconds')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subMilliseconds/index.d.ts b/date-fns/src/subMilliseconds/index.d.ts
new file mode 100644
index 0000000..ffc51f1
--- /dev/null
+++ b/date-fns/src/subMilliseconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subMilliseconds } from 'date-fns'
+export default subMilliseconds
diff --git a/date-fns/src/subMilliseconds/index.js.flow b/date-fns/src/subMilliseconds/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subMilliseconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subMilliseconds/index.ts b/date-fns/src/subMilliseconds/index.ts
new file mode 100644
index 0000000..094209e
--- /dev/null
+++ b/date-fns/src/subMilliseconds/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addMilliseconds from '../addMilliseconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subMilliseconds
+ * @category Millisecond Helpers
+ * @summary Subtract the specified number of milliseconds from the given date.
+ *
+ * @description
+ * Subtract the specified number of milliseconds from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the milliseconds subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
+ * //=> Thu Jul 10 2014 12:45:29.250
+ */
+export default function subMilliseconds(dirtyDate: Date | number, dirtyAmount: number) {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addMilliseconds(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subMilliseconds/test.ts b/date-fns/src/subMilliseconds/test.ts
new file mode 100644
index 0000000..bd93b39
--- /dev/null
+++ b/date-fns/src/subMilliseconds/test.ts
@@ -0,0 +1,67 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subMilliseconds from '.'
+
+describe('subMilliseconds', function() {
+ it('subtracts the given number of milliseconds', function() {
+ const result = subMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0),
+ 750
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 29, 250))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0).getTime(),
+ 500
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 29, 500))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0),
+ 750.75
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 29, 250))
+ })
+
+ it('implicitly converts number arguments', function() {
+ const result = subMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0),
+ // $ExpectedMistake
+ // @ts-expect-error
+ '750'
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 45, 29, 250))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0)
+ subMilliseconds(date, 250)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subMilliseconds(new Date(NaN), 750)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subMilliseconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 30, 0),
+ NaN
+ )
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subMilliseconds.bind(null), TypeError)
+ assert.throws(subMilliseconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subMinutes/benchmark.js b/date-fns/src/subMinutes/benchmark.js
new file mode 100644
index 0000000..2f9ac04
--- /dev/null
+++ b/date-fns/src/subMinutes/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subMinutes from '.'
+import moment from 'moment'
+
+suite('subMinutes', function () {
+ benchmark('date-fns', function () {
+ return subMinutes(this.date, 25)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(25, 'minutes')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subMinutes/index.d.ts b/date-fns/src/subMinutes/index.d.ts
new file mode 100644
index 0000000..43c3222
--- /dev/null
+++ b/date-fns/src/subMinutes/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subMinutes } from 'date-fns'
+export default subMinutes
diff --git a/date-fns/src/subMinutes/index.js.flow b/date-fns/src/subMinutes/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subMinutes/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subMinutes/index.ts b/date-fns/src/subMinutes/index.ts
new file mode 100644
index 0000000..365928b
--- /dev/null
+++ b/date-fns/src/subMinutes/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addMinutes from '../addMinutes/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subMinutes
+ * @category Minute Helpers
+ * @summary Subtract the specified number of minutes from the given date.
+ *
+ * @description
+ * Subtract the specified number of minutes from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of minutes to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the minutes subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 30 minutes from 10 July 2014 12:00:00:
+ * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)
+ * //=> Thu Jul 10 2014 11:30:00
+ */
+export default function subMinutes(dirtyDate: Date | number, dirtyAmount: number) {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addMinutes(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subMinutes/test.ts b/date-fns/src/subMinutes/test.ts
new file mode 100644
index 0000000..572dc07
--- /dev/null
+++ b/date-fns/src/subMinutes/test.ts
@@ -0,0 +1,54 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subMinutes from '.'
+
+describe('subMinutes', function() {
+ it('subtracts the given number of minutes', function() {
+ const result = subMinutes(new Date(2014, 6 /* Jul */, 10, 12, 0), 30)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 11, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subMinutes(
+ new Date(2014, 6 /* Jul */, 10, 12, 0).getTime(),
+ 20
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 11, 40))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subMinutes(new Date(2014, 6 /* Jul */, 10, 12, 0), 30.4)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 11, 30))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ const result = subMinutes(new Date(2014, 6 /* Jul */, 10, 12, 0), '30')
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 11, 30))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 12, 0)
+ subMinutes(date, 25)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 10, 12, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subMinutes(new Date(NaN), 30)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subMinutes(new Date(2014, 6 /* Jul */, 10, 12, 0), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subMinutes.bind(null), TypeError)
+ assert.throws(subMinutes.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subMonths/benchmark.js b/date-fns/src/subMonths/benchmark.js
new file mode 100644
index 0000000..f2e1662
--- /dev/null
+++ b/date-fns/src/subMonths/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subMonths from '.'
+import moment from 'moment'
+
+suite('subMonths', function () {
+ benchmark('date-fns', function () {
+ return subMonths(this.date, 7)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(7, 'months')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subMonths/index.d.ts b/date-fns/src/subMonths/index.d.ts
new file mode 100644
index 0000000..dd963a1
--- /dev/null
+++ b/date-fns/src/subMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subMonths } from 'date-fns'
+export default subMonths
diff --git a/date-fns/src/subMonths/index.js.flow b/date-fns/src/subMonths/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subMonths/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subMonths/index.ts b/date-fns/src/subMonths/index.ts
new file mode 100644
index 0000000..d827fad
--- /dev/null
+++ b/date-fns/src/subMonths/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addMonths from '../addMonths/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subMonths
+ * @category Month Helpers
+ * @summary Subtract the specified number of months from the given date.
+ *
+ * @description
+ * Subtract the specified number of months from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the months subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 5 months from 1 February 2015:
+ * const result = subMonths(new Date(2015, 1, 1), 5)
+ * //=> Mon Sep 01 2014 00:00:00
+ */
+export default function subMonths(dirtyDate: Date | number, dirtyAmount: number): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addMonths(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subMonths/test.ts b/date-fns/src/subMonths/test.ts
new file mode 100644
index 0000000..0b5c32d
--- /dev/null
+++ b/date-fns/src/subMonths/test.ts
@@ -0,0 +1,69 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subMonths from '.'
+
+describe('subMonths', function() {
+ it('subtracts the given number of months', function() {
+ const result = subMonths(new Date(2015, 1 /* Feb */, 1), 5)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subMonths(new Date(2015, 8 /* Sep */, 1).getTime(), 12)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subMonths(new Date(2015, 1 /* Feb */, 1), 5.999)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = subMonths(new Date(2015, 1 /* Feb */, 1), '5')
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ subMonths(date, 12)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('works well if the desired month has fewer days and the provided date is in the last day of a month', function() {
+ const date = new Date(2014, 11 /* Dec */, 31)
+ const result = subMonths(date, 3)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(1, 2 /* Mar */, 31)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(1, 1 /* Feb */, 28)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = subMonths(initialDate, 1)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subMonths(new Date(NaN), 5)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subMonths(new Date(2015, 1 /* Feb */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subMonths.bind(null), TypeError)
+ assert.throws(subMonths.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subQuarters/benchmark.js b/date-fns/src/subQuarters/benchmark.js
new file mode 100644
index 0000000..2af1732
--- /dev/null
+++ b/date-fns/src/subQuarters/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subQuarters from '.'
+import moment from 'moment'
+
+suite('subQuarters', function () {
+ benchmark('date-fns', function () {
+ return subQuarters(this.date, 1)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(1, 'quarters')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subQuarters/index.d.ts b/date-fns/src/subQuarters/index.d.ts
new file mode 100644
index 0000000..216a1f3
--- /dev/null
+++ b/date-fns/src/subQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subQuarters } from 'date-fns'
+export default subQuarters
diff --git a/date-fns/src/subQuarters/index.js.flow b/date-fns/src/subQuarters/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subQuarters/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subQuarters/index.ts b/date-fns/src/subQuarters/index.ts
new file mode 100644
index 0000000..0833596
--- /dev/null
+++ b/date-fns/src/subQuarters/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addQuarters from '../addQuarters/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subQuarters
+ * @category Quarter Helpers
+ * @summary Subtract the specified number of year quarters from the given date.
+ *
+ * @description
+ * Subtract the specified number of year quarters from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of quarters to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the quarters subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 3 quarters from 1 September 2014:
+ * const result = subQuarters(new Date(2014, 8, 1), 3)
+ * //=> Sun Dec 01 2013 00:00:00
+ */
+export default function subQuarters(dirtyDate: Date | number, dirtyAmount: number): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addQuarters(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subQuarters/test.ts b/date-fns/src/subQuarters/test.ts
new file mode 100644
index 0000000..cfd1d9f
--- /dev/null
+++ b/date-fns/src/subQuarters/test.ts
@@ -0,0 +1,69 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subQuarters from '.'
+
+describe('subQuarters', function() {
+ it('subtracts the given number of quarters', function() {
+ const result = subQuarters(new Date(2014, 8 /* Sep */, 1), 3)
+ assert.deepEqual(result, new Date(2013, 11 /* Dec */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subQuarters(new Date(2014, 8 /* Sep */, 1).getTime(), 4)
+ assert.deepEqual(result, new Date(2013, 8 /* Sep */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subQuarters(new Date(2014, 8 /* Sep */, 1), 3.33)
+ assert.deepEqual(result, new Date(2013, 11 /* Dec */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = subQuarters(new Date(2014, 8 /* Sep */, 1), '3')
+ assert.deepEqual(result, new Date(2013, 11 /* Dec */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ subQuarters(date, 3)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('works well if the desired month has fewer days and the provided date is in the last day of a month', function() {
+ const date = new Date(2014, 11 /* Dec */, 31)
+ const result = subQuarters(date, 1)
+ assert.deepEqual(result, new Date(2014, 8 /* Sep */, 30))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(0, 10 /* Nov */, 30)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(0, 1 /* Feb */, 29)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = subQuarters(initialDate, 3)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subQuarters(new Date(NaN), 3)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subQuarters(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subQuarters.bind(null), TypeError)
+ assert.throws(subQuarters.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subSeconds/benchmark.js b/date-fns/src/subSeconds/benchmark.js
new file mode 100644
index 0000000..7801686
--- /dev/null
+++ b/date-fns/src/subSeconds/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subSeconds from '.'
+import moment from 'moment'
+
+suite('subSeconds', function () {
+ benchmark('date-fns', function () {
+ return subSeconds(this.date, 100)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(100, 'seconds')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subSeconds/index.d.ts b/date-fns/src/subSeconds/index.d.ts
new file mode 100644
index 0000000..f718279
--- /dev/null
+++ b/date-fns/src/subSeconds/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subSeconds } from 'date-fns'
+export default subSeconds
diff --git a/date-fns/src/subSeconds/index.js.flow b/date-fns/src/subSeconds/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subSeconds/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subSeconds/index.ts b/date-fns/src/subSeconds/index.ts
new file mode 100644
index 0000000..72142a6
--- /dev/null
+++ b/date-fns/src/subSeconds/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addSeconds from '../addSeconds/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subSeconds
+ * @category Second Helpers
+ * @summary Subtract the specified number of seconds from the given date.
+ *
+ * @description
+ * Subtract the specified number of seconds from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of seconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the seconds subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 30 seconds from 10 July 2014 12:45:00:
+ * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)
+ * //=> Thu Jul 10 2014 12:44:30
+ */
+export default function subSeconds(dirtyDate: Date | number, dirtyAmount: number): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addSeconds(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subSeconds/test.ts b/date-fns/src/subSeconds/test.ts
new file mode 100644
index 0000000..1b0b97d
--- /dev/null
+++ b/date-fns/src/subSeconds/test.ts
@@ -0,0 +1,55 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subSeconds from '.'
+
+describe('subSeconds', function() {
+ it('subtracts the given number of seconds', function() {
+ const result = subSeconds(new Date(2014, 6 /* Jul */, 10, 12, 45, 0), 30)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 44, 30))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subSeconds(
+ new Date(2014, 6 /* Jul */, 10, 12, 45, 0).getTime(),
+ 20
+ )
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 44, 40))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subSeconds(new Date(2014, 6 /* Jul */, 10, 12, 45, 0), 30.5)
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 44, 30))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = subSeconds(new Date(2014, 6 /* Jul */, 10, 12, 45, 0), '30')
+ assert.deepEqual(result, new Date(2014, 6 /* Jul */, 10, 12, 44, 30))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 6 /* Jul */, 10, 12, 45, 0)
+ subSeconds(date, 15)
+ assert.deepEqual(date, new Date(2014, 6 /* Jul */, 10, 12, 45, 0))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subSeconds(new Date(NaN), 30)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subSeconds(new Date(2014, 6 /* Jul */, 10, 12, 45, 0), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subSeconds.bind(null), TypeError)
+ assert.throws(subSeconds.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subWeeks/benchmark.js b/date-fns/src/subWeeks/benchmark.js
new file mode 100644
index 0000000..0fef6a6
--- /dev/null
+++ b/date-fns/src/subWeeks/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subWeeks from '.'
+import moment from 'moment'
+
+suite('subWeeks', function () {
+ benchmark('date-fns', function () {
+ return subWeeks(this.date, 8)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(8, 'weeks')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subWeeks/index.d.ts b/date-fns/src/subWeeks/index.d.ts
new file mode 100644
index 0000000..b6e3c82
--- /dev/null
+++ b/date-fns/src/subWeeks/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subWeeks } from 'date-fns'
+export default subWeeks
diff --git a/date-fns/src/subWeeks/index.js.flow b/date-fns/src/subWeeks/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subWeeks/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subWeeks/index.ts b/date-fns/src/subWeeks/index.ts
new file mode 100644
index 0000000..d12d2a0
--- /dev/null
+++ b/date-fns/src/subWeeks/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addWeeks from '../addWeeks/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subWeeks
+ * @category Week Helpers
+ * @summary Subtract the specified number of weeks from the given date.
+ *
+ * @description
+ * Subtract the specified number of weeks from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of weeks to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the weeks subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 4 weeks from 1 September 2014:
+ * const result = subWeeks(new Date(2014, 8, 1), 4)
+ * //=> Mon Aug 04 2014 00:00:00
+ */
+export default function subWeeks(dirtyDate: Date | number, dirtyAmount: number): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addWeeks(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subWeeks/test.ts b/date-fns/src/subWeeks/test.ts
new file mode 100644
index 0000000..efa311b
--- /dev/null
+++ b/date-fns/src/subWeeks/test.ts
@@ -0,0 +1,52 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subWeeks from '.'
+
+describe('subWeeks', function() {
+ it('subtracts the given number of weeks', function() {
+ const result = subWeeks(new Date(2014, 8 /* Sep */, 1), 4)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 4))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subWeeks(new Date(2014, 8 /* Sep */, 1).getTime(), 1)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 25))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subWeeks(new Date(2014, 8 /* Sep */, 1), 4.2)
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 4))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = subWeeks(new Date(2014, 8 /* Sep */, 1), '4')
+ assert.deepEqual(result, new Date(2014, 7 /* Aug */, 4))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ subWeeks(date, 2)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subWeeks(new Date(NaN), 4)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subWeeks(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subWeeks.bind(null), TypeError)
+ assert.throws(subWeeks.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/subYears/benchmark.js b/date-fns/src/subYears/benchmark.js
new file mode 100644
index 0000000..eada68d
--- /dev/null
+++ b/date-fns/src/subYears/benchmark.js
@@ -0,0 +1,21 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import subYears from '.'
+import moment from 'moment'
+
+suite('subYears', function () {
+ benchmark('date-fns', function () {
+ return subYears(this.date, 5)
+ })
+
+ benchmark('Moment.js', function () {
+ return this.moment.subtract(5, 'years')
+ })
+}, {
+ setup: function () {
+ this.date = new Date()
+ this.moment = moment()
+ }
+})
diff --git a/date-fns/src/subYears/index.d.ts b/date-fns/src/subYears/index.d.ts
new file mode 100644
index 0000000..5edf482
--- /dev/null
+++ b/date-fns/src/subYears/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { subYears } from 'date-fns'
+export default subYears
diff --git a/date-fns/src/subYears/index.js.flow b/date-fns/src/subYears/index.js.flow
new file mode 100644
index 0000000..f568f0d
--- /dev/null
+++ b/date-fns/src/subYears/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (date: Date | number, amount: number) => Date
diff --git a/date-fns/src/subYears/index.ts b/date-fns/src/subYears/index.ts
new file mode 100644
index 0000000..2619a6c
--- /dev/null
+++ b/date-fns/src/subYears/index.ts
@@ -0,0 +1,32 @@
+import toInteger from '../_lib/toInteger/index'
+import addYears from '../addYears/index'
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name subYears
+ * @category Year Helpers
+ * @summary Subtract the specified number of years from the given date.
+ *
+ * @description
+ * Subtract the specified number of years from the given date.
+ *
+ * ### v2.0.0 breaking changes:
+ *
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
+ *
+ * @param {Date|Number} date - the date to be changed
+ * @param {Number} amount - the amount of years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
+ * @returns {Date} the new date with the years subtracted
+ * @throws {TypeError} 2 arguments required
+ *
+ * @example
+ * // Subtract 5 years from 1 September 2014:
+ * const result = subYears(new Date(2014, 8, 1), 5)
+ * //=> Tue Sep 01 2009 00:00:00
+ */
+export default function subYears(dirtyDate: Date | number, dirtyAmount: number): Date {
+ requiredArgs(2, arguments)
+
+ const amount = toInteger(dirtyAmount)
+ return addYears(dirtyDate, -amount)
+}
diff --git a/date-fns/src/subYears/test.ts b/date-fns/src/subYears/test.ts
new file mode 100644
index 0000000..24b431e
--- /dev/null
+++ b/date-fns/src/subYears/test.ts
@@ -0,0 +1,68 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import subYears from '.'
+
+describe('subYears', function() {
+ it('subtracts the given number of years', function() {
+ const result = subYears(new Date(2014, 8 /* Sep */, 1), 5)
+ assert.deepEqual(result, new Date(2009, 8 /* Sep */, 1))
+ })
+
+ it('accepts a timestamp', function() {
+ const result = subYears(new Date(2014, 8 /* Sep */, 1).getTime(), 12)
+ assert.deepEqual(result, new Date(2002, 8 /* Sep */, 1))
+ })
+
+ it('converts a fractional number to an integer', function() {
+ const result = subYears(new Date(2014, 8 /* Sep */, 1), 5.1)
+ assert.deepEqual(result, new Date(2009, 8 /* Sep */, 1))
+ })
+
+ it('implicitly converts number arguments', function() {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = subYears(new Date(2014, 8 /* Sep */, 1), '5')
+ assert.deepEqual(result, new Date(2009, 8 /* Sep */, 1))
+ })
+
+ it('does not mutate the original date', function() {
+ const date = new Date(2014, 8 /* Sep */, 1)
+ subYears(date, 12)
+ assert.deepEqual(date, new Date(2014, 8 /* Sep */, 1))
+ })
+
+ it('handles the leap years properly', function() {
+ const result = subYears(new Date(2016, 1 /* Feb */, 29), 1)
+ assert.deepEqual(result, new Date(2015, 1 /* Feb */, 28))
+ })
+
+ it('handles dates before 100 AD', function() {
+ const initialDate = new Date(0)
+ initialDate.setFullYear(0, 1 /* Feb */, 29)
+ initialDate.setHours(0, 0, 0, 0)
+ const expectedResult = new Date(0)
+ expectedResult.setFullYear(-1, 1 /* Feb */, 28)
+ expectedResult.setHours(0, 0, 0, 0)
+ const result = subYears(initialDate, 1)
+ assert.deepEqual(result, expectedResult)
+ })
+
+ it('returns `Invalid Date` if the given date is invalid', function() {
+ const result = subYears(new Date(NaN), 5)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('returns `Invalid Date` if the given amount is NaN', function() {
+ const result = subYears(new Date(2014, 8 /* Sep */, 1), NaN)
+ // @ts-expect-error
+ assert(result instanceof Date && isNaN(result))
+ })
+
+ it('throws TypeError exception if passed less than 2 arguments', function() {
+ assert.throws(subYears.bind(null), TypeError)
+ assert.throws(subYears.bind(null, 1), TypeError)
+ })
+})
diff --git a/date-fns/src/toDate/benchmark.js b/date-fns/src/toDate/benchmark.js
new file mode 100644
index 0000000..290d5d3
--- /dev/null
+++ b/date-fns/src/toDate/benchmark.js
@@ -0,0 +1,16 @@
+// @flow
+/* eslint-env mocha */
+/* global suite, benchmark */
+
+import toDate from '.'
+import moment from 'moment'
+
+suite('toDate', function() {
+ benchmark('date-fns', function() {
+ return toDate(539980200000)
+ })
+
+ benchmark('Moment.js', function() {
+ return moment(539980200000)
+ })
+})
diff --git a/date-fns/src/toDate/index.d.ts b/date-fns/src/toDate/index.d.ts
new file mode 100644
index 0000000..0231ae7
--- /dev/null
+++ b/date-fns/src/toDate/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { toDate } from 'date-fns'
+export default toDate
diff --git a/date-fns/src/toDate/index.js.flow b/date-fns/src/toDate/index.js.flow
new file mode 100644
index 0000000..19292c7
--- /dev/null
+++ b/date-fns/src/toDate/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (argument: Date | number) => Date
diff --git a/date-fns/src/toDate/index.ts b/date-fns/src/toDate/index.ts
new file mode 100644
index 0000000..a7282ed
--- /dev/null
+++ b/date-fns/src/toDate/index.ts
@@ -0,0 +1,61 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+
+/**
+ * @name toDate
+ * @category Common Helpers
+ * @summary Convert the given argument to an instance of Date.
+ *
+ * @description
+ * Convert the given argument to an instance of Date.
+ *
+ * If the argument is an instance of Date, the function returns its clone.
+ *
+ * If the argument is a number, it is treated as a timestamp.
+ *
+ * If the argument is none of the above, the function returns Invalid Date.
+ *
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
+ *
+ * @param {Date|Number} argument - the value to convert
+ * @returns {Date} the parsed date in the local time zone
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Clone the date:
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
+ * //=> Tue Feb 11 2014 11:30:30
+ *
+ * @example
+ * // Convert the timestamp to date:
+ * const result = toDate(1392098430000)
+ * //=> Tue Feb 11 2014 11:30:30
+ */
+export default function toDate(argument: Date | number): Date {
+ requiredArgs(1, arguments)
+
+ const argStr = Object.prototype.toString.call(argument)
+
+ // Clone the date
+ if (
+ argument instanceof Date ||
+ (typeof argument === 'object' && argStr === '[object Date]')
+ ) {
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
+ return new Date(argument.getTime())
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
+ return new Date(argument)
+ } else {
+ if (
+ (typeof argument === 'string' || argStr === '[object String]') &&
+ typeof console !== 'undefined'
+ ) {
+ // eslint-disable-next-line no-console
+ console.warn(
+ "Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"
+ )
+ // eslint-disable-next-line no-console
+ console.warn(new Error().stack)
+ }
+ return new Date(NaN)
+ }
+}
diff --git a/date-fns/src/toDate/test.ts b/date-fns/src/toDate/test.ts
new file mode 100644
index 0000000..c376727
--- /dev/null
+++ b/date-fns/src/toDate/test.ts
@@ -0,0 +1,136 @@
+// @flow
+/* eslint-env mocha */
+
+import assert from 'power-assert'
+import sinon from 'sinon'
+import toDate from '.'
+
+describe('toDate', () => {
+ describe('date argument', () => {
+ it('returns a clone of the given date', () => {
+ const date = new Date(2016, 0, 1)
+ const dateClone = toDate(date)
+ dateClone.setFullYear(2015)
+ assert.deepEqual(date, new Date(2016, 0, 1))
+ })
+ })
+
+ describe('timestamp argument', () => {
+ it('creates a date from the timestamp', () => {
+ const timestamp = new Date(2016, 0, 1, 23, 30, 45, 123).getTime()
+ const result = toDate(timestamp)
+ assert.deepEqual(result, new Date(2016, 0, 1, 23, 30, 45, 123))
+ })
+ })
+
+ describe('invalid argument', () => {
+ mockConsoleWarn()
+
+ it('returns Invalid Date if argument is a string', () => {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = toDate('1987-02-11')
+ assert(result instanceof Date)
+ // @ts-expect-error
+ assert(isNaN(result))
+ })
+
+ it('prints deprecation warning if the argument is a string', () => {
+ // $ExpectedMistake
+ console.warn = sinon.spy() // eslint-disable-line no-console
+ // $ExpectedMistake
+ // @ts-expect-error
+ toDate('1987-02-11')
+ assert(
+ // eslint-disable-next-line no-console
+ // @ts-expect-error
+ console.warn.calledWith(
+ "Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"
+ )
+ )
+ })
+
+ it('returns Invalid Date if argument is NaN', () => {
+ const result = toDate(NaN)
+ assert(result instanceof Date)
+ // @ts-expect-error
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is Invalid Date', () => {
+ const result = toDate(new Date(NaN))
+ assert(result instanceof Date)
+ // @ts-expect-error
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is null', () => {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = toDate(null)
+ assert(result instanceof Date)
+ // @ts-expect-error
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is undefined', () => {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = toDate(undefined)
+ assert(result instanceof Date)
+ // @ts-expect-error
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is false', () => {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = toDate(false)
+ assert(result instanceof Date)
+ // @ts-expect-error
+ assert(isNaN(result))
+ })
+
+ it('returns Invalid Date if argument is true', () => {
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = toDate(true)
+ assert(result instanceof Date)
+ // @ts-expect-error
+ assert(isNaN(result))
+ })
+ })
+
+ describe('argument conversion', () => {
+ it('implicitly converts instance of Number into a number', () => {
+ // eslint-disable-next-line no-new-wrappers
+ const timestamp = new Number(
+ new Date(2016, 0, 1, 23, 30, 45, 123).getTime()
+ )
+ // $ExpectedMistake
+ // @ts-expect-error
+ const result = toDate(timestamp)
+ assert.deepEqual(result, new Date(2016, 0, 1, 23, 30, 45, 123))
+ })
+ })
+
+ it('throws TypeError exception if passed less than 1 argument', () => {
+ assert.throws(toDate.bind(null), TypeError)
+ })
+})
+
+function mockConsoleWarn() {
+ let originalWarn
+
+ beforeEach(() => {
+ originalWarn = console.warn // eslint-disable-line no-console
+ // $ExpectedMistake
+ console.warn = () => {} // eslint-disable-line no-console
+ })
+
+ afterEach(() => {
+ // $ExpectedMistake
+ // @ts-expect-error
+ console.warn = originalWarn // eslint-disable-line no-console
+ })
+}
diff --git a/date-fns/src/types.ts b/date-fns/src/types.ts
new file mode 100644
index 0000000..9ce6059
--- /dev/null
+++ b/date-fns/src/types.ts
@@ -0,0 +1,53 @@
+import { Locale } from './locale/types'
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+export interface Duration {
+ years?: number
+ months?: number
+ weeks?: number
+ days?: number
+ hours?: number
+ minutes?: number
+ seconds?: number
+}
+
+export interface Interval {
+ start: Date | number
+ end: Date | number
+}
+
+export interface StepOptions {
+ step?: number
+}
+
+export interface WeekStartOptions {
+ weekStartsOn?: Day
+}
+
+export interface LocaleOptions {
+ locale?: Locale
+}
+
+export type FirstWeekContainsDate = 1 | 4
+
+export interface FirstWeekContainsDateOptions {
+ firstWeekContainsDate?: FirstWeekContainsDate
+}
+
+export interface DateValues {
+ year?: number
+ month?: number
+ date?: number
+ hours?: number
+ minutes?: number
+ seconds?: number
+ milliseconds?: number
+}
+
+export type Unit = 'second'
+ | 'minute'
+ | 'hour'
+ | 'day'
+ | 'month'
+ | 'year';
diff --git a/date-fns/src/weeksToDays/index.d.ts b/date-fns/src/weeksToDays/index.d.ts
new file mode 100644
index 0000000..dd8c1fe
--- /dev/null
+++ b/date-fns/src/weeksToDays/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { weeksToDays } from 'date-fns'
+export default weeksToDays
diff --git a/date-fns/src/weeksToDays/index.js.flow b/date-fns/src/weeksToDays/index.js.flow
new file mode 100644
index 0000000..257c1cc
--- /dev/null
+++ b/date-fns/src/weeksToDays/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (weeks: number) => number
diff --git a/date-fns/src/weeksToDays/index.ts b/date-fns/src/weeksToDays/index.ts
new file mode 100644
index 0000000..6675186
--- /dev/null
+++ b/date-fns/src/weeksToDays/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { daysInWeek } from '../constants/index'
+
+/**
+ * @name weeksToDays
+ * @category Conversion Helpers
+ * @summary Convert weeks to days.
+ *
+ * @description
+ * Convert a number of weeks to a full number of days.
+ *
+ * @param {number} weeks - number of weeks to be converted
+ *
+ * @returns {number} the number of weeks converted in days
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 weeks into days
+ * const result = weeksToDays(2)
+ * //=> 14
+ */
+export default function weeksToDays(weeks: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(weeks * daysInWeek)
+}
diff --git a/date-fns/src/weeksToDays/test.ts b/date-fns/src/weeksToDays/test.ts
new file mode 100644
index 0000000..46bbab1
--- /dev/null
+++ b/date-fns/src/weeksToDays/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import weeksToDays from '.'
+
+describe('weeksToDays', function () {
+ it('converts weeks to days', function () {
+ assert(weeksToDays(1) === 7)
+ assert(weeksToDays(2) === 14)
+ })
+
+ it('uses floor rounding', () => {
+ assert(weeksToDays(1.5) === 10)
+ assert(weeksToDays(0.1) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(weeksToDays(1.5) === 10)
+ assert(weeksToDays(0) === 0)
+ })
+})
diff --git a/date-fns/src/yearsToMonths/index.d.ts b/date-fns/src/yearsToMonths/index.d.ts
new file mode 100644
index 0000000..9e9126d
--- /dev/null
+++ b/date-fns/src/yearsToMonths/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { yearsToMonths } from 'date-fns'
+export default yearsToMonths
diff --git a/date-fns/src/yearsToMonths/index.js.flow b/date-fns/src/yearsToMonths/index.js.flow
new file mode 100644
index 0000000..d081919
--- /dev/null
+++ b/date-fns/src/yearsToMonths/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (years: number) => number
diff --git a/date-fns/src/yearsToMonths/index.ts b/date-fns/src/yearsToMonths/index.ts
new file mode 100644
index 0000000..2e547bd
--- /dev/null
+++ b/date-fns/src/yearsToMonths/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { monthsInYear } from '../constants/index'
+
+/**
+ * @name yearsToMonths
+ * @category Conversion Helpers
+ * @summary Convert years to months.
+ *
+ * @description
+ * Convert a number of years to a full number of months.
+ *
+ * @param {number} years - number of years to be converted
+ *
+ * @returns {number} the number of years converted in months
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 years into months
+ * const result = yearsToMonths(2)
+ * //=> 24
+ */
+export default function yearsToMonths(years: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(years * monthsInYear)
+}
diff --git a/date-fns/src/yearsToMonths/test.ts b/date-fns/src/yearsToMonths/test.ts
new file mode 100644
index 0000000..e91231c
--- /dev/null
+++ b/date-fns/src/yearsToMonths/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import yearsToMonths from '.'
+
+describe('yearsToMonths', function () {
+ it('converts years to months', function () {
+ assert(yearsToMonths(1) === 12)
+ assert(yearsToMonths(2) === 24)
+ })
+
+ it('uses floor rounding', () => {
+ assert(yearsToMonths(1.7) === 20)
+ assert(yearsToMonths(0.1) === 1)
+ })
+
+ it('handles border values', () => {
+ assert(yearsToMonths(1.5) === 18)
+ assert(yearsToMonths(0) === 0)
+ })
+})
diff --git a/date-fns/src/yearsToQuarters/index.d.ts b/date-fns/src/yearsToQuarters/index.d.ts
new file mode 100644
index 0000000..e3ebc70
--- /dev/null
+++ b/date-fns/src/yearsToQuarters/index.d.ts
@@ -0,0 +1,4 @@
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+import { yearsToQuarters } from 'date-fns'
+export default yearsToQuarters
diff --git a/date-fns/src/yearsToQuarters/index.js.flow b/date-fns/src/yearsToQuarters/index.js.flow
new file mode 100644
index 0000000..d081919
--- /dev/null
+++ b/date-fns/src/yearsToQuarters/index.js.flow
@@ -0,0 +1,52 @@
+// @flow
+// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
+
+export type Interval = {
+ start: Date | number,
+ end: Date | number,
+}
+
+export type Locale = {
+ code?: string,
+ formatDistance?: (...args: Array<any>) => any,
+ formatRelative?: (...args: Array<any>) => any,
+ localize?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ formatLong?: {
+ date: (...args: Array<any>) => any,
+ time: (...args: Array<any>) => any,
+ dateTime: (...args: Array<any>) => any,
+ },
+ match?: {
+ ordinalNumber: (...args: Array<any>) => any,
+ era: (...args: Array<any>) => any,
+ quarter: (...args: Array<any>) => any,
+ month: (...args: Array<any>) => any,
+ day: (...args: Array<any>) => any,
+ dayPeriod: (...args: Array<any>) => any,
+ },
+ options?: {
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
+ firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
+ },
+}
+
+export type Duration = {
+ years?: number,
+ months?: number,
+ weeks?: number,
+ days?: number,
+ hours?: number,
+ minutes?: number,
+ seconds?: number,
+}
+
+export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
+
+declare module.exports: (years: number) => number
diff --git a/date-fns/src/yearsToQuarters/index.ts b/date-fns/src/yearsToQuarters/index.ts
new file mode 100644
index 0000000..223e7d5
--- /dev/null
+++ b/date-fns/src/yearsToQuarters/index.ts
@@ -0,0 +1,25 @@
+import requiredArgs from '../_lib/requiredArgs/index'
+import { quartersInYear } from '../constants/index'
+
+/**
+ * @name yearsToQuarters
+ * @category Conversion Helpers
+ * @summary Convert years to quarters.
+ *
+ * @description
+ * Convert a number of years to a full number of quarters.
+ *
+ * @param {number} years - number of years to be converted
+ *
+ * @returns {number} the number of years converted in quarters
+ * @throws {TypeError} 1 argument required
+ *
+ * @example
+ * // Convert 2 years to quarters
+ * const result = yearsToQuarters(2)
+ * //=> 8
+ */
+export default function yearsToQuarters(years: number): number {
+ requiredArgs(1, arguments)
+ return Math.floor(years * quartersInYear)
+}
diff --git a/date-fns/src/yearsToQuarters/test.ts b/date-fns/src/yearsToQuarters/test.ts
new file mode 100644
index 0000000..a08ef68
--- /dev/null
+++ b/date-fns/src/yearsToQuarters/test.ts
@@ -0,0 +1,21 @@
+/* eslint-env mocha */
+
+import assert from 'assert'
+import yearsToQuarters from '.'
+
+describe('yearsToQuarters', function () {
+ it('converts years to quarters', function () {
+ assert(yearsToQuarters(1) === 4)
+ assert(yearsToQuarters(2) === 8)
+ })
+
+ it('uses floor rounding', () => {
+ assert(yearsToQuarters(1.3) === 5)
+ assert(yearsToQuarters(0.2) === 0)
+ })
+
+ it('handles border values', () => {
+ assert(yearsToQuarters(1.5) === 6)
+ assert(yearsToQuarters(0) === 0)
+ })
+})