mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-26 03:59:41 +00:00
Update:Remove node-cron dependency
This commit is contained in:
parent
26ef275ab4
commit
b7e546f2f5
19 changed files with 686 additions and 18 deletions
|
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
module.exports = (() => {
|
||||
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'), parseInt(i, 10) + 1);
|
||||
}
|
||||
return expression;
|
||||
}
|
||||
|
||||
function interprete(monthExpression){
|
||||
monthExpression = convertMonthName(monthExpression, months);
|
||||
monthExpression = convertMonthName(monthExpression, shortMonths);
|
||||
return monthExpression;
|
||||
}
|
||||
|
||||
return interprete;
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue