diff options
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r-- | webapp/utils/utils.jsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index f12fcefba..89e031a3c 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -475,6 +475,11 @@ export function splitFileLocation(fileLocation) { return {ext, name: filename, path: filePath}; } +export function sortFilesByName(files) { + const locale = LocalizationStore.getLocale(); + return Array.from(files).sort((a, b) => a.name.localeCompare(b.name, locale, {numeric: true})); +} + export function toTitleCase(str) { function doTitleCase(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); |