From 883208f7df0d3c419027e2ec3e69829e314e99b1 Mon Sep 17 00:00:00 2001 From: Origami Date: Tue, 14 Oct 2025 00:32:10 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=94=D0=97:=20=D1=84=D0=BE=D1=80=D0=BC?= =?UTF-8?q?=D0=B0=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=B5=D0=B2=20=E2=80=94=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE?= =?UTF-8?q?=D0=BD,=20=D0=B4=D0=B0=D1=82=D0=B0,=200=20=D0=BB=D0=B0=D0=B9?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 6f14ae14aa..64ddfeb8ea 100644 --- a/index.html +++ b/index.html @@ -48,16 +48,18 @@
- +
@@ -66,6 +68,45 @@ From dfa72853562f89e9bf130f1ef51988cfd2442634 Mon Sep 17 00:00:00 2001 From: Origami Date: Tue, 14 Oct 2025 19:08:27 +0300 Subject: [PATCH 2/3] correction --- index.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 64ddfeb8ea..de30591604 100644 --- a/index.html +++ b/index.html @@ -72,15 +72,20 @@ const addComment = document.getElementById("comment"); const buttonAdd = document.getElementById("button"); const commentsList = document.querySelector(".comments"); - const currentTime = new Date().toLocaleString(); - addName.addEventListener("input", () => {}); - addComment.addEventListener("input", () => {}); buttonAdd.addEventListener("click", () => { - const currentTime = new Date().toLocaleString(); + const now = new Date(); + const currentTime = now.toLocaleString("ru-RU", { + day: "2-digit", + month: "2-digit", + year: "2-digit", + hour: "2-digit", + minute: "2-digit", + }); const nameValue = addName.value; const commentValue = addComment.value; if (nameValue === "" || commentValue === "") { + alert("Напиши что нибудь!"); return; } From 68093c04e3e4d4c5898de88a35a20a819a0c7587 Mon Sep 17 00:00:00 2001 From: Origami Date: Tue, 14 Oct 2025 19:15:27 +0300 Subject: [PATCH 3/3] correction time --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index de30591604..1910f24b77 100644 --- a/index.html +++ b/index.html @@ -75,13 +75,18 @@ buttonAdd.addEventListener("click", () => { const now = new Date(); - const currentTime = now.toLocaleString("ru-RU", { + const dateStr = now.toLocaleDateString("ru-RU", { day: "2-digit", month: "2-digit", year: "2-digit", + }); + const timeStr = now.toLocaleTimeString("ru-RU", { hour: "2-digit", minute: "2-digit", + hour12: false, }); + + const currentTime = `${dateStr} ${timeStr}`; const nameValue = addName.value; const commentValue = addComment.value; if (nameValue === "" || commentValue === "") {