Dayjs: Difference in "week" units

Created on 5 Apr 2019  路  4Comments  路  Source: iamkun/dayjs

Rationale
I would expect to be able to get the difference between two dates using "week" (or its variants) as unit.
Typescript doesn't let me compile the code because the expected type for the unit parameter is of QUnitType which doesn't hold "week" as a possible value. Also, from the source code we can actually pass one of the "week" variants although the types are not expecting it.

Expected behavior
I would expect to have diff(date: ConfigType, unit: QUnitType | OpUnitType, float?: boolean): number (or similar) instead of diff(date: ConfigType, unit: QUnitType, float?: boolean): number

Information

  • Day.js 1.8.12
released 鈽笍Bug

Most helpful comment

will fix in next release

All 4 comments

will fix in next release

@issuehunt has funded $20.00 to this issue.


@iamkun has rewarded $18.00 to @iamkun. See it on IssueHunt

  • :moneybag: Total deposit: $20.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $2.00

:tada: This issue has been resolved in version 1.8.13 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings