You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- SUBSCRIPTIONSsubscriptions:Model->SubMsgsubscriptions model =Time.every Time.second NewTime
in main ergänzen
, subscriptions = subscriptions
im Model ergänzen
, time :Time
in init ergänzen
, time =0
in Msg ergänzen
|NewTimeTime
in update ergänzen
NewTime time ->({ model | time = time },Cmd.none )
in view ergänzen
, h1 [ class "text-center"][ text ("Giphy Search - "++ toClock model.time)]
und toClock hinzufügen
toClock:Time->StringtoClock time =let
date =
fromTime time
hour =Date.hour date |> to2DigitString
minute =
to2DigitString (Date.minute date)
second =
date |>Date.second |> to2DigitString
in
hour ++":"++ minute ++":"++ second
to2DigitString:Int->Stringto2DigitString t =let
ts =
toString t
incase String.length ts of1->"0"++ ts
_ ->
ts
Client starten und auf die kurze Anfangssituation hinweisen - Zeit ist erst nicht richtig!