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

fix: wip new pipeline

parent 617fcd36
No related branches found
No related tags found
No related merge requests found
......@@ -625,7 +625,7 @@ function transform(value) {
const maximumFractionDigits = args?.[0] || 2;
const roundingIncrement = args?.[1] || 5;
const nf = new Intl.NumberFormat(locale, {
const nf = new Intl.NumberFormat(locale.toString(), {
style: "currency",
currency: currency,
maximumFractionDigits: maximumFractionDigits,
......@@ -692,7 +692,9 @@ function transform(value) {
try {
locale = getLocaleOfDocument();
return date.toLocaleString(locale);
return date.toLocaleString(locale.toString(),{
hour12: false
});
} catch (e) {
throw new Error(`unsupported locale or missing format (${e.message})`);
}
......@@ -705,7 +707,12 @@ function transform(value) {
try {
locale = getLocaleOfDocument();
return date.toLocaleDateString(locale);
return date.toLocaleDateString(locale.toString(),
{
year: "numeric",
month: "2-digit",
day: "2-digit"
});
} catch (e) {
throw new Error(`unsupported locale or missing format (${e.message})`);
}
......
......@@ -51,11 +51,11 @@ describe('Transformer', function () {
['equals:null', null, true],
['equals:null', 3, false],
['equals:3', 6, false],
['currency', "EUR0", "0,00 €"],
['currency', "EUR0", "€0.00"], // 0,00 €
// ['currency:1:2', "EUR14.25", "14,2 €"], nodejs and browser have different results (https://gitlab.schukai.com/oss/libraries/javascript/monster/-/issues/124)
['currency', "EUR14.25", "14,25"],
['datetime', "2023-02-14 14:12:10", "14.2.2023, 14:12:10"],
['datetime', "2023-02-14 08:02:01", "14.2.2023, 08:02:01"],
['currency', "EUR14.25", "14.25"],
['datetime', "2023-02-14 14:12:10", "2/14/2023, 14:12:10"],
['datetime', "2023-02-14 08:02:01", "2/14/2023, 08:02:01"],
['has-entries', {}, false],
['has-entries', {a:4}, true],
['has-entries', [], false],
......@@ -90,7 +90,7 @@ describe('Transformer', function () {
['not', true, false],
['not', false, true],
['map:a=4:b=5:c=6', "a", "4"],
['date', "2023-02-14", "14.2.2023"],
['date', "2023-02-14", "02/14/2023"],
['year', "2023-02-14", 2023],
['month', "2023-02-14", 2],
['day', "2023-02-14", 14],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment