mgold / elm-date-format Goto Github PK
View Code? Open in Web Editor NEWNot updated for 0.19; use ryannhg/date-format
License: BSD 3-Clause "New" or "Revised" License
Not updated for 0.19; use ryannhg/date-format
License: BSD 3-Clause "New" or "Revised" License
It should be deadfoxygrandpa/elm-test
Hi -
It's not possible to use this package right now with 0.15 of the Elm platform because the latest version of the project with elm-version
defined in elm-package.json
hasn't yet been tagged as a release.
Could you tag master
with a new release so that the updated elm-package.json
will get pulled down by elm package install
?
Hi
Any plans to update this for Elm 0.19?
Thanks
I just noticed that @heyLu forked this package, renaming Elm-Format-String
to elm-format-date
and FormatString
to FormatDate
for the module name.
I'd propose elm-date-format
and Date.Format
myself for uniformity (at least, this is how circuithub modules look). This way it lines up nicely with say
-- Other (potential) date packages
elm-date-extra Date.Extra
elm-date-conversion Date.Convert
elm-date-format Date.Format
elm-date-format-extra Date.Format.Extra
-- Other (potential) formatting packages
elm-number-format Number.Format
-- Existing core libraries
core Json.Decode
core Json.Encode
I only thought I'd mention it since this strange fork now exists, I'm not massively concerned by naming conventions!
time formatting is wrong when using this in the test case:
("time2", "105351", "%H%M%S")
the output is
time2: FAILED. Expected: "105351"; got: "10%M51"
It looks like there is no way to render milliseconds at all. Could we add this feature?
In the format directives there is one missing: a space-padded (or non-padded) month number (July
-> 7
or 7
). I'd find that useful :)
Date.Format.formatISO8601
appears to be ignoring time zone information.
Here, in the repl, Date.fromString
appears to parse dates correctly; toString
shows them in BST or GMT depending when they fall in the year :
> Date.fromString "2015-11-10T20:34:17Z"
Ok <Tue Nov 10 2015 20:34:17 GMT+0000 (GMT)> : Result.Result String Date.Date
> Date.fromString "2015-10-10T20:34:17Z"
Ok <Sat Oct 10 2015 21:34:17 GMT+0100 (BST)> : Result.Result String Date.Date
But when I use Date.Format.formatISO8601
these two examples result in different times: both should be 20:34
, but the one in October shows up as 21:34:
> Date.fromString "2015-11-10T20:34:17Z" |> Result.map Date.Format.formatISO8601
Ok "2015-11-10T20:34:17Z" : Result.Result String String
> Date.fromString "2015-10-10T20:34:17Z" |> Result.map Date.Format.formatISO8601
Ok "2015-10-10T21:34:17Z" : Result.Result String String
midnight is "00"
with %I
, expected is "12"
https://github.com/mgold/elm-date-format/blob/master/src/Date/Format.elm#L89-L100
I feel like this should be < 12
instead of < 13
. At least in the US. Unless I'm missing something blindingly obvious. Which is very possible.
Consider 12:52, which is afternoon, which should get PM
, but currently gets AM
.
I'll submit a PR if it turns out I'm right.
Hi, thank you for present great library! ๐
In my opinion,
format "%H" 0
should show "00",
but it shows "09".
%k, %I, and %l are same, it shows with "9".
Is this correct behabior?
Sorry if my opinion is wrong ๐ฃ
It would be great if there was also a Time.format
which does the same thing, but for times (it would only need to replace hours, minutes and seconds in the format string).
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.