diff --git a/dlls/jscript/date.c b/dlls/jscript/date.c index d43708a8835..aa06f4e740d 100644 --- a/dlls/jscript/date.c +++ b/dlls/jscript/date.c @@ -2617,12 +2617,11 @@ static HRESULT DateConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPP if(FAILED(hres)) return hres; - if(V_VT(&prim) == VT_BSTR) { - FIXME("VT_BSTR not supported\n"); - return E_NOTIMPL; - } + if(V_VT(&prim) == VT_BSTR) + hres = date_parse(V_BSTR(&prim), &num); + else + hres = to_number(dispex->ctx, &prim, ei, &num); - hres = to_number(dispex->ctx, &prim, ei, &num); VariantClear(&prim); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 27eabfc8d22..b76e94bd071 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -940,6 +940,8 @@ date = new Date(8.64e15+1); ok(isNaN(0+date.getTime()), "date.getTime() is not NaN"); date = new Date(Infinity); ok(isNaN(0+date.getTime()), "date.getTime() is not NaN"); +date = new Date("3 July 2009 22:28:00 UTC+0100"); +ok(date.getTime() === 1246656480000, "date.getTime() = " + date.getTime()); date = new Date(1984, 11, 29, 13, 51, 24, 120); ok(date.getFullYear() === 1984, "date.getFullYear() = " + date.getFullYear()); ok(date.getMonth() === 11, "date.getMonth() = " + date.getMonth());