Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot mainpulate time values based on HH:mm:ss format #1672

Open
GhettoBurger996 opened this issue Oct 20, 2021 · 0 comments
Open

Cannot mainpulate time values based on HH:mm:ss format #1672

GhettoBurger996 opened this issue Oct 20, 2021 · 0 comments

Comments

@GhettoBurger996
Copy link

I have values like time values like so 08:00:00 and 22:00:00, following ISO 8601 standards and how postgres accepts "time" types.

The issue is I cant find a means of manipulating values like so using dayjs. For instance I cant get the difference between 2 time values using the format. The code block below return NaN, when attempting to format the time is return invalid date as well.

      const operationalHours: number = dayjs("22:00:00").diff(
        "08:00:00",
        "hour",
      );

      const format = dayjs("22:00:00").format("HH:mm:ss");

I cant change how the time is set, is their a workaround for this?

@GhettoBurger996 GhettoBurger996 changed the title Cannot mainpulating time values based on HH:mm:ss format Cannot mainpulate time values based on HH:mm:ss format Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant