Calendar v2 - Combined Calendar Feature
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user