Browse Source

fix(nc-gui): day view fixes

pull/7611/head
DarkPhoenix2704 7 months ago
parent
commit
be9e190315
  1. 9
      packages/nc-gui/components/smartsheet/calendar/DayView.vue
  2. 3
      packages/nc-gui/components/smartsheet/calendar/SideMenu.vue

9
packages/nc-gui/components/smartsheet/calendar/DayView.vue

@ -116,7 +116,8 @@ const hours = computed<dayjs.Dayjs>(() => {
.millisecond(0)
.year(selectedDate.value.getFullYear())
.month(selectedDate.value.getMonth())
.date(selectedDate.value.getDate()),
.date(selectedDate.value.getDate())
.toDate(),
)
}
return hours
@ -294,8 +295,8 @@ const dropEvent = (event: DragEvent) => {
>
<div ref="container" class="relative" @drop="dropEvent($event)">
<div
v-for="hour in hours"
:key="hour"
v-for="(hour, index) in hours"
:key="index"
:class="{
'!border-brand-500': dayjs(hour).isSame(selectedTime) && !props.isEmbed,
}"
@ -307,7 +308,7 @@ const dropEvent = (event: DragEvent) => {
"
>
<div
v-if="isEmbed && dayjs(hour).isSame(dayjs(selectedDateRange.start), 'day')"
v-if="(isEmbed && dayjs(hour).isSame(dayjs(selectedDateRange.start), 'day')) || !isEmbed"
class="pt-2 px-4 text-xs text-gray-500 font-semibold h-20"
>
{{ dayjs(hour).format('H A') }}

3
packages/nc-gui/components/smartsheet/calendar/SideMenu.vue

@ -1,6 +1,7 @@
<script lang="ts" setup>
import type { VNodeRef } from '@vue/runtime-core'
import { UITypes } from 'nocodb-sdk'
import dayjs from 'dayjs'
import { computed, ref } from '#imports'
const props = defineProps<{
@ -162,7 +163,7 @@ const sideBarListScrollHandle = useDebounceFn(async (e: Event) => {
<template v-else-if="formattedSideBarData.length > 0">
<LazySmartsheetRow v-for="(record, rowIndex) in formattedSideBarData" :key="rowIndex" :row="record">
<LazySmartsheetCalendarSideRecordCard
:date="record.row[calendarRange[0] ? calendarRange[0].fk_from_col.title : '']"
:date="dayjs(record.row[calendarRange[0] ? calendarRange[0].fk_from_col.title : '']).format('YYYY-MM-DD HH:mm')"
:name="record.row[displayField.title]"
color="blue"
@click="emit('expand-record', record)"

Loading…
Cancel
Save