chore: debug

This commit is contained in:
Cory Dransfeldt 2024-04-04 17:00:04 -07:00
parent 8890af06b2
commit d0b2ac85bf
No known key found for this signature in database

View file

@ -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 }) => {