Skip to content

Conversation

@Albez0-An7h
Copy link

Summary

Fixes #2954.

This PR addresses an inconsistency where parsing input like dayjs('11/1/2004', 'MM/DD/YYYY') returned a valid date in Node.js but "Invalid Date" in some browsers. The goal is to make parsing behavior consistent across environments.

  • Refines the warning in devHelper to only trigger when a format string is passed and the CustomParseFormat plugin is not loaded.
  • Adds a test to verify the warning appears for format strings like 'MM/DD/YYYY'.

Albez0-An7h added 3 commits November 26, 2025 11:20
Add a more precise check to only show the warning when a format string is actually passed as the second argument. This helps developers understand why their date parsing fails and guides them to enable the CustomParseFormat plugin.
Add a more precise check to only show the warning when a format string is actually passed as the second argument. This helps developers understand why their date parsing fails and guides them to enable the CustomParseFormat plugin.
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

Successfully merging this pull request may close these issues.

dayjs constructor returns "Invalid Date" in the Browser, but valid date in Node.js

1 participant