+// ----------------------------------------------------------------------------
+// wxDateTime comparison
+// ----------------------------------------------------------------------------
+
+bool wxDateTime::IsEqualTo(const wxDateTime& datetime) const
+{
+ wxASSERT_MSG( IsValid() && datetime.IsValid(), "invalid wxDateTime");
+
+ return m_time == datetime.m_time;
+}
+
+bool wxDateTime::operator==(const wxDateTime& datetime) const
+{
+ return IsEqualTo(datetime);
+}
+
+bool wxDateTime::operator!=(const wxDateTime& datetime) const
+{
+ return !IsEqualTo(datetime);
+}
+
+bool wxDateTime::IsEarlierThan(const wxDateTime& datetime) const
+{
+ wxASSERT_MSG( IsValid() && datetime.IsValid(), "invalid wxDateTime");
+
+ return m_time < datetime.m_time;
+}
+
+bool wxDateTime::IsLaterThan(const wxDateTime& datetime) const
+{
+ wxASSERT_MSG( IsValid() && datetime.IsValid(), "invalid wxDateTime");
+
+ return m_time > datetime.m_time;
+}
+
+bool wxDateTime::IsStrictlyBetween(const wxDateTime& t1,
+ const wxDateTime& t2) const
+{
+ // no need for assert, will be checked by the functions we call
+ return IsLaterThan(t1) && IsEarlierThan(t2);
+}
+
+bool wxDateTime::IsBetween(const wxDateTime& t1, const wxDateTime& t2) const
+{
+ // no need for assert, will be checked by the functions we call
+ return IsEqualTo(t1) || IsEqualTo(t2) || IsStrictlyBetween(t1, t2);
+}
+
+// ----------------------------------------------------------------------------
+// wxDateTime arithmetics
+// ----------------------------------------------------------------------------
+
+wxDateTime& wxDateTime::Add(const wxTimeSpan& diff)
+{
+ wxASSERT_MSG( IsValid(), "invalid wxDateTime");
+
+ m_time += diff.GetValue();
+
+ return *this;
+}
+
+wxDateTime& wxDateTime::operator+=(const wxTimeSpan& diff)
+{
+ return Add(diff);
+}
+