mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/date] Check month range as civil
This commit is contained in:
parent
cb80ee7a4a
commit
739ad81ff1
1 changed files with 2 additions and 0 deletions
|
@ -761,6 +761,8 @@ c_valid_civil_p(int y, int m, int d, double sg,
|
||||||
|
|
||||||
if (m < 0)
|
if (m < 0)
|
||||||
m += 13;
|
m += 13;
|
||||||
|
if (m < 1 || m > 12)
|
||||||
|
return 0;
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
if (!c_find_ldom(y, m, sg, rjd, ns))
|
if (!c_find_ldom(y, m, sg, rjd, ns))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue