mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 22:33:08 +02:00
Enhancement - Duration
- Relocated util/formatSeconds and util/formatSecondsCompact into Duration object. - Relocated unit tests. - Upgraded Duration object to use seconds, not days. - Enhanced Duration so that it can now parse '4 mins' etc.
This commit is contained in:
parent
1f8f4c631d
commit
9477660e02
10 changed files with 600 additions and 584 deletions
|
@ -323,11 +323,11 @@ Date getNextRecurrence (Date& current, std::string& period)
|
|||
}
|
||||
|
||||
// If the period is an 'easy' one, add it to current, and we're done.
|
||||
int days = 0;
|
||||
try { Duration du (period); days = du; }
|
||||
catch (...) { days = 0; }
|
||||
int secs = 0;
|
||||
try { Duration du (period); secs = du; }
|
||||
catch (...) { secs = 0; }
|
||||
|
||||
return current + (days * 86400);
|
||||
return current + secs;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue