-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
Expose Time::MIN
and Time::MAX
#686
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #686 +/- ##
=======================================
- Coverage 97.8% 97.7% -0.1%
=======================================
Files 81 83 +2
Lines 9378 9000 -378
=======================================
- Hits 9169 8793 -376
+ Misses 209 207 -2 ☔ View full report in Codecov by Sentry. |
Can you elaborate on your use case? Even within this repository the values are used in very few locations, all of which could easily be replaced without issue. |
We have a scheduling app that accepts missing start and end times. To make computations easier, we replace these bounds with actual values, specifically |
In that case, why wouldn't you want to be explicit about the exact value being added? |
We are being explicit. By not specifying the range ends, you opt in to MIN as the minimum and MAX as the maximum. We could enforce using MIN instead of a missing lower bound, but for the upper bound, the problem is slightly more difficult as specifying an upper bound is dependent on the precision. That said, we were able to workaround MIN/MAX by subtracting 1.nanosecond() from MIDNIGHT. If you're not convinced of this PR, maybe we can add some documentation about max bounds and how to achieve them (perhaps using the workaround just mentioned). |
@jhpratt Gentle ping, could you please take a look? If you feel this PR isn't useful, please close. |
I've decided that this would cause minimal confusion given that |
This PR exposes the internal max/min values for
Time
. These are useful for building ranges.