Fixed rendering of countdown columns
Countdown columns were counting up days instead of down.
This commit is contained in:
@@ -75,6 +75,8 @@
|
|||||||
- TW #2536 Feature: inclusive range-end attribute modifier 'by' so 'end of'
|
- TW #2536 Feature: inclusive range-end attribute modifier 'by' so 'end of'
|
||||||
named dates can be filtered inclusively
|
named dates can be filtered inclusively
|
||||||
Thanks to Scott Mcdermott
|
Thanks to Scott Mcdermott
|
||||||
|
- TW #1824 Fixed countdown formatting
|
||||||
|
Thanks to Sebastian Uharek
|
||||||
|
|
||||||
------ current release ---------------------------
|
------ current release ---------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ void ColumnTypeDate::render (
|
|||||||
else if (_style == "countdown")
|
else if (_style == "countdown")
|
||||||
{
|
{
|
||||||
Datetime now;
|
Datetime now;
|
||||||
renderStringRight (lines, width, color, Duration (now - date).formatVague (true));
|
renderStringRight (lines, width, color, Duration (date - now).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));
|
||||||
|
|||||||
@@ -390,8 +390,8 @@ class TestDateFormats(TestCase):
|
|||||||
def test_date_format_countdown(self):
|
def test_date_format_countdown(self):
|
||||||
"""Verify due.countdown formatting"""
|
"""Verify due.countdown formatting"""
|
||||||
code, out, err = self.t("xxx rc.report.xxx.columns:id,due.countdown")
|
code, out, err = self.t("xxx rc.report.xxx.columns:id,due.countdown")
|
||||||
self.assertRegex(out, r'1\s+\d+\S+')
|
self.assertRegex(out, r'1\s+')
|
||||||
self.assertRegex(out, r'2\s+')
|
self.assertRegex(out, r'2\s+\d+\S+')
|
||||||
|
|
||||||
def test_date_format_unrecognized(self):
|
def test_date_format_unrecognized(self):
|
||||||
"""Verify due.donkey formatting fails"""
|
"""Verify due.donkey formatting fails"""
|
||||||
|
|||||||
Reference in New Issue
Block a user