Browse Source

fix(nc-gui): day view fixes

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

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

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

Loading…
Cancel
Save