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: 'All records', value: 'allRecords' },
{ label: 'In selected hours', value: 'selectedHours' },
{ label: 'In selected date', value: 'selectedDate' },
]
}
case 'week' as const:
if (calDataType.value === UITypes.Date) {
return [
{ label: 'In this day', value: 'day' },
{ label: 'In selected date', value: 'selectedDate' },
{ label: 'Without dates', value: 'withoutDates' },
{ label: 'All records', value: 'allRecords' },
]
} else {
return [
{ label: 'In this day', value: 'day' },
{ label: 'Without dates', value: 'withoutDates' },
{ label: 'All records', value: 'allRecords' },
{ label: 'In selected hours', value: 'selectedHours' },
{ label: 'In selected week', value: 'week' },
{ label: 'In selected date', value: 'selectedDate' },
]
}

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

@ -14,6 +14,7 @@ const {
calendarRange,
displayField,
selectedTime,
selectedDate,
updateRowProperty,
sideBarFilterOption,
showSideMenu,
@ -749,7 +750,12 @@ const viewMore = (hour: dayjs.Dayjs) => {
'!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"
@click="selectedTime = hour"
@click="
() => {
selectedTime = hour
selectedDate = hour
}
"
>
<span v-if="date[0].day() === selectedDateRange.start?.day()" class="absolute left-1">
{{ hour.format('h A') }}

Loading…
Cancel
Save