Mondereignisse vollständig und kompakt ausgeben

This commit is contained in:
2026-09-12 11:44:49 +02:00
parent d62879cce3
commit 5bb05e69df
2 changed files with 101 additions and 17 deletions
+14 -8
View File
@@ -913,13 +913,16 @@ if (!function_exists('monthForecastBuildNarrativeText')) {
));
$phaseEvents = array_values(array_filter($sortedMoonEvents, static fn (array $e): bool => (string) ($e['type'] ?? '') === 'moon_phase'));
// Alle Mondphasen müssen erhalten bleiben. Die übrigen Mondereignisse
// werden weiterhin begrenzt, damit der Übersichtstext kompakt bleibt.
$nonPhaseEvents = array_slice(
array_values(array_filter($sortedMoonEvents, static fn (array $e): bool => (string) ($e['type'] ?? '') !== 'moon_phase')),
0,
10
);
// Alle Mondphasen und alle Mondereignisse werden vollständig übernommen.
$nonPhaseCandidates = array_values(array_filter(
$sortedMoonEvents,
static fn (array $e): bool => (string) ($e['type'] ?? '') !== 'moon_phase'
));
$nonPhaseEvents = $nonPhaseCandidates;
usort($nonPhaseEvents, static fn (array $a, array $b): int => strcmp(
(string) ($a['local_iso'] ?? $a['date'] ?? ''),
(string) ($b['local_iso'] ?? $b['date'] ?? '')
));
$moonSentences = [];
@@ -985,7 +988,7 @@ if (!function_exists('monthForecastBuildNarrativeText')) {
}
if ($goldenHandle !== null) {
$moonSentences[] = 'Am ' . $sd . ' zeigt der Mond den Goldenen Henkel: Ein Gebirgskamm am Mondrand leuchtet bereits im Sonnenlicht, während das Tal dahinter noch im Schatten liegt – ein lohnender Anblick schon im kleinen Teleskop.';
$moonSentences[] = 'Am ' . $sd . ' zeigt der Mond den Goldenen Henkel.';
}
if ($apsis !== null) {
@@ -1057,6 +1060,9 @@ if (!function_exists('monthForecastBuildNarrativeText')) {
if (str_starts_with($apLabel, 'Mond nahe ')) {
$target = substr($apLabel, strlen('Mond nahe '));
$moonSentences[] = 'Am ' . $apSd . ' zieht der Mond' . $sepStr . ' an ' . $target . ' vorbei.';
} elseif (str_starts_with($apLabel, 'Mond streift ')) {
$target = substr($apLabel, strlen('Mond streift '));
$moonSentences[] = 'Am ' . $apSd . ' streift der Mond ' . $target . '.';
} elseif (str_starts_with($apLabel, 'Mond bedeckt ')) {
$target = substr($apLabel, strlen('Mond bedeckt '));
$moonSentences[] = 'Am ' . $apSd . ' bedeckt der Mond ' . $target . '.';