Discussion:
[elm-discuss] Date type not recognized
Casper Bollen
2017-06-27 13:00:29 UTC
Permalink
When I want to use the Date type, it isn't recognized. Isn't this type
automatically loaded with the core libs??
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Casper Bollen
2017-06-27 13:03:54 UTC
Permalink
For example when I use:

type alias Test = { date : Date }

I get an Cannot find type Date error
Post by Casper Bollen
When I want to use the Date type, it isn't recognized. Isn't this type
automatically loaded with the core libs??
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ilias Van Peer
2017-06-27 13:49:26 UTC
Permalink
Hi Casper,

Correct, the `Date` module (and type) are not imported or exposed by
default. You can find the default imports
here: http://package.elm-lang.org/packages/elm-lang/core/latest

To make `Date` available in your module, you can use `import Date exposing
(Date)`. The "exposing" part means you can reference the `Date` type
unqualified as `Date` rather than `Date.Date`, but other functions will
only be available when qualified (e.g. `Date.fromString`)

Good luck!
Post by Casper Bollen
type alias Test = { date : Date }
I get an Cannot find type Date error
Post by Casper Bollen
When I want to use the Date type, it isn't recognized. Isn't this type
automatically loaded with the core libs??
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...