summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-20 18:26:12 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-21 16:16:15 +0900
commit67e544cbe15abb852742236f9de1b3b9a9add676 (patch)
tree7071b0bd0fb04e574aa0a99e7a40860a1fcd9344
parent538276aa777e4abfb6eaf55466043a3752fbb8ec (diff)
[ruby/date] [DOC] Emphasized that `parse` methods are not validators
https://github.com/ruby/date/commit/81a057db11
-rw-r--r--ext/date/date_core.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 666f278a9b..ed7bff04db 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -4345,8 +4345,11 @@ date_s__parse_internal(int argc, VALUE *argv, VALUE klass)
* Date._parse(string[, comp=true]) -> hash
*
* Parses the given representation of date and time, and returns a
- * hash of parsed elements. This method does not function as a
- * validator.
+ * hash of parsed elements.
+ *
+ * This method **does not** function as a validator. If the input
+ * string does not match valid formats strictly, you may get a cryptic
+ * result.
*
* If the optional second argument is true and the detected year is in
* 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)
* Date.parse(string='-4712-01-01'[, comp=true[, start=Date::ITALY]]) -> date
*
* Parses the given representation of date and time, and creates a
- * date object. This method does not function as a validator.
+ * date object.
+ *
+ * This method **does not** function as a validator. If the input
+ * string does not match valid formats strictly, you may get a cryptic
+ * result.
*
* If the optional second argument is true and the detected year is in
* 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)
* DateTime.parse(string='-4712-01-01T00:00:00+00:00'[, comp=true[, start=Date::ITALY]]) -> datetime
*
* Parses the given representation of date and time, and creates a
- * DateTime object. This method does not function as a validator.
+ * DateTime object.
+ *
+ * This method **does not** function as a validator. If the input
+ * string does not match valid formats strictly, you may get a cryptic
+ * result.
*
* If the optional second argument is true and the detected year is in
* the range "00" to "99", makes it full.