Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cronstrue

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cronstrue - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

dist/cronstrue-i18n.js

330

dist/cronstrue.js

@@ -58,14 +58,32 @@ (function webpackUniversalModuleDefinition(root, factory) {

"use strict";
var stringUtilities_1 = __webpack_require__(1);
var cronParser_1 = __webpack_require__(2);
var LocalesManager = __webpack_require__(3);
var cronstrue = (function () {
function cronstrue(expression, options) {
var cronstrue_1 = __webpack_require__(1);
var enLocaleLoader_1 = __webpack_require__(4);
cronstrue_1.Cronstrue.initialize(new enLocaleLoader_1.enLocaleLoader());
module.exports = cronstrue_1.Cronstrue;
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var stringUtilities_1 = __webpack_require__(2);
var cronParser_1 = __webpack_require__(3);
var Cronstrue = (function () {
function Cronstrue(expression, options) {
this.expression = expression;
this.options = options;
this.expressionParts = new Array(5);
this.i18n = cronstrue.locales[options.locale || 'en'];
if (Cronstrue.locales[options.locale]) {
this.i18n = Cronstrue.locales[options.locale];
}
else {
this.i18n = Cronstrue.locales["en"];
}
if (options.use24HourTimeFormat === undefined) {
options.use24HourTimeFormat = this.i18n.Use24HourTimeFormatByDefault();
}
}
cronstrue.toString = function (expression, _a) {
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.use24HourTimeFormat, use24HourTimeFormat = _f === void 0 ? false : _f, _g = _b.locale, locale = _g === void 0 ? 'en' : _g;
Cronstrue.toString = function (expression, _a) {
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, use24HourTimeFormat = _b.use24HourTimeFormat, _f = _b.locale, locale = _f === void 0 ? "en" : _f;
var options = {

@@ -78,10 +96,12 @@ throwExceptionOnParseError: throwExceptionOnParseError,

};
var descripter = new cronstrue(expression, options);
var descripter = new Cronstrue(expression, options);
return descripter.getFullDescription();
};
cronstrue.initialize = function () {
cronstrue.specialCharacters = ["/", "-", ",", "*"];
LocalesManager.init(cronstrue.locales);
Cronstrue.initialize = function (localesLoader) {
Cronstrue.specialCharacters = ["/", "-", ",", "*"];
localesLoader.load(Cronstrue.locales);
};
cronstrue.prototype.getFullDescription = function () {
Cronstrue.locale = function (localeName) {
};
Cronstrue.prototype.getFullDescription = function () {
var description = "";

@@ -110,3 +130,3 @@ try {

};
cronstrue.prototype.getTimeOfDayDescription = function () {
Cronstrue.prototype.getTimeOfDayDescription = function () {
var secondsExpression = this.expressionParts[0];

@@ -116,5 +136,5 @@ var minuteExpression = this.expressionParts[1];

var description = "";
if (!stringUtilities_1.StringUtilities.containsAny(minuteExpression, cronstrue.specialCharacters)
&& !stringUtilities_1.StringUtilities.containsAny(hourExpression, cronstrue.specialCharacters)
&& !stringUtilities_1.StringUtilities.containsAny(secondsExpression, cronstrue.specialCharacters)) {
if (!stringUtilities_1.StringUtilities.containsAny(minuteExpression, Cronstrue.specialCharacters)
&& !stringUtilities_1.StringUtilities.containsAny(hourExpression, Cronstrue.specialCharacters)
&& !stringUtilities_1.StringUtilities.containsAny(secondsExpression, Cronstrue.specialCharacters)) {
description += this.i18n.AtSpace() + this.formatTime(hourExpression, minuteExpression, secondsExpression);

@@ -124,7 +144,7 @@ }

&& !(minuteExpression.indexOf(",") > -1)
&& !stringUtilities_1.StringUtilities.containsAny(hourExpression, cronstrue.specialCharacters)) {
&& !stringUtilities_1.StringUtilities.containsAny(hourExpression, Cronstrue.specialCharacters)) {
var minuteParts = minuteExpression.split("-");
description += stringUtilities_1.StringUtilities.format(this.i18n.EveryMinuteBetweenX0AndX1(), this.formatTime(hourExpression, minuteParts[0], ""), this.formatTime(hourExpression, minuteParts[1], ""));
}
else if (hourExpression.indexOf(",") > -1 && !stringUtilities_1.StringUtilities.containsAny(minuteExpression, cronstrue.specialCharacters)) {
else if (hourExpression.indexOf(",") > -1 && !stringUtilities_1.StringUtilities.containsAny(minuteExpression, Cronstrue.specialCharacters)) {
var hourParts = hourExpression.split(",");

@@ -159,3 +179,3 @@ description += this.i18n.At();

};
cronstrue.prototype.getSecondsDescription = function () {
Cronstrue.prototype.getSecondsDescription = function () {
var _this = this;

@@ -169,3 +189,3 @@ var description = this.getSegmentDescription(this.expressionParts[0], this.i18n.EverySecond(), function (s) { return s; }, function (s) { return stringUtilities_1.StringUtilities.format(_this.i18n.EveryX0Seconds(), s); }, function (s) { return _this.i18n.SecondsX0ThroughX1PastTheMinute(); }, function (s) {

};
cronstrue.prototype.getMinutesDescription = function () {
Cronstrue.prototype.getMinutesDescription = function () {
var _this = this;

@@ -184,3 +204,3 @@ var description = this.getSegmentDescription(this.expressionParts[1], this.i18n.EveryMinute(), function (s) { return s; }, function (s) { return stringUtilities_1.StringUtilities.format(_this.i18n.EveryX0Minutes(), s); }, function (s) { return _this.i18n.MinutesX0ThroughX1PastTheHour(); }, function (s) {

};
cronstrue.prototype.getHoursDescription = function () {
Cronstrue.prototype.getHoursDescription = function () {
var _this = this;

@@ -191,5 +211,5 @@ var expression = this.expressionParts[2];

};
cronstrue.prototype.getDayOfWeekDescription = function () {
Cronstrue.prototype.getDayOfWeekDescription = function () {
var _this = this;
var daysOfWeekNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var daysOfWeekNames = this.i18n.DaysOfTheWeek();
var description = this.getSegmentDescription(this.expressionParts[5], this.i18n.ComaEveryDay(), function (s) {

@@ -238,10 +258,9 @@ var exp = s;

};
cronstrue.prototype.getMonthDescription = function () {
Cronstrue.prototype.getMonthDescription = function () {
var _this = this;
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
var monthNames = this.i18n.MonthsOfTheYear();
var description = this.getSegmentDescription(this.expressionParts[4], "", function (s) { return monthNames[(parseInt(s) - 1)]; }, function (s) { return stringUtilities_1.StringUtilities.format(_this.i18n.ComaEveryX0Months(), s); }, function (s) { return _this.i18n.ComaMonthX0ThroughMonthX1() || _this.i18n.ComaX0ThroughX1(); }, function (s) { return _this.i18n.ComaOnlyInX0(); });
return description;
};
cronstrue.prototype.getDayOfMonthDescription = function () {
Cronstrue.prototype.getDayOfMonthDescription = function () {
var _this = this;

@@ -277,3 +296,3 @@ var description = null;

};
cronstrue.prototype.getYearDescription = function () {
Cronstrue.prototype.getYearDescription = function () {
var _this = this;

@@ -283,3 +302,3 @@ var description = this.getSegmentDescription(this.expressionParts[6], "", function (s) { return /^\d+$/.test(s) ? new Date(parseInt(s), 1).getFullYear().toString() : s; }, function (s) { return stringUtilities_1.StringUtilities.format(_this.i18n.ComaEveryX0Years(), s); }, function (s) { return _this.i18n.ComaYearX0ThroughYearX1() || _this.i18n.ComaX0ThroughX1(); }, function (s) { return _this.i18n.ComaOnlyInX0(); });

};
cronstrue.prototype.getSegmentDescription = function (expression, allDescription, getSingleItemDescription, getIntervalDescriptionFormat, getBetweenDescriptionFormat, getDescriptionFormat) {
Cronstrue.prototype.getSegmentDescription = function (expression, allDescription, getSingleItemDescription, getIntervalDescriptionFormat, getBetweenDescriptionFormat, getDescriptionFormat) {
var _this = this;

@@ -341,3 +360,3 @@ var description = null;

};
cronstrue.prototype.generateBetweenSegmentDescription = function (betweenExpression, getBetweenDescriptionFormat, getSingleItemDescription) {
Cronstrue.prototype.generateBetweenSegmentDescription = function (betweenExpression, getBetweenDescriptionFormat, getSingleItemDescription) {
var description = "";

@@ -352,3 +371,3 @@ var betweenSegments = betweenExpression.split('-');

};
cronstrue.prototype.formatTime = function (hourExpression, minuteExpression, secondExpression) {
Cronstrue.prototype.formatTime = function (hourExpression, minuteExpression, secondExpression) {
var hour = parseInt(hourExpression);

@@ -365,7 +384,7 @@ var period = "";

if (secondExpression) {
second = ":" + ('00' + secondExpression).substring(secondExpression.length);
second = ":" + ("00" + secondExpression).substring(secondExpression.length);
}
return ('00' + hour.toString()).substring(hour.toString().length) + ":" + ('00' + minute.toString()).substring(minute.toString().length) + second + period;
return ("00" + hour.toString()).substring(hour.toString().length) + ":" + ("00" + minute.toString()).substring(minute.toString().length) + second + period;
};
cronstrue.prototype.transformVerbosity = function (description, useVerboseFormat) {
Cronstrue.prototype.transformVerbosity = function (description, useVerboseFormat) {
if (!useVerboseFormat) {

@@ -378,11 +397,10 @@ description = description.replace(new RegExp(this.i18n.ComaEveryMinute(), 'g'), "");

};
cronstrue.locales = {};
return cronstrue;
Cronstrue.locales = {};
return Cronstrue;
}());
cronstrue.initialize();
module.exports = cronstrue;
exports.Cronstrue = Cronstrue;
/***/ },
/* 1 */
/* 2 */
/***/ function(module, exports) {

@@ -412,3 +430,3 @@

/***/ },
/* 2 */
/* 3 */
/***/ function(module, exports) {

@@ -425,3 +443,3 @@

if (!this.expression) {
throw new Error('Expression is empty');
throw new Error("Expression is empty");
}

@@ -433,4 +451,4 @@ var parsed = this.expression.trim().split(' ');

else if (parsed.length == 5) {
parsed.unshift('');
parsed.push('');
parsed.unshift("");
parsed.push("");
}

@@ -486,3 +504,3 @@ else if (parsed.length == 6) {

var days = {
'SUN': 0, 'MON': 1, 'TUE': 2, 'WED': 3, 'THU': 4, 'FRI': 5, 'SAT': 6
"SUN": 0, "MON": 1, "TUE": 2, "WED": 3, "THU": 4, "FRI": 5, "SAT": 6
};

@@ -493,3 +511,3 @@ for (var day in days) {

var months = {
'JAN': 1, 'FEB': 2, 'MAR': 3, 'APR': 4, 'MAY': 5, 'JUN': 6, 'JUL': 7, 'AUG': 8, 'SEP': 9, 'OCT': 10, 'NOV': 11, 'DEC': 12
"JAN": 1, "FEB": 2, "MAR": 3, "APR": 4, "MAY": 5, "JUN": 6, "JUL": 7, "AUG": 8, "SEP": 9, "OCT": 10, "NOV": 11, "DEC": 12
};

@@ -524,3 +542,3 @@ for (var month in months) {

if (stepRangeThrough != null) {
var parts = expressionParts[i].split('/');
var parts = expressionParts[i].split("/");
expressionParts[i] = parts[0] + "-" + stepRangeThrough + "/" + parts[1];

@@ -537,19 +555,2 @@ }

/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
var availableLocales = __webpack_require__(4);
function init(locales) {
for (var property in availableLocales) {
if (availableLocales.hasOwnProperty(property)) {
var locale = new (availableLocales[property]);
locales[property] = locale;
}
}
}
exports.init = init;
/***/ },
/* 4 */

@@ -560,3 +561,11 @@ /***/ function(module, exports, __webpack_require__) {

var en_1 = __webpack_require__(5);
exports.en = en_1.en;
var enLocaleLoader = (function () {
function enLocaleLoader() {
}
enLocaleLoader.prototype.load = function (availableLocales) {
availableLocales["en"] = new en_1.en();
};
return enLocaleLoader;
}());
exports.enLocaleLoader = enLocaleLoader;

@@ -572,94 +581,189 @@

}
en.prototype.AnErrorOccuredWhenGeneratingTheExpressionD = function () { return "An error occured when generating the expression description. Check the cron expression syntax."; };
en.prototype.AtX0SecondsPastTheMinuteGt20 = function () { return null; };
en.prototype.AtX0MinutesPastTheHourGt20 = function () { return null; };
en.prototype.ComaMonthX0ThroughMonthX1 = function () { return null; };
en.prototype.ComaYearX0ThroughYearX1 = function () { return null; };
en.prototype.Use24HourTimeFormatByDefault = function () { return false; };
en.prototype.AnErrorOccuredWhenGeneratingTheExpressionD = function () {
return "An error occured when generating the expression description. Check the cron expression syntax.";
};
;
en.prototype.EveryMinute = function () { return "every minute"; };
en.prototype.EveryMinute = function () {
return "every minute";
};
;
en.prototype.EveryHour = function () { return "every hour"; };
en.prototype.EveryHour = function () {
return "every hour";
};
;
en.prototype.AtSpace = function () { return "At "; };
en.prototype.AtSpace = function () {
return "At ";
};
;
en.prototype.EveryMinuteBetweenX0AndX1 = function () { return "Every minute between %s and %s"; };
en.prototype.EveryMinuteBetweenX0AndX1 = function () {
return "Every minute between %s and %s";
};
;
en.prototype.At = function () { return "At"; };
en.prototype.At = function () {
return "At";
};
;
en.prototype.SpaceAnd = function () { return " and"; };
en.prototype.SpaceAnd = function () {
return " and";
};
;
en.prototype.EverySecond = function () { return "every second"; };
en.prototype.EverySecond = function () {
return "every second";
};
;
en.prototype.EveryX0Seconds = function () { return "every %s seconds"; };
en.prototype.EveryX0Seconds = function () {
return "every %s seconds";
};
;
en.prototype.SecondsX0ThroughX1PastTheMinute = function () { return "seconds %s through %s past the minute"; };
en.prototype.SecondsX0ThroughX1PastTheMinute = function () {
return "seconds %s through %s past the minute";
};
;
en.prototype.AtX0SecondsPastTheMinute = function () { return "at %s seconds past the minute"; };
en.prototype.AtX0SecondsPastTheMinute = function () {
return "at %s seconds past the minute";
};
;
en.prototype.AtX0SecondsPastTheMinuteGt20 = function () { return null; };
en.prototype.EveryX0Minutes = function () { return "every %s minutes"; };
en.prototype.EveryX0Minutes = function () {
return "every %s minutes";
};
;
en.prototype.MinutesX0ThroughX1PastTheHour = function () { return "minutes %s through %s past the hour"; };
en.prototype.MinutesX0ThroughX1PastTheHour = function () {
return "minutes %s through %s past the hour";
};
;
en.prototype.AtX0MinutesPastTheHour = function () { return "at %s minutes past the hour"; };
en.prototype.AtX0MinutesPastTheHour = function () {
return "at %s minutes past the hour";
};
;
en.prototype.AtX0MinutesPastTheHourGt20 = function () { return null; };
en.prototype.EveryX0Hours = function () { return "every %s hours"; };
en.prototype.EveryX0Hours = function () {
return "every %s hours";
};
;
en.prototype.BetweenX0AndX1 = function () { return "between %s and %s"; };
en.prototype.BetweenX0AndX1 = function () {
return "between %s and %s";
};
;
en.prototype.AtX0 = function () { return "at %s"; };
en.prototype.AtX0 = function () {
return "at %s";
};
;
en.prototype.ComaEveryDay = function () { return ", every day"; };
en.prototype.ComaEveryDay = function () {
return ", every day";
};
;
en.prototype.ComaEveryX0DaysOfTheWeek = function () { return ", every %s days of the week"; };
en.prototype.ComaEveryX0DaysOfTheWeek = function () {
return ", every %s days of the week";
};
;
en.prototype.ComaX0ThroughX1 = function () { return ", %s through %s"; };
en.prototype.ComaX0ThroughX1 = function () {
return ", %s through %s";
};
;
en.prototype.ComaMonthX0ThroughMonthX1 = function () { return null; };
en.prototype.ComaYearX0ThroughYearX1 = function () { return null; };
en.prototype.First = function () { return "first"; };
en.prototype.First = function () {
return "first";
};
;
en.prototype.Second = function () { return "second"; };
en.prototype.Second = function () {
return "second";
};
;
en.prototype.Third = function () { return "third"; };
en.prototype.Third = function () {
return "third";
};
;
en.prototype.Forth = function () { return "forth"; };
en.prototype.Forth = function () {
return "forth";
};
;
en.prototype.Fifth = function () { return "fifth"; };
en.prototype.Fifth = function () {
return "fifth";
};
;
en.prototype.ComaOnThe = function () { return ", on the "; };
en.prototype.ComaOnThe = function () {
return ", on the ";
};
;
en.prototype.SpaceX0OfTheMonth = function () { return " %s of the month"; };
en.prototype.SpaceX0OfTheMonth = function () {
return " %s of the month";
};
;
en.prototype.ComaOnTheLastX0OfTheMonth = function () { return ", on the last %s of the month"; };
en.prototype.ComaOnTheLastX0OfTheMonth = function () {
return ", on the last %s of the month";
};
;
en.prototype.ComaOnlyOnX0 = function () { return ", only on %s"; };
en.prototype.ComaOnlyOnX0 = function () {
return ", only on %s";
};
;
en.prototype.ComaEveryX0Months = function () { return ", every %s months"; };
en.prototype.ComaEveryX0Months = function () {
return ", every %s months";
};
;
en.prototype.ComaOnlyInX0 = function () { return ", only in %s"; };
en.prototype.ComaOnlyInX0 = function () {
return ", only in %s";
};
;
en.prototype.ComaOnTheLastDayOfTheMonth = function () { return ", on the last day of the month"; };
en.prototype.ComaOnTheLastDayOfTheMonth = function () {
return ", on the last day of the month";
};
;
en.prototype.ComaOnTheLastWeekdayOfTheMonth = function () { return ", on the last weekday of the month"; };
en.prototype.ComaOnTheLastWeekdayOfTheMonth = function () {
return ", on the last weekday of the month";
};
;
en.prototype.FirstWeekday = function () { return "first weekday"; };
en.prototype.FirstWeekday = function () {
return "first weekday";
};
;
en.prototype.WeekdayNearestDayX0 = function () { return "weekday nearest day %s"; };
en.prototype.WeekdayNearestDayX0 = function () {
return "weekday nearest day %s";
};
;
en.prototype.ComaOnTheX0OfTheMonth = function () { return ", on the %s of the month"; };
en.prototype.ComaOnTheX0OfTheMonth = function () {
return ", on the %s of the month";
};
;
en.prototype.ComaEveryX0Days = function () { return ", every %s days"; };
en.prototype.ComaEveryX0Days = function () {
return ", every %s days";
};
;
en.prototype.ComaBetweenDayX0AndX1OfTheMonth = function () { return ", between day %s and %s of the month"; };
en.prototype.ComaBetweenDayX0AndX1OfTheMonth = function () {
return ", between day %s and %s of the month";
};
;
en.prototype.ComaOnDayX0OfTheMonth = function () { return ", on day %s of the month"; };
en.prototype.ComaOnDayX0OfTheMonth = function () {
return ", on day %s of the month";
};
;
en.prototype.SpaceAndSpace = function () { return " and "; };
en.prototype.SpaceAndSpace = function () {
return " and ";
};
;
en.prototype.ComaEveryMinute = function () { return ", every minute"; };
en.prototype.ComaEveryMinute = function () {
return ", every minute";
};
;
en.prototype.ComaEveryHour = function () { return ", every hour"; };
en.prototype.ComaEveryHour = function () {
return ", every hour";
};
;
en.prototype.ComaEveryX0Years = function () { return ", every %s years"; };
en.prototype.ComaEveryX0Years = function () {
return ", every %s years";
};
;
en.prototype.CommaStartingX0 = function () { return ", starting %s"; };
en.prototype.CommaStartingX0 = function () {
return ", starting %s";
};
;
en.prototype.DaysOfTheWeek = function () {
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
};
en.prototype.MonthsOfTheYear = function () {
return ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
};
return en;

@@ -666,0 +770,0 @@ }());

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cronstrue",[],e):"object"==typeof exports?exports.cronstrue=e():t.cronstrue=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1),i=n(2),o=n(3),s=function(){function t(e,n){this.expression=e,this.options=n,this.expressionParts=new Array(5),this.i18n=t.locales[n.locale||"en"]}return t.toString=function(e,n){var r=void 0===n?{}:n,i=r.throwExceptionOnParseError,o=void 0===i||i,s=r.verbose,a=void 0!==s&&s,u=r.dayOfWeekStartIndexZero,p=void 0===u||u,c=r.use24HourTimeFormat,h=void 0!==c&&c,f=r.locale,y=void 0===f?"en":f,l={throwExceptionOnParseError:o,verbose:a,dayOfWeekStartIndexZero:p,use24HourTimeFormat:h,locale:y},g=new t(e,l);return g.getFullDescription()},t.initialize=function(){t.specialCharacters=["/","-",",","*"],o.init(t.locales)},t.prototype.getFullDescription=function(){var t="";try{var e=new i.CronParser(this.expression,this.options.dayOfWeekStartIndexZero);this.expressionParts=e.parse();var n=this.getTimeOfDayDescription(),r=this.getDayOfMonthDescription(),o=this.getMonthDescription(),s=this.getDayOfWeekDescription(),a=this.getYearDescription();t+=n+r+s+o+a,t=this.transformVerbosity(t,this.options.verbose),t=t.charAt(0).toLocaleUpperCase()+t.substr(1)}catch(u){if(this.options.throwExceptionOnParseError)throw""+u;t=this.i18n.AnErrorOccuredWhenGeneratingTheExpressionD()}return t},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],n=this.expressionParts[1],i=this.expressionParts[2],o="";if(r.StringUtilities.containsAny(n,t.specialCharacters)||r.StringUtilities.containsAny(i,t.specialCharacters)||r.StringUtilities.containsAny(e,t.specialCharacters))if(!(n.indexOf("-")>-1)||n.indexOf(",")>-1||r.StringUtilities.containsAny(i,t.specialCharacters))if(i.indexOf(",")>-1&&!r.StringUtilities.containsAny(n,t.specialCharacters)){var s=i.split(",");o+=this.i18n.At();for(var a=0;a<s.length;a++)o+=" ",o+=this.formatTime(s[a],n,""),a<s.length-2&&(o+=","),a==s.length-2&&(o+=this.i18n.SpaceAnd())}else{var u=this.getSecondsDescription(),p=this.getMinutesDescription(),c=this.getHoursDescription();o+=u,o.length>0&&(o+=", "),o+=p,o.length>0&&(o+=", "),o+=c}else{var h=n.split("-");o+=r.StringUtilities.format(this.i18n.EveryMinuteBetweenX0AndX1(),this.formatTime(i,h[0],""),this.formatTime(i,h[1],""))}else o+=this.i18n.AtSpace()+this.formatTime(i,n,e);return o},t.prototype.getSecondsDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[0],this.i18n.EverySecond(),function(t){return t},function(e){return r.StringUtilities.format(t.i18n.EveryX0Seconds(),e)},function(e){return t.i18n.SecondsX0ThroughX1PastTheMinute()},function(e){return"0"==e?"":parseInt(e)<20?t.i18n.AtX0SecondsPastTheMinute():t.i18n.AtX0SecondsPastTheMinuteGt20()||t.i18n.AtX0SecondsPastTheMinute()});return e},t.prototype.getMinutesDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[1],this.i18n.EveryMinute(),function(t){return t},function(e){return r.StringUtilities.format(t.i18n.EveryX0Minutes(),e)},function(e){return t.i18n.MinutesX0ThroughX1PastTheHour()},function(e){try{return"0"==e?"":parseInt(e)<20?t.i18n.AtX0MinutesPastTheHour():t.i18n.AtX0MinutesPastTheHourGt20()||t.i18n.AtX0MinutesPastTheHour()}catch(n){return t.i18n.AtX0MinutesPastTheHour()}});return e},t.prototype.getHoursDescription=function(){var t=this,e=this.expressionParts[2],n=this.getSegmentDescription(e,this.i18n.EveryHour(),function(e){return t.formatTime(e,"0","")},function(e){return r.StringUtilities.format(t.i18n.EveryX0Hours(),e)},function(e){return t.i18n.BetweenX0AndX1()},function(e){return t.i18n.AtX0()});return n},t.prototype.getDayOfWeekDescription=function(){var t=this,e=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n=this.getSegmentDescription(this.expressionParts[5],this.i18n.ComaEveryDay(),function(t){var n=t;return t.indexOf("#")>-1?n=t.substr(0,t.indexOf("#")):t.indexOf("L")>-1&&(n=n.replace("L","")),e[parseInt(n)]},function(e){return r.StringUtilities.format(t.i18n.ComaEveryX0DaysOfTheWeek(),e)},function(e){return t.i18n.ComaX0ThroughX1()},function(e){var n=null;if(e.indexOf("#")>-1){var r=e.substring(e.indexOf("#")+1),i=null;switch(r){case"1":i=t.i18n.First();break;case"2":i=t.i18n.Second();break;case"3":i=t.i18n.Third();break;case"4":i=t.i18n.Forth();break;case"5":i=t.i18n.Fifth()}n=t.i18n.ComaOnThe()+i+t.i18n.SpaceX0OfTheMonth()}else n=e.indexOf("L")>-1?t.i18n.ComaOnTheLastX0OfTheMonth():t.i18n.ComaOnlyOnX0();return n});return n},t.prototype.getMonthDescription=function(){var t=this,e=["January","February","March","April","May","June","July","August","September","October","November","December"],n=this.getSegmentDescription(this.expressionParts[4],"",function(t){return e[parseInt(t)-1]},function(e){return r.StringUtilities.format(t.i18n.ComaEveryX0Months(),e)},function(e){return t.i18n.ComaMonthX0ThroughMonthX1()||t.i18n.ComaX0ThroughX1()},function(e){return t.i18n.ComaOnlyInX0()});return n},t.prototype.getDayOfMonthDescription=function(){var t=this,e=null,n=this.expressionParts[3];switch(n){case"L":e=this.i18n.ComaOnTheLastDayOfTheMonth();break;case"WL":case"LW":e=this.i18n.ComaOnTheLastWeekdayOfTheMonth();break;default:var i=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(i){var o=parseInt(i[0].replace("W","")),s=1==o?this.i18n.FirstWeekday():r.StringUtilities.format(this.i18n.WeekdayNearestDayX0(),o.toString());e=r.StringUtilities.format(this.i18n.ComaOnTheX0OfTheMonth(),s);break}e=this.getSegmentDescription(n,this.i18n.ComaEveryDay(),function(t){return t},function(e){return"1"==e?t.i18n.ComaEveryDay():t.i18n.ComaEveryX0Days()},function(e){return t.i18n.ComaBetweenDayX0AndX1OfTheMonth()},function(e){return t.i18n.ComaOnDayX0OfTheMonth()})}return e},t.prototype.getYearDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[6],"",function(t){return/^\d+$/.test(t)?new Date(parseInt(t),1).getFullYear().toString():t},function(e){return r.StringUtilities.format(t.i18n.ComaEveryX0Years(),e)},function(e){return t.i18n.ComaYearX0ThroughYearX1()||t.i18n.ComaX0ThroughX1()},function(e){return t.i18n.ComaOnlyInX0()});return e},t.prototype.getSegmentDescription=function(t,e,n,i,o,s){var a=this,u=null;if(t)if("*"===t)u=e;else if(r.StringUtilities.containsAny(t,["/","-",","]))if(t.indexOf("/")>-1){var p=t.split("/");if(u=r.StringUtilities.format(i(p[1]),n(p[1])),p[0].indexOf("-")>-1){var c=this.generateBetweenSegmentDescription(p[0],o,n);0!=c.indexOf(", ")&&(u+=", "),u+=c}else if(!r.StringUtilities.containsAny(p[0],["*",","])){var h=r.StringUtilities.format(s(p[0]),n(p[0]));h=h.replace(", ",""),u+=r.StringUtilities.format(this.i18n.CommaStartingX0(),h)}}else if(t.indexOf(",")>-1){for(var p=t.split(","),f="",y=0;y<p.length;y++)if(y>0&&p.length>2&&(f+=",",y<p.length-1&&(f+=" ")),y>0&&p.length>1&&(y==p.length-1||2==p.length)&&(f+=this.i18n.SpaceAndSpace()),p[y].indexOf("-")>-1){var c=this.generateBetweenSegmentDescription(p[y],function(t){return a.i18n.ComaX0ThroughX1()},n);c=c.replace(", ",""),f+=c}else f+=n(p[y]);u=r.StringUtilities.format(s(t),f)}else t.indexOf("-")>-1&&(u=this.generateBetweenSegmentDescription(t,o,n));else u=r.StringUtilities.format(s(t),n(t));else u="";return u},t.prototype.generateBetweenSegmentDescription=function(t,e,n){var i="",o=t.split("-"),s=n(o[0]),a=n(o[1]);a=a.replace(":00",":59");var u=e(t);return i+=r.StringUtilities.format(u,s,a)},t.prototype.formatTime=function(t,e,n){var r=parseInt(t),i="";this.options.use24HourTimeFormat||(i=r>=12?" PM":" AM",r>12&&(r-=12));var o=e,s="";return n&&(s=":"+("00"+n).substring(n.length)),("00"+r.toString()).substring(r.toString().length)+":"+("00"+o.toString()).substring(o.toString().length)+s+i},t.prototype.transformVerbosity=function(t,e){return e||(t=t.replace(new RegExp(this.i18n.ComaEveryMinute(),"g"),""),t=t.replace(new RegExp(this.i18n.ComaEveryHour(),"g"),""),t=t.replace(new RegExp(this.i18n.ComaEveryDay(),"g"),"")),t},t.locales={},t}();s.initialize(),t.exports=s},function(t,e){"use strict";var n=function(){function t(){}return t.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.replace(/%s/g,function(){return e.shift()})},t.containsAny=function(t,e){return e.some(function(e){return t.indexOf(e)>-1})},t}();e.StringUtilities=n},function(t,e){"use strict";var n=function(){function t(t,e){void 0===e&&(e=!0),this.expression=t,this.dayOfWeekStartIndexZero=e}return t.prototype.parse=function(){if(!this.expression)throw new Error("Expression is empty");var t=this.expression.trim().split(" ");if(t.length<5)throw new Error("Expression only has "+t.length+" parts. At least 5 part are required.");if(5==t.length)t.unshift(""),t.push("");else if(6==t.length)/\d{4}$/.test(t[5])?t.unshift(""):t.push("");else if(t.length>7)throw new Error("Expression has "+t.length+" parts; too many!");return this.normalizeExpression(t),t},t.prototype.normalizeExpression=function(t){t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),0==t[0].indexOf("0/")&&(t[0]=t[0].replace("0/","*/")),0==t[1].indexOf("0/")&&(t[1]=t[1].replace("0/","*/")),0==t[2].indexOf("0/")&&(t[2]=t[2].replace("0/","*/")),0==t[3].indexOf("1/")&&(t[3]=t[3].replace("1/","*/")),0==t[4].indexOf("1/")&&(t[4]=t[4].replace("1/","*/")),0==t[5].indexOf("1/")&&(t[5]=t[5].replace("1/","*/")),0==t[6].indexOf("1/")&&(t[6]=t[6].replace("1/","*/")),this.dayOfWeekStartIndexZero||(t[5]=t[5].replace(/(^\d)|([^#\/\s]\d)+/g,function(t){var e=t.replace(/\D/,""),n=(parseInt(e)-1).toString();return t.replace(e,n)})),"?"==t[3]&&(t[3]="*");var e={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var n in e)t[5]=t[5].replace(new RegExp(n,"g"),e[n].toString());var r={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var i in r)t[4]=t[4].replace(new RegExp(i,"g"),r[i].toString());"0"==t[0]&&(t[0]="");for(var o=0;o<t.length;o++)if("*/1"==t[o]&&(t[o]="*"),t[o].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[o])){var s=null;switch(o){case 4:s="12";break;case 5:s="6";break;case 6:s="9999";break;default:s=null}if(null!=s){var a=t[o].split("/");t[o]=a[0]+"-"+s+"/"+a[1]}}},t}();e.CronParser=n},function(t,e,n){"use strict";function r(t){for(var e in i)if(i.hasOwnProperty(e)){var n=new i[e];t[e]=n}}var i=n(4);e.init=r},function(t,e,n){"use strict";var r=n(5);e.en=r.en},function(t,e){"use strict";var n=function(){function t(){}return t.prototype.AnErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},t.prototype.EveryMinute=function(){return"every minute"},t.prototype.EveryHour=function(){return"every hour"},t.prototype.AtSpace=function(){return"At "},t.prototype.EveryMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},t.prototype.At=function(){return"At"},t.prototype.SpaceAnd=function(){return" and"},t.prototype.EverySecond=function(){return"every second"},t.prototype.EveryX0Seconds=function(){return"every %s seconds"},t.prototype.SecondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},t.prototype.AtX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},t.prototype.AtX0SecondsPastTheMinuteGt20=function(){return null},t.prototype.EveryX0Minutes=function(){return"every %s minutes"},t.prototype.MinutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},t.prototype.AtX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},t.prototype.AtX0MinutesPastTheHourGt20=function(){return null},t.prototype.EveryX0Hours=function(){return"every %s hours"},t.prototype.BetweenX0AndX1=function(){return"between %s and %s"},t.prototype.AtX0=function(){return"at %s"},t.prototype.ComaEveryDay=function(){return", every day"},t.prototype.ComaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},t.prototype.ComaX0ThroughX1=function(){return", %s through %s"},t.prototype.ComaMonthX0ThroughMonthX1=function(){return null},t.prototype.ComaYearX0ThroughYearX1=function(){return null},t.prototype.First=function(){return"first"},t.prototype.Second=function(){return"second"},t.prototype.Third=function(){return"third"},t.prototype.Forth=function(){return"forth"},t.prototype.Fifth=function(){return"fifth"},t.prototype.ComaOnThe=function(){return", on the "},t.prototype.SpaceX0OfTheMonth=function(){return" %s of the month"},t.prototype.ComaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},t.prototype.ComaOnlyOnX0=function(){return", only on %s"},t.prototype.ComaEveryX0Months=function(){return", every %s months"},t.prototype.ComaOnlyInX0=function(){return", only in %s"},t.prototype.ComaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},t.prototype.ComaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},t.prototype.FirstWeekday=function(){return"first weekday"},t.prototype.WeekdayNearestDayX0=function(){return"weekday nearest day %s"},t.prototype.ComaOnTheX0OfTheMonth=function(){return", on the %s of the month"},t.prototype.ComaEveryX0Days=function(){return", every %s days"},t.prototype.ComaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},t.prototype.ComaOnDayX0OfTheMonth=function(){return", on day %s of the month"},t.prototype.SpaceAndSpace=function(){return" and "},t.prototype.ComaEveryMinute=function(){return", every minute"},t.prototype.ComaEveryHour=function(){return", every hour"},t.prototype.ComaEveryX0Years=function(){return", every %s years"},t.prototype.CommaStartingX0=function(){return", starting %s"},t}();e.en=n}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cronstrue",[],e):"object"==typeof exports?exports.cronstrue=e():t.cronstrue=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1),i=n(4);r.Cronstrue.initialize(new i.enLocaleLoader),t.exports=r.Cronstrue},function(t,e,n){"use strict";var r=n(2),i=n(3),o=function(){function t(e,n){this.expression=e,this.options=n,this.expressionParts=new Array(5),t.locales[n.locale]?this.i18n=t.locales[n.locale]:this.i18n=t.locales.en,void 0===n.use24HourTimeFormat&&(n.use24HourTimeFormat=this.i18n.Use24HourTimeFormatByDefault())}return t.toString=function(e,n){var r=void 0===n?{}:n,i=r.throwExceptionOnParseError,o=void 0===i||i,s=r.verbose,a=void 0!==s&&s,u=r.dayOfWeekStartIndexZero,c=void 0===u||u,p=r.use24HourTimeFormat,h=r.locale,f=void 0===h?"en":h,y={throwExceptionOnParseError:o,verbose:a,dayOfWeekStartIndexZero:c,use24HourTimeFormat:p,locale:f},l=new t(e,y);return l.getFullDescription()},t.initialize=function(e){t.specialCharacters=["/","-",",","*"],e.load(t.locales)},t.locale=function(t){},t.prototype.getFullDescription=function(){var t="";try{var e=new i.CronParser(this.expression,this.options.dayOfWeekStartIndexZero);this.expressionParts=e.parse();var n=this.getTimeOfDayDescription(),r=this.getDayOfMonthDescription(),o=this.getMonthDescription(),s=this.getDayOfWeekDescription(),a=this.getYearDescription();t+=n+r+s+o+a,t=this.transformVerbosity(t,this.options.verbose),t=t.charAt(0).toLocaleUpperCase()+t.substr(1)}catch(u){if(this.options.throwExceptionOnParseError)throw""+u;t=this.i18n.AnErrorOccuredWhenGeneratingTheExpressionD()}return t},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],n=this.expressionParts[1],i=this.expressionParts[2],o="";if(r.StringUtilities.containsAny(n,t.specialCharacters)||r.StringUtilities.containsAny(i,t.specialCharacters)||r.StringUtilities.containsAny(e,t.specialCharacters))if(!(n.indexOf("-")>-1)||n.indexOf(",")>-1||r.StringUtilities.containsAny(i,t.specialCharacters))if(i.indexOf(",")>-1&&!r.StringUtilities.containsAny(n,t.specialCharacters)){var s=i.split(",");o+=this.i18n.At();for(var a=0;a<s.length;a++)o+=" ",o+=this.formatTime(s[a],n,""),a<s.length-2&&(o+=","),a==s.length-2&&(o+=this.i18n.SpaceAnd())}else{var u=this.getSecondsDescription(),c=this.getMinutesDescription(),p=this.getHoursDescription();o+=u,o.length>0&&(o+=", "),o+=c,o.length>0&&(o+=", "),o+=p}else{var h=n.split("-");o+=r.StringUtilities.format(this.i18n.EveryMinuteBetweenX0AndX1(),this.formatTime(i,h[0],""),this.formatTime(i,h[1],""))}else o+=this.i18n.AtSpace()+this.formatTime(i,n,e);return o},t.prototype.getSecondsDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[0],this.i18n.EverySecond(),function(t){return t},function(e){return r.StringUtilities.format(t.i18n.EveryX0Seconds(),e)},function(e){return t.i18n.SecondsX0ThroughX1PastTheMinute()},function(e){return"0"==e?"":parseInt(e)<20?t.i18n.AtX0SecondsPastTheMinute():t.i18n.AtX0SecondsPastTheMinuteGt20()||t.i18n.AtX0SecondsPastTheMinute()});return e},t.prototype.getMinutesDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[1],this.i18n.EveryMinute(),function(t){return t},function(e){return r.StringUtilities.format(t.i18n.EveryX0Minutes(),e)},function(e){return t.i18n.MinutesX0ThroughX1PastTheHour()},function(e){try{return"0"==e?"":parseInt(e)<20?t.i18n.AtX0MinutesPastTheHour():t.i18n.AtX0MinutesPastTheHourGt20()||t.i18n.AtX0MinutesPastTheHour()}catch(n){return t.i18n.AtX0MinutesPastTheHour()}});return e},t.prototype.getHoursDescription=function(){var t=this,e=this.expressionParts[2],n=this.getSegmentDescription(e,this.i18n.EveryHour(),function(e){return t.formatTime(e,"0","")},function(e){return r.StringUtilities.format(t.i18n.EveryX0Hours(),e)},function(e){return t.i18n.BetweenX0AndX1()},function(e){return t.i18n.AtX0()});return n},t.prototype.getDayOfWeekDescription=function(){var t=this,e=this.i18n.DaysOfTheWeek(),n=this.getSegmentDescription(this.expressionParts[5],this.i18n.ComaEveryDay(),function(t){var n=t;return t.indexOf("#")>-1?n=t.substr(0,t.indexOf("#")):t.indexOf("L")>-1&&(n=n.replace("L","")),e[parseInt(n)]},function(e){return r.StringUtilities.format(t.i18n.ComaEveryX0DaysOfTheWeek(),e)},function(e){return t.i18n.ComaX0ThroughX1()},function(e){var n=null;if(e.indexOf("#")>-1){var r=e.substring(e.indexOf("#")+1),i=null;switch(r){case"1":i=t.i18n.First();break;case"2":i=t.i18n.Second();break;case"3":i=t.i18n.Third();break;case"4":i=t.i18n.Forth();break;case"5":i=t.i18n.Fifth()}n=t.i18n.ComaOnThe()+i+t.i18n.SpaceX0OfTheMonth()}else n=e.indexOf("L")>-1?t.i18n.ComaOnTheLastX0OfTheMonth():t.i18n.ComaOnlyOnX0();return n});return n},t.prototype.getMonthDescription=function(){var t=this,e=this.i18n.MonthsOfTheYear(),n=this.getSegmentDescription(this.expressionParts[4],"",function(t){return e[parseInt(t)-1]},function(e){return r.StringUtilities.format(t.i18n.ComaEveryX0Months(),e)},function(e){return t.i18n.ComaMonthX0ThroughMonthX1()||t.i18n.ComaX0ThroughX1()},function(e){return t.i18n.ComaOnlyInX0()});return n},t.prototype.getDayOfMonthDescription=function(){var t=this,e=null,n=this.expressionParts[3];switch(n){case"L":e=this.i18n.ComaOnTheLastDayOfTheMonth();break;case"WL":case"LW":e=this.i18n.ComaOnTheLastWeekdayOfTheMonth();break;default:var i=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(i){var o=parseInt(i[0].replace("W","")),s=1==o?this.i18n.FirstWeekday():r.StringUtilities.format(this.i18n.WeekdayNearestDayX0(),o.toString());e=r.StringUtilities.format(this.i18n.ComaOnTheX0OfTheMonth(),s);break}e=this.getSegmentDescription(n,this.i18n.ComaEveryDay(),function(t){return t},function(e){return"1"==e?t.i18n.ComaEveryDay():t.i18n.ComaEveryX0Days()},function(e){return t.i18n.ComaBetweenDayX0AndX1OfTheMonth()},function(e){return t.i18n.ComaOnDayX0OfTheMonth()})}return e},t.prototype.getYearDescription=function(){var t=this,e=this.getSegmentDescription(this.expressionParts[6],"",function(t){return/^\d+$/.test(t)?new Date(parseInt(t),1).getFullYear().toString():t},function(e){return r.StringUtilities.format(t.i18n.ComaEveryX0Years(),e)},function(e){return t.i18n.ComaYearX0ThroughYearX1()||t.i18n.ComaX0ThroughX1()},function(e){return t.i18n.ComaOnlyInX0()});return e},t.prototype.getSegmentDescription=function(t,e,n,i,o,s){var a=this,u=null;if(t)if("*"===t)u=e;else if(r.StringUtilities.containsAny(t,["/","-",","]))if(t.indexOf("/")>-1){var c=t.split("/");if(u=r.StringUtilities.format(i(c[1]),n(c[1])),c[0].indexOf("-")>-1){var p=this.generateBetweenSegmentDescription(c[0],o,n);0!=p.indexOf(", ")&&(u+=", "),u+=p}else if(!r.StringUtilities.containsAny(c[0],["*",","])){var h=r.StringUtilities.format(s(c[0]),n(c[0]));h=h.replace(", ",""),u+=r.StringUtilities.format(this.i18n.CommaStartingX0(),h)}}else if(t.indexOf(",")>-1){for(var c=t.split(","),f="",y=0;y<c.length;y++)if(y>0&&c.length>2&&(f+=",",y<c.length-1&&(f+=" ")),y>0&&c.length>1&&(y==c.length-1||2==c.length)&&(f+=this.i18n.SpaceAndSpace()),c[y].indexOf("-")>-1){var p=this.generateBetweenSegmentDescription(c[y],function(t){return a.i18n.ComaX0ThroughX1()},n);p=p.replace(", ",""),f+=p}else f+=n(c[y]);u=r.StringUtilities.format(s(t),f)}else t.indexOf("-")>-1&&(u=this.generateBetweenSegmentDescription(t,o,n));else u=r.StringUtilities.format(s(t),n(t));else u="";return u},t.prototype.generateBetweenSegmentDescription=function(t,e,n){var i="",o=t.split("-"),s=n(o[0]),a=n(o[1]);a=a.replace(":00",":59");var u=e(t);return i+=r.StringUtilities.format(u,s,a)},t.prototype.formatTime=function(t,e,n){var r=parseInt(t),i="";this.options.use24HourTimeFormat||(i=r>=12?" PM":" AM",r>12&&(r-=12));var o=e,s="";return n&&(s=":"+("00"+n).substring(n.length)),("00"+r.toString()).substring(r.toString().length)+":"+("00"+o.toString()).substring(o.toString().length)+s+i},t.prototype.transformVerbosity=function(t,e){return e||(t=t.replace(new RegExp(this.i18n.ComaEveryMinute(),"g"),""),t=t.replace(new RegExp(this.i18n.ComaEveryHour(),"g"),""),t=t.replace(new RegExp(this.i18n.ComaEveryDay(),"g"),"")),t},t.locales={},t}();e.Cronstrue=o},function(t,e){"use strict";var n=function(){function t(){}return t.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.replace(/%s/g,function(){return e.shift()})},t.containsAny=function(t,e){return e.some(function(e){return t.indexOf(e)>-1})},t}();e.StringUtilities=n},function(t,e){"use strict";var n=function(){function t(t,e){void 0===e&&(e=!0),this.expression=t,this.dayOfWeekStartIndexZero=e}return t.prototype.parse=function(){if(!this.expression)throw new Error("Expression is empty");var t=this.expression.trim().split(" ");if(t.length<5)throw new Error("Expression only has "+t.length+" parts. At least 5 part are required.");if(5==t.length)t.unshift(""),t.push("");else if(6==t.length)/\d{4}$/.test(t[5])?t.unshift(""):t.push("");else if(t.length>7)throw new Error("Expression has "+t.length+" parts; too many!");return this.normalizeExpression(t),t},t.prototype.normalizeExpression=function(t){t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),0==t[0].indexOf("0/")&&(t[0]=t[0].replace("0/","*/")),0==t[1].indexOf("0/")&&(t[1]=t[1].replace("0/","*/")),0==t[2].indexOf("0/")&&(t[2]=t[2].replace("0/","*/")),0==t[3].indexOf("1/")&&(t[3]=t[3].replace("1/","*/")),0==t[4].indexOf("1/")&&(t[4]=t[4].replace("1/","*/")),0==t[5].indexOf("1/")&&(t[5]=t[5].replace("1/","*/")),0==t[6].indexOf("1/")&&(t[6]=t[6].replace("1/","*/")),this.dayOfWeekStartIndexZero||(t[5]=t[5].replace(/(^\d)|([^#\/\s]\d)+/g,function(t){var e=t.replace(/\D/,""),n=(parseInt(e)-1).toString();return t.replace(e,n)})),"?"==t[3]&&(t[3]="*");var e={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var n in e)t[5]=t[5].replace(new RegExp(n,"g"),e[n].toString());var r={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var i in r)t[4]=t[4].replace(new RegExp(i,"g"),r[i].toString());"0"==t[0]&&(t[0]="");for(var o=0;o<t.length;o++)if("*/1"==t[o]&&(t[o]="*"),t[o].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[o])){var s=null;switch(o){case 4:s="12";break;case 5:s="6";break;case 6:s="9999";break;default:s=null}if(null!=s){var a=t[o].split("/");t[o]=a[0]+"-"+s+"/"+a[1]}}},t}();e.CronParser=n},function(t,e,n){"use strict";var r=n(5),i=function(){function t(){}return t.prototype.load=function(t){t.en=new r.en},t}();e.enLocaleLoader=i},function(t,e){"use strict";var n=function(){function t(){}return t.prototype.AtX0SecondsPastTheMinuteGt20=function(){return null},t.prototype.AtX0MinutesPastTheHourGt20=function(){return null},t.prototype.ComaMonthX0ThroughMonthX1=function(){return null},t.prototype.ComaYearX0ThroughYearX1=function(){return null},t.prototype.Use24HourTimeFormatByDefault=function(){return!1},t.prototype.AnErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},t.prototype.EveryMinute=function(){return"every minute"},t.prototype.EveryHour=function(){return"every hour"},t.prototype.AtSpace=function(){return"At "},t.prototype.EveryMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},t.prototype.At=function(){return"At"},t.prototype.SpaceAnd=function(){return" and"},t.prototype.EverySecond=function(){return"every second"},t.prototype.EveryX0Seconds=function(){return"every %s seconds"},t.prototype.SecondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},t.prototype.AtX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},t.prototype.EveryX0Minutes=function(){return"every %s minutes"},t.prototype.MinutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},t.prototype.AtX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},t.prototype.EveryX0Hours=function(){return"every %s hours"},t.prototype.BetweenX0AndX1=function(){return"between %s and %s"},t.prototype.AtX0=function(){return"at %s"},t.prototype.ComaEveryDay=function(){return", every day"},t.prototype.ComaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},t.prototype.ComaX0ThroughX1=function(){return", %s through %s"},t.prototype.First=function(){return"first"},t.prototype.Second=function(){return"second"},t.prototype.Third=function(){return"third"},t.prototype.Forth=function(){return"forth"},t.prototype.Fifth=function(){return"fifth"},t.prototype.ComaOnThe=function(){return", on the "},t.prototype.SpaceX0OfTheMonth=function(){return" %s of the month"},t.prototype.ComaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},t.prototype.ComaOnlyOnX0=function(){return", only on %s"},t.prototype.ComaEveryX0Months=function(){return", every %s months"},t.prototype.ComaOnlyInX0=function(){return", only in %s"},t.prototype.ComaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},t.prototype.ComaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},t.prototype.FirstWeekday=function(){return"first weekday"},t.prototype.WeekdayNearestDayX0=function(){return"weekday nearest day %s"},t.prototype.ComaOnTheX0OfTheMonth=function(){return", on the %s of the month"},t.prototype.ComaEveryX0Days=function(){return", every %s days"},t.prototype.ComaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},t.prototype.ComaOnDayX0OfTheMonth=function(){return", on day %s of the month"},t.prototype.SpaceAndSpace=function(){return" and "},t.prototype.ComaEveryMinute=function(){return", every minute"},t.prototype.ComaEveryHour=function(){return", every hour"},t.prototype.ComaEveryX0Years=function(){return", every %s years"},t.prototype.CommaStartingX0=function(){return", starting %s"},t.prototype.DaysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},t.prototype.MonthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},t}();e.en=n}])});

@@ -1,4 +0,5 @@

import { Options } from './options';
import { Locale } from './locale/locale';
declare class cronstrue {
import { Options } from "./options";
import { Locale } from "./i18n/locale";
import { LocaleLoader } from "./i18n/localeLoader";
export declare class Cronstrue {
static locales: {

@@ -13,3 +14,4 @@ [name: string]: Locale;

static toString(expression: string, {throwExceptionOnParseError, verbose, dayOfWeekStartIndexZero, use24HourTimeFormat, locale}?: Options): string;
static initialize(): void;
static initialize(localesLoader: LocaleLoader): void;
static locale(localeName: string): void;
constructor(expression: string, options: Options);

@@ -30,2 +32,1 @@ protected getFullDescription(): string;

}
export = cronstrue;
{
"name": "cronstrue",
"version": "0.1.2",
"description": "Convert cron expressions into human readable descriptions",
"author": "Brady Holt",
"license": "MIT",
"bugs": {
"url": "https://github.com/bradyholt/cronstrue/issues"
},
"homepage": "https://github.com/bradyholt/cronstrue#readme",
"keywords": [
"cron",
"cronjob",
"crontab",
"schedule",
"parser",
"cron expression",
"cron description",
"pretty cron",
"cron for humans",
"cron translated",
"cron english",
"cron schedule",
"cron english",
"cron schedule"
],
"main": "dist/cronstrue.js",
"typings": "dist/declarations/cronstrue.d.ts",
"files": [
"dist/"
],
"repository": {
"type": "git",
"url": "git+https://github.com/bradyholt/cronstrue.git"
},
"devDependencies": {
"awesome-typescript-loader": "^2.1.1",
"chai": "^3.5.0",
"expose-loader": "^0.7.1",
"mocha": "^2.5.3",
"typescript": "^1.8.10",
"webpack": "^1.13.1"
},
"scripts": {
"build": "tsc",
"pretest": "npm run build",
"test": "./node_modules/.bin/mocha --reporter spec",
"prepublish": "rm -rf ./dist && webpack && mv ./dist/src ./dist/declarations"
}
}
"name": "cronstrue",
"version": "0.1.3",
"description": "Convert cron expressions into human readable descriptions",
"author": "Brady Holt",
"license": "MIT",
"bugs": {
"url": "https://github.com/bradyholt/cronstrue/issues"
},
"homepage": "https://github.com/bradyholt/cronstrue#readme",
"keywords": [
"cron",
"cronjob",
"crontab",
"schedule",
"parser",
"cron expression",
"cron description",
"pretty cron",
"cron for humans",
"cron translated",
"cron english",
"cron schedule",
"cron english",
"cron schedule"
],
"main": "dist/cronstrue.js",
"typings": "dist/declarations/cronstrue.d.ts",
"files": [
"dist/",
"i18n.js"
],
"repository": {
"type": "git",
"url": "git+https://github.com/bradyholt/cronstrue.git"
},
"devDependencies": {
"awesome-typescript-loader": "^2.1.1",
"chai": "^3.5.0",
"expose-loader": "^0.7.1",
"mocha": "^2.5.3",
"typescript": "^1.8.10",
"webpack": "^1.13.1"
},
"scripts": {
"build": "tsc",
"pretest": "npm run build",
"test": "./node_modules/.bin/mocha --reporter spec",
"package": "rm -rf ./dist && webpack && mv ./dist/src ./dist/declarations",
"prepublish": "npm run package"
}
}

@@ -1,16 +0,15 @@

# c**r**onstrue [![Build Status](https://travis-ci.org/bradyholt/cronstrue.svg?branch=master)](https://travis-ci.org/bradyholt/cronstrue)
# cRonstrue [![Build Status](https://travis-ci.org/bradyholt/cronstrue.svg?branch=master)](https://travis-ci.org/bradyholt/cronstrue) [![NPM Package](https://img.shields.io/npm/v/cronstrue.svg)](https://www.npmjs.com/package/cronstrue)
c**r**onstrue is a JavaScript library that parses a cron expression and outputs a human readable description of the cron schedule. For example, given the expression "*/5 * * * *" it will output "Every 5 minutes".
cRonstrue is a JavaScript library that parses a cron expression and outputs a human readable description of the cron schedule. For example, given the expression "*/5 * * * *" it will output "Every 5 minutes".
This library was ported from the original C# implemenation called [cron-expression-descriptor](https://github.com/bradyholt/cron-expression-descriptor) and is also available in a [few other languages](https://github.com/bradyholt/cron-expression-descriptor#ports).
## Features
## Features
- Zero dependencies
- Supports all cron expression special characters including * / , - ? L W, #
- Supports 5, 6 (w/ seconds or year), or 7 (w/ seconds and year) part cron expressions
- (i18n support with 14 languages coming soon)
- i18n support with 14 languages
## Installation
c**r**onstrue is exported as an [UMD](https://github.com/umdjs/umd) module so it will work in an [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD), [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) or browser global context.
cRonstrue is exported as an [UMD](https://github.com/umdjs/umd) module so it will work in an [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD), [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) or browser global context.
### Node

@@ -22,7 +21,10 @@ ```

### Browser
The `cronstrue.min.js` file from the `/dist` folder in the npm package should be served to the browser. There are no dependencies so you can simply include the library in a `<script>` tag.
The `cronstrue.min.js` file from the `/dist` folder in the npm package should be served to the browser. There are no dependencies so you can simply include the library in a `<script>` tag.
```
<script src="cronstrue.min.js" type="text/javascript"></script>
var cronstrue = window.cronstrue;
<script>
var cronstrue = window.cronstrue;
</script>
```
## Usage

@@ -41,6 +43,41 @@

For more usage examples, including a demonstration of how cronstrue can handle some very complex cron expressions, you can [reference the unit tests](https://github.com/bradyholt/cronstrue/blob/master/test/cronstrue.js).
For more usage examples, including a demonstration of how cRonstrue can handle some very complex cron expressions, you can [reference the unit tests](https://github.com/bradyholt/cronstrue/blob/master/test/cronstrue.js).
## i18n
To use the i18n support cRonstrue provides, you must use the packaged library that contains the locale transalations. Once you do this, you can pass the name of a supported locale as an option to `cronstrue.toString()`. For example, for the es (Spanish) locale, you would use: `cronstrue.toString("* * * * *", { locale: "es" });`.
### Node
```
var cronstrue = require('cronstrue/i18n');
cronstrue.toString("*/5 * * * *", { locale: "fr" });
```
### Browser
The `cronstrue-i18n.min.js` file from the `/dist` folder in the npm package should be served to the browser.
```
<script src="cronstrue-i18n.min.js" type="text/javascript"></script>
<script>
cronstrue.toString("*/5 * * * *", { locale: "fr" });
</script>
```
### Supported Locales
- en - English
- nl - Dutch
- fr - French
- de - German
- it - Italian
- nb - Norwegian
- pl - Polish
- pt_BR - Portuguese (Brazil)
- ro - Romanian
- ru - Russian
- es - Spanish
- tr - Turkish
- uk - Ukrainian
- zh_CN - Chinese (Simplified)
## License
c**r**onstrue is freely distributable under the terms of the [MIT license](https://github.com/bradyholt/cronstrue/blob/master/LICENSE).
cRonstrue is freely distributable under the terms of the [MIT license](https://github.com/bradyholt/cronstrue/blob/master/LICENSE).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc