diff --git a/src/client/components/DateInput/DateInput.DOCUMENTATION.md b/src/client/components/DateInput/DateInput.DOCUMENTATION.md index ef6c3a54..87301d6b 100644 --- a/src/client/components/DateInput/DateInput.DOCUMENTATION.md +++ b/src/client/components/DateInput/DateInput.DOCUMENTATION.md @@ -39,7 +39,7 @@ Based on configured to OpusCapita defaults [react-day-picker](https://github.com diff --git a/src/client/components/DateRangeInput/DateRangeInput.react.js b/src/client/components/DateRangeInput/DateRangeInput.react.js index c8633457..8ca525ae 100644 --- a/src/client/components/DateRangeInput/DateRangeInput.react.js +++ b/src/client/components/DateRangeInput/DateRangeInput.react.js @@ -65,23 +65,35 @@ let defaultProps = { variants: [ { getLabel: (locale) => getMessage(locale, 'previousWeek'), - getValue: (locale) => [ + // TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215 + getValue: (locale) => locale === 'en' ? [ dayjs().locale(locale).subtract(7, 'days').startOf('week').toDate(), dayjs().locale(locale).subtract(7, 'days').endOf('week').toDate() + ] : [ + dayjs().locale(locale).subtract(7, 'days').startOf('week').add(1, 'day').toDate(), + dayjs().locale(locale).subtract(7, 'days').endOf('week').add(1, 'day').toDate() ] }, { getLabel: (locale) => getMessage(locale, 'thisWeek'), - getValue: (locale) => [ + // TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215 + getValue: (locale) => locale === 'en' ? [ dayjs().locale(locale).startOf('week').toDate(), dayjs().locale(locale).endOf('week').toDate() + ] : [ + dayjs().locale(locale).startOf('week').add(1, 'day').toDate(), + dayjs().locale(locale).endOf('week').add(1, 'day').toDate() ] }, { getLabel: (locale) => getMessage(locale, 'nextWeek'), - getValue: (locale) => [ + // TODO remove ternary operator below. Monitor this issue: https://github.com/iamkun/dayjs/issues/215 + getValue: (locale) => locale === 'en' ? [ dayjs().locale(locale).add(7, 'days').startOf('week').toDate(), dayjs().locale(locale).add(7, 'days').endOf('week').toDate() + ] : [ + dayjs().locale(locale).add(7, 'days').startOf('week').add(1, 'day').toDate(), + dayjs().locale(locale).add(7, 'days').endOf('week').add(1, 'day').toDate() ] }, { diff --git a/src/client/components/DayPicker/DayPicker.react.js b/src/client/components/DayPicker/DayPicker.react.js index d449273d..7308031c 100644 --- a/src/client/components/DayPicker/DayPicker.react.js +++ b/src/client/components/DayPicker/DayPicker.react.js @@ -180,6 +180,7 @@ class DayPicker extends Component { className={pickerClassName} localeUtils={localeUtils} locale={locale} + firstDayOfWeek={locale === 'en' ? 0 : 1} onDayClick={this.handleDateChange} onDayKeyDown={this.handleDateChange} onDayTouchEnd={this.handleDateChange}