From 81f6522f88d2a4406cdc85b71d50a36f97ca7f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Thu, 2 Mar 2023 17:26:44 +0100 Subject: [PATCH] input datetime-local needs day to also be two digits --- games/static/js/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/games/static/js/utils.js b/games/static/js/utils.js index 988e0a7..5b51cc5 100644 --- a/games/static/js/utils.js +++ b/games/static/js/utils.js @@ -5,5 +5,6 @@ */ export function toISOUTCString(date) { let month = (date.getMonth() + 1).toString().padStart(2, 0); - return `${date.getFullYear()}-${month}-${date.getDate()}T${date.getHours()}:${date.getMinutes()}`; + let day = date.getDate().padStart(2, 0); + return `${date.getFullYear()}-${month}-${day}T${date.getHours()}:${date.getMinutes()}`; }