@rkmodules/rules 0.0.126 → 0.0.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2515,7 +2515,7 @@ var formatDate = {
2515
2515
  impl: function (inputs, params, engine) { return __awaiter(void 0, void 0, void 0, function () {
2516
2516
  return __generator(this, function (_a) {
2517
2517
  return [2 /*return*/, {
2518
- string: mapTree(inputs.date, function (dateInput) {
2518
+ string: mapTree(inputs.date || {}, function (dateInput) {
2519
2519
  var parsedDate = new Date(dateInput || Date.now());
2520
2520
  if (isNaN(parsedDate.getTime())) {
2521
2521
  return [];
@@ -2576,7 +2576,7 @@ var formatDate = {
2576
2576
  if (isNaN(parsedDate.getTime())) {
2577
2577
  return "invalid date";
2578
2578
  }
2579
- return new Date()
2579
+ return parsedDate
2580
2580
  .toLocaleString("sv", {
2581
2581
  timeZone: params.timezone,
2582
2582
  timeZoneName: "longOffset",
@@ -2651,7 +2651,40 @@ var isoDate = {
2651
2651
  }); },
2652
2652
  };
2653
2653
 
2654
+ var today = {
2655
+ name: "today",
2656
+ label: "Today",
2657
+ description: "The date of today",
2658
+ inputs: {},
2659
+ outputs: {
2660
+ iso: "string",
2661
+ date: "string",
2662
+ time: "string",
2663
+ },
2664
+ impl: function (inputs, params, engine) { return __awaiter(void 0, void 0, void 0, function () {
2665
+ return __generator(this, function (_a) {
2666
+ return [2 /*return*/, {
2667
+ date: broadCast(new Date().toLocaleDateString("sv", {
2668
+ timeZone: params.timezone,
2669
+ dateStyle: "short",
2670
+ })),
2671
+ time: broadCast(new Date().toLocaleTimeString("sv", {
2672
+ timeZone: params.timezone,
2673
+ })),
2674
+ iso: broadCast(new Date()
2675
+ .toLocaleString("sv", {
2676
+ timeZone: params.timezone,
2677
+ timeZoneName: "longOffset",
2678
+ })
2679
+ .replace(" ", "T")
2680
+ .replace(" GMT", "")),
2681
+ }];
2682
+ });
2683
+ }); },
2684
+ };
2685
+
2654
2686
  var functions = {
2687
+ today: today,
2655
2688
  parseDate: parseDate,
2656
2689
  formatDate: formatDate,
2657
2690
  isoDate: isoDate,