calculator/src/CalculatorUnitTests
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
..
Assets Optimised images losslessly. (#229) 2019-03-13 16:37:50 -07:00
Mocks Fix declarations of functions (#186) 2019-03-13 13:15:08 -07:00
AsyncHelper.cpp Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
AsyncHelper.h Replace escape sequences with path separators in include paths 2019-03-07 15:51:00 -08:00
CalcEngineTests.cpp Replace escape sequences with path separators in include paths 2019-03-07 15:51:00 -08:00
CalcInputTest.cpp Build with /W4 (#197) 2019-03-08 23:15:28 -08:00
CalculatorManagerTest.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
CalculatorUnitTests_TemporaryKey.pfx Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
CalculatorUnitTests.rc Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
CalculatorUnitTests.vcxproj Build with /W4 (#197) 2019-03-08 23:15:28 -08:00
CalculatorUnitTests.vcxproj.filters Clean up project structure in Visual Studio (#8) 2019-02-04 11:52:28 -08:00
CopyPasteManagerTest.cpp Added support for pasting of monetary values (#176) 2019-03-15 17:45:49 -07:00
CurrencyConverterUnitTests.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
DateCalculatorUnitTests.cpp Fix issue with Date diff when it includes a Daylight Saving Time (#193) 2019-03-18 11:22:32 -07:00
DateUtils.h Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
Helpers.h Replace escape sequences with path separators in include paths 2019-03-07 15:51:00 -08:00
HistoryTests.cpp Build with /W4 (#197) 2019-03-08 23:15:28 -08:00
Module.cpp Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
MultiWindowUnitTests.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
NavCategoryUnitTests.cpp Build with /W4 (#197) 2019-03-08 23:15:28 -08:00
Package.appxmanifest Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
pch.cpp Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
pch.h Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
resource.h Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
StandardViewModelUnitTests.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
Test.resw Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
UnitConverterTest.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
UnitConverterViewModelUnitTests.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
UnitConverterViewModelUnitTests.h Build with /W4 (#197) 2019-03-08 23:15:28 -08:00
UnitTestApp.rd.xml Spelling (#135) 2019-03-07 10:27:13 -08:00
UnitTestApp.xaml Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00
UnitTestApp.xaml.cpp Updating comments per the C++ core guidelines and removing trailing whitespace (#194) 2019-03-14 23:30:07 -07:00
UnitTestApp.xaml.h Replace escape sequences with path separators in include paths 2019-03-07 15:51:00 -08:00
UtilsTests.cpp Clean up unit test projects (#4) 2019-01-29 19:37:37 -08:00