From 0842aaeaf4eabd3e8e0459bbd5cef0adf7f45eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Correa?= Date: Fri, 3 Sep 2021 03:07:12 +0700 Subject: [PATCH] ajusta y agrega vista de lista al calendario --- public/js/program.js | 70 +++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/public/js/program.js b/public/js/program.js index 56c05cb..56cff4c 100644 --- a/public/js/program.js +++ b/public/js/program.js @@ -55,43 +55,39 @@ document.addEventListener("DOMContentLoaded", function () { url: "/api/eventos/premiados", color: "darkred", }, - { url:"/api/eventos/sesiones/", - color: "gray", - }, + { url: "/api/eventos/sesiones/", color: "gray" }, { - events: function(info,success,fail){ + events: function (info, success, fail) { let comisiones = []; - for(let i=0;i<3;i++){ - comisiones.push({ - title: "Comisión de Género", - start: `2021-09-${14 + i}T18:30-0300`, - end: `2021-09-${14 + i}T19:30-0300`, - speaker: { nombre: "organizadores" }, - description: "Reuniones de Comisión de Género de UMALCA", - color: "#812c64", - }); + for (let i = 0; i < 3; i++) { + comisiones.push({ + title: "Comisión de Género", + start: `2021-09-${14 + i}T18:30-0300`, + end: `2021-09-${14 + i}T19:30-0300`, + speaker: { nombre: "organizadores" }, + description: "Reuniones de Comisión de Género de UMALCA", + color: "#812c64", + }); } success(comisiones); - } + }, }, { - events: function(info,success,fail){ + events: function (info, success, fail) { let asamblea = { - title: "Asamblea UMALCA", - start: "2021-09-13T19:00-0300", - end: "2019-09-13T20:00-0300", - speaker: { nombre: "organizadores" }, - color: "black", - } - success([asamblea]) - } - } + title: "Asamblea UMALCA", + start: "2021-09-13T19:00-0300", + end: "2019-09-13T20:00-0300", + speaker: { nombre: "organizadores" }, + color: "black", + }; + success([asamblea]); + }, + }, ], - - - + headerToolbar: { - center: "timeGridAll,timeGridThree,timeGridOne", + center: "timeGridAll,timeGridThree,timeGridOne,listView", }, eventTimeFormat: { hour: "numeric", @@ -109,7 +105,7 @@ document.addEventListener("DOMContentLoaded", function () { nowIndicator: true, now: "2021-09-12", slotMinTime: "11:00:00", - slotMaxTime: "21:00:00", + slotMaxTime: "21:00:00", slotDuration: "00:15", allDaySlot: false, slotLabelFormat: { @@ -135,7 +131,18 @@ document.addEventListener("DOMContentLoaded", function () { duration: { days: 1 }, buttonText: "1 dia", }, - duration: { days: 1 }, + dayGridD: { + type: "dayGridDay", + }, + dayGridW: { + type: "dayGridWeek", + duration: { days: 2 }, + }, + listView:{ + type:"listWeek", + buttonText:"Lista" + }, + }, }); calendar.render(); @@ -152,6 +159,7 @@ document.addEventListener("DOMContentLoaded", function () { start: "2021-09-13", end: "2021-09-18", }); + calendar.changeView("timeGridAll"); break; case "UTC": calendar.setOption("slotMinTime", "14:00:00"); @@ -161,8 +169,10 @@ document.addEventListener("DOMContentLoaded", function () { start: "2021-09-13", end: "2021-09-18", }); + calendar.changeView("timeGridAll"); break; default: + calendar.changeView("dayGridW"); let initial = moment("2021-09-13T14:00Z"); let final = moment("2021-09-17T23:30Z"); let offset = initial.utcOffset();