We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 750469b commit 9e3ae1aCopy full SHA for 9e3ae1a
src/index.js
@@ -11,9 +11,9 @@ const SortOrder = {
11
function sortFilesByDate(filesList, sortByDate = SortOrder.ASC) {
12
const result = filesList.sort((a, b) => {
13
if (sortByDate === SortOrder.DESC) {
14
- return a.lastModified.getTime() < b.lastModified.getTime();
+ return b.lastModified.getTime() - a.lastModified.getTime();
15
}
16
- return a.lastModified.getTime() > b.lastModified.getTime();
+ return a.lastModified.getTime() - b.lastModified.getTime();
17
});
18
19
return result;
0 commit comments