Skip to content

TypeError when formatting interval #54

@1ec5

Description

@1ec5

The format() function throws a TypeError when passing in an interval. For example:

edtf.format(edtf.default('2000/2001'))

throws:

Uncaught TypeError: Cannot read properties of undefined (reading 'value')

It might be possible to format some intervals natively using Intl.DateTimeFormat.prototype.formatRange(). However, this API doesn’t accept other kinds of intervals, such as /2001 and ../2001. Ultimately, I’d like to be able to rely on this library to output something like “before 2001”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions