mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-01 07:45:22 +03:00
Add Form.Value module.
This commit is contained in:
parent
d5478db009
commit
43a227d22c
@ -0,0 +1,39 @@
|
||||
module Form.Value exposing (Value, toString)
|
||||
|
||||
import Date exposing (Date)
|
||||
|
||||
|
||||
type Value dataType
|
||||
= Value String
|
||||
|
||||
|
||||
toString : Value dataType -> String
|
||||
toString (Value rawValue) =
|
||||
rawValue
|
||||
|
||||
|
||||
date : Date -> Value Date
|
||||
date date_ =
|
||||
date_
|
||||
|> Date.toIsoString
|
||||
|> Value
|
||||
|
||||
|
||||
float : Float -> Value Float
|
||||
float float_ =
|
||||
float_
|
||||
|> String.fromFloat
|
||||
|> Value
|
||||
|
||||
|
||||
int : Int -> Value Int
|
||||
int int_ =
|
||||
int_
|
||||
|> String.fromInt
|
||||
|> Value
|
||||
|
||||
|
||||
string : String -> Value String
|
||||
string string_ =
|
||||
string_
|
||||
|> Value
|
Loading…
Reference in New Issue
Block a user