diff --git a/frontend/src/components/schedule_overlap/ScheduleOverlap.vue b/frontend/src/components/schedule_overlap/ScheduleOverlap.vue index 64a00b7a..241359d8 100644 --- a/frontend/src/components/schedule_overlap/ScheduleOverlap.vue +++ b/frontend/src/components/schedule_overlap/ScheduleOverlap.vue @@ -682,6 +682,25 @@ +
+ + + +
+ Invert default availaibility editing mode +
+
+
0 && this.overlayAvailabilitiesEnabled }, @@ -2832,6 +2857,8 @@ export default { this.availabilityAnimEnabled = false }, async submitAvailability(guestPayload = { name: "", email: "" }) { + this.invertAvailability = false + let payload = {} let type = "" @@ -3488,6 +3515,7 @@ export default { // Reset options this.availabilityType = availabilityTypes.AVAILABLE this.overlayAvailability = false + this.invertAvailability = false }, highlightAvailabilityBtn() { this.$emit("highlightAvailabilityBtn") @@ -3997,6 +4025,30 @@ export default { this.showEventOptions = !this.showEventOptions localStorage["showEventOptions"] = this.showEventOptions }, + updateInvertAvailability(val) { + this.invertAvailability = !!val + + if (this.event.daysOnly) return + + const allSlots = new Set() + for (const day of this.allDays) { + for (const time of this.times) { + const date = getDateHoursOffset(day.dateObject, time.hoursOffset) + if (date) allSlots.add(date.getTime()) + } + } + + const newAvailability = new Set() + for (const ts of allSlots) { + if (!this.availability.has(ts) && !this.ifNeeded.has(ts)) { + newAvailability.add(ts) + } + } + + this.availability = newAvailability + + this.getResponsesFormatted() + }, updateOverlayAvailability(val) { this.overlayAvailability = !!val this.$posthog.capture("overlay_availability_toggled", {