From 58f9d44e9cd63d404e6d44995565c9723fdc5a3a Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Nov 2025 14:58:20 +0000 Subject: [PATCH] Fix: Correction de la regex du parser TIMESTAMPTZ pour supporter +HH et +HH:MM --- config/database.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/database.js b/config/database.js index dd7f80f..b23b4c5 100644 --- a/config/database.js +++ b/config/database.js @@ -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(); }