You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Matthias Beyer 0b9130fd4e Update minimum rustc version to 1.32.0 9 months ago
.github Rewrite github template 1 year ago
doc Add language documentation 2 years ago
examples Make example output pretty 2 years ago
fuzz Add simple fuzzer for parser 2 years ago
src Move code to failure as error handling library 1 year ago
.gitignore Initial import 2 years ago
.travis.yml Update minimum rustc version to 1.32.0 9 months ago
Cargo.toml Bump version to 0.3.0 1 year ago
LICENSE Initial import 2 years ago Revert "Add vacation notice" 1 year ago


Calculate times with chrono “plain text like” in Rust.

Build Status license Tokei

From Wikipedia:

Kairos (καιρός) is an Ancient Greek word meaning the right, critical or opportune moment.

This library offers an abstraction over the awesome chrono crate to calculate dates almost like one would write plain text:

use kairos::timetype::TimeType as TT;

// get the end of the month of the day 5 days ago
let _ = (TT::today() - TT::weeks(1) + TT::days(2)).end_of_month();

// alternative to above
let _ = (TT::today() - TT::days(5)).end_of_month();

// NOTE: The following features are not yet included

// get a vector of dates for the next 4 weeks, starting today
let _ = TT::today()

// get an iterator of dates for the next year, in a weekly fashion, starting
// today but skipping october
let _ = TT::today()

// and finally, a complex one

let _ = (TT::today() - TT::years(1))       // exactly one year ago
  .every(Day::Monday)                      // and then every Monday
  .skip(Month::October)                    // but not in october
  .skip(|date| // and not if the day is the 1st of a month
  .until(Mark::Moment(today()));           // until today

Parsing User-Input

kairos ships a user input parser, so you can include kairos in your commandline applications.

Have a look at the example CLI utility or the language documentation.


MPL 2.0