From 7931d9dc836d7c137f06738156042a767e361832 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..53954ca 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().toString().padStart(2, 0); + return `${date.getFullYear()}-${month}-${day}T${date.getHours()}:${date.getMinutes()}`; }