Skip to content
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

Adds support for fractional units to next_/last_ week/day/hour/minute… #77

Closed
wants to merge 1 commit into from

Conversation

liavkoren
Copy link

…/second.

Re: issue #75, this appears to be related to dateutil/dateutil#40 + https://github.com/myusuf3/delorean/blob/master/delorean/dates.py#L295. It looks like some sort of official relativedelta float-support for fractional years/months might be coming in the 2.5.0 release of dateutils. In the meantime, floats do work with relativedelta for weeks down to microseconds.

This patch adds support for those. If you think this is a worthwhile idea, I'm happy to write some tests for it.

Review on Reviewable

@liavkoren
Copy link
Author

If we do implement fractional weeks..microseconds, we should probably handle the conversion for months and years, too. Having thought about this more, I start to see why dateutils didn't support floats for month/year.

Months and years are stupid.

@myusuf3
Copy link
Owner

myusuf3 commented Feb 16, 2016

Thanks for the pull request. Adding some tests would help, make sure you verify that whole numbers continue to work and update the documentation accordingly.

@myusuf3 myusuf3 closed this Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants