Fixed week view headers for single digit days.
authoranuko <support@anuko.com>
Tue, 26 Dec 2017 23:32:17 +0000 (23:32 +0000)
committeranuko <support@anuko.com>
Tue, 26 Dec 2017 23:32:17 +0000 (23:32 +0000)
WEB-INF/lib/ttTimeHelper.class.php
WEB-INF/templates/footer.tpl
week.php

index 4895956..da76882 100644 (file)
@@ -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();
index 3f894c7..1002303 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.13.3.3695 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.13.0.3696 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index e237bc7..c6841f8 100644 (file)
--- 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']));