-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
54 lines (50 loc) · 1.43 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const botonMes = document.querySelectorAll('.mesbtn');
const calendarEl = document.getElementById('calendar');
const calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth',
locale: 'es',
themeSystem: 'bootstrap5',
initialDate: new Date(),
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
},
events: [
{
title: 'Evento 1',
start: '2024-07-01',
description: 'Descripción del Evento 1'
},
{
title: 'Evento 2',
start: '2024-07-07',
end: '2024-07-10',
description: 'Descripción del Evento 2'
},
{
title: 'Evento 3',
start: '2024-07-09T16:00:00',
description: 'Descripción del Evento 3'
}
],
eventDidMount: function (info) {
tippy(info.el, {
content: info.event.extendedProps.description,
placement: 'top',
theme: 'light'
});
}
});
document.addEventListener('DOMContentLoaded', function () {
calendar.render();
});
botonMes.forEach((cadaBoton, i) => {
botonMes[i].addEventListener('click', () => {
let month = String(i+1);
let year = new Date().getFullYear();
let date = new Date(year, month, 1);
calendar.gotoDate(date);
console.log(date);
})
})