Skip to content
Snippets Groups Projects
Commit 565cd35c authored by rswindell's avatar rswindell
Browse files

strftime() now uses current time if not specified (without warning).

parent 314303c6
No related branches found
No related tags found
No related merge requests found
......@@ -1110,7 +1110,7 @@ js_strftime(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
JSString* js_str;
fmt=JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
if(argc)
if(argc>1)
JS_ValueToInt32(cx,argv[1],(int32*)&t);
strcpy(str,"-Invalid time-");
......@@ -1221,7 +1221,7 @@ static jsMethodSpec js_global_functions[] = {
{"rmdir", js_rmdir, 1, JSTYPE_BOOLEAN, JSDOCSTR("string directory")
,JSDOCSTR("remove directory")
},
{"strftime", js_strftime, 2, JSTYPE_STRING, JSDOCSTR("string format, number time")
{"strftime", js_strftime, 1, JSTYPE_STRING, JSDOCSTR("string format [,number time]")
,JSDOCSTR("return a formatted time string")
},
{"format", js_format, 1, JSTYPE_STRING, JSDOCSTR("string format [,args]")
......
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