Browse Source

fix(nc-gui): week filters

pull/7611/head
DarkPhoenix2704 7 months ago
parent
commit
6d42f666ed
  1. 5
      packages/nc-gui/components/smartsheet/calendar/SideMenu.vue
  2. 8
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue

5
packages/nc-gui/components/smartsheet/calendar/SideMenu.vue

@ -202,22 +202,21 @@ const options = computed(() => {
{ label: 'Without dates', value: 'withoutDates' }, { label: 'Without dates', value: 'withoutDates' },
{ label: 'All records', value: 'allRecords' }, { label: 'All records', value: 'allRecords' },
{ label: 'In selected hours', value: 'selectedHours' }, { label: 'In selected hours', value: 'selectedHours' },
{ label: 'In selected date', value: 'selectedDate' },
] ]
} }
case 'week' as const: case 'week' as const:
if (calDataType.value === UITypes.Date) { if (calDataType.value === UITypes.Date) {
return [ return [
{ label: 'In this day', value: 'day' }, { label: 'In selected date', value: 'selectedDate' },
{ label: 'Without dates', value: 'withoutDates' }, { label: 'Without dates', value: 'withoutDates' },
{ label: 'All records', value: 'allRecords' }, { label: 'All records', value: 'allRecords' },
] ]
} else { } else {
return [ return [
{ label: 'In this day', value: 'day' },
{ label: 'Without dates', value: 'withoutDates' }, { label: 'Without dates', value: 'withoutDates' },
{ label: 'All records', value: 'allRecords' }, { label: 'All records', value: 'allRecords' },
{ label: 'In selected hours', value: 'selectedHours' }, { label: 'In selected hours', value: 'selectedHours' },
{ label: 'In selected week', value: 'week' },
{ label: 'In selected date', value: 'selectedDate' }, { label: 'In selected date', value: 'selectedDate' },
] ]
} }

8
packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue

@ -14,6 +14,7 @@ const {
calendarRange, calendarRange,
displayField, displayField,
selectedTime, selectedTime,
selectedDate,
updateRowProperty, updateRowProperty,
sideBarFilterOption, sideBarFilterOption,
showSideMenu, showSideMenu,
@ -749,7 +750,12 @@ const viewMore = (hour: dayjs.Dayjs) => {
'!border-l-0': date[0].day() === selectedDateRange.start?.day(), '!border-l-0': date[0].day() === selectedDateRange.start?.day(),
}" }"
class="text-center relative h-20 text-sm text-gray-500 w-full py-1 border-gray-200 first:border-l-none border-1 border-r-gray-50 border-t-gray-50 bg-gray-50" class="text-center relative h-20 text-sm text-gray-500 w-full py-1 border-gray-200 first:border-l-none border-1 border-r-gray-50 border-t-gray-50 bg-gray-50"
@click="selectedTime = hour" @click="
() => {
selectedTime = hour
selectedDate = hour
}
"
> >
<span v-if="date[0].day() === selectedDateRange.start?.day()" class="absolute left-1"> <span v-if="date[0].day() === selectedDateRange.start?.day()" class="absolute left-1">
{{ hour.format('h A') }} {{ hour.format('h A') }}

Loading…
Cancel
Save