#7869: Added include and exclude event from list #1574

Merged
jon merged 22 commits from 7869-ModifyZones into dev 2025-03-20 07:39:09 +00:00
1 changed files with 6 additions and 2 deletions
Showing only changes of commit dd5356f45c - Show all commits

View File

@ -54,7 +54,7 @@ const { openConfirmationModal } = useVnConfirm();
const quasar = useQuasar();
const isNew = computed(() => props.isNewMode);
const eventInclusionFormData = ref({ wdays: [] });
const dated = ref(props.date || Date.vnNew());
const _inclusionType = ref('indefinitely');
const inclusionType = computed({
get: () => _inclusionType.value,
@ -82,7 +82,9 @@ const createEvent = async () => {
const zoneIds = props.zoneIds?.length ? props.zoneIds : [route.params.id];
for (const id of zoneIds) {
let today = moment(eventInclusionFormData.value.dated);
let today = eventInclusionFormData.value.dated
? moment(eventInclusionFormData.value.dated)
: moment(dated.value);
let lastDay = today.clone().add(4, 'months').endOf('month');
const { data } = await axios.get(`Zones/getEventsFiltered`, {
@ -136,9 +138,11 @@ const refetchEvents = async () => {
onMounted(() => {
if (props.event) {
dated.value = props.event?.dated;
eventInclusionFormData.value = { ...props.event };
inclusionType.value = props.event?.type || 'day';
} else if (props.date) {
dated.value = props.date;
eventInclusionFormData.value.dated = props.date;
inclusionType.value = 'day';
} else inclusionType.value = 'indefinitely';