Skip to content

Commit

Permalink
Merge pull request #792 from egauzens/fix-metrics-request
Browse files Browse the repository at this point in the history
Reformatted metrics request
  • Loading branch information
egauzens authored Jan 5, 2024
2 parents 400cf5c + 2f618b1 commit 59153a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions pages/about/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 59153a7

Please sign in to comment.