Content deleted Content added
No edit summary |
maintenance: TypeError: undefined is not an object (evaluating 'html.replace') |
||
(4 intermediate revisions by one other user not shown) | |||
Line 1:
/
*▼
*/▼
// <nowiki>
$(function()
Line 117 ⟶ 108:
$("#footer-info-lastmod").text(rxReplace($("#footer-info-lastmod").text()));
}
});▼
/*
function rxReplace(html)
{▼
return html.replace(/(\d\d:\d\d)/g, convert);▼
}▼
* Used when a very specific match needs to be made and▼
* only a substring of the match should be modified.▼
function rxPartition(match, p1, p2, p3)▼
return (p1 + convert(p2) + p3);▼
function convert(time)▼
var hour = parseFloat(time.substr(0, 2));▼
if(hour >= 12)▼
{
// Note a call to html on nonexistent elements returns undefined e.g. $('.sssssss').html(). Guard against this being passed in.
if(hour != 12)▼
html = html || '';
{▼
hour = hour - 12;▼
}▼
return (hour + time.substr(2) + " PM");▼
}
▲ /*
if(hour === 0)▼
▲ function rxPartition(match, p1, p2, p3)
{
hour = 12;▼
}
▲ function convert(time)
return (hour + time.substr(2) + " AM");▼
▲ {
▲ {
▲ if(hour != 12)
{
▲ hour = hour - 12;
}
▲ return (hour + time.substr(2) + " PM");
▲ }
{
▲ hour = 12;
}
▲ }
▲});
// </nowiki>
|