cronstrue 3.12.0 → 3.14.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/README.md CHANGED
@@ -128,6 +128,7 @@ An options object can be passed as the second parameter to `cronstrue.toString`.
128
128
  - **dayOfWeekStartIndexZero: boolean** - Whether to interpret cron expression DOW `1` as Sunday or Monday. (Default: true)
129
129
  - **monthStartIndexZero: boolean** - Whether to interpret January as `0` or `1`. (Default: false)
130
130
  - **use24HourTimeFormat: boolean** - If true, descriptions will use a [24-hour clock](https://en.wikipedia.org/wiki/24-hour_clock) (Default: false but some translations will default to true)
131
+ - **trimHoursLeadingZero: boolean** - Whether to trim the leading zero that may appear in the hours description; e.g. "02:00 AM" -> "2:00 AM", "08:00" -> "8:00" (Default: false)
131
132
  - **locale: string** - The locale to use (Default: "en")
132
133
  - **logicalAndDayFields: boolean** - If true, descriptions for cron expressions with both day of month and day of week specified will follow a logical-AND wording rather than logical-OR wording; e.g. "...between day 11 and 17 of the month, only on Friday" rather than "...between day 11 and 17 of the month, and on Friday" (Default: false)
133
134
 
@@ -287,13 +287,14 @@ var ExpressionDescriptor = (function () {
287
287
  }
288
288
  }
289
289
  ExpressionDescriptor.toString = function (expression, _a) {
290
- var _b = _a === void 0 ? {} : _a, _c = _b.throwExceptionOnParseError, throwExceptionOnParseError = _c === void 0 ? true : _c, _d = _b.verbose, verbose = _d === void 0 ? false : _d, _e = _b.dayOfWeekStartIndexZero, dayOfWeekStartIndexZero = _e === void 0 ? true : _e, _f = _b.monthStartIndexZero, monthStartIndexZero = _f === void 0 ? false : _f, use24HourTimeFormat = _b.use24HourTimeFormat, _g = _b.locale, locale = _g === void 0 ? null : _g, _h = _b.logicalAndDayFields, logicalAndDayFields = _h === void 0 ? false : _h;
290
+ var _b = _a === void 0 ? {} : _a, _c = _b.throwExceptionOnParseError, throwExceptionOnParseError = _c === void 0 ? true : _c, _d = _b.verbose, verbose = _d === void 0 ? false : _d, _e = _b.dayOfWeekStartIndexZero, dayOfWeekStartIndexZero = _e === void 0 ? true : _e, _f = _b.monthStartIndexZero, monthStartIndexZero = _f === void 0 ? false : _f, use24HourTimeFormat = _b.use24HourTimeFormat, _g = _b.trimHoursLeadingZero, trimHoursLeadingZero = _g === void 0 ? false : _g, _h = _b.locale, locale = _h === void 0 ? null : _h, _j = _b.logicalAndDayFields, logicalAndDayFields = _j === void 0 ? false : _j;
291
291
  var options = {
292
292
  throwExceptionOnParseError: throwExceptionOnParseError,
293
293
  verbose: verbose,
294
294
  dayOfWeekStartIndexZero: dayOfWeekStartIndexZero,
295
295
  monthStartIndexZero: monthStartIndexZero,
296
296
  use24HourTimeFormat: use24HourTimeFormat,
297
+ trimHoursLeadingZero: trimHoursLeadingZero,
297
298
  locale: locale,
298
299
  logicalAndDayFields: logicalAndDayFields,
299
300
  };
@@ -752,7 +753,12 @@ var ExpressionDescriptor = (function () {
752
753
  if (secondExpression) {
753
754
  second = ":".concat(("00" + secondExpression).substring(secondExpression.length));
754
755
  }
755
- return "".concat(setPeriodBeforeTime ? period : "").concat(("00" + hour.toString()).substring(hour.toString().length), ":").concat(("00" + minute.toString()).substring(minute.toString().length)).concat(second).concat(!setPeriodBeforeTime ? period : "");
756
+ var hourStr = hour.toString();
757
+ var paddedHour = ("00" + hourStr).substring(hourStr.length);
758
+ var minuteStr = minute.toString();
759
+ var paddedMinute = ("00" + minuteStr).substring(minuteStr.length);
760
+ var displayHour = this.options.trimHoursLeadingZero ? hourStr : paddedHour;
761
+ return "".concat(setPeriodBeforeTime ? period : "").concat(displayHour, ":").concat(paddedMinute).concat(second).concat(!setPeriodBeforeTime ? period : "");
756
762
  };
757
763
  ExpressionDescriptor.prototype.transformVerbosity = function (description, useVerboseFormat) {
758
764
  if (!useVerboseFormat) {
@@ -4544,7 +4550,7 @@ var ko = (function () {
4544
4550
  return "시간 ";
4545
4551
  };
4546
4552
  ko.prototype.everyMinuteBetweenX0AndX1 = function () {
4547
- return "%s %s 사이에 매 분";
4553
+ return "매분 %s~%s";
4548
4554
  };
4549
4555
  ko.prototype.at = function () {
4550
4556
  return "시간";
@@ -4559,19 +4565,19 @@ var ko = (function () {
4559
4565
  return "%s초마다";
4560
4566
  };
4561
4567
  ko.prototype.secondsX0ThroughX1PastTheMinute = function () {
4562
- return "정분 후 %s초에서 %s초까지";
4568
+ return "%s~%s";
4563
4569
  };
4564
4570
  ko.prototype.atX0SecondsPastTheMinute = function () {
4565
- return "정분 후 %s초에서";
4571
+ return "%s";
4566
4572
  };
4567
4573
  ko.prototype.everyX0Minutes = function () {
4568
4574
  return "%s분마다";
4569
4575
  };
4570
4576
  ko.prototype.minutesX0ThroughX1PastTheHour = function () {
4571
- return "정시 후 %s분에서 %s분까지";
4577
+ return "%s~%s";
4572
4578
  };
4573
4579
  ko.prototype.atX0MinutesPastTheHour = function () {
4574
- return "정시 후 %s분에서";
4580
+ return "%s";
4575
4581
  };
4576
4582
  ko.prototype.everyX0Hours = function () {
4577
4583
  return "%s시간마다";
@@ -4610,10 +4616,10 @@ var ko = (function () {
4610
4616
  return "다섯 번째";
4611
4617
  };
4612
4618
  ko.prototype.commaOnThe = function () {
4613
- return ", 해당 ";
4619
+ return ", 매월 ";
4614
4620
  };
4615
4621
  ko.prototype.spaceX0OfTheMonth = function () {
4616
- return " 해당 월의 %s";
4622
+ return " %s";
4617
4623
  };
4618
4624
  ko.prototype.lastDay = function () {
4619
4625
  return "마지막 날";
@@ -4637,7 +4643,7 @@ var ko = (function () {
4637
4643
  return ", 해당 월의 마지막 날에";
4638
4644
  };
4639
4645
  ko.prototype.commaOnTheLastWeekdayOfTheMonth = function () {
4640
- return ", 해당 월의 마지막 평일에";
4646
+ return ", 매월 마지막 평일";
4641
4647
  };
4642
4648
  ko.prototype.commaDaysBeforeTheLastDayOfTheMonth = function () {
4643
4649
  return ", 해당 월의 마지막 날 %s일 전";
@@ -4649,7 +4655,7 @@ var ko = (function () {
4649
4655
  return "%s일과 가장 가까운 평일";
4650
4656
  };
4651
4657
  ko.prototype.commaOnTheX0OfTheMonth = function () {
4652
- return ", 해당 월의 %s";
4658
+ return ", 매월 %s";
4653
4659
  };
4654
4660
  ko.prototype.commaEveryX0Days = function () {
4655
4661
  return ", %s일마다";
@@ -4658,7 +4664,7 @@ var ko = (function () {
4658
4664
  return ", 해당 월의 %s일에서 %s일까지";
4659
4665
  };
4660
4666
  ko.prototype.commaOnDayX0OfTheMonth = function () {
4661
- return ", 해당 월의 %s일에";
4667
+ return ", 매월 %s";
4662
4668
  };
4663
4669
  ko.prototype.commaEveryMinute = function () {
4664
4670
  return ", 1분마다";