Change time range shortcut method name from moving time range due to refined issue scope.

pull/1744/head
Hunter Trujillo 2017-08-14 12:32:06 -06:00
parent dd14b91b41
commit a47722d2bc
1 changed files with 9 additions and 9 deletions

View File

@ -8,7 +8,7 @@ class CustomTimeRange extends Component {
this.handleClick = ::this.handleClick this.handleClick = ::this.handleClick
this._formatTimeRange = ::this._formatTimeRange this._formatTimeRange = ::this._formatTimeRange
this.handleMovingTimeRange = ::this.handleMovingTimeRange this.handleTimeRangeShortcut = ::this.handleTimeRangeShortcut
} }
componentDidMount() { componentDidMount() {
@ -44,37 +44,37 @@ class CustomTimeRange extends Component {
<div className="custom-time--shortcuts-header">Shortcuts</div> <div className="custom-time--shortcuts-header">Shortcuts</div>
<div <div
className="custom-time--shortcut" className="custom-time--shortcut"
onClick={this.handleMovingTimeRange('pastWeek')} onClick={this.handleTimeRangeShortcut('pastWeek')}
> >
Past Week Past Week
</div> </div>
<div <div
className="custom-time--shortcut" className="custom-time--shortcut"
onClick={this.handleMovingTimeRange('pastMonth')} onClick={this.handleTimeRangeShortcut('pastMonth')}
> >
Past Month Past Month
</div> </div>
<div <div
className="custom-time--shortcut" className="custom-time--shortcut"
onClick={this.handleMovingTimeRange('pastYear')} onClick={this.handleTimeRangeShortcut('pastYear')}
> >
Past Year Past Year
</div> </div>
<div <div
className="custom-time--shortcut" className="custom-time--shortcut"
onClick={this.handleMovingTimeRange('thisWeek')} onClick={this.handleTimeRangeShortcut('thisWeek')}
> >
This Week This Week
</div> </div>
<div <div
className="custom-time--shortcut" className="custom-time--shortcut"
onClick={this.handleMovingTimeRange('thisMonth')} onClick={this.handleTimeRangeShortcut('thisMonth')}
> >
This Month This Month
</div> </div>
<div <div
className="custom-time--shortcut" className="custom-time--shortcut"
onClick={this.handleMovingTimeRange('thisYear')} onClick={this.handleTimeRangeShortcut('thisYear')}
> >
This Year This Year
</div> </div>
@ -125,11 +125,11 @@ class CustomTimeRange extends Component {
} }
} }
handleMovingTimeRange(movingTimeRange) { handleTimeRangeShortcut(shortcut) {
return () => { return () => {
let lower let lower
switch (movingTimeRange) { switch (shortcut) {
case 'pastWeek': { case 'pastWeek': {
lower = moment().subtract(1, 'week') lower = moment().subtract(1, 'week')
break break