Skip to content

Difference in "week" units #561

Description

@idasbiste

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions