From f977313ff095a10478291334109d9aae40528a34 Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 18 Sep 2025 17:26:24 +0200 Subject: =?UTF-8?q?gestion=20correcte=20des=20dates=20des=20articles:=20UT?= =?UTF-8?q?C=20c=C3=B4t=C3=A9=20serveur,=20locale=20c=C3=B4t=C3=A9=20clien?= =?UTF-8?q?t=20+=20date=20UTC=20dans=20l'attribut=20date-utc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/tinymce.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'public/js/tinymce.js') diff --git a/public/js/tinymce.js b/public/js/tinymce.js index 81ba8ea..97ecad8 100644 --- a/public/js/tinymce.js +++ b/public/js/tinymce.js @@ -292,7 +292,6 @@ class Editor } submit(clone = null){ - //var editor; var content; const params = new URL(document.location).searchParams; // "search" = ? et paramètres, searchParams = objet avec des getters // à comparer avec: new URLSearchParams(window.location.search); @@ -312,9 +311,12 @@ class Editor if(first_letter === 'i'){ id_from_builder = element.id; } + else if(first_letter === 'd'){ + content[first_letter] = element.getAttribute('date-utc'); + } } }) - content['d'] = dateToISO(content['d']); + content['d'] = new Date(content['d']).toISOString().slice(0, 16); // date UTC, format: 2025-09-18T15:21 } // champs à remplir des nouvelles "news" else if(window.Config.page === 'article' && params != null && params.get("id")[0] === 'n'){ @@ -324,7 +326,6 @@ class Editor // dans les autres cas, on doit pouvoir récupérer l'éditeur else{ // l'éditeur correspond à l'article OU si page = "article" à un élément: titre, aperçu, article - //editor = editors[id]; if(!this.tiny_instance){ console.error("Éditeur non trouvé pour l'article:", this.id); return; -- cgit v1.2.3