Skip to content

Commit

Permalink
Merge pull request #109 from mikkom/master
Browse files Browse the repository at this point in the history
Fix Date type support when using Aurora PostgreSQL
  • Loading branch information
jeremydaly authored Apr 6, 2022
2 parents dd30fd6 + ba87736 commit 89b1e7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ const formatRecords = (recs,columns,hydrate,formatOptions) => {

// Format record value based on its value, the database column's typeName and the formatting options
const formatRecordValue = (value,typeName,formatOptions) => {
if(formatOptions && formatOptions.deserializeDate && ['DATE', 'DATETIME', 'TIMESTAMP', 'TIMESTAMP WITH TIME ZONE'].includes(typeName)) {
if(formatOptions && formatOptions.deserializeDate && ['DATE', 'DATETIME', 'TIMESTAMP', 'TIMESTAMPTZ', 'TIMESTAMP WITH TIME ZONE'].includes(typeName)) {
return formatFromTimeStamp(value,(formatOptions && formatOptions.treatAsLocalDate) || typeName === 'TIMESTAMP WITH TIME ZONE')
} else if (typeName === 'JSON') {
return JSON.parse(value)
Expand Down

0 comments on commit 89b1e7f

Please sign in to comment.