Cron4s

Join the chat at https://gitter.im/alonsodomin/cron4s License Scala.js Latest version

Build Status Codacy Badge codecov

Idiomatic Cron expression parsing in Scala and ScalaJS.

Setup

To start using cron4s in your project just include the library as part of your dependencies:

libraryDependencies += "com.github.alonsodomin.cron4s" %% "cron4s-core" % "0.6.1"

Or in ScalaJS:

libraryDependencies += "com.github.alonsodomin.cron4s" %%% "cron4s-core" % "0.6.1"

cron4s is cross compiled for Scala 2.12 and Scala 2.13. Java 8 or later is required when using it in the JVM.

Limitations

Before delving into the user guide, is preferred to understand that the library at this given moment has some limitations in the expressions that is able to parse. These are the type of expressions that are not supported at the moment:

  • L alone in day of month meaning the last day of the month
  • nL in day of week, being n a number between 0 and 6 meaning the last day of week of a month
  • nW in day of month, being n a number between 0 and 31 meaning the nearest weekday (Monday-Friday) to the given month day.
  • n#m in day of week, being n a number between 0 and 6 and m a number between 0 and 5 meaning the mth day of the month.

Versioning

Current cron4s is library that is evolving towards stability and does not follow semantic versioning yet. Version numbers are compound of three numbers as 0.major.minor. A change in the minor part means that the new version is source compatible (in its public API) with the previous version. A change in the major part means that source compatibility with previous version is not guaranteed. Binary compatibility is not guaranteed either in between any version number change.

Once the library reaches version 1.0.0, semantic versioning will be adopted as follows major.minor.patch. Changes in the major part won’t be binary or source compatible with previous version. Changes in the minor part will be source and binary compatible with previous version (with the exception of deprecated API). And changes in the patch part will mean that the library is fully source and binary compatible with previous version.

License

Copyright 2016-2017 Antonio Alonso Dominguez

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.