Skip to content

Commit 62335a0

Browse files
committed
Change due date sorting order to use date algorithm
1 parent a76a55a commit 62335a0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/TaskList.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
<script lang="ts">
120120
import store from "@/store";
121121
import { defineComponent } from "vue";
122+
import { TodoTask } from "./NewTask.vue";
122123
123124
export enum RepeatInterval {
124125
Daily = 1, //daily gets 1x XP, weekly gets 2x XP, monthly gets 3x XP, yearly gets 4x XP, one-time gets 5x XP multiplier
@@ -161,9 +162,10 @@ export default defineComponent({
161162
},
162163
computed: {
163164
getTasks() {
164-
//eslint-disable-next-line
165-
return store.getters.getTasks.sort((a: any, b: any) =>
166-
a.dueDate.localeCompare(b.dueDate),
165+
return store.getters.getTasks.sort(
166+
(a: TodoTask, b: TodoTask) =>
167+
Number(new Date(a.dueDate + " 23:59:59.999")) -
168+
Number(new Date(b.dueDate + " 23:59:59.999")),
167169
); //get list of tasks (todos) and sort tasks by task's due date with the top one the oldest
168170
},
169171
getCurrentLevel() {

0 commit comments

Comments
 (0)