fix: refs #7869 fixed dated when adding an indefinetely or range event
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
268d723eb1
commit
dd5356f45c
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue