mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 19:16:47 +00:00
fic(nc-gui): copy date and paste in dateTime field
This commit is contained in:
@@ -56,8 +56,14 @@ export default function convertCellData(
|
||||
}
|
||||
return null
|
||||
case UITypes.Date: {
|
||||
const parsedDate = dayjs(value, getDateFormat(value))
|
||||
if (!(validateDateWithUnknownFormat(value) && parsedDate.isValid())) {
|
||||
const isValid = validateDateWithUnknownFormat(value)
|
||||
let parsedDate = dayjs(value, getDateTimeFormat(value))
|
||||
|
||||
if (isValid && !parsedDate.isValid()) {
|
||||
parsedDate = dayjs(value, getDateFormat(value))
|
||||
}
|
||||
|
||||
if (!(isValid && parsedDate.isValid())) {
|
||||
if (isMultiple) {
|
||||
return null
|
||||
} else {
|
||||
@@ -67,8 +73,13 @@ export default function convertCellData(
|
||||
return parsedDate.format('YYYY-MM-DD')
|
||||
}
|
||||
case UITypes.DateTime: {
|
||||
const parsedDateTime = dayjs(value, getDateTimeFormat(value))
|
||||
if (!(validateDateWithUnknownFormat(value) && parsedDateTime.isValid())) {
|
||||
const isValid = validateDateWithUnknownFormat(value)
|
||||
let parsedDateTime = dayjs(value, getDateTimeFormat(value))
|
||||
if (isValid && !parsedDateTime.isValid()) {
|
||||
parsedDateTime = dayjs(value, getDateFormat(value))
|
||||
}
|
||||
|
||||
if (!(isValid && parsedDateTime.isValid())) {
|
||||
if (isMultiple) {
|
||||
return null
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user