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

Document argumentless diff #1505

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ declare namespace dayjs {
* const date1 = dayjs('2019-01-25')
* const date2 = dayjs('2018-06-05')
* date1.diff(date2) // 20214000000 default milliseconds
* date1.diff() // milliseconds to current time
* ```
*
* To get the difference in another unit of measurement, pass that measurement as the second argument.
* ```
* const date1 = dayjs('2019-01-25')
Expand All @@ -296,7 +298,7 @@ declare namespace dayjs {
*
* Docs: https://day.js.org/docs/en/display/difference
*/
diff(date: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
/**
* This returns the number of **milliseconds** since the Unix Epoch of the Day.js object.
* ```
Expand Down