From 2e1cb45f01d5b7faf6bf454df31d049ca04cba54 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Sat, 12 Nov 2011 19:04:07 +0700 Subject: [PATCH] Fix NaN-NaN... in dates --- lib/abstract-class.js | 1 - lib/adapters/mysql.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/abstract-class.js b/lib/abstract-class.js index 78cbee30..a877399b 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -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); }; diff --git a/lib/adapters/mysql.js b/lib/adapters/mysql.js index 3de4efea..a115ac35 100644 --- a/lib/adapters/mysql.js +++ b/lib/adapters/mysql.js @@ -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); }