From 3f167ffd3ae792565777eacad4c3c591ceeae9a9 Mon Sep 17 00:00:00 2001
From: alexm <alexm@verdnatura.es>
Date: Thu, 9 Jan 2025 09:00:29 +0100
Subject: [PATCH] fix: hotFix if not date return null/undefined

---
 src/filters/toDateHourMin.js    | 4 ++--
 src/filters/toDateHourMinSec.js | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/filters/toDateHourMin.js b/src/filters/toDateHourMin.js
index 2b6995c01..c813840cb 100644
--- a/src/filters/toDateHourMin.js
+++ b/src/filters/toDateHourMin.js
@@ -1,5 +1,6 @@
 export default function toDateHourMin(date) {
-    const dateHour = new Date(date).toLocaleDateString('es-ES', {
+    if (!date) return date;
+    return new Date(date).toLocaleDateString('es-ES', {
         timeZone: 'Europe/Madrid',
         year: 'numeric',
         month: '2-digit',
@@ -7,5 +8,4 @@ export default function toDateHourMin(date) {
         hour: '2-digit',
         minute: '2-digit',
     });
-    return dateHour;
 }
diff --git a/src/filters/toDateHourMinSec.js b/src/filters/toDateHourMinSec.js
index cfc9506fb..51df725e4 100644
--- a/src/filters/toDateHourMinSec.js
+++ b/src/filters/toDateHourMinSec.js
@@ -1,5 +1,6 @@
 export default function toDateHourMinSec(date) {
-    const dateHour = new Date(date).toLocaleDateString('es-ES', {
+    if (!date) return date;
+    return new Date(date).toLocaleDateString('es-ES', {
         timeZone: 'Europe/Madrid',
         year: 'numeric',
         month: '2-digit',
@@ -8,5 +9,4 @@ export default function toDateHourMinSec(date) {
         minute: '2-digit',
         second: '2-digit',
     });
-    return dateHour;
 }