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 dow and doy usage in locales #279
Comments
This would prevent confusion such as that in moment/moment#3056 also. |
There's more discussion in moment/moment#2115 about how |
I'll get to it when I start my next round of documentation. |
I'd rather first update the logic to make it more intuitive, as suggested by @ichernev in moment/moment#2115. A mentioned on that issue, the current semantics are kind of an abuse of an early implementation and not very intuitive nor based on any standard implementation. :/ Question: Would that kind of backwards-compatible change require an [RFC](Moment RFCs)? |
[bump] I'm still keen on updating the logic, though not sure I can do it in a backwards compatible way because of locale configurations such as I'd suggested an alternative on moment/moment#2115, but I think I need more feedback on how to continue. Not sure this is the right place to ask for that feedback, though.. Thoughts? |
Hi! |
Hi @pranjalk! I'd wait for feedback from the official project members, though this open issue is more about documenting proper usage of these specific configuration options, which may change depending on responses to my above questions. The current semantics of |
I would like to bump this. I would prefer an introduction to a semantically more meaningful setting variable and deprecating My suggestion would be to take Gregor Rayman's explanation as a basis (moment/moment#2115 (comment)). My proposal for the documentation: Customizing Locale: 1st Day of Week & 1st Week of YearTo define the first day of week and the first week of year, customize the entry
Three settings for the first day of week and the first week of year most used around the world: ISO-8601: Europe
US, Canada:
Most of Arab countries:
|
@adamlibusa @pranjalk @usmonster - Documentation on existing behavior is best as a first pass. Other discussions about changing behavior can be had in |
moment#279 Add new docs: Customize: First Day of Week and First Week of Year. Remove misleading comments in example code elsewhere. Instead link to this explanation.
I took a shot at turning @adamlibusa 's suggested text into a doc PR. |
#279 Add new docs: Customize: First Day of Week and First Week of Year. Remove misleading comments in example code elsewhere. Instead link to this explanation.
fixed in #513 |
Thanks @mj1856 for bringing this up and @warrenwhipple for the PR! |
Now I understand |
ISO-8601: Europe -> doy: 4 // 1st week of the year is the one that contains the first Thursday, not the one that contains the 4th of January? I'm confused. |
@jsdocker The week with the first Thursday and the week with the fourth of January are equivalent. |
thank you very much. |
The only docs we have about
dow
anddoy
are in comments [here]:(http://momentjs.com/docs/#/i18n/locale-data/)This should be clarified, as many of the locale files make the mistake of thinking that
doy: 1
means that the week with Jan 1 is the first week.The text was updated successfully, but these errors were encountered: