Skip to content

Commit 4271216

Browse files
smstammSteph Stamm
andauthored
Remove month name transformations (#991)
* default getTranslation() to prevent breaking change, remove capitalization of months in other languages * undo unnecessary change --------- Co-authored-by: Steph Stamm <stephanie.stamm@mx.com>
1 parent 8fac078 commit 4271216

5 files changed

Lines changed: 7 additions & 12 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mx-react-components",
3-
"version": "8.6.1",
3+
"version": "8.6.2",
44
"description": "A collection of generic React UI components",
55
"main": "dist/index.js",
66
"files": [

src/components/DateRangePicker.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ class DateRangePicker extends React.Component {
244244
};
245245

246246
_formatMomentDate = (date, format = 'MMMM Do, YYYY') => {
247-
const d = moment.unix(date).format(format)
248-
249-
return d.charAt(0).toUpperCase() + d.slice(1)
247+
return moment.unix(date).format(format)
250248
}
251249

252250
_getDateRangePosition = (selectedStart, selectedEnd, active, date) => {
@@ -328,7 +326,7 @@ class DateRangePicker extends React.Component {
328326
]
329327

330328
const weekDayNames = moment.weekdays()
331-
const weekDayObject = moment.weekdaysMin().map((d, index) => ({ label: d.charAt(0).toUpperCase(), value: weekDayNames[index].charAt(0).toUpperCase()}))
329+
const weekDayObject = moment.weekdaysMin().map((d, index) => ({ label: d, value: weekDayNames[index]}))
332330

333331
const mergedFocusTrapProps = {
334332
focusTrapOptions: {

src/components/DateRangePicker/SelectionPane.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ class SelectionPane extends React.Component {
3535
}
3636

3737
_formatDate = (date) => {
38-
const d = moment.unix(date).format('MMM D, YYYY')
39-
40-
return d.charAt(0).toUpperCase() + d.slice(1)
38+
return moment.unix(date).format('MMM D, YYYY')
4139
}
4240

4341
render () {

src/components/DateRangePicker/Selector.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,11 @@ class MonthSelector extends React.Component {
9999

100100
render () {
101101
const styles = this.styles();
102-
const momentDate = moment.unix(this.props.currentDate).format('MMMM')
103102

104103
return (
105104
<Selector
106105
{...this.props}
107-
currentDate={momentDate.charAt(0).toUpperCase() + momentDate.slice(1)}
106+
currentDate={moment.unix(this.props.currentDate).format('MMMM')}
108107
handleNextClick={this._handleNextClick}
109108
handlePreviousClick={this._handlePreviousClick}
110109
style={styles.monthSelector}

0 commit comments

Comments
 (0)