mirror of
https://github.com/urosran/cally.git
synced 2026-10-23 08:07:55 +00:00
- Sorted the todo list and showed the todos by sorted date
This commit is contained in:
@@ -7,7 +7,8 @@ import { AntDesign } from "@expo/vector-icons";
|
|||||||
import {IToDo} from "@/hooks/firebase/types/todoData";
|
import {IToDo} from "@/hooks/firebase/types/todoData";
|
||||||
|
|
||||||
const groupToDosByDate = (toDos: IToDo[]) => {
|
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;
|
let dateKey;
|
||||||
|
|
||||||
if (toDo.date === null) {
|
if (toDo.date === null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user