Skip to content

Commit

Permalink
Merge pull request #2089 from nextcloud/backport/2088/stable28
Browse files Browse the repository at this point in the history
[stable28] Fix: Sorting filenames containing numbers
  • Loading branch information
AndyScherzinger authored Nov 30, 2023
2 parents 65c07dd + 1bc4904 commit 44e3f6d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/utils/fileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const sortCompare = function(fileInfo1, fileInfo2, key, asc = true) {

// finally sort by name
return asc
? fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage())
: -fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage())
? fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage(), { numeric: true })
: -fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage(), { numeric: true })
}

export type FileInfo = object
Expand Down

0 comments on commit 44e3f6d

Please sign in to comment.