Browse Source

feat(nc-gui): handle +00:00 as well

pull/5601/head
Wing-Kam Wong 2 years ago
parent
commit
61cc90a5ed
  1. 3
      packages/nc-gui/utils/dateTimeUtils.ts

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

@ -2,7 +2,8 @@ import dayjs from 'dayjs'
// show in local time
export const timeAgo = (date: any) => {
if (date.slice(-1) === 'Z') {
// handle Z and +00:00
if (date.slice(-1) === 'Z' || date.slice(-6) === '+00:00') {
return dayjs(date).fromNow()
}
return dayjs(date).utc(true).local().fromNow()

Loading…
Cancel
Save