iamkun / iamkun/dayjs

dayjs not parsing german date string

Open
#1,868 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

dayjs is not able to parse a date string with this format: DD.MM.YYYY (2-digits day.2-digits month.4-digits year).

Given the date string "22.04.2022", dayjs tells me it is an invalid date.

Example:

```

dayjs.locale('de')
console.log(dayjs().locale()) <!-- Output: de -->
console.log(dayjs('22.04.2022')) <!-- Output: M {$L: 'de', $d: Invalid Date, $x: {…}, $y: NaN, $M: NaN, …} -->

```

Contributor guide

Open the contributing guide

Research direction

Start with the provided reproduction for "22.04.2022" and locate Day.js's date-string parsing and German locale tests or entry points. Determine how this format is expected to be supported, add a regression case for the example, and run the relevant test suite to confirm the string is no longer treated as invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
localization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.