To be honest, much of this date stuff makes me cringe. The well tested, highly revered library `moment.js` is infinitely superior to this code and can satisfy all of the date formatting that has been written in this file.