[英]Change left column in the agenda day of Full calendar
I need to change left column of agenda day, where hours are placed (12am, 1am, 2am etc) to just counters. 我需要将议程时间的左栏更改为仅放置柜台的时间(凌晨12点,凌晨1点,凌晨2点等)。
Instead of 12am there should be 1; 而不是凌晨12点,应该是1; instead of 1am, 2; 而不是凌晨1点,而是2点; instead of 2am, 3 etc. 而不是凌晨2点,3等
How can i do this ? 我怎样才能做到这一点 ?
Looks like the first column of a table maybe? 看起来像表的第一列? Try 尝试
<script>
$(document).ready(function() {
var rows = 0;
$('tr').each(function() {
if (rows > 1)
{
var cell = $(this).find('td:first');
var val = cell.html();
cell.html(val.substring(0,val.length-3));
}
rows++;
});
});
</script>
This is a working solution. 这是一个可行的解决方案。 Add this code to the viewRender property/function: 将此代码添加到viewRender属性/函数:
viewRender: function(view){
if(view.type !== 'agendaDay') return;
var timeSpans = document.querySelectorAll('.fc-axis.fc-time > span');
for(var i = 0; i < timeSpans.length; i++){
timeSpans[i].innerHTML = i + 1;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.