<script>
(function(){
function timeConverter(UNIX_timestamp) {
const metaLang = document.querySelector(`html`);
let lang = metaLang ? metaLang.getAttribute(`lang`).toLowerCase() : `en`;
const a = new Date(UNIX_timestamp * 1000);
const year = a.getFullYear();
const monthIndex = a.getMonth();
const date = a.getDate();
const months = {
"ru": ["January","February","March","April","May","June","July","August","September","October","November","December"],
"uk": ["January","February","March","April","May","June","July","August","September","October","November","December"],
"pl": ["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],
"en": ["January","February","March","April","May","June","July","August","September","October","November","December"]
};
if (!months[lang]) lang = "en";
return { day: date, month: months[lang][monthIndex], year: year };
}
document.querySelectorAll(`#hotengine-content-page .hotengine-blog-page-list-block, #hotengine-content-blog .hotengine-blog-page-list-block`).forEach(block => {
const timestamp = block.getAttribute(`data-hotengine-marking-timestamp`);
if(timestamp){
const t = timeConverter(timestamp);
const dateHtml = `
${t.day}
${t.month}
${t.year}
`;
const contentElem = block.querySelector(`.contenth_i`);
if(contentElem){
contentElem.insertAdjacentHTML(`afterbegin`, dateHtml);
}
}
});
})();
</script>
This script finds the markup element, #hotengine-content-blog .hotengine-blog-page-list-block (article from the list) and inserts the date, pre-converted from TIMESTAMP by the timeConverter function, at the beginning of the .contenth_i element.