Permalink
Browse files

fix(lib/field_type/datetime.js): Datetime.toJSON "Invalid date" error…

… when datetime value is null
  • Loading branch information...
lfeng authored and XadillaX committed Mar 7, 2016
1 parent dbfdd29 commit 86dc5a82a38e9b798b9a7f8348f666351883ebda
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/field_type/datetime.js
@@ -46,6 +46,7 @@ Datetime.equal = function(a, b) {
* @return {Object} the json object
*/
Datetime.toJSON = function(datetime) {
if (datetime === null) return null;
if(!(datetime instanceof Date)) {
datetime = moment(datetime).toDate();
}

0 comments on commit 86dc5a8

Please sign in to comment.