Skip to content

Commit 81a057d

Browse files
committed
[DOC] Emphasized that parse methods are not validators
1 parent 47cca1b commit 81a057d

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

ext/date/date_core.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4345,8 +4345,11 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass)
43454345
* Date._parse(string[, comp=true]) -> hash
43464346
*
43474347
* Parses the given representation of date and time, and returns a
4348-
* hash of parsed elements. This method does not function as a
4349-
* validator.
4348+
* hash of parsed elements.
4349+
*
4350+
* This method **does not** function as a validator. If the input
4351+
* string does not match valid formats strictly, you may get a cryptic
4352+
* result.
43504353
*
43514354
* If the optional second argument is true and the detected year is in
43524355
* the range "00" to "99", considers the year a 2-digit form and makes
@@ -4365,7 +4368,11 @@ date_s__parse(int argc, VALUE *argv, VALUE klass)
43654368
* Date.parse(string='-4712-01-01'[, comp=true[, start=Date::ITALY]]) -> date
43664369
*
43674370
* Parses the given representation of date and time, and creates a
4368-
* date object. This method does not function as a validator.
4371+
* date object.
4372+
*
4373+
* This method **does not** function as a validator. If the input
4374+
* string does not match valid formats strictly, you may get a cryptic
4375+
* result.
43694376
*
43704377
* If the optional second argument is true and the detected year is in
43714378
* the range "00" to "99", considers the year a 2-digit form and makes
@@ -8001,7 +8008,11 @@ datetime_s_strptime(int argc, VALUE *argv, VALUE klass)
80018008
* DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=Date::ITALY]]) -> datetime
80028009
*
80038010
* Parses the given representation of date and time, and creates a
8004-
* DateTime object. This method does not function as a validator.
8011+
* DateTime object.
8012+
*
8013+
* This method **does not** function as a validator. If the input
8014+
* string does not match valid formats strictly, you may get a cryptic
8015+
* result.
80058016
*
80068017
* If the optional second argument is true and the detected year is in
80078018
* the range "00" to "99", makes it full.

0 commit comments

Comments
 (0)