Comments (9)
Just pasting here the full code to update locale:
moment.updateLocale('en', {
week: {
dow: 1,
},
})
from react-dates.
Use
date.startOf('isoWeek'); instead of date.startOf('week');
from react-dates.
Doing this:
moment.updateLocale('en', {
week: {
dow: 1,
},
})
and then This:
moment.weekdays()
gives me:
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
Anyone else facing this?
from react-dates.
pass in true to the weekdays function
moment.weekdays(true)
so they are returned in locale specific order
from react-dates.
Moment docs imply that this is a locale-specific setting.
http://momentjs.com/docs/#/customization/ indicates that to override this, you should create your own moment locale - it looks like per http://momentjs.com/docs/#/i18n/changing-locale/ you can set this with:
week: {
dow: 1
}
Since moment already handles this, perhaps it's best to leave it to that lib?
from react-dates.
Has anyone verified that it works? I set my moment()._locale._week.dow
to 1
, but the calendar still displays Su
as the first day of the week.
from react-dates.
Use
date.startOf('isoWeek'); instead of date.startOf('week');
Thanks for the help
from react-dates.
Yeah! I don't think this is an issue for us to take on so much as for moment localization. For instance, if you change the locale to es
you'll see that the week starts on Monday.
Which means that for your own app you should be able to alter this using moment. I'm going to close this as won't fix.
from react-dates.
Hi @vladbalan, I am not sure that you can set the starting weekday in moment that way. I do know that if you look at pl.airbnb.com, the calendar starts on Monday:
This was done by calling moment.locale('pl')
. Perhaps the parentheses are throwing it off. That is a moment object instead of the general moment class.
from react-dates.
Related Issues (20)
- Any plan to support month/year range pickers? HOT 6
- wrong height on month transitions HOT 3
- How to disable the preselected dates HOT 3
- Installation command results in error HOT 2
- Focus jumps to End Date before user is finished typing Start Date
- Cannot Use verticalScrollable DayPickerRangeControllerWrapper renders Empty HOT 1
- problem SingleDatePickerInput
- Overlap behavior when date pickers are vertically stacked
- DayPickerRangeController does not change visible month when startDate or endDate update from state value HOT 4
- Question: Is there a predefined way to change the months' language? HOT 1
- Accessibility issue with shortcut panel close button
- click date input randomly triggers outside click
- Unable to test with DateRangePicker HOT 10
- Three interesting questions about border-radius in cells, years and holidays HOT 1
- isOutsideRange property ends up nullifying invalid dates entirely HOT 5
- manually force refresh/render of blockedday
- problem with react HOT 1
- Change the width of calender in daterangepicker
- Allowing past dates is messing with dates selection at DayPickerRangeController component HOT 5
- I can't change React-Dates Language! HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-dates.