Browse Source

refactor(sdk): add comment to handleTZ regex

pull/6870/head
աɨռɢӄաօռɢ 1 year ago
parent
commit
ddf6f07f1f
  1. 1
      packages/nocodb-sdk/src/lib/dateTimeHelper.ts

1
packages/nocodb-sdk/src/lib/dateTimeHelper.ts

@ -98,6 +98,7 @@ export const handleTZ = (val: any) => {
return val; return val;
} }
return val.replace( return val.replace(
// match and extract dates and times in the ISO 8601 format
/((?:-?(?:[1-9][0-9]*)?[0-9]{4})-(?:1[0-2]|0[1-9])-(?:3[01]|0[1-9]|[12][0-9])T(?:2[0-3]|[01][0-9]):(?:[0-5][0-9]):(?:[0-5][0-9])(?:\.[0-9]+)?(?:Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9]))/g, /((?:-?(?:[1-9][0-9]*)?[0-9]{4})-(?:1[0-2]|0[1-9])-(?:3[01]|0[1-9]|[12][0-9])T(?:2[0-3]|[01][0-9]):(?:[0-5][0-9]):(?:[0-5][0-9])(?:\.[0-9]+)?(?:Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9]))/g,
(_, v) => { (_, v) => {
return dayjs(v).format('YYYY-MM-DD HH:mm'); return dayjs(v).format('YYYY-MM-DD HH:mm');

Loading…
Cancel
Save