Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add date and time fields #231

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion src/Element/Input.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module Element.Input exposing
, button
, checkbox, defaultCheckbox
, text, multiline
, date, time
, Placeholder, placeholder
, username, newPassword, currentPassword, email, search, spellChecked
, slider, Thumb, thumb, defaultThumb
Expand Down Expand Up @@ -64,7 +65,7 @@ This is also the first input element that has a [`required label`](#Label).

# Text

@docs text, multiline
@docs text, multiline, date, time

@docs Placeholder, placeholder

Expand Down Expand Up @@ -1407,6 +1408,40 @@ text =
, autofill = Nothing
}

{-| -}
date :
List (Attribute msg)
->
{ onChange : String -> msg
, text : String
, placeholder : Maybe (Placeholder msg)
, label : Label msg
}
-> Element msg
date =
textHelper
{ type_ = TextInputNode "date"
, spellchecked = False
, autofill = Nothing
}

{-| -}
time :
List (Attribute msg)
->
{ onChange : String -> msg
, text : String
, placeholder : Maybe (Placeholder msg)
, label : Label msg
}
-> Element msg
time =
textHelper
{ type_ = TextInputNode "time"
, spellchecked = False
, autofill = Nothing
}


{-| If spell checking is available, this input will be spellchecked.
-}
Expand Down