iamkun / iamkun/dayjs

It's not clear how to compare Durations (please improve documentation?)

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

Description

Hi,

How can I compare two Durations? I want to know if one is larger (longer) than the other.

I've read about `Duration`, `dayjs#diff`, `Is Before`, but it's not clear from documentation which api should work.
* `Duration` has no documentation/function/example, can I simply use '<' operator?
* It's not clear if `dayjs#diff` works with Duration
* `Is Before` does not seem to be appropriate way to check Durations because they do not have "before/after" meaning

Thanks

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing documentation for Duration, dayjs#diff, and Is Before, then check the API behavior for comparing two Durations. Document the supported comparison approach with a clear example and explain whether the other APIs apply; the issue is complete when a reader can determine which method to use.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.