Don't show year for updated dates in current year of project table

This commit is contained in:
Alex Cabal 2025-01-03 13:43:59 -06:00
parent ea7cf4733c
commit 9b959e3eda
2 changed files with 8 additions and 1 deletions

View file

@ -25,4 +25,7 @@ enum DateTimeFormat: string{
/** Like Jan 5, 2024 */ /** Like Jan 5, 2024 */
case ShortDate = 'M j, Y'; case ShortDate = 'M j, Y';
/** Like Jan 5 */
case ShortDateWithoutYear = 'M j';
} }

View file

@ -52,7 +52,11 @@ $showEditButton = $showEditButton ?? false;
<a href="<?= $project->Reviewer->Url ?>/projects"><?= Formatter::EscapeHtml($project->Reviewer->DisplayName) ?></a> <a href="<?= $project->Reviewer->Url ?>/projects"><?= Formatter::EscapeHtml($project->Reviewer->DisplayName) ?></a>
</td> </td>
<td> <td>
<?= $project->LastActivityTimestamp->format(Enums\DateTimeFormat::ShortDate->value) ?> <? if(intval($project->LastActivityTimestamp->format('Y')) == intval(NOW->format('Y'))){ ?>
<?= $project->LastActivityTimestamp->format(Enums\DateTimeFormat::ShortDateWithoutYear->value) ?>
<? }else{ ?>
<?= $project->LastActivityTimestamp->format(Enums\DateTimeFormat::ShortDate->value) ?>
<? } ?>
</td> </td>
<? if($includeStatus){ ?> <? if($includeStatus){ ?>
<td class="status<? if($project->Status == Enums\ProjectStatusType::Stalled){ ?> stalled<? } ?>"> <td class="status<? if($project->Status == Enums\ProjectStatusType::Stalled){ ?> stalled<? } ?>">