{
}"
class="absolute group draggable-record pointer-events-auto"
@mousedown="dragStart($event, record)"
+ @mouseleave="hoverRecord = null"
+ @mouseover="hoverRecord = record.rowMeta.id"
>
= {}
@@ -145,7 +145,10 @@ const recordsAcrossAllRange = computed<{
dayIndex = 6
}
- const hourIndex = datesHours.value[dayIndex].findIndex((h) => h.format('HH:mm') === hourKey)
+ const hourIndex = Math.max(
+ datesHours.value[dayIndex].findIndex((h) => h.startOf('hour').format('HH:mm') === hourKey),
+ 0,
+ )
style = {
...style,
@@ -731,7 +734,7 @@ const viewMore = (hour: dayjs.Dayjs) => {
{{ dayjs(date[0]).format('DD ddd') }}
@@ -743,6 +746,7 @@ const viewMore = (hour: dayjs.Dayjs) => {
:key="hourIndex"
:class="{
'border-1 !border-brand-500': hour.isSame(selectedTime, 'hour'),
+ '!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"
diff --git a/packages/nc-gui/composables/useCalendarViewStore.ts b/packages/nc-gui/composables/useCalendarViewStore.ts
index 40381ae251..84e791589a 100644
--- a/packages/nc-gui/composables/useCalendarViewStore.ts
+++ b/packages/nc-gui/composables/useCalendarViewStore.ts
@@ -170,9 +170,9 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
nextDate = selectedDate.value.add(1, 'day').startOf('day')
break
case 'week':
- prevDate = selectedDateRange.value.start.subtract(1, 'day').endOf('day')
fromDate = selectedDateRange.value.start.startOf('day')
toDate = selectedDateRange.value.end.endOf('day')
+ prevDate = selectedDateRange.value.start.subtract(1, 'day').endOf('day')
nextDate = selectedDateRange.value.end.add(1, 'day').startOf('day')
break
case 'month': {
@@ -190,7 +190,6 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
case 'year':
fromDate = selectedDate.value.startOf('year')
toDate = selectedDate.value.endOf('year')
-
prevDate = fromDate.subtract(1, 'day').endOf('day')
nextDate = toDate.add(1, 'day').startOf('day')
break
@@ -225,53 +224,40 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
logical_op: 'and',
children: [
{
- is_group: true,
- logical_op: 'or',
- children: [
- {
- is_group: true,
- logical_op: 'and',
- children: [
- {
- fk_column_id: fromCol.id,
- comparison_op: 'lt',
- comparison_sub_op: 'exactDate',
- value: nextDate,
- },
- {
- fk_column_id: toCol.id,
- comparison_op: 'gt',
- comparison_sub_op: 'exactDate',
- value: prevDate,
- },
- ],
- },
- {
- // Exact match check
- is_group: true,
- logical_op: 'or',
- children: [
- {
- fk_column_id: fromCol.id,
- comparison_op: 'eq',
- logical_op: 'or',
- comparison_sub_op: 'exactDate',
- value: fromDate,
- },
- ],
- },
- ],
+ fk_column_id: fromCol.id,
+ comparison_op: 'lt',
+ comparison_sub_op: 'exactDate',
+ value: nextDate,
+ },
+ {
+ fk_column_id: toCol.id,
+ comparison_op: 'gt',
+ comparison_sub_op: 'exactDate',
+ value: prevDate,
},
],
},
+ {
+ fk_column_id: fromCol.id,
+ comparison_op: 'eq',
+ logical_op: 'or',
+ comparison_sub_op: 'exactDate',
+ value: fromDate,
+ },
]
} else if (fromCol) {
rangeFilter = [
{
fk_column_id: fromCol.id,
- comparison_op: 'btw',
+ comparison_op: 'lt',
comparison_sub_op: 'exactDate',
- value: `${prevDate},${nextDate}`,
+ value: nextDate,
+ },
+ {
+ fk_column_id: fromCol.id,
+ comparison_op: 'gt',
+ comparison_sub_op: 'exactDate',
+ value: prevDate,
},
]
}
@@ -401,65 +387,47 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
logical_op: 'and',
children: [
{
- is_group: true,
- logical_op: 'or',
- children: [
- {
- is_group: true,
- logical_op: 'and',
- children: [
- {
- fk_column_id: fromCol.id,
- comparison_op: 'lt',
- comparison_sub_op: 'exactDate',
- value: nextDate,
- },
- {
- fk_column_id: toCol.id,
- comparison_op: 'gt',
- comparison_sub_op: 'exactDate',
- value: prevDate,
- },
- ],
- },
- {
- // Exact match check
- is_group: true,
- logical_op: 'or',
- children: [
- {
- fk_column_id: fromCol.id,
- comparison_op: 'eq',
- logical_op: 'or',
- comparison_sub_op: 'exactDate',
- value: fromDate,
- },
- ],
- },
- ],
+ fk_column_id: fromCol.id,
+ comparison_op: 'lt',
+ comparison_sub_op: 'exactDate',
+ value: nextDate,
+ },
+ {
+ fk_column_id: toCol.id,
+ comparison_op: 'gt',
+ comparison_sub_op: 'exactDate',
+ value: prevDate,
},
],
},
+ {
+ fk_column_id: fromCol.id,
+ comparison_op: 'eq',
+ logical_op: 'or',
+ comparison_sub_op: 'exactDate',
+ value: fromDate,
+ },
]
} else if (fromCol) {
rangeFilter = [
{
fk_column_id: fromCol.id,
- comparison_op: 'btw',
+ comparison_op: 'lt',
+ comparison_sub_op: 'exactDate',
+ value: nextDate,
+ },
+ {
+ fk_column_id: fromCol.id,
+ comparison_op: 'gt',
comparison_sub_op: 'exactDate',
- value: `${prevDate},${nextDate}`,
+ value: prevDate,
},
]
}
if (rangeFilter.length > 0) {
- combinedFilters.children.push({
- is_group: true,
- logical_op: 'or',
- children: rangeFilter,
- })
+ combinedFilters.children.push(rangeFilter)
}
})
-
return combinedFilters.children.length > 0 ? [combinedFilters] : []
})