Skip to content

Commit

Permalink
sort test
Browse files Browse the repository at this point in the history
  • Loading branch information
FallBackITA27 committed Apr 12, 2024
1 parent cc4abd7 commit c9b15a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mkwpp-parser/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ document.getElementById("readInput").addEventListener("click", async function()
console.log("Finished");
resetOutput();
let out = [];
data.submissions.sort((a,b)=>a.date - b.date).sort((a,b)=>a.name - b.name);
for (let submission of data.submissions) {
if (submission.err || submission.skip) {
if (submission.err) {
Expand All @@ -279,7 +280,7 @@ document.getElementById("readInput").addEventListener("click", async function()
}
writeToOutput("Name: "+submission.name);
writeToOutput("Date: "+submission.date);
submission.times.sort((a,b)=>(a.track + a.flap)-(b.track + b.flap))
submission.times.sort((a,b)=>(a.track*2 + a.flap)-(b.track*2 + b.flap))
writeToOutput("Times submitted: "+submission.times.length);
for (let time of submission.times) {
writeToOutput(`>> ${constants.track_names[time.track]}:${time.flap ? " flap" : ""}${time.nosc ? " nosc" : ""} ${formatMsToTime(time.time)}${" " + time.comment}`);
Expand Down

0 comments on commit c9b15a7

Please sign in to comment.