From 617fcd36e0416139ef6017dd0163eecf65787b85 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Tue, 14 May 2024 16:54:04 +0200
Subject: [PATCH] fix: wip new pipeline

---
 source/data/transformer.mjs     | 12 ++++++------
 test/cases/data/transformer.mjs |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/source/data/transformer.mjs b/source/data/transformer.mjs
index 22ec307c1..af210b3c2 100644
--- a/source/data/transformer.mjs
+++ b/source/data/transformer.mjs
@@ -647,10 +647,12 @@ function transform(value) {
 			if (isNaN(date.getTime())) {
 				throw new Error("invalid date");
 			}
-
+			
 			try {
 				locale = getLocaleOfDocument();
-				return date.toLocaleTimeString(locale);
+				return date.toLocaleTimeString(locale.toString(),{
+					hour12: false
+				});
 			} catch (e) {
 				throw new Error(`unsupported locale or missing format (${e.message})`);
 			}
@@ -663,7 +665,8 @@ function transform(value) {
 			
 			const options = {
 				dateStyle: "medium",
-				timeStyle: "medium"
+				timeStyle: "medium",
+				hour12: false
 			};
 			
 			if (args.length > 0) {
@@ -676,9 +679,6 @@ function transform(value) {
 
 			try {
 				locale = getLocaleOfDocument().toString();
-				
-				console.log(locale, options, date,"!!!!");	
-				
 				return new Intl.DateTimeFormat(locale, options).format(date);
 			} catch (e) {
 				throw new Error(`unsupported locale or missing format (${e.message})`);
diff --git a/test/cases/data/transformer.mjs b/test/cases/data/transformer.mjs
index 1e3e82460..f01085b07 100644
--- a/test/cases/data/transformer.mjs
+++ b/test/cases/data/transformer.mjs
@@ -29,9 +29,9 @@ describe('Transformer', function () {
     describe('Transformer.run()', function () {
 
         [
-            ['datetimeformat', "2023-02-04 08:02:01", "04.02.2023, 08:02:01"],
-            ['datetimeformat:long:short', "2023-02-04 08:02:01","4. Februar 2023 um 08:02"],
-            ['datetimeformat:short:short', "2023-02-04 08:02:01", "04.02.23, 08:02"],
+            ['datetimeformat', "2023-02-04 08:02:01", "Feb 4, 2023, 08:02:01"],
+            ['datetimeformat:long:short', "2023-02-04 08:02:01","February 4, 2023 at 08:02"],
+            ['datetimeformat:short:short', "2023-02-04 08:02:01", "2/4/23, 08:02"],
             ['equals:a', "a", true],
             ['equals:a', "b", false],
             ['equals:3', 3, true],
-- 
GitLab