From a03fb0cf0033bc90f4ab41f86a1f582f5c08c0ca Mon Sep 17 00:00:00 2001 From: Satyam Rastogi Date: Fri, 29 May 2026 03:24:57 +0530 Subject: [PATCH] chore(data): add DEMO_TODAY anchor and use it for kanban day-counter --- src/components/kanban/KanbanCard.jsx | 3 ++- src/data/mockStore.jsx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/kanban/KanbanCard.jsx b/src/components/kanban/KanbanCard.jsx index b3906b8..d72fe9f 100644 --- a/src/components/kanban/KanbanCard.jsx +++ b/src/components/kanban/KanbanCard.jsx @@ -2,6 +2,7 @@ import React from 'react'; import { useDraggable } from '@dnd-kit/core'; import { CSS } from '@dnd-kit/utilities'; import { MapPin, User, Clock, CloudLightning } from 'lucide-react'; +import { DEMO_TODAY } from '../../data/mockStore'; function getInitials(name) { return (name || '').split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase(); @@ -11,7 +12,7 @@ function getDaysInStage(activity) { if (!activity?.length) return 0; const last = activity[0]; const lastDate = new Date(last.date); - const now = new Date('2026-04-07'); + const now = DEMO_TODAY; return Math.max(0, Math.floor((now - lastDate) / 86400000)); } diff --git a/src/data/mockStore.jsx b/src/data/mockStore.jsx index 1662360..4e45ba1 100644 --- a/src/data/mockStore.jsx +++ b/src/data/mockStore.jsx @@ -2,6 +2,9 @@ import React, { createContext, useContext, useState, useEffect } from 'react'; import { toast } from 'sonner'; import { logger } from '../utils/logger'; +// Fixed "today" for the demo so seeded dates never go stale or land in the future. +export const DEMO_TODAY = new Date('2026-05-29T12:00:00'); + // --- DATA CONSTANTS (Extracted from old App.jsx) --- const RAW_LOCATIONS = [