Skip to content
Snippets Groups Projects
Commit 67ab15f1 authored by deuce's avatar deuce
Browse files

Use JS_NewNumberValue() rather than INT_TO_JSVAL() for system.datestr()

conversion from string.  This allows dates from the last couple years to work

*cough*
parent 9254d939
No related branches found
No related tags found
No related merge requests found
......@@ -938,8 +938,7 @@ js_datestr(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
t=time(NULL); /* use current time */
else {
if(JSVAL_IS_STRING(argv[0])) { /* convert from string to time_t? */
*rval = INT_TO_JSVAL(
dstrtounix(cfg,JS_GetStringBytes(JS_ValueToString(cx, argv[0]))));
JS_NewNumberValue(cx,dstrtounix(cfg,JS_GetStringBytes(JS_ValueToString(cx, argv[0]))),rval);
return(JS_TRUE);
}
JS_ValueToInt32(cx,argv[0],(int32*)&t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment