GithubHelp home page GithubHelp logo

Comments (6)

djc avatar djc commented on May 24, 2024 1

I'd be happy to review a PR -- I probably won't have time to work on this myself.

from chrono.

joroKr21 avatar joroKr21 commented on May 24, 2024

It's not urgent for me but I think I will find time for it

from chrono.

pitdicker avatar pitdicker commented on May 24, 2024

To be honest in my opinion the API and approach in the round module is fundamentally flawed. A lot of the behavior doesn't make sense, especially for a library that tries to do handle dates and timezones correctly like chrono. And I don't think it is even possible to fix all logic bugs.

But we would need to have an alternative before it can be deprecated.

from chrono.

djc avatar djc commented on May 24, 2024

But we would need to have an alternative before it can be deprecated.

Why? If we think this API is silly or wrong or dangerous, we could deprecate it without providing an alternative.

Does the time crate provide this functionality?

from chrono.

pitdicker avatar pitdicker commented on May 24, 2024

There are some cases where it works and gives correct results. For example rounding or truncating a NaiveTime to a reasonable Duration such as 10 seconds. But rounding to for example 7 seconds, and especially when involving dates becomes a mess. And that is ignoring DST 😄.

Why? If we think this API is silly or wrong or dangerous, we could deprecate it without providing an alternative.

Maybe you are right. It does not really feel like an inconvenience yet, but we can expect more issues like this.

Does the time crate provide this functionality?

It doesn't seem to.

from chrono.

pitdicker avatar pitdicker commented on May 24, 2024

Another issue with duration_trunc: #584.

from chrono.

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.