Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Monster
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Javascript
Monster
Commits
617fcd36
Verified
Commit
617fcd36
authored
1 year ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
fix: wip new pipeline
parent
041b6393
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
source/data/transformer.mjs
+6
-6
6 additions, 6 deletions
source/data/transformer.mjs
test/cases/data/transformer.mjs
+3
-3
3 additions, 3 deletions
test/cases/data/transformer.mjs
with
9 additions
and
9 deletions
source/data/transformer.mjs
+
6
−
6
View file @
617fcd36
...
...
@@ -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
}
)`
);
...
...
This diff is collapsed.
Click to expand it.
test/cases/data/transformer.mjs
+
3
−
3
View file @
617fcd36
...
...
@@ -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
"
,
"
Februar
y 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
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment