Skip to content
Snippets Groups Projects
Commit 23e9866b authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard
Browse files

comctl32/monthcal: Fix navigation from last day in a month.

parent a3508545
No related branches found
No related tags found
No related merge requests found
......@@ -458,22 +458,32 @@ int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace)
/* properly updates date to point on next month */
static inline void MONTHCAL_GetNextMonth(SYSTEMTIME *date)
{
INT length;
if(++date->wMonth > 12)
{
date->wMonth = 1;
date->wYear++;
}
/* fix moving from last day in a month */
length = MONTHCAL_MonthLength(date->wMonth, date->wYear);
if(date->wDay > length) date->wDay = length;
MONTHCAL_CalculateDayOfWeek(date, TRUE);
}
/* properly updates date to point on prev month */
static inline void MONTHCAL_GetPrevMonth(SYSTEMTIME *date)
{
INT length;
if(--date->wMonth < 1)
{
date->wMonth = 12;
date->wYear--;
}
/* fix moving from last day in a month */
length = MONTHCAL_MonthLength(date->wMonth, date->wYear);
if(date->wDay > length) date->wDay = length;
MONTHCAL_CalculateDayOfWeek(date, TRUE);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment