Skip to content

Commit 00c0397

Browse files
committed
Handle date column types
1 parent 9bc8c31 commit 00c0397

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/postgresql.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,14 @@ PostgreSQL.prototype.fromColumnValue = function(prop, val) {
395395
} else {
396396
return val;
397397
}
398+
} else if (
399+
type === 'String' &&
400+
prop &&
401+
prop.postgresql &&
402+
prop.postgresql.dataType === 'date' &&
403+
val instanceof Date
404+
) {
405+
return val.toISOString().split('T')[0];
398406
} else {
399407
return val;
400408
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apexdesigner/loopback-connector-postgresql",
3-
"version": "7.0.6",
3+
"version": "7.0.7",
44
"description": "Loopback PostgreSQL Connector",
55
"keywords": [
66
"LoopBack",

0 commit comments

Comments
 (0)