- TW-115 allow "0day" durations for UDAs.
This commit is contained in:
Paul Beckingham 2014-04-12 14:12:59 -04:00
parent 1922c4f6a4
commit 5706cca207
2 changed files with 31 additions and 23 deletions

View file

@ -3,9 +3,6 @@
- TD-42 Cannot compile taskd - GNUTLS_VERSION undefined in diag.cpp (thanks
to Michele Vetturi).
- TD-45 Fix preprocessor define (thanks to Jochen Sprickerhof).
- TW-278 Cygwin throws warnings building mk_wcwidth() in wcwidth6.c.
- TW-1254 Calc command can segfault on negative numbers (thanks to Renato
Alves).
- #1255 l10n translation utility improvements (thanks to Renato Alves).
- #1473 Make TASK_RCDIR customizable (thanks to Elias Probst).
- #1486 Truncated sentence in task-sync(5) manpage (thanks to Jakub Wilk).
@ -18,10 +15,14 @@
- #1508 Show command highlight configuration (thanks to Nicolas Appriou).
- #1511 sync init crashes if client certification file is empty or invalid
(thanks to Marton Suranyi).
- TW-115 allow "0day" durations for UDAs.
- TW-197 New virtual tag READY.
- TW-255 'Mask' instead of 'iMask' shown in info report (thanks to Benjamin
Weber)
- TW-261 Easy to create "not deletable" task (thanks to Jan Kunder).
- TW-278 Cygwin throws warnings building mk_wcwidth() in wcwidth6.c.
- TW-1254 Calc command can segfault on negative numbers (thanks to Renato
Alves).
- TW-1255 New testing framework (thanks to Renato Alves).
- TW-1257 The 'Syncing with <host>:<port>' message ignores verbosity tokens.
- TW-1258 Portuguese Localization (thanks to Renato Alves).

View file

@ -1302,28 +1302,35 @@ Variant::operator std::string () const
{
time_t t = _duration;
int seconds = t % 60; t /= 60;
int minutes = t % 60; t /= 60;
int hours = t % 24; t /= 24;
int days = t % 30; t /= 30;
int months = t % 12; t /= 12;
int years = t;
std::stringstream s;
s << 'P';
if (years) s << years << 'Y';
if (months) s << months << 'M';
if (days) s << days << 'D';
if (hours || minutes || seconds)
if (t)
{
s << 'T';
if (hours) s << hours << 'H';
if (minutes) s << minutes << 'M';
if (seconds) s << seconds << 'S';
}
int seconds = t % 60; t /= 60;
int minutes = t % 60; t /= 60;
int hours = t % 24; t /= 24;
int days = t % 30; t /= 30;
int months = t % 12; t /= 12;
int years = t;
return s.str ();
std::stringstream s;
s << 'P';
if (years) s << years << 'Y';
if (months) s << months << 'M';
if (days) s << days << 'D';
if (hours || minutes || seconds)
{
s << 'T';
if (hours) s << hours << 'H';
if (minutes) s << minutes << 'M';
if (seconds) s << seconds << 'S';
}
return s.str ();
}
else
{
return "P0S";
}
}
case type_unknown: