- Sorted the todo list and showed the todos by sorted date

This commit is contained in:
Dejan
2024-10-15 22:52:53 +02:00
parent dc05090f49
commit e2d18cf7d5
+2 -1
View File
@@ -7,7 +7,8 @@ import { AntDesign } from "@expo/vector-icons";
import {IToDo} from "@/hooks/firebase/types/todoData";
const groupToDosByDate = (toDos: IToDo[]) => {
return toDos.reduce((groups, toDo) => {
let sortedTodos = toDos.sort((a, b) => a.date - b.date);
return sortedTodos.reduce((groups, toDo) => {
let dateKey;
if (toDo.date === null) {