I'm using Momentjs in several places in an App I'm working on, and it is working fine. However, I am using endOf('week')
and it is resulting in Saturdays. What I am expecting is Sundays.
I've been trying to find information about it, but it is not standing out anywhere how to get around it without changing code everywhere it is used. From my digging around, Moment automatically applies locales. And from looking in one of the locale files, I can see where this day of week (dow) is configured.
Example: moment/locale/en-gb.js
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
So what I gather is if I were in GB, end of week would be Sundays. But what I'm not clear on, is where are the defaults for U.S.? There is no en-US.js in the locale directory and it seems to default to dow:0
What I'm trying to determine is:
- Is there a reason there's no en-US?
- Is my best solution to just copy the en-gb.js as en-US.js? If I do that and include it in my App, will this affect others in other locales?
I did tinker in moment.min.js and changed dow from 0 to 1, and that resulted in Sundays being the end of week throughout the App. But that's not something I want to do.
Hopefully this is not just me missing the answers somewhere.
Any suggestions are welcome.
Thank you.
Update 1
Using:
- momentjs 2.9.0
- angular-moment 0.10.3