Giter Club home page Giter Club logo

elm-date-extra's People

Contributors

justinmimbs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elm-date-extra's Issues

Unable to install via elm-package install

$ elm-package install justinmimbs/elm-date-extra
To install justinmimbs/elm-date-extra I would like to add the following
dependency to elm-package.json:

    "justinmimbs/elm-date-extra": "3.0.0 <= v < 4.0.0"

May I add that to elm-package.json for you? [Y/n]

Error: I cannot find a set of packages that works with your constraints.

One way to rebuild your constraints is to clear everything out of the
"dependencies" field of elm-package.json and add them back one at a time with
`elm-package install`.

I hope to automate this in the future, but at least there is a way to make
progress for now!```

toString function for Interval

I've found that I need a function to get string versions of the Interval constructors. Would you be interested in adding that to this library? I could put a PR together if so.

UTC vs Local Time

Hi,

I testing out this library. It works well for what I'm trying because I can build a Date object directly, instead of getting a union type like Maybe Date or Result Date.

So I have this code in Test.elm

module Test exposing (initialDate)

import Date.Extra as Date
import Date exposing (Month(..))

initialDate = 
    Date.fromSpec
        Date.utc
        (Date.atTime 6 0 0 0)
        (Date.calendarDate 2015 Jan 1)

And this code in Main.elm

import Html
import Test as Test

main = Html.text (toString Test.initialDate)

When I run it in elm-reactor I get:
<Thu Jan 01 2015 04:00:00 GMT-0200 (E. South America Daylight Time)>
But I expected something like
<Thu Jan 01 2015 06:00:00 GMT-0000 (UTC)>

Why doesn't that work? Is it a bug or is my code wrong?

I want to use this library to control the date/time of a game that is set in the future. The game date/time has to be the same regardless of where the player is located. In other words, his local time is completely irrelevant and should never affect the in game clock. Otherwise the in game character might wake up a 6:00am if the player in from one country, and wake up at 8:00 am if the player is from another one.

Anyways, thanks for the package.

Upgrade to Elm 0.19

Hi, I'm working on an upgrade for this to Elm 0.19, the thing is now I'm stuck with the fact that a lot of new functions such as toMinute, toYear and so on expect a Zone as you can see in the docs.

What would you like to be done? Ask that information from the consumer of the package? I think this is the safest choice, the other option would be to use here

Ceiling not adding one interval if date is exactly the beginning of the interval.

Currently using Ceiling on a date may yield either the next interval beginning, or, if the date is the exact beginning of an interval, itself. From reading the code, this seems to be voluntary.

However, this violates some desirable invariants of the code: e.g. for any date, one would expect that the duration between floor interval date and ceiling interval date is always one interval.

What do you think?

Elm 0.19

Hi :) I've been using this lib and am trying to upgrade my project to elm 0.19 ; apparently it's still on 0.18 ; are there any hangups? May I help?

unexpected result from diffing 2 dates

Am I going mad here??

module Main exposing (..)

import Html exposing (Html, text)
import Date exposing (Date, Month(..))
import Date.Extra as DE exposing (Interval(..))

main : Html a
main =
    text ("the same? " ++ (toString (diff1 == diff2)))

diff1 =
    DE.diff Day
        (DE.fromCalendarDate 2022 Mar 27)
        (DE.fromCalendarDate 2022 Apr 3)
        
diff2 =
    DE.diff Day
        (DE.fromCalendarDate 2022 Mar 28)
        (DE.fromCalendarDate 2022 Apr 4)

tells me the diffs are not the same - they should both be 7 days, but diff1 is 6....

I feel hesitant to press submit as I must be doing something stupid, but I can't see what! Please help my sanity recover ;)

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.