🤔 Adding Features
I added some new shortcodes to my site, which doesn’t affect any of the
front-end stuff, but while doing that, I was trying to determine when a post was
published and found that the relative date formatting was annoying and getting
in the way. So, instead of removing it, I added click
handler to toggle it:
let state = 0;
// code handling the relative date formatting ...
element.addEventListener("click", function(){
if(0 === state)
{
state = 1;
element.textContent = dtObject.toString();
}
else
{
state = 0
element.textContent = formattedTime;
}
});
Nice and simple.