summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-11-19 15:57:39 +0100
committerGitHub <noreply@github.com>2017-11-19 15:57:39 +0100
commit8164d268235c29b05566e635c8e0e206e8a667de (patch)
treecfe57367c595b3be6469f2be86624a5504122e7d /README.md
parent902f04bd7c975b7d97849327b464e0e5db1f9ec5 (diff)
parentfd3f3ff1e5ee75e3050c26788b86f0362baa2d8f (diff)
Merge pull request #11 from matthiasbeyer/0.1.0-beta-1
0.1.0 beta 1
Diffstat (limited to 'README.md')
-rw-r--r--README.md29
1 files 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