Giter Club home page Giter Club logo

Comments (9)

awickert avatar awickert commented on June 15, 2024

Please do submit a PR! I am no longer very actively maintaining this code, so community support is much appreciated.

from ds3231.

IowaDave avatar IowaDave commented on June 15, 2024

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 DateTime::unixtime() method.

Code segment:

DateTime A(); // assume initiated properly
DateTime B(); // assume initiated properly
uint32_t a = A.unixtime();
uint32_t b = B.unixtime

if (a > b) { // A is after B }

uint32_t diff = a - b;

from ds3231.

awickert avatar awickert commented on June 15, 2024

Good point @IowaDave.

I don't have need for this overloading so won't be dev'ing it. How about this as a plan?

  • If we hear from @namanvs soon-ish about creating a PR, great
  • Otherwise, we close this as wontfix with reason "not enough current motivation"

from ds3231.

namanvs avatar namanvs commented on June 15, 2024

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?

from ds3231.

IowaDave avatar IowaDave commented on June 15, 2024

from ds3231.

IowaDave avatar IowaDave commented on June 15, 2024

@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

from ds3231.

namanvs avatar namanvs commented on June 15, 2024

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.

from ds3231.

IowaDave avatar IowaDave commented on June 15, 2024

@namanvs Welcome! I look forward to reviewing your code.

Please see my comments in the PR (#71). Thanks!

from ds3231.

IowaDave avatar IowaDave commented on June 15, 2024

Changed the label to Enhancement because that is really what @namanvs is proposing. Leaving this Issue open pending resolution of his PR #71.

cc: @awickert

from ds3231.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.