Displaying correction

Fixed Week selector
This commit is contained in:
2025-04-16 12:44:06 +02:00
parent e21e46b2c8
commit 93b36be42c

View File

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