From 8fdfd1b8eab010c0e95c0753655730d36c2f895c Mon Sep 17 00:00:00 2001 From: n8fr8 Date: Thu, 7 May 2026 08:42:05 -0400 Subject: [PATCH] if the datetime field isn't there, don't try to set it --- app/static/time.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/static/time.js b/app/static/time.js index 38d3ef7..bc7abdc 100644 --- a/app/static/time.js +++ b/app/static/time.js @@ -1,7 +1,7 @@ document.addEventListener('DOMContentLoaded', () => { -var currentTime = new Date(); -const $myDatetimeField = document.querySelector('#butterbox_date') + const $myDatetimeField = document.querySelector('#butterbox_date'); + if (!$myDatetimeField) return; + const currentTime = new Date(); console.log(currentTime.toISOString().substring(0, 19)); $myDatetimeField.value = currentTime.toISOString().substring(0, 19) + 'Z'; - -}); \ No newline at end of file +});