Javascript Date toLocalArray()
/* Converts a Date object into a [year, month, day]. Note that months are * zero indexed to keep with standard set by JavaScript Date and moment */ Date.prototype.toLocalArray = function() { return [this.getFullYear(), this.getMonth(), this.getDate()] };