Skip to content

Commit

Permalink
fix: unit is an optional arg for add() and subtract()
Browse files Browse the repository at this point in the history
  • Loading branch information
mfogel committed Oct 21, 2020
1 parent 26ee8f6 commit 379f348
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,21 +222,21 @@ declare namespace dayjs {
* ```
* dayjs().add(7, 'day')// => Dayjs
* ```
* Units are case insensitive, and support plural and short forms.
* Units are case insensitive, support plural and short forms, and default to 'ms' if not supplied.
*
* Docs: https://day.js.org/docs/en/manipulate/add
*/
add(value: number, unit: OpUnitType): Dayjs
add(value: number, unit?: OpUnitType): Dayjs
/**
* Returns a cloned Day.js object with a specified amount of time subtracted.
* ```
* dayjs().subtract(7, 'year')// => Dayjs
* ```
* Units are case insensitive, and support plural and short forms.
* Units are case insensitive, support plural and short forms, and default to 'ms' if not supplied.
*
* Docs: https://day.js.org/docs/en/manipulate/subtract
*/
subtract(value: number, unit: OpUnitType): Dayjs
subtract(value: number, unit?: OpUnitType): Dayjs
/**
* Returns a cloned Day.js object and set it to the start of a unit of time.
* ```
Expand Down

0 comments on commit 379f348

Please sign in to comment.