iamkun / iamkun/dayjs

[isValid] function not works properly.

Open
#2,498 4 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

**Describe the bug**
How the hell on earth with any string + one random number at the end with space -> the .isValid() is still return true
`dayjs(`what_ever_string_you_input 999`).isValid())` -> true ?

**Expected behavior**
It should return false instead.

**Information**
- Day.js Version in "Antd": "^5.9.1", -> maybe need check with Antd
- OS: window
- Browser: Edge Version 119.0.2151.44 (Official build) (64-bit)
- Time zone: GMT+7

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported dayjs("what_ever_string_you_input 999").isValid() case and inspect the isValid entry point. Compare the result across the reported environment and current Day.js behavior, then add a regression test showing that the described invalid input returns false.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.