Add timezone preference and fix all date handling to be timezone-aware
Build and push image / build (push) Successful in 56s

Dates were computed using browser/server local time with no explicit timezone,
causing inconsistencies when server runs in UTC. Now all "today" computations
and date formatting use the user's chosen IANA timezone, persisted in
localStorage and selectable from Settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 22:30:01 -04:00
parent 946e96c3ea
commit 4044de7bfc
22 changed files with 165 additions and 85 deletions
+4 -9
View File
@@ -125,15 +125,10 @@ export const TYPES: TypeConfig[] = [
// User-supplied 6-digit asset ids are printed on a roll of physical tags.
export const ASSET_ID_RE = /^\d{6}$/;
// 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}`;
})();
import { getToday, getBrowserTimezone } from "./tz.js";
export { getToday } from "./tz.js";
export const TODAY_STR = getToday(getBrowserTimezone());
// Build the joined Item[] view from bootstrap. Inventory items are dropped
// silently if they reference a missing product — that shouldn't happen in