Translate cron expression into natural language.
* * * * *
┬ ┬ ┬ ┬ ┬
│ │ │ │ │
│ │ │ │ │
│ │ │ │ └───── day of week (0 - 6) (0 is Sun)
│ │ │ └────────── month (1 - 12)
│ │ └─────────────── day of month (1 - 31)
│ └──────────────────── hour (0 - 23)
└───────────────────────── minute (0 - 59)
npm install crontrans
Useage:
var crontrans = require('crontrans');
bower install crontrans
Just insert the script tag into HTML page:
<script src="../lib/crontrans.js"></script>
Useage:
var crontrans = new CronTrans();
var message = crontrans.translate("0 11 4 * mon-wed");
/*
min: 0
hour: 11
day: 4
month: any
weekday: Mon,Tue,Wed
*/
message = crontrans.translate("*/15 8-16,3 * * *");
/*
min: 0,15,30,45
hour: 8,9,10,11,12,13,14,15,16,3
day: any
month: any
weekday: any
*/