Skip to content

Update docs for parse to discourage its use #25

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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Data/JSDate.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

behaviourbehavior

Does PureScript have any language-level conventions on spelling?

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

-- | should parse consistently.
-- | behavior for a given string. For this reason, it is **strongly** encouraged
-- | that you avoid this function if at all possible.
Copy link
Contributor

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.

Copy link
Contributor

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 👍

-- |
-- | If you must use it, the RFC2822 and ISO8601 date string formats should
-- | parse consistently.
-- |
-- | This function is effectful because if no time zone is specified in the
-- | string the current locale's time zone will be used instead.
Expand Down