Commit 296ff41d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Add Year function implementation.

parent d87dc355
......@@ -1637,8 +1637,13 @@ static HRESULT Global_Weekday(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, V
static HRESULT Global_Year(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
SYSTEMTIME st;
HRESULT hres;
TRACE("(%s)\n", debugstr_variant(arg));
hres = to_system_time(arg, &st);
return FAILED(hres) ? hres : return_short(res, st.wYear);
}
static HRESULT Global_Hour(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
......
......@@ -1446,6 +1446,8 @@ Call ok(getVT(Day(now)) = "VT_I2", "getVT(Day(now)) = " & getVT(Day(now)))
Call ok(Day(2) = 1, "Day(2) = " & Day(2))
Call ok(getVT(Month(now)) = "VT_I2", "getVT(Month(now)) = " & getVT(Month(now)))
Call ok(Month(2) = 1, "Month(2) = " & Month(2))
Call ok(getVT(Year(now)) = "VT_I2", "getVT(Year(now)) = " & getVT(Year(now)))
Call ok(Year(2) = 1900, "Year(2) = " & Year(2))
Sub testRGBError(arg1, arg2, arg3, error_num)
on error resume next
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment