@fileverse-dev/formulajs 4.4.11-mod-19 → 4.4.11-mod-19-patch-1
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/lib/browser/formula.js +15 -4
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +18 -3
- package/lib/esm/index.mjs +18 -3
- package/package.json +1 -1
- package/types/cjs/index.d.cts +1 -1
- package/types/esm/index.d.mts +1 -1
package/lib/browser/formula.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @fileverse-dev/formulajs v4.4.11-mod-19 */
|
|
1
|
+
/* @fileverse-dev/formulajs v4.4.11-mod-19-patch-1 */
|
|
2
2
|
function _regeneratorRuntime() {
|
|
3
3
|
"use strict";
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() {
|
|
@@ -773,9 +773,20 @@ function _typeof(o) {
|
|
|
773
773
|
return serialToDate(d);
|
|
774
774
|
}
|
|
775
775
|
if (typeof date === "string") {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
776
|
+
if (/^\d{4}-\d{1,2}-\d{1,2}$/.test(date)) {
|
|
777
|
+
return new Date(date + "T00:00:00.000");
|
|
778
|
+
}
|
|
779
|
+
var match = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(date);
|
|
780
|
+
if (match) {
|
|
781
|
+
var _match$map = match.map(Number), _match$map2 = _slicedToArray(_match$map, 4), day = _match$map2[1], month = _match$map2[2], year = _match$map2[3];
|
|
782
|
+
var _d = new Date(year, month - 1, day);
|
|
783
|
+
if (!isNaN(_d)) {
|
|
784
|
+
return _d;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
var parsed = new Date(date);
|
|
788
|
+
if (!isNaN(parsed)) {
|
|
789
|
+
return parsed;
|
|
779
790
|
}
|
|
780
791
|
}
|
|
781
792
|
return value;
|