mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
rdv: edit calendar range: fix display of new calendar ranges
This commit is contained in:
parent
6d607e3939
commit
bcb36ddc11
@ -34,11 +34,11 @@ export default {
|
||||
userId: window.userId,
|
||||
showMyCalendar: true,
|
||||
calendarEvents: {
|
||||
userCalendar: [],
|
||||
userCalendarRange: [],
|
||||
userCalendar: null,
|
||||
userCalendarRange: null,
|
||||
new: {
|
||||
events: [],
|
||||
color: "red"
|
||||
color: "#3788d8"
|
||||
}
|
||||
},
|
||||
calendarOptions: {
|
||||
@ -50,6 +50,8 @@ export default {
|
||||
selectable: true,
|
||||
select: this.onDateSelect,
|
||||
eventChange: this.onEventChange,
|
||||
eventDrop: this.onEventDropOrResize,
|
||||
eventResize: this.onEventDropOrResize,
|
||||
// eventClick: this.onEventClick,
|
||||
selectMirror: true,
|
||||
editable: true,
|
||||
@ -79,7 +81,7 @@ export default {
|
||||
);
|
||||
let calendarRangeEvents = {
|
||||
events: events,
|
||||
color: 'orange',
|
||||
color: '#79bafc',
|
||||
textColor: '#444444'
|
||||
};
|
||||
this.calendarEvents.userCalendarRange = calendarRangeEvents;
|
||||
@ -107,8 +109,8 @@ export default {
|
||||
},
|
||||
updateEventsSource() {
|
||||
this.calendarOptions.eventSources = [];
|
||||
this.calendarOptions.eventSources.push(this.calendarEvents.userCalendarRange);
|
||||
this.calendarOptions.eventSources.push(this.calendarEvents.new);
|
||||
this.calendarOptions.eventSources.push(this.calendarEvents.userCalendarRange);
|
||||
if (this.showMyCalendar) {
|
||||
this.calendarOptions.eventSources.push(this.calendarEvents.userCalendar);
|
||||
}
|
||||
@ -122,17 +124,24 @@ export default {
|
||||
},
|
||||
onDateSelect(payload) {
|
||||
console.log(payload)
|
||||
this.calendarEvents.new.events.push({ //TODO does not work
|
||||
let events = this.calendarEvents.new.events;
|
||||
events.push({
|
||||
start: payload.startStr,
|
||||
end: payload.endStr,
|
||||
end: payload.endStr
|
||||
});
|
||||
this.calendarEvents.new = {
|
||||
events: events,
|
||||
color: "#3788d8"
|
||||
};
|
||||
this.updateEventsSource();
|
||||
this.$store.dispatch('createRange', payload);
|
||||
},
|
||||
onEventChange(payload) {
|
||||
console.log(payload)
|
||||
this.$store.dispatch('updateRange', payload);
|
||||
//TODO update the eventsSource with payload, or use the store for updating the eventsSource
|
||||
},
|
||||
onEventDropOrResize(payload) {
|
||||
payload.event.setProp('color', '#3788d8');
|
||||
},
|
||||
// onEventClick(payload) {
|
||||
// console.log(payload)
|
||||
|
Loading…
x
Reference in New Issue
Block a user