Skip to content

[CustomParseFormat] Invalid date when passing just time values #6

Open
@lbittner-pdftron

Description

@lbittner-pdftron

When trying to create a dayjs object using the format HH:ss, the result is "Invalid Date". Here is a minimal example to reproduce:

import dayjs from "dayjs-ext";
import customParseFormat from "dayjs-ext/plugin/customParseFormat";

dayjs.extend(customParseFormat);

const r = dayjs("12:12", { format: "HH:ss" });
console.log(r); // invalid date

Here's the runnable code as well:
https://codesandbox.io/s/pkl826wrj?module=%2Fsrc%2Findex.js

Thanks for your time!

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