🌀
можешь обернуть try catch
всегда вызывать json метод, но если возникнет ошибка - возвращай null/undefined
но это уже немного грязно
Size: a a a
🌀
S
S
VD
OS
IN
V
VZ
IN
columns: [
{
Header: 'Order Date',
accessor: 'dateCreated',
width: 190,
Cell: row => {
let unformattedDate = null
if (row.value && row.value.date) {
unformattedDate = row.value.date
}
else if (row.value) {
unformattedDate = row.value
}
const dateToDisplay = unformattedDate !== null ? dayjs(unformattedDate).format('ddd DD/MM/YYYY hh:mm a') : row.original.paymentMethodTitle
return <Inline>{dateToDisplay}</Inline>
},
filterable: false,
},
...
dateCreated: "2020-04-03T16:13:03"
VD
IN
sortMethod: (a, b) => {
const a1 = new Date(a).getTime()
const b1 = new Date(b).getTime()
if(a1 > b1)
return 1
else if(a1 < b1)
return -1
else
return 0
}
IN
M
LH
R
🌀
M
KY
VD