Skip to content

Commit

Permalink
Improved main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
callumacrae committed Feb 4, 2013
1 parent 5c149f2 commit 05a622b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions assets/main.js
@@ -1,12 +1,11 @@
var dates = document.getElementsByTagName('date'),
i;
date, diff, i;

// Prettify the dates
for (i = dates.length - 1; i >= 0; i--) {
var date = dates[i].textContent.split('/'),
diff;

date = dates[i].textContent.split('/');
date = new Date(date[2], date[1] - 1, date[0]);

diff = Math.floor((Date.now() - date.getTime()) / 86400000);

if (diff === 0) {
Expand Down

0 comments on commit 05a622b

Please sign in to comment.