-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functions strpdate() and daterange(), which make working with date objects more convenient. #75
Conversation
…e objects more convenient.
These are good ones! Nice. A bit of feedback:
Thanks for the great work! |
Thanks for the excellent (and quick) feedback! I really like to idea behind your |
Great! Yes, in fact, ideally, I'd like to include these in the next release, so if it's not likely you'll be able to make the changes in the next day or so, I can merge and modify them myself. It's really no trouble. |
I'm going to argue for keeping the name |
I'll be unavailable for the next couple of days, so please feel free to make any additional changes that you think are required – I trust your judgement here. |
…s well as add some tests and tweak some docstrings
So, I made a few tweaks, here are the highlights:
Have a look at the docs and take it for a spin! http://boltons.readthedocs.io/en/latest/timeutils.html#boltons.timeutils.daterange |
I've often wanted to use a
strptime()
-style format string to parse date values, and find that having a complimentarystrpdate()
function is clearer than writing e.g.datetime.strptime(val, '%Y-%m-%d').date()
all over the place.Also, iterating over date ranges can be quite awkward, because any date arithmetic requires the involvement of the dreaded
timedelta
class.