Skip to content

Offset bug with non 4 digit input dates #77

@KonnokMollom

Description

@KonnokMollom

File:
src/offset.ts

Bug:
The offset function returns +NaN:NaN when called with non 4 digit year date input like

offset('0001-01-01')

This is because the Intl.DateTimeFormat.prototype.formatToParts function being used in line 24 does not pad the year number.

Solution:
Add padding for the year in line 38

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions