Fix JavaScript relative date problem