Browse Source

fix(nc-gui): some filters update

pull/7753/head
DarkPhoenix2704 8 months ago
parent
commit
c91c9a6c60
  1. 6
      packages/nc-gui/components/smartsheet/calendar/MonthView.vue
  2. 10
      packages/nc-gui/components/smartsheet/calendar/RecordCard.vue
  3. 12
      packages/nocodb/src/db/conditionV2.ts

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

@ -202,6 +202,7 @@ const recordsToDisplay = computed<{
// If the range specifies fromCol and endCol
const startDate = dayjs(record.row[startCol!.title!])
const endDate = dayjs(record.row[endCol!.title!])
let currentWeekStart = startDate.startOf('week')
const id = record.rowMeta.id ?? generateRandomNumber()
@ -219,6 +220,11 @@ const recordsToDisplay = computed<{
const recordStart = currentWeekStart.isBefore(startDate) ? startDate : currentWeekStart
const recordEnd = currentWeekEnd.isAfter(endDate) ? endDate : currentWeekEnd
if (recordEnd.isBefore(dates.value[0][0])) {
currentWeekStart = currentWeekStart.add(1, 'week')
continue
}
// Update the recordsInDay object to keep track of the number of records in a day
let day = recordStart.clone()
while (day.isSameOrBefore(recordEnd)) {

10
packages/nc-gui/components/smartsheet/calendar/RecordCard.vue

@ -28,8 +28,8 @@ const emit = defineEmits(['resize-start'])
:class="{
'min-h-9': size === 'small',
'h-full': size === 'auto',
'rounded-l-md': position === 'leftRounded',
'rounded-r-md': position === 'rightRounded',
'rounded-l-md ml-1': position === 'leftRounded',
'rounded-r-md mr-1': position === 'rightRounded',
'rounded-md mx-1': position === 'rounded',
'rounded-none': position === 'none',
'bg-maroon-50': color === 'maroon',
@ -60,7 +60,7 @@ const emit = defineEmits(['resize-start'])
<div v-if="(position === 'leftRounded' || position === 'rounded') && resize" class="mt-0.7 h-7.1 absolute -left-4 resize">
<NcButton
:class="{
'!block z-1 !border-brand-500': selected || hover,
'!block z-2 !border-brand-500': selected || hover,
'!hidden': !selected && !hover,
}"
size="xsmall"
@ -84,10 +84,10 @@ const emit = defineEmits(['resize-start'])
<span v-if="position === 'leftRounded' || position === 'none'" class="absolute my-0 right-5"> .... </span>
</div>
<div v-if="(position === 'rightRounded' || position === 'rounded') && resize" class="absolute mt-0.3 z-1 -right-4 resize">
<div v-if="(position === 'rightRounded' || position === 'rounded') && resize" class="absolute mt-0.3 -right-4 resize">
<NcButton
:class="{
'!block !border-brand-500': selected || hover,
'!block !border-brand-500 z-2': selected || hover,
'!hidden': !selected && !hover,
}"
size="xsmall"

12
packages/nocodb/src/db/conditionV2.ts

@ -902,7 +902,8 @@ const parseConditionV2 = async (
// If the column is a datetime and the client is pg and the value has a timezone offset at the end
// then we need to convert the value to timestamptz before comparing
if (
column.uidt === UITypes.DateTime &&
(column.uidt === UITypes.DateTime ||
column.uidt === UITypes.Date) &&
val.match(/[+-]\d{2}:\d{2}$/)
) {
if (qb.client.config.client === 'pg') {
@ -944,7 +945,8 @@ const parseConditionV2 = async (
// If the column is a datetime and the client is pg and the value has a timezone offset at the end
// then we need to convert the value to timestamptz before comparing
if (
column.uidt === UITypes.DateTime &&
(column.uidt === UITypes.DateTime ||
column.uidt === UITypes.Date) &&
val.match(/[+-]\d{2}:\d{2}$/)
) {
if (qb.client.config.client === 'pg') {
@ -985,7 +987,8 @@ const parseConditionV2 = async (
// If the column is a datetime and the client is pg and the value has a timezone offset at the end
// then we need to convert the value to timestamptz before comparing
if (
column.uidt === UITypes.DateTime &&
(column.uidt === UITypes.DateTime ||
column.uidt === UITypes.Date) &&
val.match(/[+-]\d{2}:\d{2}$/)
) {
if (qb.client.config.client === 'pg') {
@ -1028,7 +1031,8 @@ const parseConditionV2 = async (
// If the column is a datetime and the client is pg and the value has a timezone offset at the end
// then we need to convert the value to timestamptz before comparing
if (
column.uidt === UITypes.DateTime &&
(column.uidt === UITypes.DateTime ||
column.uidt === UITypes.Date) &&
val.match(/[+-]\d{2}:\d{2}$/)
) {
if (qb.client.config.client === 'pg') {

Loading…
Cancel
Save