Просмотр исходного кода

Add display of report month in project list

Alan Lam 8 лет назад
Родитель
Сommit
cb38d6aa21
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      views/project_list.php

+ 11 - 0
views/project_list.php

@@ -4,6 +4,7 @@
 			<th class="text-right pr-3">ID</th>
 			<th>Name</th>
 			<th>Deadline</th>
+			<th>Report Month</th>
 			<th></th>
 		</tr>
 	</thead>
@@ -11,6 +12,13 @@
 	<?php
 	foreach($projects as $project) {
 		$date_deadline = explode(" ", $project->dts_deadline)[0];
+
+		$report_month = "N/A";
+		if($project->dts_report) {
+			$dt_report = new DateTime($project->dts_report . " UTC");
+			$report_month = $dt_report->format("M Y");
+		}
+
 		?>
 		<tr>
 			<td class="text-right pr-3 align-middle">
@@ -22,6 +30,9 @@
 			<td class="align-middle">
 				<?=$date_deadline?>
 			</td>
+			<td class="align-middle">
+				<?=$report_month?>
+			</td>
 			<td class="text-right align-middle">
 				<a class="btn btn-outline-primary" href="/account/projects/<?=$project->id?>/edit">Edit</a>
 			</td>