fix: default autoresponder dates to today

This commit is contained in:
Marek Miklewicz
2026-06-02 22:01:32 +02:00
parent 767016c659
commit c0b007d25d
3 changed files with 25 additions and 4 deletions
+2 -3
View File
@@ -30,11 +30,10 @@ function render_rule_form(AppContext $ctx, string $mode, ?array $rule): string
function default_schedule_value(AppContext $ctx, bool $start): string
{
$today = new DateTimeImmutable('today', new DateTimeZone($ctx->settings->timezone()));
$date = $start ? $today : $today->modify('+14 days');
if ($ctx->settings->scheduleMode() === 'directadmin_period') {
return $date->format('Y-m-d') . '|' . ($start ? 'morning' : 'evening');
return $today->format('Y-m-d') . '|' . ($start ? 'morning' : 'evening');
}
return $date->format('Y-m-d') . 'T' . ($start ? '09:00' : '17:00');
return $today->format('Y-m-d') . 'T' . ($start ? '09:00' : '17:00');
}
/** @param array<string,mixed>|null $rule */