Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created July 24, 2011 19:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejefflarson/1102949 to your computer and use it in GitHub Desktop.
Save thejefflarson/1102949 to your computer and use it in GitHub Desktop.
24 hour hack.
$(".TS-year_notch_year_text").each(function(){
var el = $(this);
var text = el.text();
text = text.replace(/(\d?\d:\d\d) ((a\.m\.|p\.m\.))/, function(date, time, ampm){
var hourMinute = _.map(time.split(":"), function(it){ return parseInt(it, 10); });
if(ampm === "p.m.") {
hourMinute[0] = hourMinute[0] + 12;
} else if(ampm === "a.m." && hourMinute[0] === 12) hourMinute[0] = 0;
return hourMinute.join(".");
});
el.text(text);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment