Fix auto-inserted timestamp transformers

This commit is contained in:
rijkvanzanten
2021-04-09 19:59:01 -04:00
parent d50f3f9edb
commit 5d1db82554

View File

@@ -256,14 +256,16 @@ export class PayloadService {
payload[name] = newValue;
}
} else {
if (dateColumn.type === 'date') {
const newValue = parse(value, 'yyyy-MM-dd', new Date());
payload[name] = newValue;
}
if (value instanceof Date === false) {
if (dateColumn.type === 'date') {
const newValue = parse(value, 'yyyy-MM-dd', new Date());
payload[name] = newValue;
}
if (dateColumn.type === 'timestamp' || dateColumn.type === 'dateTime') {
const newValue = parseISO(value);
payload[name] = newValue;
if (dateColumn.type === 'timestamp' || dateColumn.type === 'dateTime') {
const newValue = parseISO(value);
payload[name] = newValue;
}
}
}
}