var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
document.addEventListener("DOMContentLoaded", function () {
var calendarEl = document.getElementById("calendar");
var calendar = new FullCalendar.Calendar(calendarEl, {
headerToolbar: {
right: "dayGridMonth,timeGridWeek,timeGridDay,listWeek",
center: "title",
left: "prevYear,prev,next,nextYear"
},
events: [
{
title: "Friday Throwdown",
start: new Date(y, m, 2, 10, 30),
end: new Date(y, m, 2, 11, 30),
allDay: false
},
{
title: "Marketing Meeting",
start: new Date(y, m, 2, 11, 30),
end: new Date(y, m, 2, 12, 30),
allDay: false
},
{
title: "Production Meeting",
start: new Date(y, m, 2, 15, 30),
end: new Date(y, m, 2, 16, 30),
allDay: false
}
]
});
calendar.render();
});
.fc-daygrid-event {
white-space: normal !important;
align-items: normal !important;
}
.fc-daygrid-event{
display: block!important;
padding-left: 15px!important;
}
.fc-daygrid-event-dot{
display: inline-flex;
position: absolute;
left: 0px;
top: 6px;
}
.fc-event-time,.fc-event-title{
display: inline;
}
.fc-daygrid-day{
overflow:hidden;
}
<script src="https://cdn.jsdelivr.net/npm/[email protected]/main.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/main.min.css" rel="stylesheet"/>
<div id='calendar'></div>