used month name instead of number

main
Simon Lang 3 months ago
parent 3af92a2d0e
commit 0543f78354
  1. 5
      public/elotracker/chart-integration.js

@ -16,12 +16,12 @@ const x_scale = {
ticks: {
callback: (value, index, ticks) => {
let tickdate = new Date(value);
if (index === 0) return `${tickdate.getDate()}.${tickdate.getMonth() + 1}.`;
if (index === 0) return `${tickdate.getDate()}.${month_names[tickdate.getMonth()]}`;
let prev_tickdate = new Date(ticks[index-1].value);
if (prev_tickdate.getDate() === tickdate.getDate()) {
return null;
}
return `${tickdate.getDate()}.${tickdate.getMonth() + 1}.`;
return `${tickdate.getDate()}.${month_names[tickdate.getMonth()]}`;
}
}
}
@ -345,6 +345,7 @@ function format_time_minsec(date) {
}
return min + trenner + nullausgleich + date.getSeconds() + format;
}
const month_names = ["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"];
async function update_leaderboard_elements() {
fetch(`./leaderboard_list.php`, {

Loading…
Cancel
Save