iamkun / iamkun/dayjs

dayjs在vue2代码中 任意地方执行 格式转换都返回false 代码如下

Open
#2,777 1 comment 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

const time1 = '05:00' // 符合 'HH:mm' 格式
const parsedTime = dayjs(time1, 'HH:mm')
console.log(parsedTime.isValid()) // true

放在官网执行返回true
放在vue2 mounted里边执行 返回false

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the shown dayjs('05:00', 'HH:mm') call inside a Vue 2 mounted hook and compare it with the standalone example. Check the reported Vue 2 and dayjs versions, including whether the required parsing setup is present. Done means the cause is isolated and a regression test or clear reproduction is available.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.