Skip to content

Commit

Permalink
Adjust calendar UI so week starts on Monday
Browse files Browse the repository at this point in the history
closes #128

Required an upgrade of react-dates, to include react-dates/react-dates#371
  • Loading branch information
drewda committed Sep 28, 2017
1 parent 962da8e commit 2e9da31
Show file tree
Hide file tree
Showing 3 changed files with 485 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"react": "15.6.1",
"react-addons-shallow-compare": "15.6.0",
"react-autosuggest": "9.3.1",
"react-dates": "12.2.3",
"react-dates": "12.3.0",
"react-dom": "15.6.1",
"react-leaflet": "1.3.1",
"react-redux": "5.0.5",
Expand Down
5 changes: 3 additions & 2 deletions src/components/Sidebar/DatePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class DatePicker extends React.Component {

// also here is where we enforce the selection of one week (7 days)
if (date.startDate instanceof (moment)) {
start = date.startDate.startOf('week').valueOf()
end = date.startDate.endOf('week').valueOf()
start = date.startDate.startOf('isoWeek').valueOf()
end = date.startDate.endOf('isoWeek').valueOf()
} else {
start = null
end = null
Expand Down Expand Up @@ -63,6 +63,7 @@ class DatePicker extends React.Component {
startDate={changeUnixToMoment(start)} // momentPropTypes.momentObj or null,
endDate={changeUnixToMoment(end)} // momentPropTypes.momentObj or null,
numberOfMonths={1}
firstDayOfWeek={1}
isOutsideRange={day => !isInclusivelyBeforeDay(day, today)}
onDatesChange={this.handleDateChange}
showClearDates
Expand Down
Loading

0 comments on commit 2e9da31

Please sign in to comment.