@fileverse-dev/fortune-core 1.2.61 → 1.2.62

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/es/locale/en.js CHANGED
@@ -3460,7 +3460,7 @@ export default {
3460
3460
  type: "rangeall"
3461
3461
  }]
3462
3462
  }, {
3463
- n: "NETWORKDAYS_INTL",
3463
+ n: "NETWORKDAYS.INTL",
3464
3464
  t: 6,
3465
3465
  d: "Returns the number of net working days between two provided days excluding specified weekend days and holidays.",
3466
3466
  a: "Net working days between two dates (specifying weekends).",
@@ -3712,7 +3712,7 @@ export default {
3712
3712
  type: "rangeall"
3713
3713
  }]
3714
3714
  }, {
3715
- n: "WORKDAY_INTL",
3715
+ n: "WORKDAY.INTL",
3716
3716
  t: 6,
3717
3717
  d: "Calculates the date after a specified number of workdays excluding specified weekend days and holidays.",
3718
3718
  a: "Date after a number of workdays (specifying weekends).",
@@ -689,7 +689,19 @@ export function insertUpdateFunctionGroup(ctx, r, c, id, calcChainSet) {
689
689
  file.calcChain = calcChain;
690
690
  ctx.luckysheetfile = luckysheetfile;
691
691
  }
692
+ function replaceDotsInFunctionName(str) {
693
+ if (!str.startsWith("=")) return str;
694
+ var openParenIndex = str.indexOf("(");
695
+ if (openParenIndex === -1) return str;
696
+ var fnName = str.substring(1, openParenIndex);
697
+ var fixedFnName = fnName.replace(/\./g, "_");
698
+ return "=" + fixedFnName + str.substring(openParenIndex);
699
+ }
692
700
  export function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
701
+ var originalTxt = txt;
702
+ if (txt.toUpperCase().includes("NETWORKDAYS.INTL") || txt.toUpperCase().includes("WORKDAY.INTL")) {
703
+ txt = replaceDotsInFunctionName(txt);
704
+ }
693
705
  if (txt.indexOf(error.r) > -1) {
694
706
  return [false, error.r, txt];
695
707
  }
@@ -740,7 +752,7 @@ export function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notIns
740
752
  } else {
741
753
  clearCellError(ctx, r, c);
742
754
  }
743
- return [true, !isError ? finalResult : "#ERROR", txt, isError && {
755
+ return [true, !isError ? finalResult : "#ERROR", originalTxt, isError && {
744
756
  row_column: "".concat(r, "_").concat(c),
745
757
  title: "Error",
746
758
  message: (formulaError === null || formulaError === void 0 ? void 0 : formulaError.toString()) || detectedErrorFromValue || "Unknown Error"
package/lib/locale/en.js CHANGED
@@ -3466,7 +3466,7 @@ var _default = exports.default = {
3466
3466
  type: "rangeall"
3467
3467
  }]
3468
3468
  }, {
3469
- n: "NETWORKDAYS_INTL",
3469
+ n: "NETWORKDAYS.INTL",
3470
3470
  t: 6,
3471
3471
  d: "Returns the number of net working days between two provided days excluding specified weekend days and holidays.",
3472
3472
  a: "Net working days between two dates (specifying weekends).",
@@ -3718,7 +3718,7 @@ var _default = exports.default = {
3718
3718
  type: "rangeall"
3719
3719
  }]
3720
3720
  }, {
3721
- n: "WORKDAY_INTL",
3721
+ n: "WORKDAY.INTL",
3722
3722
  t: 6,
3723
3723
  d: "Calculates the date after a specified number of workdays excluding specified weekend days and holidays.",
3724
3724
  a: "Date after a number of workdays (specifying weekends).",
@@ -719,7 +719,19 @@ function insertUpdateFunctionGroup(ctx, r, c, id, calcChainSet) {
719
719
  file.calcChain = calcChain;
720
720
  ctx.luckysheetfile = luckysheetfile;
721
721
  }
722
+ function replaceDotsInFunctionName(str) {
723
+ if (!str.startsWith("=")) return str;
724
+ var openParenIndex = str.indexOf("(");
725
+ if (openParenIndex === -1) return str;
726
+ var fnName = str.substring(1, openParenIndex);
727
+ var fixedFnName = fnName.replace(/\./g, "_");
728
+ return "=" + fixedFnName + str.substring(openParenIndex);
729
+ }
722
730
  function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc) {
731
+ var originalTxt = txt;
732
+ if (txt.toUpperCase().includes("NETWORKDAYS.INTL") || txt.toUpperCase().includes("WORKDAY.INTL")) {
733
+ txt = replaceDotsInFunctionName(txt);
734
+ }
723
735
  if (txt.indexOf(_validation.error.r) > -1) {
724
736
  return [false, _validation.error.r, txt];
725
737
  }
@@ -770,7 +782,7 @@ function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc
770
782
  } else {
771
783
  (0, _2.clearCellError)(ctx, r, c);
772
784
  }
773
- return [true, !isError ? finalResult : "#ERROR", txt, isError && {
785
+ return [true, !isError ? finalResult : "#ERROR", originalTxt, isError && {
774
786
  row_column: "".concat(r, "_").concat(c),
775
787
  title: "Error",
776
788
  message: (formulaError === null || formulaError === void 0 ? void 0 : formulaError.toString()) || detectedErrorFromValue || "Unknown Error"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.2.61",
3
+ "version": "1.2.62",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "dev": "father-build --watch"
16
16
  },
17
17
  "dependencies": {
18
- "@fileverse-dev/formula-parser": "0.2.84",
18
+ "@fileverse-dev/formula-parser": "0.2.85",
19
19
  "dayjs": "^1.11.0",
20
20
  "immer": "^9.0.12",
21
21
  "lodash": "^4.17.21",