New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs for parse
to discourage its use
#25
Update docs for parse
to discourage its use
#25
Conversation
@@ -150,8 +150,11 @@ foreign import dateMethod :: forall a. Fn2 String JSDate a | |||
|
|||
-- | Attempts to parse a date from a string. The behaviour of this function is | |||
-- | implementation specific until ES5, so may not always have the same | |||
-- | behaviour for a given string. The RFC2822 and ISO8601 date string formats |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
behaviour
→ behavior
Does PureScript have any language-level conventions on spelling?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not aware of any conventions; both British / American English variants appear in various places. I don't mind which one is used here, but if we switch this behaviour
-> behavior
then we should adjust the one two lines up as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
This is my first stab at rewording the docs. Let me know if we want to include more information (perhaps mentioning a date parsing library to use as an alternative?) or if tweaks to the wording are needed. |
-- | behaviour for a given string. The RFC2822 and ISO8601 date string formats | ||
-- | should parse consistently. | ||
-- | behavior for a given string. For this reason, it is **strongly** encouraged | ||
-- | that you avoid this function if at all possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add "and instead use functions from a higher-level library like datetime
" but I'll defer to @hdgarrood on his preferred wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine to me 👍
As discussed in #15, this PR updates the docs for
parse
to discourage its use.