From 3a3424774944a421e1b93cbaf533a3500a4d613c Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 3 May 2018 03:06:50 +0300 Subject: add site and .gitignore --- docs/assets/js/fancydates.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/assets/js/fancydates.js (limited to 'docs/assets/js/fancydates.js') diff --git a/docs/assets/js/fancydates.js b/docs/assets/js/fancydates.js new file mode 100644 index 0000000..d13b11b --- /dev/null +++ b/docs/assets/js/fancydates.js @@ -0,0 +1,20 @@ +function fancydates(fanciness, date_format) { + if (fanciness == 0) { + return; + } + + dates = $('time.published.dt-published'); + + i = 0; + l = dates.length; + + for (i = 0; i < l; i++) { + d = moment(dates[i].attributes.datetime.value); + if (fanciness == 1) { + o = d.local().format(date_format); + } else { + o = d.fromNow(); + } + dates[i].innerHTML = o; + } +} -- cgit v1.2.3