diff --git a/components/flow.tsx b/components/flow.tsx
index 10cf1d7c..0fbacb00 100644
--- a/components/flow.tsx
+++ b/components/flow.tsx
@@ -158,30 +158,54 @@ export function Flow() {
>
-
- {(() => {
- const date = task.dateToFinish && task.dateToFinish !== '0000-00-00 00:00:00'
- ? new Date(task.dateToFinish)
- : task.editTo && task.editTo !== '0000-00-00 00:00:00'
- ? new Date(task.editTo)
- : task.editFrom && task.editFrom !== '0000-00-00 00:00:00'
- ? new Date(task.editFrom)
- : new Date(task.date);
- return date.toLocaleDateString('fr-FR', { month: 'short' });
- })()}
-
-
- {(() => {
- const date = task.dateToFinish && task.dateToFinish !== '0000-00-00 00:00:00'
- ? new Date(task.dateToFinish)
- : task.editTo && task.editTo !== '0000-00-00 00:00:00'
- ? new Date(task.editTo)
- : task.editFrom && task.editFrom !== '0000-00-00 00:00:00'
- ? new Date(task.editFrom)
- : new Date(task.date);
- return date.getDate();
- })()}
-
+ {(() => {
+ const getValidDate = (task: Task) => {
+ const dates = [
+ task.dateToFinish,
+ task.editTo,
+ task.editFrom,
+ task.date
+ ];
+
+ for (const d of dates) {
+ if (d && d !== '0000-00-00 00:00:00') {
+ const parsed = new Date(d);
+ if (!isNaN(parsed.getTime())) {
+ return parsed;
+ }
+ }
+ }
+ return null;
+ };
+
+ const date = getValidDate(task);
+ const today = new Date();
+ today.setHours(0, 0, 0, 0);
+
+ if (!date) {
+ return (
+ <>
+ NO
+ DATE
+ >
+ );
+ }
+
+ const isPastDue = date < today;
+ const textColorClass = isPastDue ? 'text-red-600' : 'text-blue-600';
+ const boldColorClass = isPastDue ? 'text-red-700' : 'text-blue-700';
+
+ return (
+ <>
+
+ {date.toLocaleDateString('fr-FR', { month: 'short' })}
+
+
+ {date.getDate()}
+
+ >
+ );
+ })()}