-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Handling Equal Start and End Times in IsBetween Method #152
Comments
It would work fine if we made the change in to |
Hey is this issue resolved? Is not could I be assigned to this ? |
Why is this really an issue, do you have a test that proves the logic is wrong, or is it just the interpretation? I just did a simple test like this and it passes.
If time is a moment, and all your test date, start instant, and end instant is the same, then it should be true. If it's just a matter of interpretation, I'm completely open to accept PR's with code documentation or proper unit tests, cause my code 10 years ago it's beyond recognition 😄 |
Greetings,
Using the DateTimeExtensions library, I noticed a potentially ambiguous case in the "IsBetween" method of the "TimeExtensions.cs" file. When the "startTime" and "endTime" are the same, the method does not explicitly specify the expected behavior. This could lead to different interpretations among library users.
Proposal:
To clearly handle this case, it would be helpful to add clarification in the method documentation or adjust the logic. A suggestion would be to consider this condition to cover the whole day, which could be a logical interpretation in many usage scenarios.
A suggested code change to reflect this logic is shown below :
The text was updated successfully, but these errors were encountered: