From 84b1a42e301b31f2945114faeee7e7d3c2e65856 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Wed, 11 Sep 2024 15:08:44 +0200 Subject: [PATCH] fix time export --- gpx/src/io.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpx/src/io.ts b/gpx/src/io.ts index 84b82e86..f40e29f7 100644 --- a/gpx/src/io.ts +++ b/gpx/src/io.ts @@ -107,7 +107,7 @@ function removeEmptyElements(obj: GPXFileType): GPXFileType { for (const key in obj) { if (obj[key] === null || obj[key] === undefined || obj[key] === '' || (Array.isArray(obj[key]) && obj[key].length === 0)) { delete obj[key]; - } else if (typeof obj[key] === 'object') { + } else if (typeof obj[key] === 'object' && !(obj[key] instanceof Date)) { removeEmptyElements(obj[key]); if (Object.keys(obj[key]).length === 0) { delete obj[key];