This commit is contained in:
James Cole
2023-10-30 19:11:02 +01:00
parent 6790c318e2
commit d36feebb71
3 changed files with 10 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ class BillTransformer extends AbstractTransformer
foreach ($payDates as $string) { foreach ($payDates as $string) {
$payDatesFormatted[] = Carbon::createFromFormat('!Y-m-d', $string, config('app.timezone'))->toAtomString(); $payDatesFormatted[] = Carbon::createFromFormat('!Y-m-d', $string, config('app.timezone'))->toAtomString();
} }
$nextExpectedMatch = ''; $nextExpectedMatch = null;
if (null !== ($payDates[0] ?? null)) { if (null !== ($payDates[0] ?? null)) {
$nextExpectedMatch = Carbon::createFromFormat('!Y-m-d', $payDates[0], config('app.timezone'))->toAtomString(); $nextExpectedMatch = Carbon::createFromFormat('!Y-m-d', $payDates[0], config('app.timezone'))->toAtomString();
} }

View File

@@ -201,7 +201,7 @@ class BillTransformer extends AbstractTransformer
// date for currency conversion // date for currency conversion
/** @var Carbon|null $startParam */ /** @var Carbon|null $startParam */
$startParam = $this->parameters->get('start'); $startParam = $this->parameters->get('start');
/** @var Carbon|null $start */ /** @var Carbon|null $date */
$date = null === $startParam ? today() : clone $startParam; $date = null === $startParam ? today() : clone $startParam;
@@ -290,8 +290,8 @@ class BillTransformer extends AbstractTransformer
/** /**
* Returns the latest date in the set, or start when set is empty. * Returns the latest date in the set, or start when set is empty.
* *
* @param Collection $dates * @param array $dates
* @param Carbon $default * @param Carbon $default
* *
* @return Carbon * @return Carbon
*/ */

View File

@@ -80,7 +80,9 @@
{{ trans('firefly.not_expected_period') }} {{ trans('firefly.not_expected_period') }}
</td> </td>
<td class="expected_in_period hidden-sm hidden-xs"> <td class="expected_in_period hidden-sm hidden-xs">
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }} {% if entry.next_expected_match %}
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
{% endif %}
</td> </td>
{% endif %} {% endif %}
@@ -116,7 +118,9 @@
{% endfor %} {% endfor %}
</td> </td>
<td class="expected_in_period hidden-sm hidden-xs"> <td class="expected_in_period hidden-sm hidden-xs">
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }} {% if entry.next_expected_match %}
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
{% endif %}
</td> </td>
{% endif %} {% endif %}
{# bill is not active #} {# bill is not active #}