Refactoring, use built-in date methods
Minned JS