mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(Postgres Node): Special datetime values cause errors (#11225)
Co-authored-by: Elias Meire <elias@meire.dev>
This commit is contained in:
@@ -65,7 +65,13 @@ export async function configurePostgres(
|
||||
// Always return dates as ISO strings
|
||||
[pgp.pg.types.builtins.TIMESTAMP, pgp.pg.types.builtins.TIMESTAMPTZ].forEach((type) => {
|
||||
pgp.pg.types.setTypeParser(type, (value: string) => {
|
||||
return new Date(value).toISOString();
|
||||
const parsedDate = new Date(value);
|
||||
|
||||
if (isNaN(parsedDate.getTime())) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return parsedDate.toISOString();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user