mas ajustes a las vistas de calendario para el corrimiento de horas
This commit is contained in:
parent
0842aaeaf4
commit
19becf0a05
@ -114,6 +114,12 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
omitZeroMinute: false,
|
omitZeroMinute: false,
|
||||||
meridiem: "short",
|
meridiem: "short",
|
||||||
},
|
},
|
||||||
|
eventTimeFormat: {
|
||||||
|
hour: "numeric",
|
||||||
|
minute: "2-digit",
|
||||||
|
omitZeroMinute: false,
|
||||||
|
meridiem: "short",
|
||||||
|
},
|
||||||
eventDisplay: "block",
|
eventDisplay: "block",
|
||||||
views: {
|
views: {
|
||||||
timeGridAll: {
|
timeGridAll: {
|
||||||
@ -138,11 +144,11 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
type: "dayGridWeek",
|
type: "dayGridWeek",
|
||||||
duration: { days: 2 },
|
duration: { days: 2 },
|
||||||
},
|
},
|
||||||
listView:{
|
listView: {
|
||||||
type:"listWeek",
|
type: "listWeek",
|
||||||
buttonText:"Lista"
|
buttonText: "Lista",
|
||||||
|
duration: { days: 2 },
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
calendar.render();
|
calendar.render();
|
||||||
@ -152,6 +158,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
calendar.setOption("timeZone", this.value);
|
calendar.setOption("timeZone", this.value);
|
||||||
switch (this.value) {
|
switch (this.value) {
|
||||||
case "America/Montevideo":
|
case "America/Montevideo":
|
||||||
|
calendar.setOption("locale", "es");
|
||||||
calendar.setOption("slotMinTime", "11:00:00");
|
calendar.setOption("slotMinTime", "11:00:00");
|
||||||
calendar.setOption("slotMaxTime", "21:00:00");
|
calendar.setOption("slotMaxTime", "21:00:00");
|
||||||
calendar.setOption("initialDate", "2021-09-13");
|
calendar.setOption("initialDate", "2021-09-13");
|
||||||
@ -162,6 +169,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
calendar.changeView("timeGridAll");
|
calendar.changeView("timeGridAll");
|
||||||
break;
|
break;
|
||||||
case "UTC":
|
case "UTC":
|
||||||
|
calendar.setOption("locale", "en");
|
||||||
calendar.setOption("slotMinTime", "14:00:00");
|
calendar.setOption("slotMinTime", "14:00:00");
|
||||||
calendar.setOption("slotMaxTime", "23:59:00");
|
calendar.setOption("slotMaxTime", "23:59:00");
|
||||||
calendar.setOption("initialDate", "2021-09-13");
|
calendar.setOption("initialDate", "2021-09-13");
|
||||||
@ -171,23 +179,31 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
});
|
});
|
||||||
calendar.changeView("timeGridAll");
|
calendar.changeView("timeGridAll");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
calendar.changeView("dayGridW");
|
calendar.setOption("locale",'en')
|
||||||
let initial = moment("2021-09-13T14:00Z");
|
let initial = moment("2021-09-13T14:00Z");
|
||||||
let final = moment("2021-09-17T23:30Z");
|
let final = moment("2021-09-17T23:30Z");
|
||||||
let offset = initial.utcOffset();
|
let offset = initial.utcOffset();
|
||||||
calendar.setOption("slotMinTime", initial.format("H:mm"));
|
calendar.setOption("initialDate", initial.format("Y-MM-DD"));
|
||||||
if(offset>0){
|
|
||||||
calendar.setOption("slotMaxTime", {days:1,hours:offset/60});
|
if(offset>0 && offset < 600){
|
||||||
|
//calendar.setOption("slotMinTime", "initial.format("H:mm")");
|
||||||
|
calendar.setOption("slotMinTime", "00:00");
|
||||||
|
//calendar.setOption("slotMaxTime", {days:1,hours:offset/60});
|
||||||
|
calendar.setOption("slotMaxTime", "24:00");
|
||||||
|
calendar.changeView("listView");
|
||||||
|
|
||||||
}
|
}
|
||||||
//let currentOffset = moment().utcOffset();
|
//let currentOffset = moment().utcOffset();
|
||||||
//initial.add(currentOffset, "minutes");
|
//initial.add(currentOffset, "minutes");
|
||||||
//calendar.setOption('slotMinTime', initial.utc().format('H:mm'))
|
//calendar.setOption('slotMinTime', initial.utc().format('H:mm'))
|
||||||
//calendar.setOption("slotMaxTime", {days:1,hours:currentOffset/60});
|
//calendar.setOption("slotMaxTime", {days:1,hours:currentOffset/60});
|
||||||
else{
|
else{
|
||||||
calendar.setOption("slotMaxTime",final.format("H:mm"));
|
|
||||||
|
calendar.setOption("slotMaxTime",final.format("H:mm"));
|
||||||
|
calendar.setOption("slotMinTime", initial.format("H:mm"));
|
||||||
}
|
}
|
||||||
calendar.setOption("initialDate",initial.format("Y-MM-DD"));
|
|
||||||
calendar.setOption("validRange", {
|
calendar.setOption("validRange", {
|
||||||
start: initial.format("Y-MM-DD"),
|
start: initial.format("Y-MM-DD"),
|
||||||
end:final.add(1,'d').format("Y-MM-DD")
|
end:final.add(1,'d').format("Y-MM-DD")
|
||||||
|
Loading…
Reference in New Issue
Block a user