ariebovenberg / whenever

⏰ Modern datetime library for Python
https://whenever.rtfd.io
MIT License
898 stars 15 forks source link

Alternative ways to handle days overflowing months #184

Open ariebovenberg opened 3 weeks ago

ariebovenberg commented 3 weeks ago

Handling the common "too many days in a month" situation should be customizable.

For example Date(2017, 1, 30).add(month=1) currently truncates the result: Date(2017, 2, 28). While this is what many libraries do by default, it may be worth adding different options, like (1) extrapolating or (2) raising an exception.

Places where this could be useful: