From 80bee1d0ee588fb02a9d2af703a43bfef99225c5 Mon Sep 17 00:00:00 2001 From: Will Harney Date: Mon, 26 Oct 2020 10:29:00 -0400 Subject: [PATCH] docs: change "rounding" explanation to "truncate" --- src/add/index.ts | 2 +- src/addBusinessDays/index.ts | 2 +- src/addDays/index.ts | 2 +- src/addHours/index.ts | 2 +- src/addISOWeekYears/index.ts | 2 +- src/addMilliseconds/index.ts | 2 +- src/addMinutes/index.ts | 2 +- src/addMonths/index.ts | 2 +- src/addQuarters/index.ts | 2 +- src/addSeconds/index.ts | 2 +- src/addWeeks/index.ts | 2 +- src/addYears/index.ts | 2 +- src/milliseconds/index.ts | 2 +- src/subBusinessDays/index.js | 2 +- src/subDays/index.ts | 2 +- src/subHours/index.ts | 2 +- src/subISOWeekYears/index.ts | 2 +- src/subMilliseconds/index.ts | 2 +- src/subMinutes/index.ts | 2 +- src/subMonths/index.ts | 2 +- src/subQuarters/index.ts | 2 +- src/subSeconds/index.ts | 2 +- src/subWeeks/index.ts | 2 +- src/subYears/index.ts | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/add/index.ts b/src/add/index.ts index 5a4f019e62..327f08f84e 100644 --- a/src/add/index.ts +++ b/src/add/index.ts @@ -14,7 +14,7 @@ import { Duration } from '../types' * 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`. + * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Fractional values are truncated towards zero. * * | Key | Description | * |----------------|------------------------------------| diff --git a/src/addBusinessDays/index.ts b/src/addBusinessDays/index.ts index 0cfdf5ce80..7eab74cc44 100644 --- a/src/addBusinessDays/index.ts +++ b/src/addBusinessDays/index.ts @@ -14,7 +14,7 @@ import isSaturday from '../isSaturday/index' * 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`. + * @param {Number} amount - the amount of business days to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the business days added * @throws {TypeError} 2 arguments required * diff --git a/src/addDays/index.ts b/src/addDays/index.ts index 41c647d192..9a2aae6acb 100644 --- a/src/addDays/index.ts +++ b/src/addDays/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of days to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the days added * @throws {TypeError} 2 arguments required * diff --git a/src/addHours/index.ts b/src/addHours/index.ts index d7de0e3e4d..66a8552cb7 100644 --- a/src/addHours/index.ts +++ b/src/addHours/index.ts @@ -17,7 +17,7 @@ const MILLISECONDS_IN_HOUR = 3600000 * - [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`. + * @param {Number} amount - the amount of hours to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the hours added * @throws {TypeError} 2 arguments required * diff --git a/src/addISOWeekYears/index.ts b/src/addISOWeekYears/index.ts index 297b61333d..a4f95152f2 100644 --- a/src/addISOWeekYears/index.ts +++ b/src/addISOWeekYears/index.ts @@ -23,7 +23,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * 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`. + * @param {Number} amount - the amount of ISO week-numbering years to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the ISO week-numbering years added * @throws {TypeError} 2 arguments required * diff --git a/src/addMilliseconds/index.ts b/src/addMilliseconds/index.ts index 18aefe5084..c27697ecde 100644 --- a/src/addMilliseconds/index.ts +++ b/src/addMilliseconds/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of milliseconds to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the milliseconds added * @throws {TypeError} 2 arguments required * diff --git a/src/addMinutes/index.ts b/src/addMinutes/index.ts index 41ecc48e8b..ceccb747ad 100644 --- a/src/addMinutes/index.ts +++ b/src/addMinutes/index.ts @@ -17,7 +17,7 @@ const MILLISECONDS_IN_MINUTE = 60000 * - [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`. + * @param {Number} amount - the amount of minutes to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the minutes added * @throws {TypeError} 2 arguments required * diff --git a/src/addMonths/index.ts b/src/addMonths/index.ts index b390f8e512..478eaddd81 100644 --- a/src/addMonths/index.ts +++ b/src/addMonths/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of months to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the months added * @throws {TypeError} 2 arguments required * diff --git a/src/addQuarters/index.ts b/src/addQuarters/index.ts index 4eaebf0afc..252167337c 100644 --- a/src/addQuarters/index.ts +++ b/src/addQuarters/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of quarters to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the quarters added * @throws {TypeError} 2 arguments required * diff --git a/src/addSeconds/index.ts b/src/addSeconds/index.ts index c858a04fe2..9a0bfde071 100644 --- a/src/addSeconds/index.ts +++ b/src/addSeconds/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of seconds to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the seconds added * @throws {TypeError} 2 arguments required * diff --git a/src/addWeeks/index.ts b/src/addWeeks/index.ts index 0b526163b6..8e19892e94 100644 --- a/src/addWeeks/index.ts +++ b/src/addWeeks/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of weeks to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the weeks added * @throws {TypeError} 2 arguments required * diff --git a/src/addYears/index.ts b/src/addYears/index.ts index 84e1b94ff5..38b5b5ecd0 100644 --- a/src/addYears/index.ts +++ b/src/addYears/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of years to be added. Fractional values are truncated towards zero. * @returns {Date} the new date with the years added * @throws {TypeError} 2 arguments required * diff --git a/src/milliseconds/index.ts b/src/milliseconds/index.ts index 19a003b6af..58a8ca02b9 100644 --- a/src/milliseconds/index.ts +++ b/src/milliseconds/index.ts @@ -20,7 +20,7 @@ const yearInDays = 365.2425 * @description * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds. * - * @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`. + * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Fractional values are truncated towards zero. * @returns {number} the milliseconds * @throws {TypeError} 1 argument required * diff --git a/src/subBusinessDays/index.js b/src/subBusinessDays/index.js index dbfa505443..08a3a9a1d2 100644 --- a/src/subBusinessDays/index.js +++ b/src/subBusinessDays/index.js @@ -11,7 +11,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * 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`. + * @param {Number} amount - the amount of business days to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the business days subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subDays/index.ts b/src/subDays/index.ts index 7c706c362f..78ed4193d4 100644 --- a/src/subDays/index.ts +++ b/src/subDays/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of days to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the days subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subHours/index.ts b/src/subHours/index.ts index 2db706a51a..475bc6ff92 100644 --- a/src/subHours/index.ts +++ b/src/subHours/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of hours to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the hours subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subISOWeekYears/index.ts b/src/subISOWeekYears/index.ts index bbd396c93c..3ebbe1d1ce 100644 --- a/src/subISOWeekYears/index.ts +++ b/src/subISOWeekYears/index.ts @@ -22,7 +22,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * 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`. + * @param {Number} amount - the amount of ISO week-numbering years to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the ISO week-numbering years subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subMilliseconds/index.ts b/src/subMilliseconds/index.ts index 094209ef83..fad58fc9a6 100644 --- a/src/subMilliseconds/index.ts +++ b/src/subMilliseconds/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of milliseconds to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the milliseconds subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subMinutes/index.ts b/src/subMinutes/index.ts index 365928b1b5..21eac6657a 100644 --- a/src/subMinutes/index.ts +++ b/src/subMinutes/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of minutes to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the minutes subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subMonths/index.ts b/src/subMonths/index.ts index d827fad23e..8f6aaa0256 100644 --- a/src/subMonths/index.ts +++ b/src/subMonths/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of months to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the months subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subQuarters/index.ts b/src/subQuarters/index.ts index 083359679d..a10e8623ee 100644 --- a/src/subQuarters/index.ts +++ b/src/subQuarters/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of quarters to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the quarters subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subSeconds/index.ts b/src/subSeconds/index.ts index 72142a69eb..f389e3b097 100644 --- a/src/subSeconds/index.ts +++ b/src/subSeconds/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of seconds to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the seconds subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subWeeks/index.ts b/src/subWeeks/index.ts index d12d2a005d..ab06b3e650 100644 --- a/src/subWeeks/index.ts +++ b/src/subWeeks/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of weeks to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the weeks subtracted * @throws {TypeError} 2 arguments required * diff --git a/src/subYears/index.ts b/src/subYears/index.ts index 2619a6ca00..2a2fbb900e 100644 --- a/src/subYears/index.ts +++ b/src/subYears/index.ts @@ -15,7 +15,7 @@ import requiredArgs from '../_lib/requiredArgs/index' * - [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`. + * @param {Number} amount - the amount of years to be subtracted. Fractional values are truncated towards zero. * @returns {Date} the new date with the years subtracted * @throws {TypeError} 2 arguments required *