From ea2faa0607d73c2da49f9fd5ab80b43b22f4411b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Fri, 15 Apr 2016 07:55:21 -0400 Subject: [PATCH] TW-1795: Calendar underline on Day padding - Thanks to Renato Alves. --- ChangeLog | 2 ++ src/commands/CmdCalendar.cpp | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ccb71b5f..71a472aea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ (thanks to Sebastien Badia). - TW-1792 The info command uses '0' to reference dependencies on non- pending tasks. +- TW-1795 Calendar underline on Day padding + (thanks to Renato Alves). - Added 'juhannus' as a synonym for 'midsommarafton' (thanks to Lynoure Braakman). - Deprecated the 'DUETODAY' virtual tag, which is a synonym for the 'TODAY' diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index 8a3c6cae5..36a9823ad 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -440,7 +440,7 @@ std::string CmdCalendar::renderMonths ( { if (weekStart == 1) { - view.add (Column::factory ("string.right", " ")); + view.add (Column::factory ("string.right", "")); view.add (Column::factory ("string.right", utf8_substr (ISO8601d::dayName (1), 0, 2))); view.add (Column::factory ("string.right", utf8_substr (ISO8601d::dayName (2), 0, 2))); view.add (Column::factory ("string.right", utf8_substr (ISO8601d::dayName (3), 0, 2))); @@ -451,7 +451,7 @@ std::string CmdCalendar::renderMonths ( } else { - view.add (Column::factory ("string.right", " ")); + view.add (Column::factory ("string.right", "")); view.add (Column::factory ("string.right", utf8_substr (ISO8601d::dayName (0), 0, 2))); view.add (Column::factory ("string.right", utf8_substr (ISO8601d::dayName (1), 0, 2))); view.add (Column::factory ("string.right", utf8_substr (ISO8601d::dayName (2), 0, 2))); @@ -516,7 +516,11 @@ std::string CmdCalendar::renderMonths ( int woy = temp.weekOfYear (weekStart); if (context.config.getBoolean ("displayweeknumber")) - view.set (row, (8 * mpl), woy, color_weeknumber); + view.set (row, + (8 * mpl), + // Make sure the week number is always 4 columns, space-padded. + format ((woy < 10 ? " {1}" : " {1}"), woy), + color_weeknumber); // Calculate column id. int thisCol = dow + // 0 = Sunday