cronstrue 3.52.0 → 3.53.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
CHANGED
|
@@ -473,9 +473,10 @@ var ExpressionDescriptor = (function () {
|
|
|
473
473
|
bounds: { min: 0, max: 23 },
|
|
474
474
|
});
|
|
475
475
|
};
|
|
476
|
-
ExpressionDescriptor.prototype.getDayOfWeekDescription = function (dayOfWeekExpression) {
|
|
476
|
+
ExpressionDescriptor.prototype.getDayOfWeekDescription = function (dayOfWeekExpression, isFirstClause) {
|
|
477
477
|
var _this = this;
|
|
478
478
|
if (dayOfWeekExpression === void 0) { dayOfWeekExpression = this.expressionParts[5]; }
|
|
479
|
+
if (isFirstClause === void 0) { isFirstClause = true; }
|
|
479
480
|
var daysOfWeekNames = this.i18n.daysOfTheWeek();
|
|
480
481
|
var description = null;
|
|
481
482
|
if (dayOfWeekExpression == "*") {
|
|
@@ -487,7 +488,7 @@ var ExpressionDescriptor = (function () {
|
|
|
487
488
|
var _a, _b;
|
|
488
489
|
return ((_a = _this.getDayOfWeekDescription(items.join(","))) !== null && _a !== void 0 ? _a : "") +
|
|
489
490
|
"".concat(_this.i18n.spaceAnd(), " ") +
|
|
490
|
-
ExpressionDescriptor.removeLeadingComma((_b = _this.getDayOfWeekDescription(otherItems.join(","))) !== null && _b !== void 0 ? _b : "");
|
|
491
|
+
ExpressionDescriptor.removeLeadingComma((_b = _this.getDayOfWeekDescription(otherItems.join(","), false)) !== null && _b !== void 0 ? _b : "");
|
|
491
492
|
};
|
|
492
493
|
var nthOrLastItems = dayOfWeekItems.filter(function (s) { return /[#L]/.test(s); });
|
|
493
494
|
var plainItems = dayOfWeekItems.filter(function (s) { return !/[#L]/.test(s); });
|
|
@@ -511,6 +512,10 @@ var ExpressionDescriptor = (function () {
|
|
|
511
512
|
!this.options.logicalAndDayFields &&
|
|
512
513
|
!!andWord_1 &&
|
|
513
514
|
dayWithAnd_1.indexOf(andWord_1 + " ") == 0;
|
|
515
|
+
var nthOrLastAndPrefix_1 = isFirstClause && this.expressionParts[3] != "*" && !this.options.logicalAndDayFields ? andPrefix_1 : null;
|
|
516
|
+
var withNthOrLastAnd_1 = function (format) {
|
|
517
|
+
return nthOrLastAndPrefix_1 ? nthOrLastAndPrefix_1 + ExpressionDescriptor.removeLeadingComma(format) : format;
|
|
518
|
+
};
|
|
514
519
|
description = this.getSegmentDescription(dayOfWeekExpression, {
|
|
515
520
|
all: this.i18n.commaEveryDay(),
|
|
516
521
|
single: function (s, form) {
|
|
@@ -551,10 +556,10 @@ var ExpressionDescriptor = (function () {
|
|
|
551
556
|
if (s.indexOf("#") > -1) {
|
|
552
557
|
var dayOfWeekOfMonthNumber = s.substring(s.indexOf("#") + 1);
|
|
553
558
|
var dayOfWeek = s.substring(0, s.indexOf("#"));
|
|
554
|
-
format = _this.i18n.commaOnThe(dayOfWeekOfMonthNumber, dayOfWeek).trim() + _this.i18n.spaceX0OfTheMonth();
|
|
559
|
+
format = withNthOrLastAnd_1(_this.i18n.commaOnThe(dayOfWeekOfMonthNumber, dayOfWeek).trim() + _this.i18n.spaceX0OfTheMonth());
|
|
555
560
|
}
|
|
556
561
|
else if (s.indexOf("L") > -1) {
|
|
557
|
-
format = _this.i18n.commaOnTheLastX0OfTheMonth(s.split(",")[0].replace("L", ""));
|
|
562
|
+
format = withNthOrLastAnd_1(_this.i18n.commaOnTheLastX0OfTheMonth(s.split(",")[0].replace("L", "")));
|
|
558
563
|
}
|
|
559
564
|
else {
|
|
560
565
|
var domSpecified = _this.expressionParts[3] != "*";
|