-
Notifications
You must be signed in to change notification settings - Fork 83
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
DateTime comparison operators #24
Comments
Please do submit a PR! I am no longer very actively maintaining this code, so community support is much appreciated. |
Overloading might be desirable. If @namanvs would submit a PR I would be happy to review it. It may be worth noting, however, that such comparisons and arithmetic can be done presently without overloading. The approach would be to calculate a difference in seconds, taking advantage of the Code segment:
|
Hi @awickert and @IowaDave, sorry, I've been travelling but I would be happy to write these operators. I will need about 10 days to get back up to speed and have something ready, but I plan on implementing the following operators: '<', '>', '+', and '-'. I'll probably use @awickert 's suggested strategy but wrap it up into the operators for convenience. I am toying with a modulo operator to return the remainder between 2 operands in the next-smallest unit: DateTime a % DateTime::DAYS returns number of hours in the remainder. Would this seem useful? |
I will wait to complete and PR my documentation on DateTime until after the
proposed enhancements to DateTime are in place.
Thanks!
…On Fri, Aug 19, 2022 at 7:03 PM Naman Shah ***@***.***> wrote:
Hi @awickert <https://github.com/awickert> and @IowaDave
<https://github.com/IowaDave>, sorry, I've been travelling but I would be
happy to write these operators. I will need about 10 days to get back up to
speed and have something ready, but I plan on implementing the following
operators: '<', '>', '+', and '-'. I'll probably use @awickert
<https://github.com/awickert> 's suggested strategy but wrap it up into
the operators for convenience. I am toying with a modulo operator to return
the remainder between 2 operands in the next-smallest unit:
DateTime a % DateTime::DAYS returns number of hours in the remainder.
Would this seem useful?
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIOVVUBUWKW4I4XMDP6ACMDV2AOGBANCNFSM4N6FTSMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@namanvs , @awickert , I have added the DateTime documentation to the master branch of this repo. In the near future, PR #70 may add an example program that uses a DateTime calculation to advance the time values of an alarm. I'll look forward to viewing that PR you mentioned, if you choose to offer it. Thank you sincerely, David |
I have submitted a PR. This is actually the first time I'm contributing to code on Github. Open to feedback and willing to make improvements where identified. |
Can we get '<', '>', '-', '+' operator overloading for the DateTime class?
I can submit a pull request to implement this if you like.
The text was updated successfully, but these errors were encountered: