diff options
author | Zero~Informatique | 2020-09-13 10:23:05 +0200 |
---|---|---|
committer | G.Fouet | 2020-09-14 00:07:34 +0200 |
commit | 254858f632bbfd4eb45d0315ed39e0a631e64104 (patch) | |
tree | 40598022557bdb3c0cdd5e9325545c1afbccf51e /viewer/src/services | |
parent | b909ec093591b50950c0de54b2005d471ca28116 (diff) | |
download | ldgallery-254858f632bbfd4eb45d0315ed39e0a631e64104.tar.gz |
viewer: natural sort
github: resolves #243
Diffstat (limited to 'viewer/src/services')
-rw-r--r-- | viewer/src/services/itemComparators.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/viewer/src/services/itemComparators.ts b/viewer/src/services/itemComparators.ts index 380c66a..6a7c81c 100644 --- a/viewer/src/services/itemComparators.ts +++ b/viewer/src/services/itemComparators.ts | |||
@@ -31,7 +31,11 @@ export default class ItemComparators { | |||
31 | ]; | 31 | ]; |
32 | 32 | ||
33 | static sortByNameAsc(left: Gallery.Item, right: Gallery.Item): number { | 33 | static sortByNameAsc(left: Gallery.Item, right: Gallery.Item): number { |
34 | return left.title.localeCompare(right.title); | 34 | return left.title.localeCompare(right.title, undefined, { |
35 | sensitivity: "base", | ||
36 | ignorePunctuation: true, | ||
37 | numeric: true, | ||
38 | }); | ||
35 | } | 39 | } |
36 | 40 | ||
37 | static sortByDateDesc(left: Gallery.Item, right: Gallery.Item): number { | 41 | static sortByDateDesc(left: Gallery.Item, right: Gallery.Item): number { |