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

fix: wip new pipeline

parent fea032d6
No related branches found
No related tags found
No related merge requests found
......@@ -662,10 +662,18 @@ function transform(value) {
}
const options = {
dateStyle: args.shift() || "medium",
timeStyle: args.shift() || "medium",
dateStyle: "medium",
timeStyle: "medium"
};
if (args.length > 0) {
options.dateStyle = args.shift();
}
if (args.length > 0) {
options.timeStyle = args.shift();
}
try {
locale = getLocaleOfDocument();
return new Intl.DateTimeFormat(locale, options).format(date);
......
......@@ -202,22 +202,23 @@ describe('Transformer', function () {
it('Transformer.run(' + JSON.stringify(a) + ').run(' + JSON.stringify(b) + ') should return ' + JSON.stringify(c), function () {
const [major, minor, patch] = process.versions.node.split('.').map(Number)
console.log(major, minor, patch,'!!!!!!!!!!!')
const args=[b,c]
let date = new Date(b);
const options = {
dateStyle: args.shift() || "medium",
timeStyle: args.shift() || "medium",
};
console.log(options,'options')
// const locale = getLocaleOfDocument();
//const intl= new Intl.DateTimeFormat("en", options).format(new Date("2023-02-04 08:02:01"));
//console.log(intl,'intl')
// const [major, minor, patch] = process.versions.node.split('.').map(Number)
// console.log(major, minor, patch,'!!!!!!!!!!!')
//
// const args=a.split(':');
// args.shift();
//
// let date = new Date(b);
// const options = {
// dateStyle: args.shift() || "medium",
// timeStyle: args.shift() || "medium",
// };
//
// console.log(options,'options')
//
// // const locale = getLocaleOfDocument();
// //const intl= new Intl.DateTimeFormat("en", options).format(new Date("2023-02-04 08:02:01"));
// //console.log(intl,'intl')
let t = new Transformer(a);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment