Browse Source

fix: Calendar current time cursor is in the wrong place

pull/9740/head
DarkPhoenix2704 4 weeks ago
parent
commit
d7cf477d31
  1. 6
      packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
  2. 4
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue

6
packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue

@ -67,7 +67,7 @@ const overlayTop = computed(() => {
const minutes = currTime.value.minute() + currTime.value.hour() * 60 const minutes = currTime.value.minute() + currTime.value.hour() * 60
const top = (perRecordHeight / 60) * minutes const top = (perRecordHeight / 60) * minutes - 9
return top return top
}) })
@ -921,9 +921,9 @@ watch(
<div class="flex w-full items-center"> <div class="flex w-full items-center">
<span <span
class="text-brand-500 text-xs rounded-md border-1 pointer-events-auto px-0.5 border-brand-200 cursor-pointer bg-brand-50" class="text-brand-500 text-xs rounded-md border-1 pointer-events-auto px-0.5 border-brand-200 cursor-pointer bg-brand-50"
@click="newRecord(dayjs())" @click="newRecord(currTime)"
> >
{{ dayjs().format('hh:mm A') }} {{ currTime.format('hh:mm A') }}
</span> </span>
<div class="flex-1 border-b-1 border-brand-500"></div> <div class="flex-1 border-b-1 border-brand-500"></div>
</div> </div>

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

@ -76,7 +76,7 @@ const overlayStyle = computed(() => {
const left = (containerWidth.value / maxVisibleDays.value) * getDayIndex(currTime.value) const left = (containerWidth.value / maxVisibleDays.value) * getDayIndex(currTime.value)
const minutes = currTime.value.hour() * 60 + currTime.value.minute() const minutes = currTime.value.hour() * 60 + currTime.value.minute()
const top = (52 / 60) * minutes const top = (52 / 60) * minutes - 12
return { return {
width: `${containerWidth.value / maxVisibleDays.value}px`, width: `${containerWidth.value / maxVisibleDays.value}px`,
@ -965,7 +965,7 @@ watch(
class="text-brand-500 rounded-md text-xs border-1 pointer-events-auto px-0.5 border-brand-200 cursor-pointer bg-brand-50" class="text-brand-500 rounded-md text-xs border-1 pointer-events-auto px-0.5 border-brand-200 cursor-pointer bg-brand-50"
@click="addRecord(dayjs())" @click="addRecord(dayjs())"
> >
{{ dayjs().format('hh:mm A') }} {{ currTime.format('hh:mm A') }}
</span> </span>
<div class="flex-1 border-b-1 border-brand-500"></div> <div class="flex-1 border-b-1 border-brand-500"></div>
</div> </div>

Loading…
Cancel
Save