Sommer Winterzeit drin

This commit is contained in:
Eskimue
2026-04-03 16:25:37 +02:00
parent 4f1c06f863
commit 91f92b814a
3 changed files with 254 additions and 2 deletions
+42
View File
@@ -69,6 +69,7 @@ $outerPlanetEvents = [];
$outerPlanetStationEvents = [];
$moonOccultations = [];
$seasonChanges = [];
$timeChanges = [];
$monthEventList = [];
$starDataError = null;
@@ -372,6 +373,23 @@ if (is_array($seasonDecoded) && ($seasonDecoded['ok'] ?? false)) {
$seasonChanges = is_array($seasonDecoded['changes'] ?? null) ? $seasonDecoded['changes'] : [];
}
$timeChangeOutput = [];
$timeChangeExitCode = 0;
$timeChangeArgs = [
$pythonScriptPath,
'time_changes_for_month',
(string) $selectedYear,
(string) $selectedMonth,
$chartTimezone,
];
$timeChangeCommand = $pythonExecutable . ' ' . implode(' ', array_map('escapeshellarg', $timeChangeArgs)) . ' 2>&1';
exec($timeChangeCommand, $timeChangeOutput, $timeChangeExitCode);
$timeChangeRaw = trim(implode("\n", $timeChangeOutput));
$timeChangeDecoded = json_decode($timeChangeRaw, true);
if (is_array($timeChangeDecoded) && ($timeChangeDecoded['ok'] ?? false)) {
$timeChanges = is_array($timeChangeDecoded['events'] ?? null) ? $timeChangeDecoded['events'] : [];
}
$eclipseOutput = [];
$eclipseExitCode = 0;
$eclipseArgs = [
@@ -647,6 +665,30 @@ foreach ($seasonChanges as $seasonChange) {
];
}
foreach ($timeChanges as $timeChange) {
if (!is_array($timeChange)) {
continue;
}
$timeChangeKind = (string) ($timeChange['kind'] ?? '');
$timeChangeLabel = $timeChangeKind === 'dst_start'
? 'Beginn der Sommerzeit (Uhren von 02:00 auf 03:00 Uhr vorstellen)'
: ($timeChangeKind === 'dst_end'
? 'Beginn der Normalzeit (Uhren von 03:00 auf 02:00 Uhr zurueckstellen)'
: 'Zeitumstellung');
$timeChangeTime = $timeChangeKind === 'dst_start'
? '02:00'
: ($timeChangeKind === 'dst_end' ? '03:00' : (string) ($timeChange['local_time'] ?? ''));
$monthEventList[] = [
'event' => $timeChangeLabel,
'date' => (string) ($timeChange['local_date'] ?? ''),
'time' => $timeChangeTime,
'local_iso' => (string) ($timeChange['local_iso'] ?? ''),
'type' => 'time_change',
];
}
foreach ($eclipseEvents as $eclipseEvent) {
if (!is_array($eclipseEvent)) {
continue;