chore(data): add DEMO_TODAY anchor and use it for kanban day-counter
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import { useDraggable } from '@dnd-kit/core';
|
import { useDraggable } from '@dnd-kit/core';
|
||||||
import { CSS } from '@dnd-kit/utilities';
|
import { CSS } from '@dnd-kit/utilities';
|
||||||
import { MapPin, User, Clock, CloudLightning } from 'lucide-react';
|
import { MapPin, User, Clock, CloudLightning } from 'lucide-react';
|
||||||
|
import { DEMO_TODAY } from '../../data/mockStore';
|
||||||
|
|
||||||
function getInitials(name) {
|
function getInitials(name) {
|
||||||
return (name || '').split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase();
|
return (name || '').split(' ').map(w => w[0]).join('').slice(0, 2).toUpperCase();
|
||||||
@@ -11,7 +12,7 @@ function getDaysInStage(activity) {
|
|||||||
if (!activity?.length) return 0;
|
if (!activity?.length) return 0;
|
||||||
const last = activity[0];
|
const last = activity[0];
|
||||||
const lastDate = new Date(last.date);
|
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));
|
return Math.max(0, Math.floor((now - lastDate) / 86400000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import React, { createContext, useContext, useState, useEffect } from 'react';
|
|||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { logger } from '../utils/logger';
|
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) ---
|
// --- DATA CONSTANTS (Extracted from old App.jsx) ---
|
||||||
|
|
||||||
const RAW_LOCATIONS = [
|
const RAW_LOCATIONS = [
|
||||||
|
|||||||
Reference in New Issue
Block a user