Skip to content

Commit

Permalink
Fix: Sorting filenames containing numbers
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Thiele <adrian.thiele@live.de>
  • Loading branch information
cooltyp100 authored and backportbot-nextcloud[bot] committed Nov 30, 2023
1 parent f19d46c commit c38da38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/fileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,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 })
}

/**
Expand Down

0 comments on commit c38da38

Please sign in to comment.