Browse Source

fix: weekend highlight in spanning records

pull/9831/head
DarkPhoenix2704 2 days ago
parent
commit
c042a24ce3
  1. 11
      packages/nc-gui/components/smartsheet/calendar/DateTimeSpanningContainer.vue
  2. 2
      packages/nc-gui/components/smartsheet/calendar/MonthView.vue

11
packages/nc-gui/components/smartsheet/calendar/DateTimeSpanningContainer.vue

@ -474,7 +474,7 @@ defineExpose({
<div <div
ref="container" ref="container"
:style="{ :style="{
width: `calc(100% - 66px)`, width: `calc(100% - ${activeCalendarView === 'week' ? '64' : '66'}px)`,
}" }"
:class="{ :class="{
'border-gray-100': activeCalendarView === 'day', 'border-gray-100': activeCalendarView === 'day',
@ -484,7 +484,14 @@ defineExpose({
}" }"
class="relative border-l-1 transition-all overflow-y-scroll z-30" class="relative border-l-1 transition-all overflow-y-scroll z-30"
> >
<div class="pointer-events-none inset-y-0 relative"> <div class="pointer-events-none h-full inset-y-0 relative">
<div
v-if="maxVisibleDays === 7"
class="absolute !right-0 h-full bg-gray-100 inset-y-0"
:style="{
width: `${(containerWidth / 7) * 2}px`,
}"
></div>
<template v-for="(record, id) in calendarData" :key="id"> <template v-for="(record, id) in calendarData" :key="id">
<div <div
v-if="record.rowMeta.style?.display !== 'none'" v-if="record.rowMeta.style?.display !== 'none'"

2
packages/nc-gui/components/smartsheet/calendar/MonthView.vue

@ -107,7 +107,7 @@ const calendarData = computed(() => {
const firstDayToDisplay = startOfMonth.startOf('week').add(firstDayOffset, 'day') const firstDayToDisplay = startOfMonth.startOf('week').add(firstDayOffset, 'day')
const today = dayjs() const today = dayjs()
const daysInView = Math.max( const daysInView = Math.min(
35, 35,
Math.ceil((startOfMonth.daysInMonth() + startOfMonth.day() + (isMondayFirst.value ? 0 : 1)) / 7) * 7, Math.ceil((startOfMonth.daysInMonth() + startOfMonth.day() + (isMondayFirst.value ? 0 : 1)) / 7) * 7,
) )

Loading…
Cancel
Save