fix(badges): strip milliseconds/Z from datetime before PATCH

MariaDB rejects ISO 8601 with milliseconds ('2026-04-14T20:29:15.784Z').
print_last_datetime and print_first_datetime must be 'YYYY-MM-DDTHH:MM:SS'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-04-14 16:32:07 -04:00
parent 345641e4c4
commit 3d81cb5a83

View File

@@ -215,7 +215,9 @@ async function handle_print_badge() {
if (!$lq__event_badge_obj?.event_badge_id) return;
print_status = 'loading';
const now = new Date().toISOString();
// MariaDB datetime columns do not accept ISO 8601 with milliseconds or 'Z' suffix.
// Slice to 'YYYY-MM-DDTHH:MM:SS' — the format the DB expects.
const now = new Date().toISOString().slice(0, 19);
const is_first_print = print_count === 0;
const data_to_update: key_val = {
print_count: print_count + 1,