Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

It should not be possible to create time frames with min=max #12

Open
jzernisch opened this issue Jul 30, 2014 · 1 comment
Open

It should not be possible to create time frames with min=max #12

jzernisch opened this issue Jul 30, 2014 · 1 comment

Comments

@jzernisch
Copy link
Contributor

As long as we don't see a use case for time frames that contain only one point in time, we should not allow to create them, as the are very annoying to work with. The occur when doing intersection operations like

time_frame & time_frame.shift_by(time_frame.duration)

I would prefer to return TimeFrame::EMPTY here.

@pderichs
Copy link
Contributor

👍 regarding your sample.

I would suggest to fail when trying to create a TimeFrame instance with a duration of 0 (min == max).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants