Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript API that converts cron expressions into human readable strings

I used below Javascript API to create Quartz compatible UI to provide cron expression to server side quartz sevices.

https://github.com/felixruponen/jquery-cron

Do we have any API , which we can use to convert cron expressions into human readable strings in Java Script.

Thanks

like image 220
Dinesh Avatar asked Mar 28 '16 13:03

Dinesh


People also ask

How do you read cron expressions?

A cron expression is a string consisting of six or seven subexpressions (fields) that describe individual details of the schedule. These fields, separated by white space, can contain any of the allowed values with various combinations of the allowed characters for that field.

What does cron 0 * * * * * mean?

*/5 * * * * Execute a cron job every 5 minutes. 0 * * * * Execute a cron job every hour.

What is cron expression generator?

A cron expression is a string that represents a set of times at which a task will be executed. The expression comprises six fields: second(0-59), minute(0-59), hour(0-23), day of month(1-31), month(1-12 or JAN-DEC), and day of week(0-6 or SUN-SAT).

What is later JS?

Sponsor breejs/later * A javascript library for defining recurring schedules and calculating future (or past) occurrences for them. Includes support for using English phrases and Cron schedules.


1 Answers

I recently ported the Quartz compatible cron-expression-descriptor from C# to JavaScript and named it cRonstrue. This JavaScript library is able to convert a Quartz cron expression into a human readable string like this:

cronstrue.toString("0 23 ? * MON-FRI");
> "At 11:00 PM, Monday through Friday"
like image 141
Brady Holt Avatar answered Sep 28 '22 15:09

Brady Holt