Skip to content

Commit

Permalink
feat(chart): add past year page
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Dec 8, 2024
1 parent a93f56f commit d296cbb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions web/src/views/project/template/TemplateDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,14 @@ export default {
data() {
return {
dateRanges: [{
text: 'Last Week',
text: 'Past week',
value: 'last_week',
}, {
text: 'Last Month',
text: 'Past month',
value: 'last_month',
}, {
text: 'Past year',
value: 'last_year',
}],
users: [{
text: 'All users',
Expand All @@ -161,12 +164,15 @@ export default {
const date = new Date();
switch (this.dateRange) {
case 'last_year':
date.setDate(date.getFullYear() - 1);
break;
case 'last_month':
date.setDate(date.getDate() - 7);
date.setDate(date.getDate() - 30);
break;
case 'last_week':
default:
date.setDate(date.getDate() - 30);
date.setDate(date.getDate() - 7);
break;
}
Expand Down

0 comments on commit d296cbb

Please sign in to comment.