mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix date issues.
This commit is contained in:
@@ -46,10 +46,8 @@ class ShowController extends Controller
|
||||
{
|
||||
use UserNavigation, PeriodOverview;
|
||||
|
||||
/** @var CurrencyRepositoryInterface The currency repository */
|
||||
private $currencyRepos;
|
||||
/** @var AccountRepositoryInterface The account repository */
|
||||
private $repository;
|
||||
private CurrencyRepositoryInterface $currencyRepos;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
* ShowController constructor.
|
||||
|
||||
@@ -211,16 +211,20 @@ class BillController extends Controller
|
||||
/** @var Collection $bills */
|
||||
$bills = $unfiltered->map(
|
||||
function (Bill $bill) use ($transformer, $defaultCurrency) {
|
||||
$return = $transformer->transform($bill);
|
||||
$nextExpectedMatch = new Carbon($return['next_expected_match']);
|
||||
$return['next_expected_match_diff'] = $nextExpectedMatch->isToday() ? trans('firefly.today') : $nextExpectedMatch->diffForHumans(today(), Carbon::DIFF_RELATIVE_TO_NOW);
|
||||
$currency = $bill->transactionCurrency ?? $defaultCurrency;
|
||||
$return['currency_id'] = $currency->id;
|
||||
$return['currency_name'] = $currency->name;
|
||||
$return['currency_symbol'] = $currency->symbol;
|
||||
$return['currency_code'] = $currency->code;
|
||||
$return['currency_decimal_places'] = $currency->decimal_places;
|
||||
$return['attachments'] = $this->billRepository->getAttachments($bill);
|
||||
$return = $transformer->transform($bill);
|
||||
$nextExpectedMatch = new Carbon($return['next_expected_match']);
|
||||
$return['next_expected_match_diff'] = $nextExpectedMatch->isToday()
|
||||
? trans('firefly.today')
|
||||
: $nextExpectedMatch->diffForHumans(
|
||||
today(), Carbon::DIFF_RELATIVE_TO_NOW
|
||||
);
|
||||
$currency = $bill->transactionCurrency ?? $defaultCurrency;
|
||||
$return['currency_id'] = $currency->id;
|
||||
$return['currency_name'] = $currency->name;
|
||||
$return['currency_symbol'] = $currency->symbol;
|
||||
$return['currency_code'] = $currency->code;
|
||||
$return['currency_decimal_places'] = $currency->decimal_places;
|
||||
$return['attachments'] = $this->billRepository->getAttachments($bill);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user