3
0
Fork 0
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:
Dragory 2018-08-05 00:45:54 +03:00
parent 21c713255c
commit ea68512c7e

View file

@ -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();