Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove v2.0.0 breaking changes from individual fn docs #2905

Merged
merged 1 commit into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/addDays/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/addHours/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ const MILLISECONDS_IN_HOUR = 3600000
* @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
Expand Down
9 changes: 0 additions & 9 deletions src/addISOWeekYears/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
*
* 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
Expand Down
4 changes: 0 additions & 4 deletions src/addMilliseconds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/addMinutes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ const MILLISECONDS_IN_MINUTE = 60000
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/addMonths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/addQuarters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/addSeconds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/addWeeks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/addYears/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
34 changes: 0 additions & 34 deletions src/areIntervalsOverlapping/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
7 changes: 0 additions & 7 deletions src/closestIndexTo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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 {Array<Date> | Array<number>} datesArray - the array to search
* @returns {Number | undefined} an index of the date closest to the given date or undefined if no valid value is given
Expand Down
7 changes: 0 additions & 7 deletions src/closestTo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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 {Array<Date> | Array<number>} datesArray - the array to search
* @returns {Date | undefined} the date from the array closest to the given date or undefined if no valid value is given
Expand Down
4 changes: 0 additions & 4 deletions src/compareAsc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* 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
Expand Down
4 changes: 0 additions & 4 deletions src/compareDesc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* 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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInCalendarDays/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const MILLISECONDS_IN_DAY = 86400000
* 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
Expand Down
9 changes: 0 additions & 9 deletions src/differenceInCalendarISOWeekYears/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
*
* 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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInCalendarISOWeeks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ const MILLISECONDS_IN_WEEK = 604800000
*
* 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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInCalendarMonths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInCalendarQuarters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInCalendarWeeks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const MILLISECONDS_IN_WEEK = 604800000
* @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.
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInCalendarYears/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInDays/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ function compareLocalAsc(dateLeft: Date, dateRight: Date): number {
* `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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInHours/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { getRoundingMethod } from '../_lib/roundingMethods/index'
* @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
* @param {Object} [options] - an object with options.
Expand Down
9 changes: 0 additions & 9 deletions src/differenceInISOWeekYears/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
*
* 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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInMilliseconds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import requiredArgs from '../_lib/requiredArgs/index'
* @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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInMinutes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { getRoundingMethod } from '../_lib/roundingMethods/index'
* @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
* @param {Object} [options] - an object with options.
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInMonths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import isLastDayOfMonth from '../isLastDayOfMonth/index'
* @description
* Get the number of full months between the given dates using trunc as a default rounding method.
*
* ### 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
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInQuarters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { getRoundingMethod } from '../_lib/roundingMethods/index'
* @description
* Get the number of 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
* @param {Object} [options] - an object with options.
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInSeconds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { getRoundingMethod } from '../_lib/roundingMethods/index'
* @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
* @param {Object} [options] - an object with options.
Expand Down
4 changes: 0 additions & 4 deletions src/differenceInWeeks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ import { getRoundingMethod } from '../_lib/roundingMethods/index'
* `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
* @param {Object} [options] - an object with options.
Expand Down