cronstrue 3.43.0 → 3.45.0
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/cronstrue-i18n.js +13 -2
- package/dist/cronstrue-i18n.min.js +1 -1
- package/dist/cronstrue.js +11 -1
- package/dist/cronstrue.min.js +1 -1
- package/dist/i18n/locales/pt_BR.d.ts +2 -2
- package/locales/bg.js +2 -1
- package/locales/bg.min.js +1 -1
- package/package.json +1 -1
package/dist/cronstrue-i18n.js
CHANGED
|
@@ -130,6 +130,12 @@ var CronParser = (function () {
|
|
|
130
130
|
if (expressionParts[6].indexOf("1/") == 0) {
|
|
131
131
|
expressionParts[6] = expressionParts[6].replace("1/", "*/");
|
|
132
132
|
}
|
|
133
|
+
if (this.dayOfWeekStartIndexZero) {
|
|
134
|
+
expressionParts[5] = expressionParts[5]
|
|
135
|
+
.split(",")
|
|
136
|
+
.map(function (item) { return item.replace(/^0-7(?=\/|$)/, "0-6"); })
|
|
137
|
+
.join(",");
|
|
138
|
+
}
|
|
133
139
|
expressionParts[5] = expressionParts[5].replace(/(^\d+)|([^#/\s\d]\d+)/g, function (t) {
|
|
134
140
|
var dowDigits = t.replace(/\D/, "");
|
|
135
141
|
var dowDigitsAdjusted = dowDigits;
|
|
@@ -168,6 +174,10 @@ var CronParser = (function () {
|
|
|
168
174
|
for (var day in days) {
|
|
169
175
|
expressionParts[5] = expressionParts[5].replace(new RegExp(day, "gi"), days[day].toString());
|
|
170
176
|
}
|
|
177
|
+
expressionParts[5] = expressionParts[5]
|
|
178
|
+
.split(",")
|
|
179
|
+
.filter(function (item, index, items) { return item === "" || items.indexOf(item) === index; })
|
|
180
|
+
.join(",");
|
|
171
181
|
expressionParts[4] = expressionParts[4].replace(/(^\d{1,2})|([^#/\s\d]\d{1,2})/g, function (t) {
|
|
172
182
|
var dowDigits = t.replace(/\D/, "");
|
|
173
183
|
var dowDigitsAdjusted = dowDigits;
|
|
@@ -558,7 +568,7 @@ var ExpressionDescriptor = (function () {
|
|
|
558
568
|
format = _this.i18n.commaOnThe(dayOfWeekOfMonthNumber, dayOfWeek).trim() + _this.i18n.spaceX0OfTheMonth();
|
|
559
569
|
}
|
|
560
570
|
else if (s.indexOf("L") > -1) {
|
|
561
|
-
format = _this.i18n.commaOnTheLastX0OfTheMonth(s.replace("L", ""));
|
|
571
|
+
format = _this.i18n.commaOnTheLastX0OfTheMonth(s.split(",")[0].replace("L", ""));
|
|
562
572
|
}
|
|
563
573
|
else {
|
|
564
574
|
var domSpecified = _this.expressionParts[3] != "*";
|
|
@@ -1864,8 +1874,9 @@ var getPhraseByPlural = function (str, words) {
|
|
|
1864
1874
|
return strAsNumber < 2 ? words[0] : words[1];
|
|
1865
1875
|
};
|
|
1866
1876
|
var getPhraseByDayOfWeek = function (str, words) {
|
|
1877
|
+
var _a;
|
|
1867
1878
|
var strAsNumber = str != null ? Number(str) : 0;
|
|
1868
|
-
return words[[1, 0, 0, 1, 0, 0, 1][strAsNumber]];
|
|
1879
|
+
return words[(_a = [1, 0, 0, 1, 0, 0, 1][strAsNumber]) !== null && _a !== void 0 ? _a : 0];
|
|
1869
1880
|
};
|
|
1870
1881
|
var getNumberEnding = function (str, gender) {
|
|
1871
1882
|
var strAsNumber = str != null ? Number(str) : 1;
|