- return wxDateSpan(rt1.m_years + rt2.m_years,
- rt1.m_months + rt2.m_months,
- rt1.m_weeks + rt2.m_weeks,
- rt1.m_days + rt2.m_days);
-}
-
-// ============================================================================
-// inline functions implementation
-// ============================================================================
-
-// ----------------------------------------------------------------------------
-// wxDateTime
-// ----------------------------------------------------------------------------
-
-const int wxDateTime::TIME_T_FACTOR = 1000;
-
-wxDateTime& Set(time_t timet)
-{
- m_time = timet * wxDateTime::TIME_T_FACTOR;
-
- return *this;
-}
-
-wxDateTime& SetToCurrent()
-{
- return Set(GetTimeNow());
-}
-
-wxDateTime::wxDateTime(time_t timet)
-{
- Set(timet);
-}
-
-wxDateTime::wxDateTime(const struct tm& tm)
-{
- Set(tm);
-}
-
-wxDateTime::wxDateTime(wxDateTime_t hour,
- wxDateTime_t minute,
- wxDateTime_t second,
- wxDateTime_t millisec)
-{
- Set(hour, minute, second, millisec);
-}
-
-wxDateTime::wxDateTime(wxDateTime_t day,
- Month month,
- int year,
- wxDateTime_t hour,
- wxDateTime_t minute,
- wxDateTime_t second,
- wxDateTime_t millisec)
-{
- Set(day, month, year, hour, minute, second, millisec);
-}
-
-wxLongLong wxDateTime::GetValue() const
-{
- wxASSERT_MSG( IsValid(), "invalid wxDateTime");
-
- return m_time;
-}
-
-bool wxDateTime::SetToLastWeekDay(WeekDay weekday,
- wxDateTime_t month,
- int year)
-{
- SetToWeekDay(weekday, -1, month, year);
-}
-
-wxDateTime& wxDateTime::Substract(const wxTimeSpan& diff)
-{
- return Add(diff.Negate());
-}
-
-wxDateTime& wxDateTime::operator-=(const wxTimeSpan& diff)
-{
- return Add(diff.Negate());
-}
-
-wxDateTime& wxDateTime::Substract(const wxDateSpan& diff)
-{
- return Add(diff.Negate());
-}
-
-wxDateTime& wxDateTime::operator-=(const wxDateSpan& diff)
-{
- return Add(diff.Negate());
-}
-
-wxTimeSpan wxDateTime::operator-(const wxDateTime& datetime) const
-{
- return Substract(datetime);
-}
-
-// ----------------------------------------------------------------------------
-// wxTimeSpan
-// ----------------------------------------------------------------------------
-
-wxTimeSpan& wxTimeSpan::Add(const wxTimeSpan& diff)
-{
- m_diff += diff.GetValue();
-
- return *this;
-}
-
-wxTimeSpan& wxTimeSpan::Substract(const wxTimeSpan& diff)
-{
- m_diff -= diff.GetValue();
-
- return *this;
-}
-
-wxTimeSpan& wxTimeSpan::Multiply(int n)
-{
- m_diff *= n;
-
- return *this;
-}
-
-wxTimeSpan wxTimeSpan::operator*(int n) const
-{
- wxTimeSpan result(*this);
- result.Multiply(n);
-
- return result;
-}
-
-wxTimeSpan wxTimeSpan::Abs() const
-{
- return wxTimeSpan(GetValue().Abs());
-}
-
-bool wxTimeSpan::IsEqualTo(const wxTimeSpan& ts) const
-{
- return GetValue() == ts.GetValue();
-}
-
-bool wxTimeSpan::IsLongerThan(const wxTimeSpan& ts) const
-{
- return Abs() > ts.Abs();
-}
-
-// ----------------------------------------------------------------------------
-// wxDateSpan
-// ----------------------------------------------------------------------------
-
-wxDateSpan&
-wxDateSpan::operator+=(const wxDateSpan& other)
-{
- m_years += other.m_years;
- m_months += other.m_months;
- m_weeks += other.m_weeks;
- m_days += other.m_days;
-
- return *this;
-}
-
-wxDateSpan& wxDateSpan::operator*=(int factor)
-{
- m_years *= m_years;
- m_months *= m_months;
- m_weeks *= m_weeks;
- m_days *= m_days;
-
- return *this;
-}
-
-wxDateSpan Negate() const
-{
- return wxDateSpan(-m_years, -m_months, -m_weeks, -m_days);
-}
-
-wxDateSpan& Neg()
-{
- m_years = -m_years;
- m_months = -m_months;
- m_weeks = -m_weeks;
- m_days = -m_days;
-
- return *this;