Skip to content

Commit

Permalink
Add new type DateString to fromColumnValue
Browse files Browse the repository at this point in the history
To sync with loopback-datasource-juggler #1356
which introduces new Type: DateString
  • Loading branch information
bbito authored and Kevin Delisle committed Apr 28, 2017
1 parent d0a88ef commit 120514d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,12 @@ MySQL.prototype.fromColumnValue = function(prop, val) {
val = String(val);
break;
case 'Date':
case 'DateString':

// MySQL allows, unless NO_ZERO_DATE is set, dummy date/time entries
// new Date() will return Invalid Date for those, so we need to handle
// those separate.
if (val == '0000-00-00 00:00:00') {
if (!val || val == '0000-00-00 00:00:00' || val == '0000-00-00') {
val = null;
}
break;
Expand Down

0 comments on commit 120514d

Please sign in to comment.