Skip to content

Instantly share code, notes, and snippets.

@zackdever
Created August 29, 2012 20:08
Show Gist options
  • Save zackdever/3518171 to your computer and use it in GitHub Desktop.
Save zackdever/3518171 to your computer and use it in GitHub Desktop.
lots of example a.m. p.m. periods
// this isn't all the possible valid periods, but it's a good batch
var periods = []
, seed = ['pm', 'p', 'p.m.', 'pm.', 'p.m'];
for (var i=0; i<seed.length; i++) {
var s = seed[i];
periods.push(s);
periods.push(s.toUpperCase());
periods.push(s.replace('m', 'M'));
periods.push(s.replace('p', 'P'));
periods.push(s.replace('p', 'a'));
periods.push(s.toUpperCase());
periods.push(s.toUpperCase().replace('M', 'm'));
periods.push(s.replace('a', 'A'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment