Last active
August 29, 2015 14:04
-
-
Save dhigginbotham/b837ea8bcb748312bfde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildTimes() { | |
var times = []; | |
for (var i=-1;i<23;++i) { | |
var idx = (i+1); | |
var ampm = (idx>12 ? 'pm' : 'am'); | |
var time = (idx>12 ? idx%12 : (idx>0 ? idx : 12)); | |
if (idx==24) time = 12; | |
var t = time + ':00' + ampm; | |
times.push(t); | |
} | |
return times; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment