21 lines
899 B
JavaScript
21 lines
899 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.default = (() => {
|
|
const months = ['january', 'february', 'march', 'april', 'may', 'june', 'july',
|
|
'august', 'september', 'october', 'november', 'december'];
|
|
const shortMonths = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug',
|
|
'sep', 'oct', 'nov', 'dec'];
|
|
function convertMonthName(expression, items) {
|
|
for (let i = 0; i < items.length; i++) {
|
|
expression = expression.replace(new RegExp(items[i], 'gi'), i + 1);
|
|
}
|
|
return expression;
|
|
}
|
|
function interprete(monthExpression) {
|
|
monthExpression = convertMonthName(monthExpression, months);
|
|
monthExpression = convertMonthName(monthExpression, shortMonths);
|
|
return monthExpression;
|
|
}
|
|
return interprete;
|
|
})();
|
|
//# sourceMappingURL=month-names-conversion.js.map
|