Skip to content

Commit

Permalink
fix: Handle date clearing in Activity view (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkvach committed May 1, 2024
1 parent 400ba07 commit 97a1089
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/views/activity/Activity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,21 @@ export default {
periodLength = this.periodLength;
}
const momentJsDate = moment(date);
if (!momentJsDate.isValid()) {
return;
}
let new_date;
if (periodLength == '7 days') {
periodLength = 'last7d';
new_date = moment(date).add(1, 'days').format('YYYY-MM-DD');
new_date = momentJsDate.add(1, 'days').format('YYYY-MM-DD');
} else if (periodLength == '30 days') {
periodLength = 'last30d';
new_date = moment(date).add(1, 'days').format('YYYY-MM-DD');
new_date = momentJsDate.add(1, 'days').format('YYYY-MM-DD');
} else {
const new_period_length_moment = periodLengthConvertMoment(periodLength);
new_date = moment(date).startOf(new_period_length_moment).format('YYYY-MM-DD');
new_date = momentJsDate.startOf(new_period_length_moment).format('YYYY-MM-DD');
}
const path = `/activity/${this.host}/${periodLength}/${new_date}/${this.subview}/${this.currentViewId}`;
if (this.$route.path !== path) {
Expand Down

0 comments on commit 97a1089

Please sign in to comment.