chore: debug
This commit is contained in:
parent
8890af06b2
commit
d0b2ac85bf
1 changed files with 11 additions and 7 deletions
|
@ -4,13 +4,17 @@ import fs from 'fs'
|
||||||
|
|
||||||
const getKeys = () => {
|
const getKeys = () => {
|
||||||
const currentDate = DateTime.now()
|
const currentDate = DateTime.now()
|
||||||
return [
|
const weeks = Math.floor(currentDate.daysInMonth / 7)
|
||||||
`${currentDate.year}-${currentDate.weekNumber}`
|
let count = 0
|
||||||
`${currentDate.minus({ weeks: 1 }).year}-${currentDate.minus({ weeks: 1 }).weekNumber}`,
|
const keys = []
|
||||||
`${currentDate.minus({ weeks: 2 }).year}-${currentDate.minus({ weeks: 2 }).weekNumber}`,
|
while (count < weeks) {
|
||||||
`${currentDate.minus({ weeks: 3 }).year}-${currentDate.minus({ weeks: 3 }).weekNumber}`,
|
const weeks = 1 * (count + 1)
|
||||||
`${currentDate.minus({ weeks: 4 }).year}-${currentDate.minus({ weeks: 4 }).weekNumber}`,
|
const date = DateTime.now().minus({ weeks })
|
||||||
]
|
keys.push(`${date.year}-${date.weekNumber}`)
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
console.log(keys)
|
||||||
|
return keys
|
||||||
}
|
}
|
||||||
|
|
||||||
export const onPreBuild = async ({ constants }) => {
|
export const onPreBuild = async ({ constants }) => {
|
||||||
|
|
Reference in a new issue