Displaying correction
Fixed Week selector
This commit is contained in:
@@ -103,19 +103,23 @@ const calendarOptionsTimeline = ref({
|
||||
views: {
|
||||
resourceTimeline3Hours: {
|
||||
type: 'resourceTimeline',
|
||||
duration: {weeks: 1},
|
||||
weekends: false,
|
||||
slotDuration: {hours: 3},
|
||||
slotMinTime: "06:00:00",
|
||||
slotMaxTime: "21:00:00",
|
||||
/*duration: {days:7},*/
|
||||
buttonText: "Woche",
|
||||
visibleRange: function(currentDate) {
|
||||
// Generate a new date for manipulating in the next step
|
||||
var startDate = new Date(currentDate);
|
||||
var endDate = new Date(currentDate);
|
||||
var startDate = new Date(currentDate.valueOf());
|
||||
var endDate = new Date(currentDate.valueOf());
|
||||
|
||||
// Adjust the start & end dates, respectively
|
||||
startDate.setDate(startDate.getDate() - startDate.getDay() +1); // One day in the past
|
||||
endDate.setDate(startDate.getDate() + 5); // Two days into the future
|
||||
|
||||
console.log(startDate.getDay())
|
||||
|
||||
startDate.setDate(startDate.getDate() - 1); // One day in the past
|
||||
endDate.setDate(endDate.getDate() + 2); // Two days into the future
|
||||
|
||||
return { start: startDate, end: endDate };
|
||||
}
|
||||
@@ -249,8 +253,8 @@ const setupPage = async () => {
|
||||
let returnData = {
|
||||
title: title,
|
||||
borderColor: eventColor,
|
||||
textColor: eventColor,
|
||||
backgroundColor: "black",
|
||||
textColor: "white",
|
||||
backgroundColor: eventColor,
|
||||
start: event.startDate,
|
||||
end: event.endDate,
|
||||
resourceIds: [],
|
||||
@@ -292,10 +296,11 @@ const setupPage = async () => {
|
||||
absencerequests.forEach(absencerequest => {
|
||||
let returnData = {
|
||||
title: `${absencerequest.reason}`,
|
||||
backgroundColor: "black",
|
||||
backgroundColor: "red",
|
||||
borderColor: "red",
|
||||
start: absencerequest.startDate,
|
||||
end: absencerequest.endDate,
|
||||
resourceIds: [absencerequest.profile.id],
|
||||
resourceIds: [`P-${absencerequest.profile.id}`],
|
||||
entrytype: "absencerequest",
|
||||
allDay: true,
|
||||
absencerequestId: absencerequest.id
|
||||
@@ -304,8 +309,12 @@ const setupPage = async () => {
|
||||
tempEvents.push(returnData)
|
||||
})
|
||||
|
||||
console.log(tempEvents)
|
||||
|
||||
calendarOptionsTimeline.value.initialEvents = tempEvents
|
||||
|
||||
console.log(calendarOptionsTimeline.value)
|
||||
|
||||
loaded.value = true
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user