clam2021/public/js/program.js

133 lines
3.6 KiB
JavaScript
Raw Normal View History

2021-09-01 21:26:00 +00:00
document.addEventListener("DOMContentLoaded", function () {
var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
/*var tzOffset = new Date().getTimezoneOffset()*60*1000*-1;
if(tzOffset !== -180*60*1000){
var initialSlotMin = new Date(1631541600000 + tzOffset)
.toTimeString()
.split(" ")[0];
console.log(initialSlotMin);
var initialSlotMax = new Date(1631579400000 + tzOffset)
.toTimeString()
.split(" ")[0];
console.log(initialSlotMax);
}
*/
document.getElementById("timezone").innerHTML=`Zona Horaria: ${timeZone}`;
var calendarEl = document.getElementById("calendar");
var calendar = new FullCalendar.Calendar(calendarEl, {
schedulerLicenseKey: "CC-Attribution-NonCommercial-NoDerivatives",
googleCalendarApiKey: "AIzaSyCAkkSHMyz2HuxXxux2gOfUsLY9EC-gisE",
//themeSystem:'bootstrap',
eventDidMount: function (info) {
var tooltip = tippy(info.el, {
content: `<strong>${info.event.title}</strong><br/><strong>${info.event.extendedProps.speaker.nombre}</strong><br/>${info.event.extendedProps.description}`,
allowHTML: true,
});
},
eventSources: [
{
url: "/api/eventos/cursos",
color: "#755baf",
/*NO ESTÁ FUNCANDO EL RECUR
startTime:"13:00",
endTime:"14:00",
startRecur:"2021-09-14",
endRecur:"2021-09-16",*/
},
{
url: "/api/eventos/plenarias",
color: "#578e44",
},
{
url: "/api/eventos/semiplenarias",
color: "#3383cb",
},
{
url: "/api/eventos/publicas",
color: "#a57b00",
},
{
url: "/api/eventos/premiados",
color: "darkred",
},
],
events: [
{
title: "Sesiones",
startTime: "15:00-0300",
endTime: "18:15-0300",
startRecur: "2021-09-13",
endRecur: "2021-09-18",
speaker: { nombre: "organizadores" },
color: "gray",
//duration:{days:5}
},
{
title: "Comisión de Género",
startTime: "18:30-0300",
endTime: "19:30-0300",
startRecur: "2021-09-14",
endRecur: "2021-09-17",
speaker: { nombre: "organizadores" },
color: "#812c64",
},
{
title: "Asamblea UMALCA",
start: "2021-09-13T19:00-0300",
end: "2019-09-13T20:00-0300",
speaker: { nombre: "organizadores" },
color: "black",
},
],
headerToolbar: {
center: "timeGridAll,timeGridThree,timeGridOne",
},
eventTimeFormat: {
hour: "numeric",
minute: "2-digit",
meridiem: false,
},
//timeZone:"UTC",
locale: "es",
initialView: "timeGridAll",
initialDate: "2021-09-13",
validRange: {
start: "2021-09-13",
end: "2021-09-19",
},
nowIndicator: true,
now: "2021-09-13",
slotMinTime: "11:00:00",
slotMaxTime: "21:00:00",
slotDuration: "00:15",
allDaySlot: false,
slotLabelFormat: {
hour: "numeric",
minute: "2-digit",
omitZeroMinute: false,
meridiem: "short",
},
eventDisplay: "block",
views: {
timeGridAll: {
type: "timeGrid",
duration: { days: 5 },
buttonText: "Todos los dias",
},
timeGridThree: {
type: "timeGrid",
duration: { days: 2 },
buttonText: "2 dias",
},
timeGridOne: {
type: "timeGrid",
duration: { days: 1 },
buttonText: "1 dia",
},
duration: { days: 1 },
},
});
calendar.render();
});