iamkun / dayjs

⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API

Home Page:https://day.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid parsing

kverty opened this issue · comments

Describe the bug
dayjs function ignores provided format.

let test = dayjs('12/01/1996', 'DD/MM/YYYY')

console.log(test.format())

// "1996-12-01T00:00:00+03:00"

Expected behavior
Expected result is "1996-01-12T0:00:00+03:00"

Information

  • Day.js Version: 1.11.11
  • OS: Windows 11
  • Browser: chrome, 64 bit
  • Time zone: GMT+03:00
  • I just run it in jsfiddle