sadsad
This commit is contained in:
@@ -574,7 +574,7 @@ $mm->registerFunction($moduleName, 'format_datetime_for_display', static functio
|
||||
});
|
||||
|
||||
$mm->registerFunction($moduleName, 'local_now_input_value', static function (): string {
|
||||
return (new \DateTimeImmutable('now', new \DateTimeZone('Europe/Berlin')))->format('Y-m-d\TH:i');
|
||||
return (new \DateTimeImmutable('now', new \DateTimeZone(nexus_display_timezone_name())))->format('Y-m-d\TH:i');
|
||||
});
|
||||
|
||||
$mm->registerFunction($moduleName, 'alpha_vantage_extract_global_quote', static function (array $entry): ?array {
|
||||
|
||||
@@ -103,7 +103,7 @@ if ($daily === []) {
|
||||
|
||||
$aggregate = static function (array $points, string $format): array {
|
||||
$result = [];
|
||||
$timezone = new DateTimeZone('Europe/Berlin');
|
||||
$timezone = new DateTimeZone(nexus_display_timezone_name());
|
||||
foreach ($points as $point) {
|
||||
$date = DateTimeImmutable::createFromFormat('Y-m-d', (string) ($point['date'] ?? ''), $timezone);
|
||||
if (!$date instanceof DateTimeImmutable) {
|
||||
|
||||
@@ -840,7 +840,7 @@ final class DashboardPage
|
||||
|
||||
private function normalizeDateTimeLocal(?string $value): string
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Berlin');
|
||||
$timezone = new \DateTimeZone(nexus_display_timezone_name());
|
||||
$value = trim((string) $value);
|
||||
if ($value === '') {
|
||||
return (new \DateTimeImmutable('now', $timezone))->format('Y-m-d H:i:s');
|
||||
|
||||
@@ -298,7 +298,7 @@ final class InstrumentPage
|
||||
|
||||
private function normalizeDateTimeLocal(?string $value): string
|
||||
{
|
||||
$timezone = new \DateTimeZone('Europe/Berlin');
|
||||
$timezone = new \DateTimeZone(nexus_display_timezone_name());
|
||||
$value = trim((string) $value);
|
||||
if ($value === '') {
|
||||
return (new \DateTimeImmutable('now', $timezone))->format('Y-m-d H:i:s');
|
||||
|
||||
@@ -68,7 +68,7 @@ $mm->registerFunction($moduleName, 'settings', static function (): array {
|
||||
'preferred_currencies' => $preferredCurrencies,
|
||||
'currency_catalog' => $currencyCatalog,
|
||||
'currency_catalog_synced_at' => trim((string) ($saved['currency_catalog_synced_at'] ?? '')),
|
||||
'schedule_timezone' => trim((string) ($saved['schedule_timezone'] ?? 'Europe/Berlin')) ?: 'Europe/Berlin',
|
||||
'schedule_timezone' => trim((string) ($saved['schedule_timezone'] ?? nexus_cron_timezone_name())) ?: nexus_cron_timezone_name(),
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
@@ -991,11 +991,11 @@ final class FxRatesService
|
||||
|
||||
private function scheduleTimezone(): DateTimeZone
|
||||
{
|
||||
$timezone = trim((string) ($this->settings['schedule_timezone'] ?? 'Europe/Berlin'));
|
||||
$timezone = trim((string) ($this->settings['schedule_timezone'] ?? nexus_cron_timezone_name()));
|
||||
try {
|
||||
return new DateTimeZone($timezone);
|
||||
} catch (\Throwable) {
|
||||
return new DateTimeZone('Europe/Berlin');
|
||||
return new DateTimeZone(nexus_cron_timezone_name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ $mm->registerFunction($moduleName, 'runtime_settings', static function (): array
|
||||
$repository = new MiningRepository($pdo, $config->tablePrefix(), null, $ownerSub);
|
||||
|
||||
$settings = $repository->getSettings($projectKey) ?? [];
|
||||
$displayTimezone = trim((string) ($settings['display_timezone'] ?? 'Europe/Berlin'));
|
||||
$displayTimezone = trim((string) ($settings['display_timezone'] ?? nexus_display_timezone_name()));
|
||||
if ($displayTimezone === '') {
|
||||
$displayTimezone = 'Europe/Berlin';
|
||||
$displayTimezone = nexus_display_timezone_name();
|
||||
}
|
||||
|
||||
$baselineMeasuredAt = trim((string) ($settings['baseline_measured_at'] ?? ''));
|
||||
@@ -72,9 +72,9 @@ $mm->registerFunction($moduleName, 'save_runtime_settings', static function (arr
|
||||
$repository->ensureProject($projectKey, strtoupper(str_replace('-', ' ', $projectKey)));
|
||||
|
||||
$existing = $repository->getSettings($projectKey) ?? [];
|
||||
$displayTimezone = trim((string) ($existing['display_timezone'] ?? 'Europe/Berlin'));
|
||||
$displayTimezone = trim((string) ($existing['display_timezone'] ?? nexus_display_timezone_name()));
|
||||
if ($displayTimezone === '') {
|
||||
$displayTimezone = 'Europe/Berlin';
|
||||
$displayTimezone = nexus_display_timezone_name();
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -326,7 +326,7 @@ final class Router
|
||||
'daily_cost_currency' => 'EUR',
|
||||
'report_currency' => 'EUR',
|
||||
'crypto_currency' => 'DOGE',
|
||||
'display_timezone' => 'Europe/Berlin',
|
||||
'display_timezone' => nexus_display_timezone_name(),
|
||||
'fx_max_age_hours' => self::FX_FETCH_MAX_AGE_HOURS,
|
||||
'module_theme_mode' => 'inherit',
|
||||
'module_theme_accent' => 'teal',
|
||||
@@ -525,7 +525,7 @@ final class Router
|
||||
'daily_cost_currency' => $backup['settings']['daily_cost_currency'],
|
||||
'report_currency' => $backup['settings']['report_currency'] ?? 'EUR',
|
||||
'crypto_currency' => $backup['settings']['crypto_currency'] ?? 'DOGE',
|
||||
'display_timezone' => $backup['settings']['display_timezone'] ?? 'Europe/Berlin',
|
||||
'display_timezone' => $backup['settings']['display_timezone'] ?? nexus_display_timezone_name(),
|
||||
'fx_max_age_hours' => self::FX_FETCH_MAX_AGE_HOURS,
|
||||
'module_theme_mode' => $backup['settings']['module_theme_mode'] ?? 'inherit',
|
||||
'module_theme_accent' => $backup['settings']['module_theme_accent'] ?? 'teal',
|
||||
@@ -1158,13 +1158,13 @@ final class Router
|
||||
'daily_cost_currency' => 'EUR',
|
||||
'report_currency' => 'EUR',
|
||||
'crypto_currency' => 'DOGE',
|
||||
'display_timezone' => 'Europe/Berlin',
|
||||
'display_timezone' => nexus_display_timezone_name(),
|
||||
'module_theme_mode' => 'inherit',
|
||||
'module_theme_accent' => 'teal',
|
||||
'preferred_currencies' => $this->preferredCurrencies(),
|
||||
];
|
||||
if (!$this->isValidTimezone((string) ($base['display_timezone'] ?? ''))) {
|
||||
$base['display_timezone'] = 'Europe/Berlin';
|
||||
$base['display_timezone'] = nexus_display_timezone_name();
|
||||
}
|
||||
if (!in_array((string) ($base['module_theme_mode'] ?? ''), ['inherit', 'custom'], true)) {
|
||||
$base['module_theme_mode'] = 'inherit';
|
||||
@@ -1187,7 +1187,7 @@ final class Router
|
||||
{
|
||||
$existingSettings = $this->repository()->getSettings($projectKey) ?? [];
|
||||
$displayTimezone = $this->requiredTimezone(
|
||||
$input['display_timezone'] ?? ($existingSettings['display_timezone'] ?? 'Europe/Berlin'),
|
||||
$input['display_timezone'] ?? ($existingSettings['display_timezone'] ?? nexus_display_timezone_name()),
|
||||
'display_timezone'
|
||||
);
|
||||
$settings = [
|
||||
@@ -2069,7 +2069,7 @@ final class Router
|
||||
{
|
||||
$settings = $this->repository()->getSettings($projectKey);
|
||||
$timezone = is_array($settings) ? (string) ($settings['display_timezone'] ?? '') : '';
|
||||
return $this->isValidTimezone($timezone) ? $timezone : 'Europe/Berlin';
|
||||
return $this->isValidTimezone($timezone) ? $timezone : nexus_display_timezone_name();
|
||||
}
|
||||
|
||||
private function utcTimezone(): \DateTimeZone
|
||||
|
||||
@@ -103,7 +103,7 @@ final class MiningRepository
|
||||
'daily_cost_currency' => $settings['daily_cost_currency'],
|
||||
'report_currency' => $settings['report_currency'] ?? 'EUR',
|
||||
'crypto_currency' => $settings['crypto_currency'] ?? 'DOGE',
|
||||
'display_timezone' => $settings['display_timezone'] ?? 'Europe/Berlin',
|
||||
'display_timezone' => $settings['display_timezone'] ?? nexus_display_timezone_name(),
|
||||
'fx_max_age_hours' => $settings['fx_max_age_hours'] ?? 3,
|
||||
'module_theme_mode' => $settings['module_theme_mode'] ?? 'inherit',
|
||||
'module_theme_accent' => $settings['module_theme_accent'] ?? 'teal',
|
||||
|
||||
Reference in New Issue
Block a user