Fix: Correction de la regex du parser TIMESTAMPTZ pour supporter +HH et +HH:MM

This commit is contained in:
Claude committed 2025-11-16 14:58:35 +00:00
1 parent 2412461c0a
commit 58f9d44e9c
1 file changed
+2 -2
+2 -2
View File
@@ -14,8 +14,8 @@ types.setTypeParser(1184, function(stringValue) {
// PostgreSQL avec timezone=UTC renvoie: "2024-11-17 09:20:00" ou "2024-11-17 09:20:00+00"
// On doit toujours renvoyer une ISO string UTC propre avec 'Z'
// Si déjà au format ISO avec Z ou timezone
if (stringValue.includes('Z') || stringValue.match(/[+-]\d{2}:\d{2}$/)) {
// Si déjà au format ISO avec Z ou timezone (+HH:MM ou +HH)
if (stringValue.includes('Z') || stringValue.match(/[+-]\d{2}(:\d{2})?$/)) {
return new Date(stringValue).toISOString();
}