Jeg forsøker å fjerne tekst fra et Sharepoint 2013 Calendar-view. Jeg ønsker å fjerne alle "00:00" oppføringer:
Selve HTML'en ser slik ut:
<div class="ms-acal-item" style="position:absolute;left:496px;top:371px;width:234px;height:20px;" title="00:00 - 00:00 blablabla" _index="3,2">
<div class="ms-acal-sdiv">00:00 <a onclick="EditLink2(this,'WPQ2');return false;" href="blablabla/DispForm.aspx?ID=17">blablabla</a></div></div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
window.setTimeout(doModifyCal, 150);
});
function doModifyCal() {
var str="x";
var urlString = urlencode(location.href); // only needed for Display to Edit form link option
// get the 2nd div of class "ms-acal-rootdiv"
var CalData = $('div.ms-acal-rootdiv:eq(1)');
// remove all "00:00 - 00:00" from single item days
$("div.ms-acal-time", CalData).remove();
// remove all "00:00" from multi-item days
$('div.ms-acal-sdiv', CalData).each(function() {
if($('div', this).length == 0) {
str=$(this).html();
str=str.replace("00:00","");
$(this).html(str);
};
});
// get rid of "00:00 - 00:00" in tool tip when you hover
$('div[title]', CalData).each(function() {
str=$(this).attr("title");
str=str.replace("00:00 - 00:00","");
$(this).attr("title",str);
});
</script>
Noen som ser hva jeg gjør feil?