Browse Source

Merge pull request #9740 from nocodb/nc-calendar-current-time

fix: Calendar current time cursor is in the wrong place
pull/9741/head
Anbarasu 4 weeks ago committed by GitHub
parent
commit
12f8c0afa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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