Add format method to Date object in javascript to allow string formatting