Browse Source

fix(nc-gui): timeAgo logic

pull/5601/head
Wing-Kam Wong 2 years ago
parent
commit
54fea15a5a
  1. 6
      packages/nc-gui/utils/dateTimeUtils.ts

6
packages/nc-gui/utils/dateTimeUtils.ts

@ -1,7 +1,11 @@
import dayjs from 'dayjs'
// show in local time
export const timeAgo = (date: any) => {
return dayjs.utc(date).fromNow()
if (date.slice(-1) === 'Z') {
return dayjs(date).fromNow()
}
return dayjs(date).utc(true).local().fromNow()
}
export const dateFormats = [

Loading…
Cancel
Save