Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upDate.fromTime 1422777600000 returns {} in elm-repl #441
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rgrempel
Nov 20, 2015
Contributor
I think the issue you are seeing is that toString doesn't produce what you might expect from a Date.
For instance, here's an elm-repl session:
> import Date
> date = Date.fromTime 1422777600000
{} : Date.Date
> toString date
"{}" : String
> Date.year date
2015 : Int
> Date.month date
Feb : Date.Month
> Date.day date
1 : IntSo, you can see that elm-repl really has created a date, and you really can use it in functions. However, toString just doesn't produce what you might expect.
|
I think the issue you are seeing is that For instance, here's an elm-repl session: > import Date
> date = Date.fromTime 1422777600000
{} : Date.Date
> toString date
"{}" : String
> Date.year date
2015 : Int
> Date.month date
Feb : Date.Month
> Date.day date
1 : IntSo, you can see that elm-repl really has created a date, and you really can use it in functions. However, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
berndca
Nov 20, 2015
Thanks for the clarification! I guess the toString issue might be related to the fact that a native function call is used. Are there any plans to adjust the output of toString or perhaps to at least output a message indicating the limitation?
Thanks, Bernd
berndca
commented
Nov 20, 2015
|
Thanks for the clarification! I guess the toString issue might be related to the fact that a native function call is used. Are there any plans to adjust the output of toString or perhaps to at least output a message indicating the limitation? Thanks, Bernd |
added a commit
to rgrempel/core
that referenced
this issue
Nov 21, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I've submitted a PR -- see #442 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Jan 19, 2016
Contributor
Since there is a pull request addressing this issue, I am closing the issue itself.
|
Since there is a pull request addressing this issue, I am closing the issue itself. |
berndca commentedNov 20, 2015
I expected
Date.fromTime 1422777600000
to return
// new Date(1422777600000.0)
Sun Feb 01 2015 00:00:00 GMT-0800 (PST)
However I got {} : Date.Date
I'm using elm-repl 0.16. Am I missing something?
Thanks, Bernd