Remove adjustment from local time (#834)

This commit is contained in:
Jay Windsor 2020-03-25 04:20:13 -07:00 committed by GitHub
parent 15944fcd10
commit 7b51b45906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@ DateCalculatorViewModel::DateCalculatorViewModel()
auto today = calendar->GetDateTime();
// FromDate and ToDate should be clipped (adjusted to a consistent hour in UTC)
m_fromDate = m_toDate = ClipTime(today, true);
m_fromDate = m_toDate = ClipTime(today);
// StartDate should not be clipped
m_startDate = today;
@ -83,7 +83,7 @@ DateCalculatorViewModel::DateCalculatorViewModel()
DayOfWeek trueDayOfWeek = calendar->DayOfWeek;
DateTime clippedTime = ClipTime(today, false);
DateTime clippedTime = ClipTime(today);
calendar->SetDateTime(clippedTime);
if (calendar->DayOfWeek != trueDayOfWeek)
{
@ -113,8 +113,8 @@ void DateCalculatorViewModel::OnInputsChanged()
{
if (m_IsDateDiffMode)
{
DateTime clippedFromDate = ClipTime(FromDate, true);
DateTime clippedToDate = ClipTime(ToDate, true);
DateTime clippedFromDate = ClipTime(FromDate);
DateTime clippedToDate = ClipTime(ToDate);
// Calculate difference between two dates
auto dateDiff = m_dateCalcEngine->TryGetDateDifference(clippedFromDate, clippedToDate, m_daysOutputFormat);

View File

@ -110,7 +110,7 @@ namespace CalculatorApp
Platform::String ^ GetDateDiffString() const;
Platform::String ^ GetDateDiffStringInDays() const;
Platform::String ^ GetLocalizedNumberString(int value) const;
static Windows::Foundation::DateTime ClipTime(Windows::Foundation::DateTime dateTime, bool adjustToLocalTime);
static Windows::Foundation::DateTime ClipTime(Windows::Foundation::DateTime dateTime, bool adjustUsingLocalTime = false);
property bool IsOutOfBound
{