mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-23 12:49:09 +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
|
// Always return dates as ISO strings
|
||||||
[pgp.pg.types.builtins.TIMESTAMP, pgp.pg.types.builtins.TIMESTAMPTZ].forEach((type) => {
|
[pgp.pg.types.builtins.TIMESTAMP, pgp.pg.types.builtins.TIMESTAMPTZ].forEach((type) => {
|
||||||
pgp.pg.types.setTypeParser(type, (value: string) => {
|
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