mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
knexfile: fix issue with nullà dates
This commit is contained in:
parent
21c713255c
commit
ea68512c7e
1 changed files with 2 additions and 1 deletions
|
@ -17,7 +17,8 @@ module.exports = {
|
|||
dateStrings: true,
|
||||
typeCast(field, next) {
|
||||
if (field.type === 'DATETIME') {
|
||||
return moment(field.string()).format('YYYY-MM-DD HH:mm:ss');
|
||||
const val = field.string();
|
||||
return val != null ? moment(val).format('YYYY-MM-DD HH:mm:ss') : null;
|
||||
}
|
||||
|
||||
return next();
|
||||
|
|
Loading…
Add table
Reference in a new issue