myusuf3 / delorean

Delorean: Time Travel Made Easy
http://delorean.rtfd.org/
MIT License
1.84k stars 128 forks source link

Feature request: interface for `next_day` should match other `next_*`/`last_*` methods. #76

Open liavkoren opened 8 years ago

liavkoren commented 8 years ago
In [90]: d.next_second()
Out[90]: Delorean(datetime=2014-03-01 05:00:01+00:00, timezone=utc)

In [91]: d.next_minute()
Out[91]: Delorean(datetime=2014-03-01 05:01:00+00:00, timezone=utc)

In [92]: d.next_day()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-92-da50f63ce2d4> in <module>()
----> 1 d.next_day()

TypeError: next_day() takes exactly 2 arguments (1 given)

In [93]: d.last_second()
Out[93]: Delorean(datetime=2014-03-01 04:59:59+00:00, timezone=utc)

In [94]: d.last_day()
Out[94]: Delorean(datetime=2014-02-28 05:00:00+00:00, timezone=utc)
liavkoren commented 8 years ago

Hmm. It looks like my v0.5.0 source has a concrete next_day implementation inside delorean.dates.Delorean, while the https://github.com/myusuf3/delorean/blob/master/delorean/dates.py#L168 omits the concrete implementation. Is the cheese-shop out of date?

myusuf3 commented 8 years ago

@mlew ping!