diff --git a/src/CenturyView/__tests__/Decade.jsx b/src/CenturyView/__tests__/Decade.jsx index c070e91a..61f5aaa0 100644 --- a/src/CenturyView/__tests__/Decade.jsx +++ b/src/CenturyView/__tests__/Decade.jsx @@ -6,6 +6,7 @@ import Decade from '../Decade'; /* eslint-disable comma-dangle, jsx-a11y/mouse-events-have-key-events */ const tileProps = { + activeStartDate: new Date(2018, 0, 1), classes: ['react-calendar__tile'], date: new Date(2011, 0, 1), point: 2011, diff --git a/src/DecadeView/__tests__/Year.jsx b/src/DecadeView/__tests__/Year.jsx index f9956941..e7a78318 100644 --- a/src/DecadeView/__tests__/Year.jsx +++ b/src/DecadeView/__tests__/Year.jsx @@ -6,6 +6,7 @@ import Year from '../Year'; /* eslint-disable comma-dangle, jsx-a11y/mouse-events-have-key-events */ const tileProps = { + activeStartDate: new Date(2018, 0, 1), classes: ['react-calendar__tile'], date: new Date(2018, 0, 1), point: 2018, diff --git a/src/MonthView/__tests__/Day.jsx b/src/MonthView/__tests__/Day.jsx index dcaddf05..85b5a822 100644 --- a/src/MonthView/__tests__/Day.jsx +++ b/src/MonthView/__tests__/Day.jsx @@ -6,6 +6,7 @@ import Day from '../Day'; /* eslint-disable comma-dangle, jsx-a11y/mouse-events-have-key-events */ const tileProps = { + activeStartDate: new Date(2018, 0, 1), classes: ['react-calendar__tile'], currentMonthIndex: 0, date: new Date(2018, 0, 1), diff --git a/src/YearView/__tests__/Month.jsx b/src/YearView/__tests__/Month.jsx index 1d791792..e0a4aaf1 100644 --- a/src/YearView/__tests__/Month.jsx +++ b/src/YearView/__tests__/Month.jsx @@ -6,6 +6,7 @@ import Month from '../Month'; /* eslint-disable comma-dangle, jsx-a11y/mouse-events-have-key-events */ const tileProps = { + activeStartDate: new Date(2018, 0, 1), classes: ['react-calendar__tile'], date: new Date(2018, 0, 1), }; diff --git a/src/shared/dates.js b/src/shared/dates.js index 4391b23d..ee657649 100644 --- a/src/shared/dates.js +++ b/src/shared/dates.js @@ -440,6 +440,18 @@ export const getRange = (rangeType, date) => { */ export const getValueRange = (rangeType, date1, date2) => { const rawNextValue = [date1, date2].sort((a, b) => a.getTime() > b.getTime()); + console.log( + 'Original sorted values', + rawNextValue, + 'their values', + rawNextValue.map(e => e.getTime()), + 'their sorted values', + rawNextValue.map(e => e.getTime()).sort(), + 'their mapped sorted values', + rawNextValue.map(e => e.getTime()).sort().map(e => new Date(e)), + 'js sanity check', + [new Date(2018, 6, 1), new Date(2018, 0, 1)].sort((a, b) => a.getTime() > b.getTime()), + ); return [ getBegin(rangeType, rawNextValue[0]), getEnd(rangeType, rawNextValue[1]),