used moment instead of date.js. code still buggy.