Calendar v2 - Combined Calendar Feature

This commit is contained in:
2026-03-30 16:12:05 -05:00
parent 6353f9c9b4
commit 7eb6160b5a
9 changed files with 672 additions and 34 deletions
+13 -1
View File
@@ -31,7 +31,17 @@ if (isset($body['currency_permanence'])) {
$merged['currency_permanence'] = $p;
}
if (isset($body['timezone'])) {
$merged['timezone'] = trim((string) $body['timezone']);
$tz = trim((string) $body['timezone']);
if (!in_array($tz, familyHubUsTimezoneIdentifiers(), true)) {
sendJson(['success' => false, 'error' => 'Invalid timezone'], 400);
}
$merged['timezone'] = $tz;
}
if (array_key_exists('calendar_two_way_google', $body)) {
$merged['calendar_two_way_google'] = !empty($body['calendar_two_way_google']);
}
if (isset($body['calendar_bill_days'])) {
$merged['calendar_bill_days'] = normalizeCalendarBillDaysRaw($body['calendar_bill_days']);
}
if (isset($body['week_starts_on'])) {
$w = (int) $body['week_starts_on'];
@@ -41,6 +51,8 @@ if (isset($body['week_starts_on'])) {
$merged['week_starts_on'] = $w;
}
$merged = normalizeLoadedFamilySettings($merged);
if (!writeJsonFile('family_settings.json', $merged)) {
sendJson(['success' => false, 'error' => 'Failed to save settings'], 500);
}