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

Clarify toFormat docs #938

Merged
merged 1 commit into from May 18, 2021
Merged

Conversation

andrey-p
Copy link
Contributor

I'm a dev migrating from Moment.js who just lost a couple of hours to the fact that toFormat doesn't default to the user's own locale. I figured I might help others by adding some tweaks to the docs.

My changes are two-fold:

  1. Clarify that format in Moment.js and toFormat in Luxon aren't fully equivalent to each other. In Moment.js, format is the preferred way of formatting dates, even for human-readable strings.
  2. Add a note to the Intl section of toFormat to clarify that the default locale is en-US.

Re #2, in the contributing guidelines you say that you prefer gotchas to go in the docstrings, but considering toFormat already has a dedicated section for internationalization and I'm not the first person to run into this, I hope you'll consider making a minor exception.

@icambron icambron merged commit 2d66ce4 into moment:master May 18, 2021
@icambron
Copy link
Member

agreed, thanks

@andrey-p andrey-p deleted the toformat-docs-tweak branch May 19, 2021 13:02
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.

None yet

2 participants