tooltip date formatting updated

main
Benjamin Kraft 5 months ago
parent 9407d7e5ae
commit 7dbd89a5f9
  1. 10
      public/elotracker/chart-integration.js

@ -91,7 +91,15 @@ async function create_charts() {
return format_rank(player_entries_byName[context.dataset.label][context.parsed.x / 1000]["tier"], player_entries_byName[context.dataset.label][context.parsed.x / 1000]["rank"], player_entries_byName[context.dataset.label][context.parsed.x / 1000]["points"])
},
title: items => {
return new Date(items[0].raw.x).toLocaleDateString();
let ms = items[0].raw.x;
let options = {
weekday: "short",
day: "numeric",
month: "short",
hour: "2-digit",
minute: "2-digit"
}
return new Date(ms).toLocaleDateString("de-DE", options);
},
beforeTitle: function (context) {
return context[0].dataset.label;

Loading…
Cancel
Save