rtfeldman / elm-iso8601-date-strings

Convert between ISO-8601 date strings and Time.Posix
https://package.elm-lang.org/packages/rtfeldman/elm-iso8601-date-strings/latest
BSD 3-Clause "New" or "Revised" License
34 stars 21 forks source link

Add support for Facebook datetime type: #11

Closed Natim closed 6 years ago

Natim commented 6 years ago

@rtfeldman Is this something that you would accept to have as part as this lib?


      "created_time": "2017-04-06T22:04:21+0000",
      "from": {
        "name": "Jay P Jeanne",
        "id": "126577551217199"
      },
      "id": "126577551217199_122842541590700",
      "message": "Hello",
      "permalink_url": "https://www.facebook.com/126577551217199/posts/122842541590700",
    }```
rtfeldman commented 6 years ago

@Natim I want to keep this library scoped to ISO-8601 date time strings...if Facebook's format is technically a valid ISO-8601 string (which maybe it is and I'm not aware?) then could you link me to some docs about that relationship?

Natim commented 6 years ago

According to the wikipedia page linked in the readme or the W3C definition, it doesn't seems to be a valid ISO-8601 date, however Facebook claim it is.

The Facebook documentation itself doesn't elaborate about their datetime format.

I tried to update the parser to add a oneOf, but I wasn't successful.

It is up to you to decide if you want to cover that case and I obviously can't blame you to decide to follow the spec to the letter, just wanted to let you know that I encountered something that claimed to be an ISO8601 datetime and that it apparently wasn't supported by this lib.

Natim commented 6 years ago

https://twitter.com/Natim/status/1036926809043030016?s=19

rtfeldman commented 6 years ago

@natim yeah I want to stick to the canonical definition here - although worth noting the author of https://package.elm-lang.org/packages/jweir/elm-iso8601/latest might feel differently!

Natim commented 6 years ago

Yes right : https://github.com/jweir/elm-iso8601/blob/5.0.0/tests/Tests.elm#L45