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

[docs] When can you parse without the CustomParseFormat plugin? #2739

Open
rakleed opened this issue Oct 4, 2024 · 1 comment
Open

[docs] When can you parse without the CustomParseFormat plugin? #2739

rakleed opened this issue Oct 4, 2024 · 1 comment

Comments

@rakleed
Copy link

rakleed commented Oct 4, 2024

Describe the bug
String + Format (https://github.com/dayjs/dayjs-website/blob/master/docs/parse/string-format.md) does not specify when the CustomParseFormat plugin can be omitted. The second line "This requires the CustomParseFormat plugin to work" makes it seem like you should always use the plugin.

Expected behavior
List all cases where you can parse without the CustomParseFormat plugin. ChatGPT reports these cases:

YYYY-MM-DD
YYYY-MM-DDTHH:mm:ssZ
YYYY-MM-DDTHH:mm:ss.SSSZ
YYYY-MM-DDTHH:mm
YYYY-MM-DDTHH
YYYY-MM
YYYY
MM-DD
HH:mm:ss
HH:mm

Information

  • Day.js version: 1.11.13
  • OS: N/A
  • Browser: N/A
  • Time zone: N/A
@vladrusu
Copy link

vladrusu commented Oct 18, 2024

I agree.
My expectation is that dayJS should parse combination of locale-insensitive parameters like MM, DD, YYYY by default.
So, should be able to parse this by default:
dayjs("18/10/2024", "DD/MM/YYYY")
This should be core stuff.

Only for stuff like MMMM like dayjs("2018 Enero 15", "YYYY MMMM DD", "es") to require a 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

No branches or pull requests

2 participants