Handle data more detailed
This commit is contained in:
parent
75c9806430
commit
88156b0b83
1 changed files with 9 additions and 1 deletions
|
@ -226,7 +226,15 @@ export const TYPE_VALUE_RESOLVER_MAP = {
|
|||
formatter: (value, format) => {
|
||||
return value.filter(Boolean).map(date => formatDate(date, format)).join(',');
|
||||
},
|
||||
parser: (text, format) => text.split(',').map(string => parseDate(string.trim(), format))
|
||||
parser: (value, format) => {
|
||||
const values = typeof value === 'string' ? value.split(',') : value;
|
||||
return values.map(value => {
|
||||
if (value instanceof Date) return value;
|
||||
if (typeof value === 'string') value = value.trim();
|
||||
else if (typeof value !== 'number' && !value) value = '';
|
||||
return parseDate(value, format);
|
||||
});
|
||||
}
|
||||
},
|
||||
number: {
|
||||
formatter(value) {
|
||||
|
|
Loading…
Add table
Reference in a new issue