Browse Source

feat(nc-gui): add getDateFormat

pull/3811/head
Wing-Kam Wong 2 years ago
parent
commit
dd573ebeb5
  1. 9
      packages/nc-gui/utils/dateTimeUtils.ts

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

@ -42,3 +42,12 @@ export function validateDateWithUnknownFormat(v: string) {
}
return res
}
export function getDateFormat(v: string) {
for (const format of dateFormats) {
if (dayjs(v, format, true).isValid()) {
return format
}
}
return 'YYYY/MM/DD'
}

Loading…
Cancel
Save