diff --git a/src/components/LastFm.astro b/src/components/LastFm.astro index 4e32916..39fd8f8 100644 --- a/src/components/LastFm.astro +++ b/src/components/LastFm.astro @@ -21,7 +21,7 @@ "@attr"?: { nowplaying: boolean }, album: LastFmResource, artist: LastFmResource, - date?: LastFmResource, + date?: LastFmResource & { uts: number }, image: LastFmResource[], name: string, url: string, @@ -39,7 +39,7 @@ title.href = track.url; album.innerText = track.album["#text"]; artist.innerText = track.artist["#text"]; - time.innerText = (track.date && new Date(track.date["#text"]).toLocaleString(undefined, { + time.innerText = (track.date && new Date(track.date.uts * 1000).toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" })) || (track["@attr"]?.nowplaying && "NOW!!!") || "epic error getting play time..";