Properly calculating time differences in JavaScript | Hacker News Reader