From 7c787088656140d3c439cd772c53fa5f1c6c4f4b Mon Sep 17 00:00:00 2001 From: Florian Dupret Date: Tue, 16 Jun 2020 14:07:40 +0200 Subject: [PATCH] Fix #3437 --- app/Transformers/BillTransformer.php | 5 +++-- resources/lang/en_US/firefly.php | 3 ++- resources/views/v1/list/bills.twig | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.php index 48503732fd..e8210311ae 100644 --- a/app/Transformers/BillTransformer.php +++ b/app/Transformers/BillTransformer.php @@ -83,7 +83,8 @@ class BillTransformer extends AbstractTransformer 'skip' => (int)$bill->skip, 'active' => $bill->active, 'notes' => $notes, - 'next_expected_match' => $paidData['next_expected_match'], + 'next_expected_match' => $paidData['next_expected_match']->format('Y-m-d'), + 'next_expected_match_diff'=> $paidData['next_expected_match']->isToday() ? trans('firefly.today') : $paidData['next_expected_match']->diffForHumans(Carbon::today(), Carbon::DIFF_RELATIVE_TO_NOW), 'pay_dates' => $payDates, 'paid_dates' => $paidData['paid_dates'], 'links' => [ @@ -216,7 +217,7 @@ class BillTransformer extends AbstractTransformer } $result = [ 'paid_dates' => $result, - 'next_expected_match' => $nextMatch->format('Y-m-d'), + 'next_expected_match' => $nextMatch, ]; Log::debug('Result', $result); diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 447d7e857b..7c5de30f82 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -886,7 +886,8 @@ return [ 'bill_store_error' => 'An unexpected error occurred while storing your new bill. Please check the log files', 'list_inactive_rule' => 'inactive rule', 'bill_edit_rules' => 'Firefly III will attempt to edit the rule related to this bill as well. If you\'ve edited this rule yourself however, Firefly III won\'t change anything.|Firefly III will attempt to edit the :count rules related to this bill as well. If you\'ve edited these rules yourself however, Firefly III won\'t change anything.', - + 'bill_expected_date' => 'Expected :date', + // accounts: 'inactive_account_link' => 'You have :count inactive (archived) account, which you can view on this separate page.|You have :count inactive (archived) accounts, which you can view on this separate page.', 'all_accounts_inactive' => 'These are your inactive accounts.', diff --git a/resources/views/v1/list/bills.twig b/resources/views/v1/list/bills.twig index 0a22e8de67..14dfa1e712 100644 --- a/resources/views/v1/list/bills.twig +++ b/resources/views/v1/list/bills.twig @@ -75,11 +75,10 @@ #} {% if entry.paid_dates|length == 0 and entry.pay_dates|length > 0 and entry.active %} - {{ trans('firefly.not_or_not_yet') }} + {{ trans('firefly.bill_expected_date', {date: entry.next_expected_match_diff }) }} {% for date in entry.pay_dates %} - {#{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
#} {{ formatDate(date, monthAndDayFormat) }}
{% endfor %}