prettycron

WebJar for prettycron

License

License

GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

prettycron
Last Version

Last Version

0.10.0
Release Date

Release Date

Type

Type

jar
Description

Description

prettycron
WebJar for prettycron
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/azza-bazoo/prettycron

Download prettycron

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/prettycron/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>prettycron</artifactId>
    <version>0.10.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/prettycron/
implementation 'org.webjars.bower:prettycron:0.10.0'
// https://jarcasting.com/artifacts/org.webjars.bower/prettycron/
implementation ("org.webjars.bower:prettycron:0.10.0")
'org.webjars.bower:prettycron:jar:0.10.0'
<dependency org="org.webjars.bower" name="prettycron" rev="0.10.0">
  <artifact name="prettycron" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='prettycron', version='0.10.0')
)
libraryDependencies += "org.webjars.bower" % "prettycron" % "0.10.0"
[org.webjars.bower/prettycron "0.10.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

prettyCron Build Status

prettyCron is a simple JavaScript deuglifier for cron schedules: it prints out a human-readable interpretation of when the schedule will run.

For examples...

... check out the project home page.

Installation - browser

Include prettycron.js after adding moment.js and later.js.

<script src="moment.min.js" type="text/javascript"></script>
<script src="later.min.js" type="text/javascript"></script>
<script src="prettycron.js" type="text/javascript"></script>

Installation - Node

Simply use npm and require:

$ npm install prettycron
var prettyCron = require('prettycron');

Usage

prettyCron exposes three methods, both of which take a cron specification as the only argument.

prettyCron.toString(cron)

Returns a human-readable sentence describing all the times this cron will run.

prettyCron.toString("37 10 * * * *");
// returns "10:37 every day"

prettyCron.getNext(cron)

Returns a string representing the next time this cron will run, formatted with moment's calendar() method.

prettyCron.getNext("0 * * * *");
// if current time is 4:45pm, then returns "Today at 5:00 PM"

prettyCron.getNextDates(cron, numDates)

Returns an array of strings representing the next (numDates) amount of times this cron will run, formatted with moment's calendar() method.

prettyCron.getNextDates("0 * * * *", 4);
// If current time is 3.45 PM, then returns [ 'Today at 4:00 PM', 'Today at 5:00 PM', 'Today at 6:00 PM', 'Today at 7:00 PM' ]

Credits

prettyCron was originally written by dunse and posted to gist. This version is by Hourann Bosci with contributions from Johan Andersson, Phil Jepsen, Andre Buchanan, and Anton Petrov.

It's licensed under LGPLv3.

Versions

Version
0.10.0