mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-24 22:25:15 +00:00
feat: consistent sorting
This commit is contained in:
committed by
kolaente
parent
2175e5679f
commit
ed5d983d18
@@ -38,7 +38,7 @@ export const findCheckboxesInText = (text: string): number[] => {
|
||||
return [
|
||||
...checkboxes.checked,
|
||||
...checkboxes.unchecked,
|
||||
].sort((a, b) => a < b ? -1 : 1)
|
||||
].sort((a, b) => a - b)
|
||||
}
|
||||
|
||||
export const getChecklistStatistics = (text: string): CheckboxStatistics => {
|
||||
|
||||
@@ -107,7 +107,7 @@ export default class TaskModel extends AbstractModel<ITask> implements ITask {
|
||||
|
||||
this.labels = this.labels
|
||||
.map(l => new LabelModel(l))
|
||||
.sort((f, s) => f.title > s.title ? 1 : -1)
|
||||
.sort((a, b) => a.title.localeCompare(b.title))
|
||||
|
||||
// Parse the assignees into user models
|
||||
this.assignees = this.assignees.map(a => {
|
||||
|
||||
@@ -238,7 +238,7 @@ export const useProjectStore = defineStore('project', () => {
|
||||
} else {
|
||||
views.push(view)
|
||||
}
|
||||
views.sort((a, b) => a.position < b.position ? -1 : 1)
|
||||
views.sort((a, b) => a.position - b.position)
|
||||
|
||||
setProject({
|
||||
...projects.value[view.projectId],
|
||||
|
||||
@@ -310,7 +310,7 @@ function useAvailableTimezones(settingsRef: Ref<IUserSettings>) {
|
||||
if (r.data) {
|
||||
// Transform timezones into objects with value/label pairs
|
||||
availableTimezones.value = r.data
|
||||
.sort()
|
||||
.sort((a, b) => a.localeCompare(b))
|
||||
.map((tz: string) => ({
|
||||
value: tz,
|
||||
label: tz.replace(/_/g, ' '),
|
||||
|
||||
Reference in New Issue
Block a user