Skip to content

Commit b9fb15e

Browse files
committed
Merge pull request #3119 from PrakashDurlabhji/issue_2810_1
Issue 2810 fix
1 parent bab771c commit b9fb15e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

__tests__/shared/components/challenge-listing/Filters/__snapshots__/DateRangePicker.jsx.snap

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ exports[`Matches shallow shapshot 1`] = `
4646
"calendarLabel": "Calendar",
4747
"chooseAvailableEndDate": [Function],
4848
"chooseAvailableStartDate": [Function],
49+
"clearDate": "Clear Date",
4950
"clearDates": "Clear Dates",
5051
"closeDatePicker": "Close",
5152
"dateIsSelected": [Function],
@@ -57,8 +58,8 @@ exports[`Matches shallow shapshot 1`] = `
5758
"focusStartDate": "Interact with the calendar and add the check-in date for your trip.",
5859
"hideKeyboardShortcutsPanel": "Close the shortcuts panel.",
5960
"homeEnd": "Home and end keys",
60-
"jumpToNextMonth": "Move forward to switch to the next month.",
61-
"jumpToPrevMonth": "Move backward to switch to the previous month.",
61+
"jumpToNextMonth": "Next Month",
62+
"jumpToPrevMonth": "Previous Month",
6263
"keyboardNavigationInstructions": "Press the down arrow key to interact with the calendar and
6364
select a date. Press the question mark key to get the keyboard shortcuts for changing dates.",
6465
"keyboardShortcuts": "Keyboard Shortcuts",

src/shared/components/challenge-listing/Filters/DateRangePicker.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import 'react-dates/initialize';
1717
import { DateRangePicker as WrappedDateRangePicker } from 'react-dates';
1818
import 'react-dates/lib/css/_datepicker.css';
1919
import './_fix_DateInput__input.css';
20+
import defaultPhrases from 'react-dates/lib/defaultPhrases';
2021

2122
class DateRangePicker extends React.Component {
2223
constructor(props) {
@@ -37,6 +38,11 @@ class DateRangePicker extends React.Component {
3738
const {
3839
focusedInput,
3940
} = this.state;
41+
const phraseOverrides = {
42+
...defaultPhrases,
43+
jumpToPrevMonth: 'Previous Month',
44+
jumpToNextMonth: 'Next Month',
45+
};
4046
return (
4147
<WrappedDateRangePicker
4248
hideKeyboardShortcutsPanel
@@ -52,6 +58,7 @@ class DateRangePicker extends React.Component {
5258
anchorDirection="right"
5359
displayFormat="MMM DD, YYYY"
5460
readOnly={readOnly}
61+
phrases={phraseOverrides}
5562
/>
5663
);
5764
}

0 commit comments

Comments
 (0)