Repository: destag/at-date

Issue:
Add rule to parser to omit word 'now'
Parser now require string in format like `now next month`.

It would be good if word `now` would be optional and strings like `next month` would be parsed like one above.

This change requires adding rule to parser string and probably adding additional methods to **api.py**.

Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/destag/at-date/pull/15?src=pr&el=h1) Report
> Merging [#15](https://codecov.io/gh/destag/at-date/pull/15?src=pr&el=desc) into [master](https://codecov.io/gh/destag/at-date/commit/dc4d4b9dc25ad7b4039bfd4b9dea771df23ee282?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/destag/at-date/pull/15/graphs/tree.svg?width=650&token=zT5lrR9jF6&height=150&src=pr)](https://codecov.io/gh/destag/at-date/pull/15?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master      #15   +/-   ##
=======================================
  Coverage   99.21%   99.21%           
=======================================
  Files           3        3           
  Lines         128      128           
=======================================
  Hits          127      127           
  Misses          1        1
```


| [Impacted Files](https://codecov.io/gh/destag/at-date/pull/15?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [atdate/atdate\_format.py](https://codecov.io/gh/destag/at-date/pull/15/diff?src=pr&el=tree#diff-YXRkYXRlL2F0ZGF0ZV9mb3JtYXQucHk=) | `100% <ø> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/destag/at-date/pull/15?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/destag/at-date/pull/15?src=pr&el=footer). Last update [dc4d4b9...7489498](https://codecov.io/gh/destag/at-date/pull/15?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/atdate/atdate_format.py b/atdate/atdate_format.py
index 6749166..42e910b 100644
--- a/atdate/atdate_format.py
+++ b/atdate/atdate_format.py
@@ -7,6 +7,7 @@ format_string = r'''
          | date increment
          | nowspec
          | nowspec increment
+         | increment
 time: HR24CLOCK_HR_MIN                            -> _hr24clock_hr_min
     | HR24CLOCK_HOUR ":" MINUTE                   -> _hr24clock_hour_minute
     | WALLCLOCK_HR_MIN AM_PM                      -> _wallclock_hr_min_am_pm
diff --git a/docs/README.md b/docs/README.md
index bd6e1fc..b33fdbd 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -93,14 +93,20 @@ Valid at date string consists of tokens which can be in order:
 
 tokens|example
 ---|---
-time|17:32
-time date|17:32 11/22/2033
-time increment|17:32 next day
-time date increment|17:32 11/22/2033 next day
-date|11/22/2033
-date increment|11/22/2033 next month
-now|now
-now increment|now next day
+[time]|17:32
+[time] [date]|17:32 11/22/2033
+[time] [increment]|17:32 next day
+[time] [date] [increment]|17:32 11/22/2033 next day
+[date]|11/22/2033
+[date] [increment]|11/22/2033 next month
+[now]|now
+[now] [increment]|now next day
+[increment]|next month
+
+[time]: #time
+[date]: #date
+[increment]: #increment
+[now]: #now
 
 ### At date tokens
 


Test patch:
diff --git a/test/test_atdate.py b/test/test_atdate.py
index 5f1a4b8..fdbf0ce 100644
--- a/test/test_atdate.py
+++ b/test/test_atdate.py
@@ -206,3 +206,17 @@ def test_wallclock_hour_minute_am_pm():
     test_string = '02:01 pm'
     result = atdate.parse(test_string)
     assert result == datetime(2000, 7, 2, 14, 1, 0, 0)
+
+
+@freeze_time('2000-07-02 03:04:05')
+def test_next_month_without_now():
+    test_string = 'next month'
+    result = atdate.parse(test_string)
+    assert result == datetime(2000, 8, 2, 3, 4, 5, 0)
+
+
+@freeze_time('2000-07-02 03:04:05')
+def test_plus_one_day_without_now():
+    test_string = '+1days'
+    result = atdate.parse(test_string)
+    assert result == datetime(2000, 7, 3, 3, 4, 5, 0)