Giter Club home page Giter Club logo

Comments (5)

oldfartdeveloper avatar oldfartdeveloper commented on August 23, 2024

Did you try

Time.Date.delta (Time.Date.date 2018 4 1) (Time.Date.date 1932 4 2) |> .years

from elm-time.

muelli avatar muelli commented on August 23, 2024

yes. You, too?

It is very deceiving, but it does not work:

> import Time.Date
> Time.Date.delta (Time.Date.date 2018 4 3) (Time.Date.date 1932 4 2) |> .years
86 : Int
> Time.Date.delta (Time.Date.date 2018 4 1) (Time.Date.date 1932 4 2) |> .years
86 : Int
> 

And the code is quite clear that it is incapable of doing what is required:

{ years = d1.year - d2.year

from elm-time.

oldfartdeveloper avatar oldfartdeveloper commented on August 23, 2024

Ahh, I see what you're pointing out now. Yeah, I'd consider this a bug. Thanks for noticing and submitting the issue. If you have a fix and would like to submit a PR, I'd be glad to process it. I have an idea for the fix and will try it if you don't.

I'm presently the maintainer of this package, and I can say that time processing has changed radically for Elm 0.19 (which was just released). I haven't gone over the details yet, but here's the new Time package. If you are planning on upgrading to Elm 0.19, you might want to check it out.

from elm-time.

BendingBender avatar BendingBender commented on August 23, 2024

Got bitten by this today. Actually, it isn't a bug, the current behavior is explicitly outlined in the docs along with a couple of examples. I somehow miss the functionality that date-fns was providing me in JS.

Would you accept PRs that add the missing functionality?

from elm-time.

oldfartdeveloper avatar oldfartdeveloper commented on August 23, 2024

Am archiving this repository which recommends closing this issue

from elm-time.

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.