Fix date sorting
This commit is contained in:
		
							parent
							
								
									8bd4fce5f1
								
							
						
					
					
						commit
						52d169b296
					
				@ -310,8 +310,10 @@ async function getLeaderboardEntries() {
 | 
			
		||||
        results.push(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await results.sort((a, b) => parseInt(a.dateLastBeat) - parseInt(b.dateLastBeat));
 | 
			
		||||
    await results.sort((a, b) => parseInt(b.count) - parseInt(a.count));
 | 
			
		||||
    results.sort((a, b) => new Date(b.dateLastBeat) - new Date(a.dateLastBeat));
 | 
			
		||||
    results.sort((a, b) => parseInt(b.count) - parseInt(a.count));
 | 
			
		||||
 | 
			
		||||
    console.log(results);
 | 
			
		||||
 | 
			
		||||
    return results;
 | 
			
		||||
}
 | 
			
		||||
@ -347,8 +349,8 @@ async function getLeaderboardEntriesBetweenDates(start, end) {
 | 
			
		||||
        results.push(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await results.sort((a, b) => parseInt(a.dateLastBeat) - parseInt(b.dateLastBeat));
 | 
			
		||||
    await results.sort((a, b) => parseInt(b.count) - parseInt(a.count));
 | 
			
		||||
    results.sort((a, b) => new Date(b.dateLastBeat) - new Date(a.dateLastBeat));
 | 
			
		||||
    results.sort((a, b) => parseInt(b.count) - parseInt(a.count));
 | 
			
		||||
 | 
			
		||||
    return results;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user