From 4492475cf12e458766bf382c729b36ea265a5e4e Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Mon, 20 May 2024 04:43:00 -0700 Subject: [PATCH] chore: date range --- src/_data/weeklyArtistChart.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/_data/weeklyArtistChart.js b/src/_data/weeklyArtistChart.js index 027da5f0..238e958b 100644 --- a/src/_data/weeklyArtistChart.js +++ b/src/_data/weeklyArtistChart.js @@ -37,11 +37,11 @@ const formatData = (data) => { export default async function() { try { const now = DateTime.now(); - const startOfWeek = now.minus({ days: now.weekday % 7 }).startOf('day'); - const endOfWeek = startOfWeek.plus({ days: 6 }).endOf('day'); - const startOfWeekSeconds = startOfWeek.toSeconds(); - const endOfWeekSeconds = endOfWeek.toSeconds(); - const weekNumber = now.toFormat('kkkk-WW'); + const startOfWeek = now.minus({ days: 7 }).startOf('day') + const endOfWeek = now.endOf('day') + const startOfWeekSeconds = startOfWeek.toSeconds() + const endOfWeekSeconds = endOfWeek.toSeconds() + const weekNumber = now.toFormat('kkkk-WW') let { data: recentCharts } = await supabase .from('weekly_charts') .select('*')