mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TW-213: Align countdown column on boundary between number and text.
- Thanks to Eric Fluger.
This commit is contained in:
parent
77f5d9fe40
commit
1e6b30bbc9
2 changed files with 16 additions and 14 deletions
|
@ -4,6 +4,8 @@
|
||||||
(thanks to Markus Beppler, Konstantin Vorobyev).
|
(thanks to Markus Beppler, Konstantin Vorobyev).
|
||||||
- TW-61 Extract only tasks with annotations
|
- TW-61 Extract only tasks with annotations
|
||||||
(thanks to Aikido Guy).
|
(thanks to Aikido Guy).
|
||||||
|
- TW-213 Align countdown column on boundary between number and text.
|
||||||
|
(thanks to Eric Fluger).
|
||||||
- TW-1785 Purge command to remove deleted tasks
|
- TW-1785 Purge command to remove deleted tasks
|
||||||
(thanks to Paul Beckingham).
|
(thanks to Paul Beckingham).
|
||||||
- TW-1772 Implementation of circular dependency detection is
|
- TW-1772 Implementation of circular dependency detection is
|
||||||
|
|
|
@ -61,8 +61,8 @@ ColumnTypeDate::ColumnTypeDate ()
|
||||||
format (now.toJulian (), 13, 12),
|
format (now.toJulian (), 13, 12),
|
||||||
now.toEpochString (),
|
now.toEpochString (),
|
||||||
now.toISO (),
|
now.toISO (),
|
||||||
Duration (Datetime () - now).formatVague (),
|
Duration (Datetime () - now).formatVague (true),
|
||||||
'-' + Duration (Datetime () - now).formatVague (),
|
'-' + Duration (Datetime () - now).formatVague (true),
|
||||||
"",
|
"",
|
||||||
Duration (Datetime () - now).format ()};
|
Duration (Datetime () - now).format ()};
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ void ColumnTypeDate::measure (Task& task, unsigned int& minimum, unsigned int& m
|
||||||
else if (_style == "countdown")
|
else if (_style == "countdown")
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
minimum = maximum = Duration (now - date).formatVague ().length ();
|
minimum = maximum = Duration (now - date).formatVague (true).length ();
|
||||||
}
|
}
|
||||||
else if (_style == "julian")
|
else if (_style == "julian")
|
||||||
{
|
{
|
||||||
|
@ -112,23 +112,23 @@ void ColumnTypeDate::measure (Task& task, unsigned int& minimum, unsigned int& m
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
if (now > date)
|
if (now > date)
|
||||||
minimum = maximum = Duration (now - date).formatVague ().length ();
|
minimum = maximum = Duration (now - date).formatVague (true).length ();
|
||||||
else
|
else
|
||||||
minimum = maximum = Duration (date - now).formatVague ().length () + 1;
|
minimum = maximum = Duration (date - now).formatVague (true).length () + 1;
|
||||||
}
|
}
|
||||||
else if (_style == "relative")
|
else if (_style == "relative")
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
if (now < date)
|
if (now < date)
|
||||||
minimum = maximum = Duration (date - now).formatVague ().length ();
|
minimum = maximum = Duration (date - now).formatVague (true).length ();
|
||||||
else
|
else
|
||||||
minimum = maximum = Duration (now - date).formatVague ().length () + 1;
|
minimum = maximum = Duration (now - date).formatVague (true).length () + 1;
|
||||||
}
|
}
|
||||||
else if (_style == "remaining")
|
else if (_style == "remaining")
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
if (date > now)
|
if (date > now)
|
||||||
minimum = maximum = Duration (date - now).formatVague ().length ();
|
minimum = maximum = Duration (date - now).formatVague (true).length ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ void ColumnTypeDate::render (
|
||||||
else if (_style == "countdown")
|
else if (_style == "countdown")
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
renderStringRight (lines, width, color, Duration (now - date).formatVague ());
|
renderStringRight (lines, width, color, Duration (now - date).formatVague (true));
|
||||||
}
|
}
|
||||||
else if (_style == "julian")
|
else if (_style == "julian")
|
||||||
renderStringRight (lines, width, color, format (date.toJulian (), 13, 12));
|
renderStringRight (lines, width, color, format (date.toJulian (), 13, 12));
|
||||||
|
@ -179,24 +179,24 @@ void ColumnTypeDate::render (
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
if (now > date)
|
if (now > date)
|
||||||
renderStringLeft (lines, width, color, Duration (now - date).formatVague ());
|
renderStringRight (lines, width, color, Duration (now - date).formatVague (true));
|
||||||
else
|
else
|
||||||
renderStringLeft (lines, width, color, '-' + Duration (date - now).formatVague ());
|
renderStringRight (lines, width, color, '-' + Duration (date - now).formatVague (true));
|
||||||
}
|
}
|
||||||
else if (_style == "relative")
|
else if (_style == "relative")
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
if (now < date)
|
if (now < date)
|
||||||
renderStringLeft (lines, width, color, Duration (date - now).formatVague ());
|
renderStringRight (lines, width, color, Duration (date - now).formatVague (true));
|
||||||
else
|
else
|
||||||
renderStringLeft (lines, width, color, '-' + Duration (now - date).formatVague ());
|
renderStringRight (lines, width, color, '-' + Duration (now - date).formatVague (true));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (_style == "remaining")
|
else if (_style == "remaining")
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
if (date > now)
|
if (date > now)
|
||||||
renderStringRight (lines, width, color, Duration (date - now).formatVague ());
|
renderStringRight (lines, width, color, Duration (date - now).formatVague (true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue