mirror of
https://github.com/nocodb/nocodb.git
synced 2026-06-01 22:32:34 +00:00
Merge pull request #13301 from nocodb/nc-csv-upload
fix(nc-gui): handle Date objects and empty strings in import
This commit is contained in:
@@ -606,7 +606,13 @@ async function importTemplate() {
|
||||
input = null
|
||||
}
|
||||
} else if (v.uidt === UITypes.Date) {
|
||||
if (input) {
|
||||
if (input === '' || input === null || input === undefined) {
|
||||
input = null
|
||||
} else if (input instanceof Date) {
|
||||
// Handle JS Date objects from Excel parser
|
||||
const d = dayjs(input)
|
||||
input = d.isValid() ? d.format('YYYY-MM-DD') : null
|
||||
} else {
|
||||
const originalInput = String(input)
|
||||
|
||||
if (validateDateWithUnknownFormat(originalInput)) {
|
||||
|
||||
Reference in New Issue
Block a user