I\'m looking for a way to show the week number on the agendaWeek view. I\'ve tried this method but without result.
Actually, I need to put the number in the calendar tit
I found a way to do this and it works for me :
Place this in the settings :
viewDisplay: function(view) {
if (view.name == 'agendaWeek')
{
$("table.fc-header span.fc-header-title h2").append("
Week " + getWeekNumber(view.start));
}
}, // others settings...
Place this in the same file, before the fullcalendar settings
function getWeekNumber(d) {
d = new Date(d);
d.setHours(0, 0, 0);
d.setDate(d.getDate() + 4 - (d.getDay() || 7));
const yearStart = new Date(d.getFullYear(), 0, 1);
const weekNo = Math.ceil(((d - yearStart) / 86400000 + 1) / 7);
return weekNo;
}
And that's that. Thank you for your previous answer, I'm going to try to update my fullcalendar version.