diff --git a/server/src/routes/bootstrap.ts b/server/src/routes/bootstrap.ts index 70a35a8..ce0b963 100644 --- a/server/src/routes/bootstrap.ts +++ b/server/src/routes/bootstrap.ts @@ -123,6 +123,6 @@ bootstrapRouter.get("/bootstrap", (_req, res) => { brands, bins, strains: strainsOut, - today: "2026-04-25", + today: new Date().toISOString().slice(0, 10), }); }); diff --git a/web/src/types.ts b/web/src/types.ts index 0fa0139..8271aa9 100644 --- a/web/src/types.ts +++ b/web/src/types.ts @@ -96,7 +96,15 @@ export const TYPES: TypeConfig[] = [ { id: "Vaporizer", kind: "discrete", auditMode: "presence", cadenceDays: 30, unit: "ct", weighable: false }, ]; -export const TODAY_STR = "2026-04-25"; +// Local-time YYYY-MM-DD captured once at module load. Used as the default +// value for date inputs and as the "today" anchor for days-since math. +export const TODAY_STR = (() => { + const d = new Date(); + const y = d.getFullYear(); + const m = String(d.getMonth() + 1).padStart(2, "0"); + const day = String(d.getDate()).padStart(2, "0"); + return `${y}-${m}-${day}`; +})(); // Helpers — match data.js DATA_HELPERS API export const helpers = {