summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-01-13 00:44:00 +0100
committerCarl Hetherington <cth@carlh.net>2020-01-14 01:22:14 +0100
commit4a7730e78a55be61ae37e024e17dd1897f2dccad (patch)
tree0775db661ea8a51475a71bb2ab4ff4a97db4b9c3
parent62df0ab98a3285adcbacdcc4096ac0b7da466c9c (diff)
Stop invalid dates causing boost::posix_time to raise exceptions.
Backported from 7f05d8fd54632f72a09b6be1b8b4cf692f290b55 in v2.15.x.
-rw-r--r--src/wx/kdm_timing_panel.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wx/kdm_timing_panel.cc b/src/wx/kdm_timing_panel.cc
index bad900d27..e0e5ac44f 100644
--- a/src/wx/kdm_timing_panel.cc
+++ b/src/wx/kdm_timing_panel.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015-2020 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -70,6 +70,12 @@ KDMTimingPanel::KDMTimingPanel (wxWindow* parent)
_warning->SetForegroundColour (wxColour (255, 0, 0));
_warning->SetFont(font);
+ /* I said I've been to the year 3000. Not much has changed but they live underwater. And your In-in-in-interop DCP
+ is pretty fine.
+ */
+ _from_date->SetRange(wxDateTime(1, wxDateTime::Jan, 1900, 0, 0, 0, 0), wxDateTime(31, wxDateTime::Dec, 3000, 0, 0, 0, 0));
+ _until_date->SetRange(wxDateTime(1, wxDateTime::Jan, 1900, 0, 0, 0, 0), wxDateTime(31, wxDateTime::Dec, 3000, 0, 0, 0, 0));
+
_from_date->Bind (wxEVT_DATE_CHANGED, bind (&KDMTimingPanel::changed, this));
_until_date->Bind (wxEVT_DATE_CHANGED, bind (&KDMTimingPanel::changed, this));
_from_time->Changed.connect (bind (&KDMTimingPanel::changed, this));