Skip to content

Commit 6508494

Browse files
authored
fix: update type file .diff (#1505)
1 parent bb5df55 commit 6508494

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

types/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ declare namespace dayjs {
286286
* const date1 = dayjs('2019-01-25')
287287
* const date2 = dayjs('2018-06-05')
288288
* date1.diff(date2) // 20214000000 default milliseconds
289+
* date1.diff() // milliseconds to current time
289290
* ```
291+
*
290292
* To get the difference in another unit of measurement, pass that measurement as the second argument.
291293
* ```
292294
* const date1 = dayjs('2019-01-25')
@@ -296,7 +298,7 @@ declare namespace dayjs {
296298
*
297299
* Docs: https://day.js.org/docs/en/display/difference
298300
*/
299-
diff(date: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
301+
diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number
300302
/**
301303
* This returns the number of **milliseconds** since the Unix Epoch of the Day.js object.
302304
* ```

0 commit comments

Comments
 (0)