Browse Source

fix/moved calculateDiff to date utils

pull/2734/head
Muhammed Mustafa 2 years ago committed by braks
parent
commit
189bc5bbaa
  1. 2
      packages/nc-gui-v2/components/dashboard/settings/AuditTab.vue
  2. 10
      packages/nc-gui-v2/helpers/index.js
  3. 9
      packages/nc-gui-v2/utils/dateTimeUtils.ts

2
packages/nc-gui-v2/components/dashboard/settings/AuditTab.vue

@ -2,7 +2,7 @@
import { Tooltip as ATooltip } from 'ant-design-vue'
import { h, ref } from 'vue'
import type { AuditType } from 'nocodb-sdk'
import { calculateDiff } from '~/helpers'
import { calculateDiff } from '~/utils/dateTimeUtils'
const { $api } = useNuxtApp()
const { project } = useProject()

10
packages/nc-gui-v2/helpers/index.js

@ -1,10 +0,0 @@
import dayjs from 'dayjs'
import * as relativeTime from 'dayjs/plugin/relativeTime'
import * as utc from 'dayjs/plugin/utc'
dayjs.extend(utc)
dayjs.extend(relativeTime)
export function calculateDiff(date) {
return dayjs.utc(date).fromNow()
}

9
packages/nc-gui-v2/utils/dateTimeUtils.ts

@ -1,5 +1,14 @@
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import utc from 'dayjs/plugin/utc'
dayjs.extend(utc)
dayjs.extend(relativeTime)
export const calculateDiff = (date: any) => {
return dayjs.utc(date).fromNow()
}
export const handleTZ = (val: any) => {
if (!val) {
return

Loading…
Cancel
Save