justinmimbs / elm-date-extra Goto Github PK
View Code? Open in Web Editor NEWExtra functions for working with Date
Home Page: http://package.elm-lang.org/packages/justinmimbs/elm-date-extra/latest
Extra functions for working with Date
Home Page: http://package.elm-lang.org/packages/justinmimbs/elm-date-extra/latest
$ 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!```
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.
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.
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
Do you have a license policy for your code?
Thank you.
Due to issue elm/compiler#1096 in the elm compiler the line infixl 1 >>=
can only exist once in a project, including its libraries.
For example this library is now incompatible with https://github.com/Bogdanp/elm-combine and https://github.com/Fresheyeball/elm-return.
Related issues in these libraries:
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?
Would it be possible to use localised versions of all the names by providing locale, like "et" or "en", or whatever, and by providing the localisation data to get month, week and other names in different languages?
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?
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 ;)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.