Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformatted metrics request #792

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading