Reputation: 639
I want to show the day of each cell as the "month day" I've already try to use slotLabelFormat, and all the others slotLabel, but any of those worked.
The picture below is how I did using JS, but when I perform any action on the calendar, it got a refresh and render the default, which is only the day
Upvotes: 0
Views: 1845
Reputation: 639
Solved! I added the dayRender method like this:
dayRender(eventInfo){
if(eventInfo.view.type === 'dayGridMonth'){
return eventInfo.el.innerHTML = moment(eventInfo.el.dataset.date, 'YYYY-MM-DD').format('MMM DD');
}
}
and this on my CSS
.fc-day-number{
visibility: hidden;
}
Upvotes: 2
Reputation: 61
There is a page on how to customize with your own Javascript:
https://fullcalendar.io/docs/custom-view-with-js
Specifically, there is
renderDates(dateProfile) {
// responsible for rendering the given dates
}
and more steps on how to accomplish a more customized view. Hope this helps!
Upvotes: 1