diff --git a/games/static/js/utils.js b/games/static/js/utils.js index 988e0a7..19cadd1 100644 --- a/games/static/js/utils.js +++ b/games/static/js/utils.js @@ -4,6 +4,14 @@ * @returns {string} */ export function toISOUTCString(date) { - let month = (date.getMonth() + 1).toString().padStart(2, 0); - return `${date.getFullYear()}-${month}-${date.getDate()}T${date.getHours()}:${date.getMinutes()}`; + function stringAndPad(number) { + return number.toString().padStart(2, 0); + } + return `${ + date.getFullYear()}- + ${stringAndPad(date.getMonth() + 1)}- + ${stringAndPad(date.getDate())}T + ${stringAndPad(date.getHours())}: + ${stringAndPad(date.getMinutes()) + }`; }