Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid parsing #2658

Open
kverty opened this issue May 13, 2024 · 1 comment
Open

Invalid parsing #2658

kverty opened this issue May 13, 2024 · 1 comment

Comments

@kverty
Copy link

kverty commented May 13, 2024

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
@jorgefo
Copy link

jorgefo commented Jun 2, 2024

I have the same issue

let test = dayjs('03-04-2024', 'DD-MM-YYYY');
console.log(test.toDate()); 
// 2024-03-04T03:00:00.000Z 
// the correct is 2024-04-03T03:00:00.000Z

Information

  • Day.js Version: 1.11.11
  • OS: MacOs
  • Browser: chrome, 64 bit
  • Time zone: GMT+03:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants