From 2f618b1e1c32a822829f013d7395291247ef3ea6 Mon Sep 17 00:00:00 2001 From: Eric Gauzens Date: Wed, 3 Jan 2024 17:43:22 -0500 Subject: [PATCH] Reformatted metrics request --- pages/about/index.vue | 5 +++-- utils/common.js | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/about/index.vue b/pages/about/index.vue index 4d0d76c9..230cd734 100644 --- a/pages/about/index.vue +++ b/pages/about/index.vue @@ -155,8 +155,9 @@ export default { }, async fetch() { - const day = new Date().getDay().toString().padStart(2, "0") - const month = new Date().getMonth().toString().padStart(2, "0") + const day = new Date().getDate().toString().padStart(2, "0") + let month = new Date().getMonth() + 1 + month = month.toString().padStart(2, "0") const year = new Date().getFullYear() let totalDownloads, downloadsLastMonth, totalContributors, newContributors = 0 await this.$axios diff --git a/utils/common.js b/utils/common.js index 027908df..b2f75872 100644 --- a/utils/common.js +++ b/utils/common.js @@ -73,10 +73,9 @@ export const extractS3BucketName = uri => { export const getPreviousMonth = () => { const currentDate = new Date() - const currentMonth = currentDate.getMonth() - const previousMonth = (currentMonth === 0) ? 11 : currentMonth - 1 - - const previousYear = (currentMonth === 0) ? currentDate.getFullYear() - 1 : currentDate.getFullYear() + const currentMonth = currentDate.getMonth() + 1 + const previousMonth = (currentMonth === 1) ? 12 : currentMonth - 1 + const previousYear = (currentMonth === 1) ? currentDate.getFullYear() - 1 : currentDate.getFullYear() return { year: previousYear,