Fix NaN-NaN... in dates
This commit is contained in:
parent
fc99247390
commit
2e1cb45f01
|
@ -308,7 +308,6 @@ AbstractClass.prototype.propertyChanged = function (attr) {
|
|||
return this['_' + attr] !== this[attr + '_was'];
|
||||
};
|
||||
|
||||
|
||||
AbstractClass.prototype.reload = function (cb) {
|
||||
this.constructor.find(this.id, cb);
|
||||
};
|
||||
|
|
|
@ -76,6 +76,7 @@ MySQL.prototype.toDatabase = function (prop, val) {
|
|||
if (prop.type.name === 'Number') return val;
|
||||
if (val === null) return 'NULL';
|
||||
if (prop.type.name === 'Date') {
|
||||
if (!val) return 'NULL';
|
||||
if (!val.toUTCString) {
|
||||
val = new Date(val);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue