File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -386,16 +386,21 @@ export default {
386386 periodLength = this .periodLength ;
387387 }
388388
389+ const momentJsDate = moment (date );
390+ if (! momentJsDate .isValid ()) {
391+ return ;
392+ }
393+
389394 let new_date;
390395 if (periodLength == ' 7 days' ) {
391396 periodLength = ' last7d' ;
392- new_date = moment ( date ) .add (1 , ' days' ).format (' YYYY-MM-DD' );
397+ new_date = momentJsDate .add (1 , ' days' ).format (' YYYY-MM-DD' );
393398 } else if (periodLength == ' 30 days' ) {
394399 periodLength = ' last30d' ;
395- new_date = moment ( date ) .add (1 , ' days' ).format (' YYYY-MM-DD' );
400+ new_date = momentJsDate .add (1 , ' days' ).format (' YYYY-MM-DD' );
396401 } else {
397402 const new_period_length_moment = periodLengthConvertMoment (periodLength );
398- new_date = moment ( date ) .startOf (new_period_length_moment ).format (' YYYY-MM-DD' );
403+ new_date = momentJsDate .startOf (new_period_length_moment ).format (' YYYY-MM-DD' );
399404 }
400405 const path = ` /activity/${this .host }/${periodLength }/${new_date }/${this .subview }/${this .currentViewId } ` ;
401406 if (this .$route .path !== path ) {
You can’t perform that action at this time.
0 commit comments