1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 07:52:43 +00:00

Issue #1571: Fixes the switches for displaying hours not working.

This commit is contained in:
Massedil 2024-11-04 22:35:01 +01:00
parent 7f43169fae
commit 19ba095e07

View file

@ -67,12 +67,12 @@
label-for="begins-on-field" label-for="begins-on-field"
> >
<event-date-picker <event-date-picker
:time="eventOptions.showStartTime" :time="showStartTime"
v-model="beginsOn" v-model="beginsOn"
@blur="consistencyBeginsOnBeforeEndsOn" @blur="consistencyBeginsOnBeforeEndsOn"
></event-date-picker> ></event-date-picker>
<o-switch v-model="eventOptions.showStartTime">{{ <o-switch v-model="showStartTime">{{
t("Show the time when the event begins") t("Show the time when the event begins")
}}</o-switch> }}</o-switch>
</o-field> </o-field>
@ -84,12 +84,12 @@
class="items-center" class="items-center"
> >
<event-date-picker <event-date-picker
:time="eventOptions.showEndTime" :time="showEndTime"
v-model="endsOn" v-model="endsOn"
@blur="consistencyBeginsOnBeforeEndsOn" @blur="consistencyBeginsOnBeforeEndsOn"
:min="beginsOn" :min="beginsOn"
></event-date-picker> ></event-date-picker>
<o-switch v-model="eventOptions.showEndTime">{{ <o-switch v-model="showEndTime">{{
t("Show the time when the event ends") t("Show the time when the event ends")
}}</o-switch> }}</o-switch>
</o-field> </o-field>
@ -1201,6 +1201,30 @@ const isEventModified = computed((): boolean => {
); );
}); });
const showStartTime = computed({
get(): boolean {
return event.value.options.showStartTime;
},
set(newShowStartTime: boolean) {
event.value.options = {
...event.value.options,
showStartTime: newShowStartTime,
};
},
});
const showEndTime = computed({
get(): boolean {
return event.value.options.showEndTime;
},
set(newshowEndTime: boolean) {
event.value.options = {
...event.value.options,
showEndTime: newshowEndTime,
};
},
});
const beginsOn = ref(new Date()); const beginsOn = ref(new Date());
const endsOn = ref(new Date()); const endsOn = ref(new Date());