Ticket #15198: 0001-remove-unix32-time-checks-from-preferences-time.patch

File 0001-remove-unix32-time-checks-from-preferences-time.patch, 1.7 KB (added by nephele, 22 months ago)

Second iteration patch

  • src/preferences/time/BaseView.cpp

    From f8ca2a3f54833a94c87da4c56e5e49d7553826eb Mon Sep 17 00:00:00 2001
    From: Pascal Abresch <nep@packageloss.eu>
    Date: Sat, 28 Sep 2019 17:12:39 +0200
    Subject: [PATCH] remove unix32 time checks from preferences/time
    
    ---
     src/preferences/time/BaseView.cpp     | 6 ++----
     src/preferences/time/DateTimeEdit.cpp | 7 +------
     2 files changed, 3 insertions(+), 10 deletions(-)
    
    diff --git a/src/preferences/time/BaseView.cpp b/src/preferences/time/BaseView.cpp
    index 3e096a3045..23a2b851b5 100644
    a b TTimeBaseView::ChangeTime(BMessage* message)  
    8585        if (message->FindInt32("month", &month) != B_OK)
    8686            month = date.Month();
    8787
    88         if (year >= 1970 && year <= 2037) {
    89             date.SetDate(year, month, day);
    90             dateTime.SetDate(date);
    91         }
     88        date.SetDate(year, month, day);
     89        dateTime.SetDate(date);
    9290    }
    9391
    9492    set_real_time_clock(dateTime.Time_t());
  • src/preferences/time/DateTimeEdit.cpp

    diff --git a/src/preferences/time/DateTimeEdit.cpp b/src/preferences/time/DateTimeEdit.cpp
    index 24fb1c4d2f..644abd6961 100644
    a b TDateEdit::_CheckRange()  
    669669            break;
    670670
    671671        case B_DATE_ELEMENT_YEAR:
    672             // 2037 is the end of 32-bit UNIX time
    673             if (value > 2037)
    674                 value = 2037;
    675             else if (value < 1970)
    676                 value = 1970;
    677672
    678673            fDate.SetDate(value, fDate.Month(), fDate.Day());
    679674            break;
    TDateEdit::_IsValidDoubleDigit(int32 value)  
    713708        case B_DATE_ELEMENT_YEAR:
    714709        {
    715710            int32 year = int32(fHoldValue / 100) * 100 + value;
    716             if (year <= 2037 && year >= 1970)
     711            if (year >= -4713) // Julian callender
    717712                isInRange = true;
    718713            break;
    719714        }