Fix scheduled_at datetime format mismatch

datetime-local sends ISO format with T separator; normalize to space on save
and use SQLite datetime() in dispatcher query to handle both formats.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-06-03 17:55:11 +03:00
parent 30d2b53075
commit 8ab9b7bbe2
2 changed files with 3 additions and 3 deletions

View file

@ -101,7 +101,7 @@ if ($action === 'save_settings') {
if ($action === 'create') {
$content = trim($input['content'] ?? '');
$image_path = trim($input['image_path'] ?? '');
$scheduled_at = trim($input['scheduled_at'] ?? '');
$scheduled_at = str_replace('T', ' ', trim($input['scheduled_at'] ?? ''));
$targets = $input['targets'] ?? [];
if (!$content) { echo json_encode(['error' => 'Content required']); exit; }
@ -127,7 +127,7 @@ if ($action === 'update') {
$id = (int)($input['id'] ?? 0);
$content = trim($input['content'] ?? '');
$image_path = trim($input['image_path'] ?? '');
$scheduled_at = trim($input['scheduled_at'] ?? '');
$scheduled_at = str_replace('T', ' ', trim($input['scheduled_at'] ?? ''));
$targets = $input['targets'] ?? [];
if (!$id) { echo json_encode(['error' => 'id required']); exit; }