A few useful (unit tested) JavaScript date methods