Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b0915dfb
Commit
b0915dfb
authored
Nov 16, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implement FormatDateTime().
parent
fd6cf181
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
3 deletions
+50
-3
global.c
dlls/vbscript/global.c
+25
-3
api.vbs
dlls/vbscript/tests/api.vbs
+25
-0
No files found.
dlls/vbscript/global.c
View file @
b0915dfb
...
...
@@ -3015,10 +3015,32 @@ static HRESULT Global_FormatPercent(BuiltinDisp *This, VARIANT *args, unsigned a
return
return_bstr
(
res
,
str
);
}
static
HRESULT
Global_FormatDateTime
(
BuiltinDisp
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
static
HRESULT
Global_FormatDateTime
(
BuiltinDisp
*
This
,
VARIANT
*
arg
s
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
int
format
=
0
;
HRESULT
hres
;
BSTR
str
;
TRACE
(
"
\n
"
);
assert
(
1
<=
args_cnt
&&
args_cnt
<=
2
);
if
(
V_VT
(
args
)
==
VT_NULL
)
return
MAKE_VBSERROR
(
VBSE_TYPE_MISMATCH
);
if
(
args_cnt
==
2
)
{
if
(
V_VT
(
args
+
1
)
==
VT_NULL
)
return
MAKE_VBSERROR
(
VBSE_ILLEGAL_NULL_USE
);
if
(
V_VT
(
args
+
1
)
!=
VT_ERROR
)
{
if
(
FAILED
(
hres
=
to_int
(
args
+
1
,
&
format
)))
return
hres
;
}
}
hres
=
VarFormatDateTime
(
args
,
format
,
0
,
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
return
return_bstr
(
res
,
str
);
}
static
HRESULT
Global_WeekdayName
(
BuiltinDisp
*
This
,
VARIANT
*
args
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
b0915dfb
...
...
@@ -2411,4 +2411,29 @@ end sub
call
testFormatPercent
()
call
testFormatPercentError
()
sub
testFormatDateTimeError
()
on
error
resume
next
dim
x
call
Err
.
clear
()
x
=
FormatDateTime
(
null
)
call
ok
(
Err
.
number
=
13
,
"Err.number = "
&
Err
.
number
)
call
ok
(
getVT
(
x
)
=
"VT_EMPTY*"
,
"getVT = "
&
getVT
(
x
))
call
Err
.
clear
()
x
=
FormatDateTime
(.
10,
null
)
call
ok
(
Err
.
number
=
94
,
"Err.number = "
&
Err
.
number
)
call
ok
(
getVT
(
x
)
=
"VT_EMPTY*"
,
"getVT = "
&
getVT
(
x
))
end
sub
sub
testFormatDateTime
()
dim
x
x
=
FormatDateTime
(
0
)
call
ok
(
getVT
(
x
)
=
"VT_BSTR*"
,
"getVT = "
&
getVT
(
x
))
x
=
FormatDateTime
(
0.1
,
1
)
call
ok
(
getVT
(
x
)
=
"VT_BSTR*"
,
"getVT = "
&
getVT
(
x
))
end
sub
call
testFormatDateTime
()
call
testFormatDateTimeError
()
Call
reportSuccess
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment