diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index 0295a96b6..ba2d68d7e 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -1215,6 +1215,20 @@ void ISO8601d::operator-- () _date = yesterday._date; } +//////////////////////////////////////////////////////////////////////////////// +// Postfix decrement by one day. +void ISO8601d::operator-- (int) +{ + ISO8601d yesterday = startOfDay () - 1; + yesterday = ISO8601d (yesterday.month (), + yesterday.day (), + yesterday.year (), + hour (), + minute (), + second ()); + _date = yesterday._date; +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 85833640d..c3a24ab61 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -86,6 +86,7 @@ public: ISO8601d& operator-= (const int); time_t operator- (const ISO8601d&); void operator-- (); // Prefix + void operator-- (int); // Postfix private: void clear ();