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
ffbdd272
Commit
ffbdd272
authored
Mar 08, 2012
by
Owen Rudge
Committed by
Alexandre Julliard
Mar 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/datetime: Fix AM/PM handling with 12-hour fields.
parent
74d1c116
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
datetime.c
dlls/comctl32/datetime.c
+23
-1
No files found.
dlls/comctl32/datetime.c
View file @
ffbdd272
...
...
@@ -4,6 +4,7 @@
* Copyright 1998, 1999 Eric Kohl
* Copyright 1999, 2000 Alex Priem <alexp@sci.kun.nl>
* Copyright 2000 Chris Morgan <cmorgan@wpi.edu>
* Copyright 2012 Owen Rudge for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -896,9 +897,20 @@ DATETIME_ApplySelectedField (DATETIME_INFO *infoPtr)
break
;
case
ONEDIGIT12HOUR
:
case
TWODIGIT12HOUR
:
if
(
val
>=
24
)
val
-=
20
;
if
(
val
>=
13
)
date
.
wHour
=
val
;
else
if
(
val
!=
0
)
{
if
(
date
.
wHour
>=
12
)
/* preserve current AM/PM state */
date
.
wHour
=
(
val
==
12
?
12
:
val
+
12
);
else
date
.
wHour
=
(
val
==
12
?
0
:
val
);
}
break
;
case
ONEDIGIT24HOUR
:
case
TWODIGIT24HOUR
:
/* FIXME: Preserve AM/PM for 12HOUR? */
date
.
wHour
=
val
;
break
;
case
ONEDIGITMINUTE
:
...
...
@@ -1232,6 +1244,16 @@ DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
else
maxChars
=
2
;
if
((
fieldSpec
==
ONEDIGIT12HOUR
||
fieldSpec
==
TWODIGIT12HOUR
||
fieldSpec
==
ONEDIGIT24HOUR
||
fieldSpec
==
TWODIGIT24HOUR
)
&&
(
infoPtr
->
nCharsEntered
==
1
))
{
if
(
vkCode
>=
'3'
)
maxChars
=
1
;
}
if
(
maxChars
==
infoPtr
->
nCharsEntered
)
DATETIME_ApplySelectedField
(
infoPtr
);
}
...
...
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