Skip to content

Commit

Permalink
Added documentation, updated readme.
Browse files Browse the repository at this point in the history
- Added documentation for Chronology.range/2
- Updated README.md with time period info
- Bump version to 0.2.0
  • Loading branch information
pramsky committed Nov 1, 2022
1 parent 2c26007 commit a8229d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Chronology

This is a simple wrapper around Timex to get date ranges for humanized references,
This is a simple wrapper around Timex to get date ranges for humanized references,
such as `last week`, `past year` etc.

## Installation
Expand Down Expand Up @@ -30,21 +30,24 @@ iex> Chronology.range(:past_year)
%{
finish: ~U[2021-06-21 22:06:36.181093Z],
start: ~U[2021-05-21 22:06:36.180699Z]
}}
}}
```

## Time periods
- `:today`
- `:yesterday`
- `:this_week`
- `:this_month`
- `:this_year`
- `:last_week`
- `:last_month`
- `:last_year`
- `:previous_year`
- `:past_week`
- `:past_month`
- `:past_year`
- `:this_quarter`
- `:last_quarter`
## Time Periods

| time period | Period description |
|----------------|--------------------------|
| :today | Today |
| :yesterday | Yesterday |
| :this_week | The current week |
| :this_month | The current month |
| :this_year | The current year |
| :this_quarter | The current quarter |
| :last_week | The last week (Mon-Sun) |
| :last_month | The last full month |
| :last_year | The last full year |
| :last_quarter | The last quarter |
| :past_week | Past 7 days |
| :past_month | Past month (date to date)|
| :past_year | Past 365 days |
| :previous_year | 2 years ago |
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule Chronology.MixProject do
def project do
[
app: :chronology,
version: "0.1.1",
version: "0.2.0",
elixir: "~> 1.9",
start_permanent: Mix.env() == :prod,
deps: deps()
Expand Down

0 comments on commit a8229d6

Please sign in to comment.