Skip to content
Snippets Groups Projects
Verified Commit 617fcd36 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: wip new pipeline

parent 041b6393
No related branches found
No related tags found
No related merge requests found
......@@ -650,7 +650,9 @@ function transform(value) {
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})`);
......
......@@ -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],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment