fix: check if creation date isn't null when sorting

This commit is contained in:
Spectralitree 2021-12-19 15:19:43 +01:00
parent 2b9254471d
commit 9a7da2896e
4 changed files with 11 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@
}(window.location))
</script>
<!-- End Single Page Apps for GitHub Pages -->
<script type="module" crossorigin src="/assets/main.8aa7f48b.js"></script>
<script type="module" crossorigin src="/assets/main.b639bf70.js"></script>
<link rel="modulepreload" href="/assets/vendor.409d4218.js">
<link rel="stylesheet" href="/assets/vendor.17033500.css">
<link rel="stylesheet" href="/assets/main.9f8b34bf.css">

View File

@ -101,7 +101,9 @@
else return a.name.localeCompare(b.name);
});
break;
case "creation date": sortedList = filteredList.sort((a, b) => a.created.localeCompare(b.created));
case "creation date": sortedList = filteredList.sort((a, b) => {
if (a.created && b.created) return a.created.localeCompare(b.created);
});
break;
case "ID": sortedList = filteredList.sort((a, b) => a.id.localeCompare(b.id));
break;

View File

@ -101,7 +101,9 @@
else return a.name.localeCompare(b.name);
});
break;
case "creation date": sortedList = filteredList.sort((a, b) => a.created.localeCompare(b.created));
case "creation date": sortedList = filteredList.sort((a, b) => {
if (a.created && b.created) return a.created.localeCompare(b.created);
});
break;
case "ID": sortedList = filteredList.sort((a, b) => a.id.localeCompare(b.id));
break;