Skip to content

Commit

Permalink
Updated parse doc re: 2.0 changes
Browse files Browse the repository at this point in the history
Looks like this was updated when `parse` was renamed to `toDate`,
(date-fns#375), but fell behind when ISO parsing was extracted from `toDate`
into `parseISO` (date-fns#1023).
  • Loading branch information
eostrom committed Mar 23, 2019
1 parent 6f41d53 commit e0f23e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parse/index.js
Expand Up @@ -272,15 +272,17 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* - Old `parse` was renamed to `toDate`.
* - Old `parse` was split into [parseISO]{@link https://date-fns.org/docs/parseISO} (parses an ISO 8601 string)
and [toDate]{@link https://date-fns.org/docs/toDate} (converts a number or Date).
* Now `parse` is a new function which parses a string using a provided format.
*
* ```javascript
* // Before v2.0.0
* parse('2016-01-01')
*
* // v2.0.0 onward
* toDate('2016-01-01')
* toDate(1451606400000)
* parseISO('2016-01-01')
* parse('2016-01-01', 'yyyy-MM-dd', new Date())
* ```
*
Expand Down

0 comments on commit e0f23e5

Please sign in to comment.