This commit is contained in:
Valeria Fadeeva 2024-10-23 15:03:40 +05:00
parent f596705408
commit ffe4bd8998
2 changed files with 10 additions and 1 deletions

View File

@ -71,6 +71,15 @@ async function fetchData(log, tpl) {
post_tpl = post_tpl.replace(/{created_at}/g, `${value}`); 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") { if(key == "edited_at") {
post_tpl = post_tpl.replace(/{edited_at}/g, `${value}`); post_tpl = post_tpl.replace(/{edited_at}/g, `${value}`);
} }

View File

@ -12,7 +12,7 @@
<div class="col-md-6"> <div class="col-md-6">
<a href="https://{server_address}/@{name}/{post_id}" target="_blank" rel="noopener noreferrer"> <a href="https://{server_address}/@{name}/{post_id}" target="_blank" rel="noopener noreferrer">
<span><i class="fa fa-globe" title="Публичный"></i></span> <span><i class="fa fa-globe" title="Публичный"></i></span>
<time datetime="{created_at}" title="{created_at}">{created_at}</time> <time datetime="{created_at}" title="{created_at}">{created_at_show}</time>
<abbr title="Последнее изменение: {edited_at}"> *</abbr> <abbr title="Последнее изменение: {edited_at}"> *</abbr>
</a> </a>
</div> </div>