claude/practical-newton-4v041g #98

Merged
chrisp merged 3 commits from claude/practical-newton-4v041g into main 2026-06-18 02:33:06 +00:00
Showing only changes of commit edae04057d - Show all commits

View file

@ -18,6 +18,8 @@
*/ */
import { format } from "date-fns"; import { format } from "date-fns";
const pad = (n: number) => String(n).padStart(2, "0");
/** /**
* Format a YYYY-MM-DD date string for display (e.g. "Apr 9"). * Format a YYYY-MM-DD date string for display (e.g. "Apr 9").
* Returns null when the value is missing or unparseable callers decide how to handle that case. * Returns null when the value is missing or unparseable callers decide how to handle that case.
@ -75,7 +77,6 @@ export function utcIsoToLocalDateTime(value: string | Date | null | undefined):
if (!value) return ""; if (!value) return "";
const date = value instanceof Date ? value : new Date(value); const date = value instanceof Date ? value : new Date(value);
if (isNaN(date.getTime())) return ""; if (isNaN(date.getTime())) return "";
const pad = (n: number) => String(n).padStart(2, "0");
const year = date.getFullYear(); const year = date.getFullYear();
const month = pad(date.getMonth() + 1); const month = pad(date.getMonth() + 1);
const day = pad(date.getDate()); const day = pad(date.getDate());