From 0e6a98c88343858e870765390e9d802eda764604 Mon Sep 17 00:00:00 2001 From: anuko Date: Tue, 26 Dec 2017 23:32:17 +0000 Subject: [PATCH] Fixed week view headers for single digit days. --- WEB-INF/lib/ttTimeHelper.class.php | 6 ++++-- WEB-INF/templates/footer.tpl | 2 +- week.php | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 48959562..da768827 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -897,9 +897,11 @@ class ttTimeHelper { static function getDayHeadersForWeek($start_date) { $dayHeaders = array(); $objDate = new DateAndTime(DB_DATEFORMAT, $start_date); - $dayHeaders['day_header_0'] = (string)$objDate->getDate(); // It returns an int on first call. Why? + $dayHeaders['day_header_0'] = (string) $objDate->getDate(); // It returns an int on first call. + if (strlen($dayHeaders['day_header_0']) == 1) // Which is an implementation detail of DateAndTime class. + $dayHeaders['day_header_0'] = '0'.$dayHeaders['day_header_0']; // Add a 0 for single digit day. $objDate->incDay(); - $dayHeaders['day_header_1'] = $objDate->getDate(); + $dayHeaders['day_header_1'] = $objDate->getDate(); // After incDay it returns a string with leading 0, when necessary. $objDate->incDay(); $dayHeaders['day_header_2'] = $objDate->getDate(); $objDate->incDay(); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 3f894c72..1002303b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.13.3.3695 | Copyright © Anuko | +  Anuko Time Tracker 1.13.0.3696 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/week.php b/week.php index e237bc71..c6841f80 100644 --- a/week.php +++ b/week.php @@ -209,8 +209,7 @@ if ($user->canManageTeam()) { $table = new Table('week_durations'); // $table->setIAScript('markModified'); // TODO: write a script to mark table or particular cells as modified. $table->setTableOptions(array('width'=>'100%','cellspacing'=>'1','cellpadding'=>'3','border'=>'0')); -$table->setHeaderOptions(array('align'=>'center')); // TODO: use a class and CSS instead, perhaps a separate class for footer. -$table->setRowOptions(array('valign'=>'top','class'=>'tableHeader')); +$table->setRowOptions(array('class'=>'tableHeaderCentered')); $table->setData($dataArray); // $durations_with_labels); // Add columns to table. $table->addColumn(new TableColumn('label', '', new LabelCellRenderer(), $dayTotals['label'])); -- 2.20.1