mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
1 year ago
4 changed files with 17 additions and 4 deletions
@ -0,0 +1,10 @@ |
|||||||
|
import dayjs from 'dayjs' |
||||||
|
|
||||||
|
export const renderValue = (value: string | number | boolean) => { |
||||||
|
if (!value || typeof value !== 'string') return value |
||||||
|
return value.replace(/\b(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\+\d{2}:\d{2})\b/g, (d) => { |
||||||
|
// TODO(timezone): retrieve the format from the corresponding column meta
|
||||||
|
// assume hh:mm at this moment
|
||||||
|
return dayjs(d).utc().local().format('YYYY-MM-DD HH:mm') |
||||||
|
}) |
||||||
|
} |
Loading…
Reference in new issue