Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 757 Bytes

README.md

File metadata and controls

26 lines (22 loc) · 757 Bytes

SimpleDate Build Status

Example

For a working example, check out the Example file

{ simpleDate = {day = Nothing, month = Nothing, year = Nothing}

This is a instance of simpleDate type.

update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
    case msg of
      UpdateField field value ->
          let
            newDate = dateUpdate model.simpleDate field value
          in
            {model | simpleDate = newDate} ! []

Here you can work with the "dateUpdate" function alongside with a message type. field is the type that you want to edit, passed as a string. types can be:

  • "day"
  • "month"
  • "year"