first commit

This commit is contained in:
Alberto-Audrix committed 2026-09-08 15:21:23 +07:00
commit b54624be96
226 files changed
+108840

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
/** Keep rows on or before the dashboard publish cutoff date (ISO `YYYY-MM-DD`). */
export function throughVisibleDate<T extends { date: string }>(
rows: T[],
visibleThrough: string | null | undefined
): T[] {
if (!visibleThrough) return rows;
return rows.filter((row) => row.date <= visibleThrough);
}
/** True when `date` is on or before the publish cutoff (or cutoff is unknown). */
export function isOnOrBeforeVisibleDate(
date: string | null | undefined,
visibleThrough: string | null | undefined
): boolean {
if (!date) return false;
if (!visibleThrough) return true;
return date <= visibleThrough;
}