rluiten / elm-date-extra

Elm Date Extra library add/subtract/diff/format etc dates
http://package.elm-lang.org/packages/rluiten/elm-date-extra/latest
BSD 3-Clause "New" or "Revised" License
75 stars 36 forks source link

utcIsoWeekString : Date -> String #54

Closed adius closed 7 years ago

adius commented 7 years ago

There is already Utils.isoWeek, but the corresponding formatter is missing.

rluiten commented 7 years ago

I added all 3 fields that Utils.isoWeek can return as format fields in release 9.1.2.

adius commented 7 years ago

Ah, I see, thanks. I was looking for some convenience helper a la utcIsoString.

Btw: You should setup some type alias to make the documentation easier to read.

For example

format : Config -> FormatString -> Date -> FormattedDate

instead of

format : Config -> String -> Date -> String
rluiten commented 7 years ago

That is a good idea.

Though IMO if the documentation extraction used the name of the parameters rather as well as the types then the need for alias types has not got the value any more.

On Mon, Sep 11, 2017 at 5:23 PM, Adrian Sieber notifications@github.com wrote:

Ah, I see, thanks. I was looking for some convenience helper a la utcIsoString.

Btw: You should setup some type alias to make the documentation easier to read.

For example

format : Config -> FormatString -> Date -> FormattedDate

instead of

format : Config -> String -> Date -> String

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/rluiten/elm-date-extra/issues/54#issuecomment-328440678, or mute the thread https://github.com/notifications/unsubscribe-auth/AAo7CHxxXe85V9MWJR5IIk9R8JRIsKv-ks5shN_6gaJpZM4PSStB .

adius commented 7 years ago

But many (including me) use shortcut words as parameter names, as the signature already says what that parameter exactly is. e.g.

format : Config -> FormatString -> Date -> FormattedDate
format conf fmtStr date fmtedDate = …

And this would make a shitty documentation. (I'm exaggerating here a little, but you know what I mean…)