mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-26 06:37:20 +02:00
Bug #720
- Fixed bug #720, so that when the 'info' report renders total active time, it uses a lossless format (thanks to Bernhard B).
This commit is contained in:
parent
89d3b4e805
commit
2f60bdf9d0
6 changed files with 44 additions and 2 deletions
|
@ -283,6 +283,22 @@ std::string Duration::formatCompact () const
|
|||
return std::string (formatted);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Duration::formatPrecise () const
|
||||
{
|
||||
char formatted[24];
|
||||
|
||||
int days = mSecs / 86400;
|
||||
int hours = (mSecs % 86400) / 3600;
|
||||
int minutes = (mSecs % 3600) / 60;
|
||||
int seconds = mSecs % 60;
|
||||
|
||||
if (days > 0) sprintf (formatted, "%s%dd %d:%02d:%02d", (mNegative ? "-" : ""), days, hours, minutes, seconds);
|
||||
else sprintf (formatted, "%s%d:%02d:%02d", (mNegative ? "-" : ""), hours, minutes, seconds);
|
||||
|
||||
return std::string (formatted);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Duration::operator< (const Duration& other)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue