Fix displayed times in dashboards

This commit is contained in:
Pat Hartl 2024-06-24 17:24:04 -05:00
parent bcd3a4db39
commit 42be273a86
3 changed files with 3 additions and 3 deletions

View file

@ -15,7 +15,7 @@
meta: {
playtime: {
alias: 'Average Session Playtime',
formatter: (v) => new Date(v * 1000).toISOString().slice(11, 19)
formatter: (v) => Math.floor(v / 3600) > 0 ? `${Math.floor(v / 3600)}h ${Math.floor((v % 3600) / 60)}m` : `${Math.floor((v % 3600) / 60)}m`
}
},
label: {

View file

@ -15,7 +15,7 @@
meta: {
value: {
alias: 'Total Playtime',
formatter: (v) => new Date(v * 1000).toISOString().slice(11, 19)
formatter: (v) => Math.floor(v / 3600) > 0 ? `${Math.floor(v / 3600)}h ${Math.floor((v % 3600) / 60)}m` : `${Math.floor((v % 3600) / 60)}m`
}
},
label: {

View file

@ -15,7 +15,7 @@
meta: {
playtime: {
alias: 'Total Playtime',
formatter: (v) => new Date(v * 1000).toISOString().slice(11, 19)
formatter: (v) => Math.floor(v / 3600) > 0 ? `${Math.floor(v / 3600)}h ${Math.floor((v % 3600) / 60)}m` : `${Math.floor((v % 3600) / 60)}m`
}
},
label: {