diff --git a/modules/boersenchecker/bootstrap.php b/modules/boersenchecker/bootstrap.php
index 818490a..abf321f 100644
--- a/modules/boersenchecker/bootstrap.php
+++ b/modules/boersenchecker/bootstrap.php
@@ -515,7 +515,7 @@ $mm->registerFunction($moduleName, 'alpha_vantage_request', static function (
});
$mm->registerFunction($moduleName, 'display_timezone', static function (): \DateTimeZone {
- return new \DateTimeZone('Europe/Berlin');
+ return new \DateTimeZone(nexus_display_timezone_name());
});
$mm->registerFunction($moduleName, 'normalize_market_timestamp_utc', static function (mixed $value): string {
@@ -547,7 +547,7 @@ $mm->registerFunction($moduleName, 'format_datetime_for_display', static functio
return '';
}
- $displayTimezone = new \DateTimeZone('Europe/Berlin');
+ $displayTimezone = new \DateTimeZone(nexus_display_timezone_name());
$source = trim((string) $source);
if (str_starts_with($source, 'bavest:') || str_starts_with($source, 'alphavantage:')) {
diff --git a/partials/landingpages/index.php b/partials/landingpages/index.php
index 4886b52..e56595a 100755
--- a/partials/landingpages/index.php
+++ b/partials/landingpages/index.php
@@ -14,6 +14,7 @@ $modules = array_values(array_filter(
diff --git a/partials/landingpages/modules/setup.php b/partials/landingpages/modules/setup.php
index f989c8c..0f191dc 100644
--- a/partials/landingpages/modules/setup.php
+++ b/partials/landingpages/modules/setup.php
@@ -165,6 +165,7 @@ foreach ($fields as $field) {
$generalSetupFields = [];
$databaseSetupFields = [];
$cronSetupFields = [];
+$cronTimezoneField = null;
$customSetupFields = [];
foreach ($generalFields as $field) {
$fieldName = (string)($field['name'] ?? '');
@@ -177,7 +178,7 @@ foreach ($generalFields as $field) {
continue;
}
if ($fieldName === 'schedule_timezone') {
- $cronSetupFields[] = $field;
+ $cronTimezoneField = $field;
continue;
}
$customSetupFields[] = $field;
@@ -190,6 +191,10 @@ $driverOptions = [
];
$timezoneOptions = modules()->timezones();
+$globalCronTimezone = nexus_cron_timezone_name();
+$globalDisplayTimezone = nexus_display_timezone_name();
+$moduleCronTimezoneOverride = trim((string) ($current['schedule_timezone'] ?? ''));
+$effectiveModuleCronTimezone = $moduleCronTimezoneOverride !== '' ? $moduleCronTimezoneOverride : $globalCronTimezone;
$describeDbConfig = static function (array $dbConfig): string {
$driver = (string)($dbConfig['driver'] ?? '');
@@ -346,7 +351,7 @@ $formatRunTimestamp = static function (?string $value, ?string $timezone = null)
try {
$dt = new DateTimeImmutable($value, new DateTimeZone('UTC'));
- $targetTz = trim((string) $timezone) !== '' ? new DateTimeZone((string) $timezone) : new DateTimeZone(date_default_timezone_get());
+ $targetTz = trim((string) $timezone) !== '' ? new DateTimeZone((string) $timezone) : new DateTimeZone(nexus_display_timezone_name());
return $dt->setTimezone($targetTz)->format('Y-m-d H:i:s');
} catch (\Throwable) {
$ts = strtotime($value);
@@ -376,7 +381,7 @@ $extractSchedulerJobs = static function (array $postedSchedulerJobs, array $cron
continue;
}
$cronExpression = trim((string) ($entryPayload['cron_expression'] ?? ''));
- $timezone = trim((string) ($entryPayload['timezone'] ?? ($current['schedule_timezone'] ?? 'UTC')));
+ $timezone = trim((string) ($entryPayload['timezone'] ?? ($current['schedule_timezone'] ?? $globalCronTimezone)));
if ($cronExpression === '' && $timezone === '') {
continue;
}
@@ -523,7 +528,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$payload = [];
$sectionFieldNames = match ($submittedSetupSection) {
'general' => array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $generalSetupFields),
- 'cron' => array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $cronSetupFields),
+ 'cron' => array_values(array_filter(array_merge(
+ array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $cronSetupFields),
+ [$cronTimezoneField !== null ? (string) ($cronTimezoneField['name'] ?? '') : '']
+ ), static fn (string $name): bool => $name !== '')),
'custom' => array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $customSetupFields),
'database' => array_values(array_filter(array_merge(
array_map(static fn (array $field): string => (string) ($field['name'] ?? ''), $databaseSetupFields),
@@ -583,6 +591,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$postKey = str_replace('.', '_', $name);
$value = $_POST[$postKey] ?? null;
+ if ($submittedSetupSection === 'cron' && $name === 'schedule_timezone') {
+ if (!isset($_POST['schedule_timezone_custom'])) {
+ $payload[$name] = '';
+ continue;
+ }
+ }
+
if ($type === 'checkbox') {
$value = isset($_POST[$postKey]) ? '1' : '0';
}
@@ -930,12 +945,31 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
Hier liegen die zeitbezogenen Modul-Einstellungen, Intervall-Tasks und Cron-Jobs.
-
+
+
+
+
Standard-Zeitzone für dieses Modul
+
+
Aktiv: = e($effectiveModuleCronTimezone) ?>
+
Wenn deaktiviert, wird die globale Nexus-Cron-Zeitzone verwendet: = e($globalCronTimezone) ?>.
+
+
+
+ >
+
+
+
Dieses Modul hat keine eigenen Zeitzonenfelder. Intervall-Tasks und Cron-Jobs koennen trotzdem weiter unten verwaltet werden.
@@ -987,7 +1021,7 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
$cronMode = (string) ($cronDefinition['mode'] ?? 'single');
$cronEntries = $cronTaskStatusGroups[$cronName] ?? [];
?>
-
+
= e((string) ($cronDefinition['label'] ?? $cronName)) ?>
= e((string) $cronDefinition['help']) ?>
@@ -1002,7 +1036,7 @@ $GLOBALS['layout_header_context'] = 'Setup / ' . ($sectionTitles[$currentSection
Cron-Syntax: Minute Stunde Tag Monat Wochentag
-
+