Little suggestions on your no-string-interpolation example:
(String.pad 2 '0' <| toString (hour date)) ++ ":" ++ (String.pad 2 '0' <| 
toString (minute date)) 

1. You could try 
http://package.elm-lang.org/packages/mgold/elm-date-format/1.1.4/ if you're 
not opposed to using a third party package.
2. Or pull the duplicate code out into a function:
formatTime : Int -> String
formatTime time =
    String.pad 2 '0' <| toString time

and do
    String.join ":" [formatTime (hour date), formatTime (minute date)]

That's still not quite as tidy as string interpolation but I've found it's 
a good habit to get into to pull anything you do more than once out into 
its own function, especially in Elm; in Python my threshold tends to be 
three uses :)

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to