fix: default autoresponder dates to today
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user