From 495ad2a944e16860f746cafd3569e9e4208279d0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 19 Nov 2017 15:44:39 +0100 Subject: Update README --- README.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0a5d012..b8ea209 100644 --- a/README.md +++ b/README.md @@ -15,34 +15,43 @@ This library offers an abstraction over the awesome `chrono` crate to calculate dates almost like one would write plain text: ```rust +use kairos::timetype::TimeType as TT; + // get the end of the month of the day 5 days ago -let _ = (today() - week(1) + days(2)).end_of_month(); +let _ = (TT::today() - TT::weeks(1) + TT::days(2)).end_of_month(); // alternative to above -let _ = (today() - days(5)).end_of_month(); +let _ = (TT::today() - TT::days(5)).end_of_month(); -// get the name of the day of the end of the current year -let _ = today().end_of_year().dayname(); +// NOTE: The following features are not yet included // get a vector of dates for the next 4 weeks, starting today -let _ = today().every(week(1)).take(4); +let _ = TT::today() + .every(TT::week(1)) + .take(4); // get an iterator of dates for the next year, in a weekly fashion, starting // today but skipping october -let _ = today().every(week(1)).skip(Month::October).until(Mark::END_OF_YEAR); +let _ = TT::today() + .every(TT::week(1)) + .skip(Month::October) + .until(Mark::END_OF_YEAR); // and finally, a complex one -let _ = (today() - year(1)) // exactly one year ago +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| date.is(Mark::MONTH_START)) // and not if the day is the 1st of a month .until(Mark::Moment(today())); // until today ``` -Plus, we want to offer a string-parser which can be used to parse user input -into such things. This will be a compiletime option to include the parser or -not. +## 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](./examples/main.rs). # License -- cgit v1.2.3 From 0b0a28c06022faffb5aa1ff5b2173e7a05fa2255 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 19 Nov 2017 15:45:52 +0100 Subject: Rewrite travis script to improve readability --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d7ded8e..e02add9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,8 @@ matrix: - rust: nightly script: -- | - cargo build --all --features with-filters --verbose -j 1 && cargo test --all --features with-filters --verbose -j 1 + - cargo build --all --all-features --verbose -j 1 + - cargo test --all --all-features --verbose -j 1 cache: cargo: true -- cgit v1.2.3 From fd3f3ff1e5ee75e3050c26788b86f0362baa2d8f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 19 Nov 2017 15:46:04 +0100 Subject: Update version: 0.1.0-beta-1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index be0d3d7..f4a0d87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kairos" -version = "0.0.0" +version = "0.1.0-beta-1" authors = ["Matthias Beyer "] description = "A library on top of chrono to calculate times and dates ergonomically" -- cgit v1.2.3