From ef8d67eb6cdc18140ed84e39f4a5d6d0e51aad64 Mon Sep 17 00:00:00 2001 From: Mikko Matilainen Date: Fri, 19 Nov 2021 22:31:37 +0200 Subject: [PATCH] Fix Date type support when using Aurora PostgreSQL --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d553d39..7a7fb37 100644 --- a/index.js +++ b/index.js @@ -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) => formatOptions && formatOptions.deserializeDate && - ['DATE', 'DATETIME', 'TIMESTAMP', 'TIMESTAMP WITH TIME ZONE'].includes(typeName) + ['DATE', 'DATETIME', 'TIMESTAMP', 'TIMESTAMPTZ', 'TIMESTAMP WITH TIME ZONE'].includes(typeName.toUpperCase()) ? formatFromTimeStamp(value,(formatOptions && formatOptions.treatAsLocalDate) || typeName === 'TIMESTAMP WITH TIME ZONE') : value