diff --git a/packages/nc-gui/components/dlg/ViewCreate.vue b/packages/nc-gui/components/dlg/ViewCreate.vue index 9de6d7d4d4..f29328018f 100644 --- a/packages/nc-gui/components/dlg/ViewCreate.vue +++ b/packages/nc-gui/components/dlg/ViewCreate.vue @@ -533,6 +533,25 @@ const isCalendarReadonly = (calendarRange?: Array<{ fk_from_column_id: string; f }) } +const isDisabled = computed(() => { + return ( + viewSelectFieldOptions.value.find((f) => f.value === form.calendar_range[0]?.fk_from_column_id)?.uidt === UITypes.DateTime && + !isRangeEnabled.value + ) +}) + +const onValueChange = async () => { + form.calendar_range = form.calendar_range.map((range, i) => { + if (i === 0) { + return { + fk_from_column_id: range.fk_from_column_id, + fk_to_column_id: null, + } + } + return range + }) +} + const predictViews = async (): Promise => { const viewType = !isAIViewCreateMode.value && form.type && viewTypeToStringMap[form.type] ? viewTypeToStringMap[form.type] : undefined @@ -999,6 +1018,7 @@ const getPluralName = (name: string) => { :placeholder="$t('placeholder.notSelected')" data-testid="nc-calendar-range-from-field-select" @click.stop + @change="onValueChange" > {
- -
- - {{ $t('activity.endDate') }} -
-
+ + +
+ + {{ $t('activity.endDate') }} +
+
+ +
-