@@ -39,7 +39,6 @@ class StatsPeriodNavigation extends PureComponent {
39
39
startDate : PropTypes . bool ,
40
40
endDate : PropTypes . bool ,
41
41
isWithNewDateControl : PropTypes . bool ,
42
- appliedShortcut : PropTypes . object ,
43
42
} ;
44
43
45
44
static defaultProps = {
@@ -51,7 +50,6 @@ class StatsPeriodNavigation extends PureComponent {
51
50
startDate : false ,
52
51
endDate : false ,
53
52
isWithNewDateControl : false ,
54
- appliedShortcut : null ,
55
53
} ;
56
54
57
55
handleArrowEvent = ( arrow , href ) => {
@@ -143,7 +141,7 @@ class StatsPeriodNavigation extends PureComponent {
143
141
144
142
// TODO: refactor to extract logic with `dateForCustomRange` from `client/my-sites/stats/stats-date-picker/index.jsx`.
145
143
getFullPeriod = ( ) => {
146
- const { moment, dateRange, appliedShortcut , momentSiteZone } = this . props ;
144
+ const { moment, dateRange, momentSiteZone } = this . props ;
147
145
const localizedStartDate = moment ( dateRange . chartStart ) ;
148
146
const localizedEndDate = moment ( dateRange . chartEnd ) ;
149
147
@@ -152,7 +150,7 @@ class StatsPeriodNavigation extends PureComponent {
152
150
localizedStartDate . isSame ( localizedStartDate . clone ( ) . startOf ( 'month' ) , 'day' ) &&
153
151
localizedEndDate . isSame ( momentSiteZone , 'day' ) &&
154
152
localizedStartDate . isSame ( localizedEndDate , 'month' ) &&
155
- ( ! appliedShortcut || appliedShortcut . id === 'month_to_date' )
153
+ ( ! dateRange . shortcutId || dateRange . shortcutId === 'month_to_date' )
156
154
) {
157
155
return 'month' ;
158
156
}
@@ -162,7 +160,7 @@ class StatsPeriodNavigation extends PureComponent {
162
160
localizedStartDate . isSame ( localizedStartDate . clone ( ) . startOf ( 'year' ) , 'day' ) &&
163
161
localizedEndDate . isSame ( momentSiteZone , 'day' ) &&
164
162
localizedStartDate . isSame ( localizedEndDate , 'year' ) &&
165
- ( ! appliedShortcut || appliedShortcut . id === 'year_to_date' )
163
+ ( ! dateRange . shortcutId || dateRange . shortcutId === 'year_to_date' )
166
164
) {
167
165
return 'year' ;
168
166
}
0 commit comments