calculator/src/CalcViewModel
Rudy Huyn cd7c266a6b Fix issue with Date diff when it includes a Daylight Saving Time (#193)
The application uses local time to calculate the number of days between 2 dates. If a Daylight Saving Time takes place during this period of time (only Clocks Forward 2am->3am), the application will miss 1 day and fail to calculate the number of days/weeks/months between the 2 dates.
image

Description of the changes:
DateCalculationEngine uses local time to modify dates, however, AddDays, AddWeeks,... won't add 24 hours or 7 days if DST happens between the 2 dates, but instead add ~23.9/24.1 hours or ~6.9/7.1 days (depends if it's the DST clock backward or clock forward). When the DST is clock forward, DateCalculationEngine will miss one day.

Solution
use UTC dates to calculate date difference.

Extra Fix:
use calendar->FirstPeriodInThisDay and calendar->FirstHourInThisPeriod in ClipTime (else it will set the time to 12PM (noon) in some regions.
replace OBSERVABLE_PROPERTY_RW by OBSERVABLE_PROPERTY_R when possible.
remove the definition of CheckClipTimeSameDay (implementation missing)

How changes were validated:
Tested manually with different regions (FR, US, ES, JP).

Fixes #178
2019-03-18 11:22:32 -07:00
..
Common Fix issue with Date diff when it includes a Daylight Saving Time (#193) 2019-03-18 11:22:32 -07:00
DataLoaders Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
ApplicationViewModel.cpp Replace escape sequences with path separators in include paths 2019-03-07 15:51:00 -08:00
ApplicationViewModel.h Hello GitHub 2019-01-28 16:24:37 -08:00
CalcViewModel.vcxproj Build with /W4 (#197) 2019-03-08 23:15:28 -08:00
CalcViewModel.vcxproj.filters Clean up project structure in Visual Studio (#8) 2019-02-04 11:52:28 -08:00
DateCalculatorViewModel.cpp Fix issue with Date diff when it includes a Daylight Saving Time (#193) 2019-03-18 11:22:32 -07:00
DateCalculatorViewModel.h Fix issue with Date diff when it includes a Daylight Saving Time (#193) 2019-03-18 11:22:32 -07:00
HistoryItemViewModel.cpp Replace escape sequences with path separators in include paths 2019-03-07 15:51:00 -08:00
HistoryItemViewModel.h Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
HistoryViewModel.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
HistoryViewModel.h - Avoid referencing project headers from precompiled headers. 2019-02-14 18:20:25 -08:00
MemoryItemViewModel.cpp Hello GitHub 2019-01-28 16:24:37 -08:00
MemoryItemViewModel.h - Avoid referencing project headers from precompiled headers. 2019-02-14 18:20:25 -08:00
packages.config Hello GitHub 2019-01-28 16:24:37 -08:00
pch.cpp Hello GitHub 2019-01-28 16:24:37 -08:00
pch.h Replace custom ARRAYSIZE macro with std::size (#208) 2019-03-14 21:06:12 -07:00
StandardCalculatorViewModel.cpp Fix compilation issues due to unsigned/signed warnings treated as errors (#317) 2019-03-15 21:21:30 -07:00
StandardCalculatorViewModel.h Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
targetver.h Hello GitHub 2019-01-28 16:24:37 -08:00
UnitConverterViewModel.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
UnitConverterViewModel.h Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
ViewState.cpp Hello GitHub 2019-01-28 16:24:37 -08:00
ViewState.h Hello GitHub 2019-01-28 16:24:37 -08:00