Misparsing strings
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
DayJS is misparsing a string. Specifically `okt. 2022` is being parsed as `January 1 2022`. This is from a Danish language data set, but all other months (fx `jan` and `maj`) parse correctly.
The Danish language locale file seems correct to me if you need more examples of different spellings: https://github.com/iamkun/dayjs/blob/dev/src/locale/da.js
**Expected behavior**
I'd expect `okt. 2022` to be recognised as `October 1 2022` :)
**Code to recreate**
```javascript
import dayjs from "dayjs";
console.log(
"Expected behaviour (en)",
"oct. 2022",
dayjs("oct. 2022").toDate()
);
console.log(
"Unexpected behaviour (dk/da)",
"okt. 2022",
dayjs("okt. 2022").toDate()
);
```
**Information**
- Day.js Version 1.11.5 / 1.0.0 / 1.8.5
- OS: Browser: Big Sur Node: Big Sur & Ubuntu on docker idk what version but probably lates
- Browser Chrome Latest public release
- Time zone: CET
Contributor guide
Assessment
This issue has not been assessed yet.