Phase 18: Auto timezone detection and ability to change timezone #21

Merged
luckberg merged 38 commits from gsd/phase-18-auto-timezone-detection-and-ability-to-change-timezone into main 2026-06-15 09:55:53 -04:00
Showing only changes of commit 692fe2ad9a - Show all commits
+4 -4
View File
@@ -27,7 +27,7 @@ import { eq, sql } from 'drizzle-orm';
import { db } from '../db/client.js';
import { users, memberCredentials, calendars, appConfig } from '../db/schema.js';
import { requireAdmin } from '../lib/requireAdmin.js';
import { isValidIanaTimezone, getHouseholdTimezone } from '../lib/householdTimezone.js';
import { isValidIanaTimezone, resolveHouseholdTimezone } from '../lib/householdTimezone.js';
import {
validateEncryptAndStoreCredential,
CredentialValidationError,
@@ -205,9 +205,9 @@ adminRouter.get('/config/timezone', async (c) => {
.limit(1);
const isExplicitlySet = row?.value != null;
const timezone = isExplicitlySet
? (row.value as string)
: await getHouseholdTimezone(db);
// IN-01/IN-02: reuse the row we just SELECTed and let the centralized accessor apply
// the D-06 fallback — no second app_config round-trip, single source for the policy.
const timezone = resolveHouseholdTimezone(row?.value ?? null);
return c.json({ timezone, isExplicitlySet });
});