Skip to content

Commit

Permalink
Update docs for ISO8601
Browse files Browse the repository at this point in the history
  • Loading branch information
mgold committed Jan 6, 2016
1 parent 79b7c18 commit e407d26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Create format strings for dates in the Elm programming language.
Documentation
-------------

The module `Date.Format` exports one function, `format : String -> Date.Date -> String`.
The module `Date.Format` exports `format : String -> Date.Date -> String`.
The `Date` refers to Elm's standard [Date library](http://package.elm-lang.org/packages/elm-lang/core/latest/Date).
The input `String` may contain any of the following substrings, which will be expanded to parts of the date.

Expand Down
6 changes: 4 additions & 2 deletions src/Date/Format.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Date.Format (format, formatISO8601) where
{-|Format strings for dates.
@docs format
@docs format, formatISO8601
-}

import Date
Expand All @@ -20,7 +20,9 @@ list of accepted formatters.
format : String -> Date.Date -> String
format s d = Regex.replace Regex.All re (formatToken d) s

{-| Formats a UTC date acording to [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). This is commonly used to send dates to a server. For example: `2016-01-06T09:22:00Z`.
{-| Formats a UTC date acording to
[ISO-8601](https://en.wikipedia.org/wiki/ISO_8601). This is commonly used to
send dates to a server. For example: `2016-01-06T09:22:00Z`.
-}
formatISO8601 : Date.Date -> String
formatISO8601 = format "%Y-%m-%dT%H:%M:%SZ"
Expand Down

0 comments on commit e407d26

Please sign in to comment.