From 45c06713265af8ff2cfc4c9388e315147e11f0d1 Mon Sep 17 00:00:00 2001 From: gitadmin Date: Sun, 12 Oct 2025 20:48:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B4=20=D0=BF=D0=BE=D1=81=D1=82?= =?UTF-8?q?=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/edit_post.html | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/templates/edit_post.html b/templates/edit_post.html index 26259e6..3b3eb62 100644 --- a/templates/edit_post.html +++ b/templates/edit_post.html @@ -37,6 +37,10 @@ -moz-appearance: textfield; appearance: textfield; } + /* Принудительное отображение 24-часового формата */ + input[type="datetime-local"] { + font-family: monospace; + } @@ -143,14 +147,14 @@
-
+
-
- +
+
@@ -160,7 +164,7 @@
- +
@@ -209,7 +213,7 @@
- +
@@ -313,6 +317,27 @@ loadPostData(postId); } + // Принудительная установка 24-часового формата для полей даты-времени + const datetimeInputs = document.querySelectorAll('input[type="datetime-local"]'); + datetimeInputs.forEach(input => { + // Устанавливаем атрибут step для округления до минут + input.step = '60'; + + // Добавляем обработчик для принудительного отображения 24-часового формата + input.addEventListener('change', function() { + if (this.value) { + const date = new Date(this.value); + // Форматируем в 24-часовом формате + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + this.value = `${year}-${month}-${day}T${hours}:${minutes}`; + } + }); + }); + // Обработка отправки формы form.addEventListener('submit', (e) => { e.preventDefault();