mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
ISO8601d: Added ::operator-- (postfix)
This commit is contained in:
parent
ef6d0a8f9a
commit
e96eaaac38
2 changed files with 15 additions and 0 deletions
|
@ -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 ()
|
||||
{
|
||||
|
|
|
@ -86,6 +86,7 @@ public:
|
|||
ISO8601d& operator-= (const int);
|
||||
time_t operator- (const ISO8601d&);
|
||||
void operator-- (); // Prefix
|
||||
void operator-- (int); // Postfix
|
||||
|
||||
private:
|
||||
void clear ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue