(fix) better handle timezone changes (fixes #4624)

This commit is contained in:
Ludovic Marcotte
2018-12-20 13:37:59 -05:00
parent af70306d9a
commit e418fcb6ca
2 changed files with 23 additions and 4 deletions

View File

@@ -78,10 +78,28 @@ struct SYSTEMTIME {
tzData->wDay = ([mask firstOccurrence] == -1) ? 5 : [mask firstOccurrence];
dateValue = [self startDate];
tzData->wHour = [dateValue hourOfDay];
tzData->wMinute = [dateValue minuteOfHour];
tzData->wSecond = [dateValue secondOfMinute];
tzData->wMilliseconds = 0;
if (![dateValue hourOfDay])
{
if ([mask firstDay]-1 < 0)
tzData->wDayOfWeek = 6;
else
tzData->wDayOfWeek = [mask firstDay]-1;
tzData->wHour = 23;
tzData->wMinute = 59;
tzData->wSecond = 59;
tzData->wMilliseconds = 999;
}
else
{
tzData->wDayOfWeek = [mask firstDay];
tzData->wHour = [dateValue hourOfDay];
tzData->wMinute = [dateValue minuteOfHour];
tzData->wSecond = [dateValue secondOfMinute];
tzData->wMilliseconds = 0;
}
}
}