ref: d9f555652a9743d98143ccf3a0a5b6b903dfeaaa
parent: ddd1e5ebe619baf5794d3e2e4a66a732df4ddeb3
author: isRyven <ryven.mt@gmail.com>
date: Fri Dec 20 09:21:13 EST 2019
Fix date setMonth and setUTCMonth processed wrong optional argument
--- a/jsdate.c
+++ b/jsdate.c
@@ -649,7 +649,7 @@
double t = LocalTime(js_todate(J, 0));
double y = YearFromTime(t);
double m = js_tonumber(J, 1);
- double d = js_optnumber(J, 3, DateFromTime(t));
+ double d = js_optnumber(J, 2, DateFromTime(t));
js_setdate(J, 0, UTC(MakeDate(MakeDay(y, m, d), TimeWithinDay(t))));
}
@@ -716,7 +716,7 @@
double t = js_todate(J, 0);
double y = YearFromTime(t);
double m = js_tonumber(J, 1);
- double d = js_optnumber(J, 3, DateFromTime(t));
+ double d = js_optnumber(J, 2, DateFromTime(t));
js_setdate(J, 0, MakeDate(MakeDay(y, m, d), TimeWithinDay(t)));
}