User:Guywan/Scripts/12HourFormat.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 33:
$(this).text(time[0] + time[1] + time[2]);
}
});
}
else if(mw.config.get("wgAction") == "Edit")
{
if($("div").hasClass("mw-warning-with-logexcerpt mw-content-ltr"))
{
var text = partition($(".mw-logline-delete").text());
$(".mw-logline-delete").text(text[0] + text[1] + text[2]);
}
}
else if(mw.config.get("wgCanonicalNamespace") == "File")
{
// Modify time in file history table.
$("td > a").each(function()
{
var text = $(this).text();
// An ugly test to see if this is actually a time.
// Will convert anything in a table matching the pattern "nn:nn," where n is a digit.
var index = text.indexOf(":");
if(index > -1)
{
if(text.charAt(index - 2).match(/[0-9]/i)
&& text.charAt(index - 1).match(/[0-9]/i)
&& text.charAt(index + 1).match(/[0-9]/i)
&& text.charAt(index + 2).match(/[0-9]/i)
&& text.charAt(index + 3 == ","))
{
text = partition(text);
$(this).text(text[0] + text[1] + text[2]);
}
}
});