Skip to content

Commit

Permalink
New date-fns version (and some extra methods) (#222)
Browse files Browse the repository at this point in the history
* new version of date-fns

* added some interval methods

* Updating codesandbox references

* clonedeep

* isEmpty

* simpler isEmpty implementation

* updated missing

* Updating codesandbox references

* jest-env moved

* Updating codesandbox references

* fix coverage

* Updating codesandbox references

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
cedmax and github-actions[bot] authored Mar 16, 2024
1 parent 5a9169b commit dc6f37b
Show file tree
Hide file tree
Showing 117 changed files with 775 additions and 302 deletions.
4 changes: 2 additions & 2 deletions modules/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module.exports = ${method}()
exports['date-fns'] = (
method,
example
) => `// https://date-fns.org/v2.13.0/docs/${method}
const ${method} = require('date-fns/${method}')
) => `// https://date-fns.org/v3.5.0/docs/${method}
import { ${method} } from 'date-fns'
${example || ''}
`
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"axios": "0.27.2",
"date-fns": "2.28.0",
"date-fns": "3.5.0",
"is-mobile": "^3.1.1",
"lodash": "4.17.21",
"next": "^12.1.6",
Expand Down Expand Up @@ -45,7 +45,7 @@
"inquirer": "8.2.4",
"jest": "^28.1.0",
"jest-date-mock": "1.0.8",
"jest-environment-jsdom": "^28.1.0",
"jest-environment-jsdom": "^28.1.3",
"lint-staged": "12.4.2",
"prettier": "2.6.2",
"readme-filename": "^1.0.0",
Expand Down
5 changes: 4 additions & 1 deletion src/code-sandbox-refs.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/code-sandbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,5 +270,8 @@
"lodash/lang/isMatch": "https://codesandbox.io/s/rt6l0y?previewwindow=tests&file=/lang/isMatch/vanilla.js",
"lodash/lang/isSafeInteger": "https://codesandbox.io/s/qnjwlo?previewwindow=tests&file=/lang/isSafeInteger/vanilla.js",
"lodash/string/deburr": "https://codesandbox.io/s/eimm97?previewwindow=tests&file=/string/deburr/vanilla.js",
"lodash/number/random": "https://codesandbox.io/s/1m9u5r?previewwindow=tests&file=/number/random/vanilla.js"
"lodash/number/random": "https://codesandbox.io/s/1m9u5r?previewwindow=tests&file=/number/random/vanilla.js",
"date-fns/01-interval/eachDayOfInterval": "https://codesandbox.io/s/gv4w2v?previewwindow=tests&file=/01-interval/eachDayOfInterval/vanilla.js",
"lodash/lang/cloneDeep": "https://codesandbox.io/s/j5mnp4?previewwindow=tests&file=/lang/cloneDeep/vanilla.js",
"lodash/lang/isEmpty": "https://codesandbox.io/s/8yv474?previewwindow=tests&file=/lang/isEmpty/vanilla.js"
}
203 changes: 100 additions & 103 deletions src/content/date-fns-missing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,139 +4,136 @@

## Generic Helpers

[format](https://date-fns.org/v2.13.0/docs/format)
[formatDistance](https://date-fns.org/v2.13.0/docs/formatDistance)
[formatDistanceStrict](https://date-fns.org/v2.13.0/docs/formatDistanceStrict)
[formatDistanceToNow](https://date-fns.org/v2.13.0/docs/formatDistanceToNow)
[formatDistanceToNowStrict](https://date-fns.org/v2.13.0/docs/formatDistanceToNowStrict)
[formatISO](https://date-fns.org/v2.13.0/docs/formatISO)
[formatISO9075](https://date-fns.org/v2.13.0/docs/formatISO9075)
[formatISODuration](https://date-fns.org/v2.13.0/docs/formatISODuration)
[formatRFC3339](https://date-fns.org/v2.13.0/docs/formatRFC3339)
[formatRFC7231](https://date-fns.org/v2.13.0/docs/formatRFC7231)
[formatRelative](https://date-fns.org/v2.13.0/docs/formatRelative)
[intervalToDuration](https://date-fns.org/v2.13.0/docs/intervalToDuration)
[lightFormat](https://date-fns.org/v2.13.0/docs/lightFormat)
[parse](https://date-fns.org/v2.13.0/docs/parse)
[parseISO](https://date-fns.org/v2.13.0/docs/parseISO)
[parseJSON](https://date-fns.org/v2.13.0/docs/parseJSON)
[set](https://date-fns.org/v2.13.0/docs/set)
[sub](https://date-fns.org/v2.13.0/docs/sub)
[toDate](https://date-fns.org/v2.13.0/docs/toDate)
[format](https://date-fns.org/v3.5.0/docs/format)
[formatDistance](https://date-fns.org/v3.5.0/docs/formatDistance)
[formatDistanceStrict](https://date-fns.org/v3.5.0/docs/formatDistanceStrict)
[formatDistanceToNow](https://date-fns.org/v3.5.0/docs/formatDistanceToNow)
[formatDistanceToNowStrict](https://date-fns.org/v3.5.0/docs/formatDistanceToNowStrict)
[formatISO](https://date-fns.org/v3.5.0/docs/formatISO)
[formatISO9075](https://date-fns.org/v3.5.0/docs/formatISO9075)
[formatISODuration](https://date-fns.org/v3.5.0/docs/formatISODuration)
[formatRFC3339](https://date-fns.org/v3.5.0/docs/formatRFC3339)
[formatRFC7231](https://date-fns.org/v3.5.0/docs/formatRFC7231)
[formatRelative](https://date-fns.org/v3.5.0/docs/formatRelative)
[intervalToDuration](https://date-fns.org/v3.5.0/docs/intervalToDuration)
[lightFormat](https://date-fns.org/v3.5.0/docs/lightFormat)
[parse](https://date-fns.org/v3.5.0/docs/parse)
[parseISO](https://date-fns.org/v3.5.0/docs/parseISO)
[parseJSON](https://date-fns.org/v3.5.0/docs/parseJSON)
[set](https://date-fns.org/v3.5.0/docs/set)
[sub](https://date-fns.org/v3.5.0/docs/sub)
[toDate](https://date-fns.org/v3.5.0/docs/toDate)

## Interval Helpers

[areIntervalsOverlapping](https://date-fns.org/v2.13.0/docs/areIntervalsOverlapping)
[eachDayOfInterval](https://date-fns.org/v2.13.0/docs/eachDayOfInterval)
[eachMonthOfInterval](https://date-fns.org/v2.13.0/docs/eachMonthOfInterval)
[eachWeekOfInterval](https://date-fns.org/v2.13.0/docs/eachWeekOfInterval)
[eachWeekendOfInterval](https://date-fns.org/v2.13.0/docs/eachWeekendOfInterval)
[eachYearOfInterval](https://date-fns.org/v2.13.0/docs/eachYearOfInterval)
[getOverlappingDaysInIntervals](https://date-fns.org/v2.13.0/docs/getOverlappingDaysInIntervals)
[isWithinInterval](https://date-fns.org/v2.13.0/docs/isWithinInterval)
[eachMonthOfInterval](https://date-fns.org/v3.5.0/docs/eachMonthOfInterval)
[eachWeekOfInterval](https://date-fns.org/v3.5.0/docs/eachWeekOfInterval)
[eachWeekendOfInterval](https://date-fns.org/v3.5.0/docs/eachWeekendOfInterval)
[eachYearOfInterval](https://date-fns.org/v3.5.0/docs/eachYearOfInterval)
[getOverlappingDaysInIntervals](https://date-fns.org/v3.5.0/docs/getOverlappingDaysInIntervals)

## Day Helpers

[addBusinessDays](https://date-fns.org/v2.13.0/docs/addBusinessDays)
[differenceInBusinessDays](https://date-fns.org/v2.13.0/docs/differenceInBusinessDays)
[differenceInCalendarDays](https://date-fns.org/v2.13.0/docs/differenceInCalendarDays)
[endOfDay](https://date-fns.org/v2.13.0/docs/endOfDay)
[endOfTomorrow](https://date-fns.org/v2.13.0/docs/endOfTomorrow)
[endOfYesterday](https://date-fns.org/v2.13.0/docs/endOfYesterday)
[setDayOfYear](https://date-fns.org/v2.13.0/docs/setDayOfYear)
[startOfDay](https://date-fns.org/v2.13.0/docs/startOfDay)
[startOfToday](https://date-fns.org/v2.13.0/docs/startOfToday)
[startOfTomorrow](https://date-fns.org/v2.13.0/docs/startOfTomorrow)
[startOfYesterday](https://date-fns.org/v2.13.0/docs/startOfYesterday)
[subBusinessDays](https://date-fns.org/v2.13.0/docs/subBusinessDays)
[addBusinessDays](https://date-fns.org/v3.5.0/docs/addBusinessDays)
[differenceInBusinessDays](https://date-fns.org/v3.5.0/docs/differenceInBusinessDays)
[differenceInCalendarDays](https://date-fns.org/v3.5.0/docs/differenceInCalendarDays)
[endOfDay](https://date-fns.org/v3.5.0/docs/endOfDay)
[endOfTomorrow](https://date-fns.org/v3.5.0/docs/endOfTomorrow)
[endOfYesterday](https://date-fns.org/v3.5.0/docs/endOfYesterday)
[setDayOfYear](https://date-fns.org/v3.5.0/docs/setDayOfYear)
[startOfDay](https://date-fns.org/v3.5.0/docs/startOfDay)
[startOfToday](https://date-fns.org/v3.5.0/docs/startOfToday)
[startOfTomorrow](https://date-fns.org/v3.5.0/docs/startOfTomorrow)
[startOfYesterday](https://date-fns.org/v3.5.0/docs/startOfYesterday)
[subBusinessDays](https://date-fns.org/v3.5.0/docs/subBusinessDays)

## Weekday Helpers

[setDay](https://date-fns.org/v2.13.0/docs/setDay)
[setISODay](https://date-fns.org/v2.13.0/docs/setISODay)
[setDay](https://date-fns.org/v3.5.0/docs/setDay)
[setISODay](https://date-fns.org/v3.5.0/docs/setISODay)

## Week Helpers

[addWeeks](https://date-fns.org/v2.13.0/docs/addWeeks)
[differenceInCalendarWeeks](https://date-fns.org/v2.13.0/docs/differenceInCalendarWeeks)
[differenceInWeeks](https://date-fns.org/v2.13.0/docs/differenceInWeeks)
[endOfWeek](https://date-fns.org/v2.13.0/docs/endOfWeek)
[getWeek](https://date-fns.org/v2.13.0/docs/getWeek)
[getWeekOfMonth](https://date-fns.org/v2.13.0/docs/getWeekOfMonth)
[getWeeksInMonth](https://date-fns.org/v2.13.0/docs/getWeeksInMonth)
[isSameWeek](https://date-fns.org/v2.13.0/docs/isSameWeek)
[isThisWeek](https://date-fns.org/v2.13.0/docs/isThisWeek)
[lastDayOfWeek](https://date-fns.org/v2.13.0/docs/lastDayOfWeek)
[setWeek](https://date-fns.org/v2.13.0/docs/setWeek)
[startOfWeek](https://date-fns.org/v2.13.0/docs/startOfWeek)
[subWeeks](https://date-fns.org/v2.13.0/docs/subWeeks)
[addWeeks](https://date-fns.org/v3.5.0/docs/addWeeks)
[differenceInCalendarWeeks](https://date-fns.org/v3.5.0/docs/differenceInCalendarWeeks)
[differenceInWeeks](https://date-fns.org/v3.5.0/docs/differenceInWeeks)
[endOfWeek](https://date-fns.org/v3.5.0/docs/endOfWeek)
[getWeek](https://date-fns.org/v3.5.0/docs/getWeek)
[getWeekOfMonth](https://date-fns.org/v3.5.0/docs/getWeekOfMonth)
[getWeeksInMonth](https://date-fns.org/v3.5.0/docs/getWeeksInMonth)
[isSameWeek](https://date-fns.org/v3.5.0/docs/isSameWeek)
[isThisWeek](https://date-fns.org/v3.5.0/docs/isThisWeek)
[lastDayOfWeek](https://date-fns.org/v3.5.0/docs/lastDayOfWeek)
[setWeek](https://date-fns.org/v3.5.0/docs/setWeek)
[startOfWeek](https://date-fns.org/v3.5.0/docs/startOfWeek)
[subWeeks](https://date-fns.org/v3.5.0/docs/subWeeks)

## ISO Week Helpers

[differenceInCalendarISOWeeks](https://date-fns.org/v2.13.0/docs/differenceInCalendarISOWeeks)
[endOfISOWeek](https://date-fns.org/v2.13.0/docs/endOfISOWeek)
[getISOWeek](https://date-fns.org/v2.13.0/docs/getISOWeek)
[isSameISOWeek](https://date-fns.org/v2.13.0/docs/isSameISOWeek)
[isThisISOWeek](https://date-fns.org/v2.13.0/docs/isThisISOWeek)
[lastDayOfISOWeek](https://date-fns.org/v2.13.0/docs/lastDayOfISOWeek)
[setISOWeek](https://date-fns.org/v2.13.0/docs/setISOWeek)
[startOfISOWeek](https://date-fns.org/v2.13.0/docs/startOfISOWeek)
[differenceInCalendarISOWeeks](https://date-fns.org/v3.5.0/docs/differenceInCalendarISOWeeks)
[endOfISOWeek](https://date-fns.org/v3.5.0/docs/endOfISOWeek)
[getISOWeek](https://date-fns.org/v3.5.0/docs/getISOWeek)
[isSameISOWeek](https://date-fns.org/v3.5.0/docs/isSameISOWeek)
[isThisISOWeek](https://date-fns.org/v3.5.0/docs/isThisISOWeek)
[lastDayOfISOWeek](https://date-fns.org/v3.5.0/docs/lastDayOfISOWeek)
[setISOWeek](https://date-fns.org/v3.5.0/docs/setISOWeek)
[startOfISOWeek](https://date-fns.org/v3.5.0/docs/startOfISOWeek)

## Month Helpers

[differenceInCalendarMonths](https://date-fns.org/v2.13.0/docs/differenceInCalendarMonths)
[differenceInMonths](https://date-fns.org/v2.13.0/docs/differenceInMonths)
[eachWeekendOfMonth](https://date-fns.org/v2.13.0/docs/eachWeekendOfMonth)
[endOfMonth](https://date-fns.org/v2.13.0/docs/endOfMonth)
[getDaysInMonth](https://date-fns.org/v2.13.0/docs/getDaysInMonth)
[startOfMonth](https://date-fns.org/v2.13.0/docs/startOfMonth)
[differenceInCalendarMonths](https://date-fns.org/v3.5.0/docs/differenceInCalendarMonths)
[differenceInMonths](https://date-fns.org/v3.5.0/docs/differenceInMonths)
[eachWeekendOfMonth](https://date-fns.org/v3.5.0/docs/eachWeekendOfMonth)
[endOfMonth](https://date-fns.org/v3.5.0/docs/endOfMonth)
[getDaysInMonth](https://date-fns.org/v3.5.0/docs/getDaysInMonth)
[startOfMonth](https://date-fns.org/v3.5.0/docs/startOfMonth)

## Quarter Helpers

[addQuarters](https://date-fns.org/v2.13.0/docs/addQuarters)
[differenceInCalendarQuarters](https://date-fns.org/v2.13.0/docs/differenceInCalendarQuarters)
[differenceInQuarters](https://date-fns.org/v2.13.0/docs/differenceInQuarters)
[endOfQuarter](https://date-fns.org/v2.13.0/docs/endOfQuarter)
[getQuarter](https://date-fns.org/v2.13.0/docs/getQuarter)
[isSameQuarter](https://date-fns.org/v2.13.0/docs/isSameQuarter)
[isThisQuarter](https://date-fns.org/v2.13.0/docs/isThisQuarter)
[lastDayOfQuarter](https://date-fns.org/v2.13.0/docs/lastDayOfQuarter)
[setQuarter](https://date-fns.org/v2.13.0/docs/setQuarter)
[startOfQuarter](https://date-fns.org/v2.13.0/docs/startOfQuarter)
[subQuarters](https://date-fns.org/v2.13.0/docs/subQuarters)
[addQuarters](https://date-fns.org/v3.5.0/docs/addQuarters)
[differenceInCalendarQuarters](https://date-fns.org/v3.5.0/docs/differenceInCalendarQuarters)
[differenceInQuarters](https://date-fns.org/v3.5.0/docs/differenceInQuarters)
[endOfQuarter](https://date-fns.org/v3.5.0/docs/endOfQuarter)
[getQuarter](https://date-fns.org/v3.5.0/docs/getQuarter)
[isSameQuarter](https://date-fns.org/v3.5.0/docs/isSameQuarter)
[isThisQuarter](https://date-fns.org/v3.5.0/docs/isThisQuarter)
[lastDayOfQuarter](https://date-fns.org/v3.5.0/docs/lastDayOfQuarter)
[setQuarter](https://date-fns.org/v3.5.0/docs/setQuarter)
[startOfQuarter](https://date-fns.org/v3.5.0/docs/startOfQuarter)
[subQuarters](https://date-fns.org/v3.5.0/docs/subQuarters)

## Year Helpers

[eachWeekendOfYear](https://date-fns.org/v2.13.0/docs/eachWeekendOfYear)
[endOfYear](https://date-fns.org/v2.13.0/docs/endOfYear)
[getDaysInYear](https://date-fns.org/v2.13.0/docs/getDaysInYear)
[lastDayOfYear](https://date-fns.org/v2.13.0/docs/lastDayOfYear)
[startOfYear](https://date-fns.org/v2.13.0/docs/startOfYear)
[subYears](https://date-fns.org/v2.13.0/docs/subYears)
[eachWeekendOfYear](https://date-fns.org/v3.5.0/docs/eachWeekendOfYear)
[endOfYear](https://date-fns.org/v3.5.0/docs/endOfYear)
[getDaysInYear](https://date-fns.org/v3.5.0/docs/getDaysInYear)
[lastDayOfYear](https://date-fns.org/v3.5.0/docs/lastDayOfYear)
[startOfYear](https://date-fns.org/v3.5.0/docs/startOfYear)
[subYears](https://date-fns.org/v3.5.0/docs/subYears)

## ISO Week-Numbering Year Helpers

[addISOWeekYears](https://date-fns.org/v2.13.0/docs/addISOWeekYears)
[differenceInCalendarISOWeekYears](https://date-fns.org/v2.13.0/docs/differenceInCalendarISOWeekYears)
[differenceInISOWeekYears](https://date-fns.org/v2.13.0/docs/differenceInISOWeekYears)
[endOfISOWeekYear](https://date-fns.org/v2.13.0/docs/endOfISOWeekYear)
[getISOWeekYear](https://date-fns.org/v2.13.0/docs/getISOWeekYear)
[getISOWeeksInYear](https://date-fns.org/v2.13.0/docs/getISOWeeksInYear)
[isSameISOWeekYear](https://date-fns.org/v2.13.0/docs/isSameISOWeekYear)
[lastDayOfISOWeekYear](https://date-fns.org/v2.13.0/docs/lastDayOfISOWeekYear)
[setISOWeekYear](https://date-fns.org/v2.13.0/docs/setISOWeekYear)
[startOfISOWeekYear](https://date-fns.org/v2.13.0/docs/startOfISOWeekYear)
[subISOWeekYears](https://date-fns.org/v2.13.0/docs/subISOWeekYears)
[addISOWeekYears](https://date-fns.org/v3.5.0/docs/addISOWeekYears)
[differenceInCalendarISOWeekYears](https://date-fns.org/v3.5.0/docs/differenceInCalendarISOWeekYears)
[differenceInISOWeekYears](https://date-fns.org/v3.5.0/docs/differenceInISOWeekYears)
[endOfISOWeekYear](https://date-fns.org/v3.5.0/docs/endOfISOWeekYear)
[getISOWeekYear](https://date-fns.org/v3.5.0/docs/getISOWeekYear)
[getISOWeeksInYear](https://date-fns.org/v3.5.0/docs/getISOWeeksInYear)
[isSameISOWeekYear](https://date-fns.org/v3.5.0/docs/isSameISOWeekYear)
[lastDayOfISOWeekYear](https://date-fns.org/v3.5.0/docs/lastDayOfISOWeekYear)
[setISOWeekYear](https://date-fns.org/v3.5.0/docs/setISOWeekYear)
[startOfISOWeekYear](https://date-fns.org/v3.5.0/docs/startOfISOWeekYear)
[subISOWeekYears](https://date-fns.org/v3.5.0/docs/subISOWeekYears)

## Decade Helpers

[endOfDecade](https://date-fns.org/v2.13.0/docs/endOfDecade)
[getDecade](https://date-fns.org/v2.13.0/docs/getDecade)
[lastDayOfDecade](https://date-fns.org/v2.13.0/docs/lastDayOfDecade)
[startOfDecade](https://date-fns.org/v2.13.0/docs/startOfDecade)
[endOfDecade](https://date-fns.org/v3.5.0/docs/endOfDecade)
[getDecade](https://date-fns.org/v3.5.0/docs/getDecade)
[lastDayOfDecade](https://date-fns.org/v3.5.0/docs/lastDayOfDecade)
[startOfDecade](https://date-fns.org/v3.5.0/docs/startOfDecade)

## Week-Numbering Year Helpers

[getWeekYear](https://date-fns.org/v2.13.0/docs/getWeekYear)
[setWeekYear](https://date-fns.org/v2.13.0/docs/setWeekYear)
[startOfWeekYear](https://date-fns.org/v2.13.0/docs/startOfWeekYear)
[getWeekYear](https://date-fns.org/v3.5.0/docs/getWeekYear)
[setWeekYear](https://date-fns.org/v3.5.0/docs/setWeekYear)
[startOfWeekYear](https://date-fns.org/v3.5.0/docs/startOfWeekYear)
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/closestIndexTo/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/closestIndexTo
const closestIndexTo = require('date-fns/closestIndexTo')
// https://date-fns.org/v3.5.0/docs/closestIndexTo
import { closestIndexTo } from 'date-fns'

// Which date is closer to 6 September 2015?
const dateToCompare = new Date(2015, 8, 6)
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/closestTo/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/closestTo
const closestTo = require('date-fns/closestTo')
// https://date-fns.org/v3.5.0/docs/closestTo
import { closestTo } from 'date-fns'

// Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030?
const dateToCompare = new Date(2015, 8, 6)
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/compareAsc/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/compareAsc
const compareAsc = require('date-fns/compareAsc')
// https://date-fns.org/v3.5.0/docs/compareAsc
import { compareAsc } from 'date-fns'

// Compare 11 February 1987 and 11 February 1987:
exports.equal = compareAsc(new Date(1987, 1, 11), new Date(1987, 1, 11))
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/compareDesc/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/compareDesc
const compareDesc = require('date-fns/compareDesc')
// https://date-fns.org/v3.5.0/docs/compareDesc
import { compareDesc } from 'date-fns'

// Compare 11 February 1987 and 11 February 1987:
exports.equal = compareDesc(new Date(1987, 1, 11), new Date(1987, 1, 11))
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isAfter/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isAfter
const isAfter = require('date-fns/isAfter')
// https://date-fns.org/v3.5.0/docs/isAfter
import { isAfter } from 'date-fns'

exports.before = isAfter(new Date(1987, 6, 10), new Date(1989, 1, 11))
// => true
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isBefore/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isBefore
const isBefore = require('date-fns/isBefore')
// https://date-fns.org/v3.5.0/docs/isBefore
import { isBefore } from 'date-fns'

exports.before = isBefore(new Date(1987, 6, 10), new Date(1989, 1, 11))
// => true
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isDate/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isDate
const isDate = require('date-fns/isDate')
// https://date-fns.org/v3.5.0/docs/isDate
import { isDate } from 'date-fns'

// For a valid date:
exports.valid = isDate(new Date())
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isEqual/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isEqual
const isEqual = require('date-fns/isEqual')
// https://date-fns.org/v3.5.0/docs/isEqual
import { isEqual } from 'date-fns'

// Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?
exports.notEqual = isEqual(
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isExists/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isExists
const isExists = require('date-fns/isExists')
// https://date-fns.org/v3.5.0/docs/isExists
import { isExists } from 'date-fns'

// For the valid date:
exports.valid = isExists(2018, 0, 31)
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isFuture/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isFuture
const isFuture = require('date-fns/isFuture')
// https://date-fns.org/v3.5.0/docs/isFuture
import { isFuture } from 'date-fns'

// If today is 25 September 2014, Is 31 December 2014 in the future?
exports.future = isFuture(new Date(2014, 11, 31))
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isPast/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isPast
const isPast = require('date-fns/isPast')
// https://date-fns.org/v3.5.0/docs/isPast
import { isPast } from 'date-fns'

// If today is 25 September 2014, Is 2 July 2014 in the past?
exports.past = isPast(new Date(2014, 6, 2))
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/isValid/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/isValid
const isValid = require('date-fns/isValid')
// https://date-fns.org/v3.5.0/docs/isValid
import { isValid } from 'date-fns'

// For the valid date:
exports.valid = isValid(new Date(2014, 1, 31))
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/max/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/max
const max = require('date-fns/max')
// https://date-fns.org/v3.5.0/docs/max
import { max } from 'date-fns'

// Which of these dates is the latest?
module.exports = max([
Expand Down
4 changes: 2 additions & 2 deletions src/content/date-fns/00-generic/min/date-fns.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://date-fns.org/v2.13.0/docs/min
const min = require('date-fns/min')
// https://date-fns.org/v3.5.0/docs/min
import { min } from 'date-fns'

// Which of these dates is the earliest?
module.exports = min([
Expand Down
Loading

0 comments on commit dc6f37b

Please sign in to comment.