Fix lint: move pad helper to module scope in date-utils
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m58s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m25s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Parsons 2026-06-17 18:58:03 -07:00
parent 24ca6622e4
commit 0397da22fb

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());