chore: date range
This commit is contained in:
parent
68dd84065f
commit
4492475cf1
1 changed files with 5 additions and 5 deletions
|
@ -37,11 +37,11 @@ const formatData = (data) => {
|
||||||
export default async function() {
|
export default async function() {
|
||||||
try {
|
try {
|
||||||
const now = DateTime.now();
|
const now = DateTime.now();
|
||||||
const startOfWeek = now.minus({ days: now.weekday % 7 }).startOf('day');
|
const startOfWeek = now.minus({ days: 7 }).startOf('day')
|
||||||
const endOfWeek = startOfWeek.plus({ days: 6 }).endOf('day');
|
const endOfWeek = now.endOf('day')
|
||||||
const startOfWeekSeconds = startOfWeek.toSeconds();
|
const startOfWeekSeconds = startOfWeek.toSeconds()
|
||||||
const endOfWeekSeconds = endOfWeek.toSeconds();
|
const endOfWeekSeconds = endOfWeek.toSeconds()
|
||||||
const weekNumber = now.toFormat('kkkk-WW');
|
const weekNumber = now.toFormat('kkkk-WW')
|
||||||
let { data: recentCharts } = await supabase
|
let { data: recentCharts } = await supabase
|
||||||
.from('weekly_charts')
|
.from('weekly_charts')
|
||||||
.select('*')
|
.select('*')
|
||||||
|
|
Reference in a new issue