iamkun / iamkun/dayjs

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

Open
#1,672 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.