Improve raw command handlers and remove dayjs dependency (switched to native Intl.DateTimeFormat API)

This commit is contained in:
lowlighter
2021-02-09 18:50:25 +01:00
parent 7d9d259f23
commit b80eecc3f5
10 changed files with 37 additions and 21 deletions

View File

@@ -154,7 +154,7 @@
name:track.name,
artist:track.artists[0].name,
artwork:track.album.images[0].url,
played_at:played_at ? imports.dayjs(played_at).format("[played at] HH:MM on DD/MM/YYYY") : null,
played_at:played_at ? `${imports.date(played_at, {timeStyle:"short", timeZone:data.config.timezone?.name})} on ${imports.date(played_at, {dateStyle:"short", timeZone:data.config.timezone?.name})}` : null,
}))
//Ensure no duplicate are added
for (const track of loaded) {