Because nextExpectedMatch() must return a date (and cannot return null) the list of bills will show "unknown" when the bill is next expected in 1900.

This commit is contained in:
James Cole 2016-02-10 06:55:08 +01:00
parent 1f2b37b70e
commit 807dede90a
2 changed files with 7 additions and 6 deletions

View File

@ -399,7 +399,8 @@ class BillRepository implements BillRepositoryInterface
public function nextExpectedMatch(Bill $bill): Carbon
{
$finalDate = Carbon::now()->subDays(2);
$finalDate = Carbon::now();
$finalDate->year = 1900;
if ($bill->active == 0) {
return $finalDate;
}

View File

@ -45,14 +45,14 @@
</td>
{% endif %}
{% if entry.nextExpectedMatch.isFuture %}
<td class="hidden-sm hidden-xs" data-value="{{ entry.nextExpectedMatch.format('U') }}">
{{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}
</td>
{% else %}
{% if entry.nextExpectedMatch.year == 1900 %}
<td class="hidden-sm hidden-xs" data-value="0">
<em>{{ 'unknown'|_ }}</em>
</td>
{% else %}
<td class="hidden-sm hidden-xs" data-value="{{ entry.nextExpectedMatch.format('U') }}">
{{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}
</td>
{% endif %}
<td class="hidden-sm hidden-xs" data-value="{{ entry.active }}">