From 8677667a10b8b17a4805d23b200c1169758f05f9 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Wed, 27 Feb 2019 13:47:38 +0100 Subject: [PATCH] hotfix --- .../category-list/category-list.component.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/motions/components/category-list/category-list.component.ts b/client/src/app/site/motions/components/category-list/category-list.component.ts index 77425a61c..5aa853928 100644 --- a/client/src/app/site/motions/components/category-list/category-list.component.ts +++ b/client/src/app/site/motions/components/category-list/category-list.component.ts @@ -188,10 +188,21 @@ export class CategoryListComponent extends BaseViewComponent implements OnInit { * @returns all motions in the category */ public motionsInCategory(category: Category): ViewMotion[] { + const coll = new Intl.Collator(this.translate.currentLang); return this.motionRepo .getViewModelList() .filter(m => m.category_id === category.id) - .sort((motion1, motion2) => motion1.identifier.localeCompare(motion2.identifier)); + .sort((motion1, motion2) => { + if (motion1.identifier && motion2.identifier) { + return coll.compare(motion1.identifier, motion2.identifier); + } else if (motion1.identifier) { + return 1; + } else if (motion2.identifier) { + return -1; + } else { + return coll.compare(motion1.getTitle(), motion2.getTitle()); + } + }); } /**