Skip to content

Commit

Permalink
Remove month name transformations (#991)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
smstamm and Steph Stamm committed Oct 30, 2023
1 parent 8fac078 commit 4271216
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mx-react-components",
"version": "8.6.1",
"version": "8.6.2",
"description": "A collection of generic React UI components",
"main": "dist/index.js",
"files": [
Expand Down
6 changes: 2 additions & 4 deletions src/components/DateRangePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ class DateRangePicker extends React.Component {
};

_formatMomentDate = (date, format = 'MMMM Do, YYYY') => {
const d = moment.unix(date).format(format)

return d.charAt(0).toUpperCase() + d.slice(1)
return moment.unix(date).format(format)
}

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

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

const mergedFocusTrapProps = {
focusTrapOptions: {
Expand Down
4 changes: 1 addition & 3 deletions src/components/DateRangePicker/SelectionPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ class SelectionPane extends React.Component {
}

_formatDate = (date) => {
const d = moment.unix(date).format('MMM D, YYYY')

return d.charAt(0).toUpperCase() + d.slice(1)
return moment.unix(date).format('MMM D, YYYY')
}

render () {
Expand Down
3 changes: 1 addition & 2 deletions src/components/DateRangePicker/Selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ class MonthSelector extends React.Component {

render () {
const styles = this.styles();
const momentDate = moment.unix(this.props.currentDate).format('MMMM')

return (
<Selector
{...this.props}
currentDate={momentDate.charAt(0).toUpperCase() + momentDate.slice(1)}
currentDate={moment.unix(this.props.currentDate).format('MMMM')}
handleNextClick={this._handleNextClick}
handlePreviousClick={this._handlePreviousClick}
style={styles.monthSelector}
Expand Down

0 comments on commit 4271216

Please sign in to comment.