iamkun / iamkun/dayjs

TypeScript errors occur when using `isSameOrBefore` and `isSameOrAfter`

Open
#3,192 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

**Describe the bug**
When using `isSameOrAfter` or `isSameOrBefore` to compare **quarter** dates, a ts error occurs, as shown in the screenshot below.

image

**Expected behavior**
No TypeScript errors should occur.

**Information**
- Day.js Version [v1.11.20]
- OS: [Windows 11]
- Browser [Chrome 151.0.7922.138]
- Time zone: [UTC+08:00 (China Standard Time)]

Contributor guide

Open the contributing guide

Research direction

Reproduce the TypeScript error with isSameOrAfter or isSameOrBefore when comparing quarter dates, using Day.js v1.11.20. Inspect the type definitions for these methods and the quarter unit, then verify that the same comparison produces no TypeScript errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.