From 3af83cc6daea4495b2e0913e0e565cda66c2c784 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Tue, 9 Apr 2024 07:18:04 -0700 Subject: [PATCH] fix: timestamp --- src/_data/weeklyArtistChart.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/_data/weeklyArtistChart.js b/src/_data/weeklyArtistChart.js index 74d0065b..8b593835 100644 --- a/src/_data/weeklyArtistChart.js +++ b/src/_data/weeklyArtistChart.js @@ -4,6 +4,7 @@ import { DateTime } from 'luxon' export default async function () { const currentDate = DateTime.now() + const lastWeek = currentDate.minus({ weeks: 1 }) const artists = JSON.parse(await readFile('./src/_data/json/artists-map.json', 'utf8')); const albums = JSON.parse(await readFile('./src/_data/json/albums-map.json', 'utf8')); const chartData = JSON.parse(await readFile('./src/_data/json/weekly-top-artists-chart.json', 'utf8')) @@ -17,8 +18,8 @@ export default async function () { return [{ title: content, - url: `https://coryd.dev/now?ts=${parseInt(chartData['timestamp'])}#artists`, + url: `https://coryd.dev/now?ts=${lastWeek.year}-${lastWeek.weekNumber}#artists`, date: DateTime.fromMillis(parseInt(chartData['timestamp'])).toISO(), - description: `My top artists for the last week ending ${currentDate.minus({ days: 1 }).toLocaleString(DateTime.DATE_FULL)}.

` + description: `My top artists for the last week.

` }] } \ No newline at end of file