Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9b011bd0
Commit
9b011bd0
authored
Jun 28, 2009
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added Date_toLocaleString implementation.
parent
5be6deb8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
2 deletions
+45
-2
date.c
dlls/jscript/date.c
+45
-2
No files found.
dlls/jscript/date.c
View file @
9b011bd0
...
...
@@ -458,11 +458,54 @@ static HRESULT Date_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
return
E_NOTIMPL
;
}
/* ECMA-262 3rd Edition 15.9.1.5 */
static
HRESULT
Date_toLocaleString
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
VARIANT
*
retv
,
jsexcept_t
*
ei
,
IServiceProvider
*
caller
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
static
const
WCHAR
NaNW
[]
=
{
'N'
,
'a'
,
'N'
,
0
};
SYSTEMTIME
st
;
DateInstance
*
date
;
BSTR
date_str
;
int
date_len
,
time_len
;
TRACE
(
"
\n
"
);
if
(
!
is_class
(
dispex
,
JSCLASS_DATE
))
{
FIXME
(
"throw TypeError
\n
"
);
return
E_FAIL
;
}
date
=
(
DateInstance
*
)
dispex
;
if
(
isnan
(
date
->
time
))
{
if
(
retv
)
{
V_VT
(
retv
)
=
VT_BSTR
;
V_BSTR
(
retv
)
=
SysAllocString
(
NaNW
);
if
(
!
V_BSTR
(
retv
))
return
E_OUTOFMEMORY
;
}
return
S_OK
;
}
st
=
create_systemtime
(
local_time
(
date
->
time
,
date
));
if
(
st
.
wYear
<
1601
||
st
.
wYear
>
9999
)
return
Date_toString
(
dispex
,
lcid
,
flags
,
dp
,
retv
,
ei
,
caller
);
if
(
retv
)
{
date_len
=
GetDateFormatW
(
lcid
,
DATE_LONGDATE
,
&
st
,
NULL
,
NULL
,
0
);
time_len
=
GetTimeFormatW
(
lcid
,
0
,
&
st
,
NULL
,
NULL
,
0
);
date_str
=
SysAllocStringLen
(
NULL
,
date_len
+
time_len
-
1
);
if
(
!
date_str
)
return
E_OUTOFMEMORY
;
GetDateFormatW
(
lcid
,
DATE_LONGDATE
,
&
st
,
NULL
,
date_str
,
date_len
);
GetTimeFormatW
(
lcid
,
0
,
&
st
,
NULL
,
&
date_str
[
date_len
],
time_len
);
date_str
[
date_len
-
1
]
=
' '
;
V_VT
(
retv
)
=
VT_BSTR
;
V_BSTR
(
retv
)
=
date_str
;
}
return
S_OK
;
}
static
HRESULT
Date_hasOwnProperty
(
DispatchEx
*
dispex
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
dp
,
...
...
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