cronstrue 3.41.0 → 3.42.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.
@@ -474,7 +474,7 @@ var ExpressionDescriptor = (function () {
474
474
  };
475
475
  ExpressionDescriptor.prototype.getDayOfWeekDescription = function (dayOfWeekExpression) {
476
476
  var _this = this;
477
- var _a, _b;
477
+ var _a, _b, _c, _d;
478
478
  if (dayOfWeekExpression === void 0) { dayOfWeekExpression = this.expressionParts[5]; }
479
479
  var daysOfWeekNames = this.i18n.daysOfTheWeek();
480
480
  var description = null;
@@ -483,11 +483,19 @@ var ExpressionDescriptor = (function () {
483
483
  }
484
484
  else {
485
485
  var dayOfWeekItems = dayOfWeekExpression.split(",");
486
+ var nthOrLastItems = dayOfWeekItems.filter(function (s) { return /[#L]/.test(s); });
487
+ var plainItems = dayOfWeekItems.filter(function (s) { return !/[#L]/.test(s); });
488
+ if (plainItems.length > 0 && nthOrLastItems.some(function (s) { return s.indexOf("#") > -1; })) {
489
+ var nthOrLastDescription = (_a = this.getDayOfWeekDescription(nthOrLastItems.join(","))) !== null && _a !== void 0 ? _a : "";
490
+ return (((_b = this.getDayOfWeekDescription(plainItems.join(","))) !== null && _b !== void 0 ? _b : "") +
491
+ "".concat(this.i18n.spaceAnd(), " ") +
492
+ ExpressionDescriptor.removeLeadingComma(nthOrLastDescription));
493
+ }
486
494
  var lastItems = dayOfWeekItems.filter(function (s) { return s.indexOf("L") > -1; });
487
495
  var otherItems = dayOfWeekItems.filter(function (s) { return s.indexOf("L") === -1; });
488
496
  if (lastItems.length > 0 && otherItems.length > 0) {
489
- var lastDescription = (_a = this.getDayOfWeekDescription(lastItems.join(","))) !== null && _a !== void 0 ? _a : "";
490
- return (((_b = this.getDayOfWeekDescription(otherItems.join(","))) !== null && _b !== void 0 ? _b : "") +
497
+ var lastDescription = (_c = this.getDayOfWeekDescription(lastItems.join(","))) !== null && _c !== void 0 ? _c : "";
498
+ return (((_d = this.getDayOfWeekDescription(otherItems.join(","))) !== null && _d !== void 0 ? _d : "") +
491
499
  "".concat(this.i18n.spaceAnd(), " ") +
492
500
  ExpressionDescriptor.removeLeadingComma(lastDescription));
493
501
  }