fix sorting in codex on title

This commit is contained in:
Wouter Groeneveld 2023-12-15 14:38:16 +01:00
parent d54514079c
commit aa4381bc32
1 changed files with 2 additions and 2 deletions

View File

@ -8,10 +8,10 @@ document.addEventListener("DOMContentLoaded",function() {
}
var sorts = {
"year": (a, b) => toI(a, 'year') > toI(b, 'year'),
"name": (a, b) => a.innerHTML.localeCompare(b.innerHTML),
"name": (a, b) => a.querySelector('.name').innerHTML.toLowerCase() > b.querySelector('.name').innerHTML.toLowerCase(),
"hours": (a, b) =>toI(a, 'hours') > toI(b, 'hours'),
"date": (a, b) => a.querySelector('.date').dateTime.localeCompare(b.querySelector('.date').dateTime),
"rating": (a, b) => toI(a, 'rating') < toI(b, 'rating')
"rating": (a, b) => toI(a, 'rating') > toI(b, 'rating')
}
articles.sort(sorts[by])