From ffe4bd89981763a6470f83d28ace00ef23bd14ee Mon Sep 17 00:00:00 2001 From: Valeria Fadeeva Date: Wed, 23 Oct 2024 15:03:40 +0500 Subject: [PATCH] Update --- public/assets/js/mastodon.js | 9 +++++++++ public/json/mastodon-tpl.html | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/public/assets/js/mastodon.js b/public/assets/js/mastodon.js index 081e1e1..40302e0 100644 --- a/public/assets/js/mastodon.js +++ b/public/assets/js/mastodon.js @@ -71,6 +71,15 @@ async function fetchData(log, tpl) { post_tpl = post_tpl.replace(/{created_at}/g, `${value}`); } + if(key == "created_at") { + var isoDate = `${value}`; + var d = new Date(isoDate); + //var datetime_ = d.toLocaleDateString('en-GB'); // dd/mm/yyyy + var datetime_ = d.toLocaleDateString('ru-RU'); + + post_tpl = post_tpl.replace(/{created_at_show}/g, `${datetime_}`); + } + if(key == "edited_at") { post_tpl = post_tpl.replace(/{edited_at}/g, `${value}`); } diff --git a/public/json/mastodon-tpl.html b/public/json/mastodon-tpl.html index 150b23a..3dcf4e8 100644 --- a/public/json/mastodon-tpl.html +++ b/public/json/mastodon-tpl.html @@ -12,7 +12,7 @@
- + *