francescomecca.eu/output/assets/js/fancydates.min.js
Francesco Mecca 1de1c54355 CV e dconf
2019-03-06 10:42:59 +01:00

1 line
239 B
JavaScript

function fancydates(t,e){if(0!=t)for(var a=document.querySelectorAll(".dt-published, .dt-updated, .listdate"),o=a.length,r=0;r<o;r++){var d,l=moment(a[r].attributes.datetime.value);d=1==t?l.local().format(e):l.fromNow(),a[r].innerHTML=d}}