Various fixes and extensions.

This commit is contained in:
James Cole
2021-07-18 14:51:30 +02:00
parent fb17da3f56
commit 6d971e86b1
13 changed files with 233 additions and 84 deletions

View File

@@ -107,18 +107,18 @@ class IndexController extends Controller
'object_group_title' => $array['object_group_title'],
'bills' => [],
];
// expected today? default:
$array['next_expected_match_diff'] = trans('firefly.not_expected_period');
$nextExpectedMatch = new Carbon($array['next_expected_match']);
if ($nextExpectedMatch->isToday()) {
$array['next_expected_match_diff'] = trans('firefly.today');
}
$current = $array['pay_dates'][0] ?? null;
if (null !== $current && !$nextExpectedMatch->isToday()) {
$currentExpectedMatch = Carbon::createFromFormat('Y-m-d\TH:i:sP', $current);
$array['next_expected_match_diff'] = $currentExpectedMatch->diffForHumans(today(), Carbon::DIFF_RELATIVE_TO_NOW);
}
// var_dump($array);exit;
// // expected today? default:
// $array['next_expected_match_diff'] = trans('firefly.not_expected_period');
// $nextExpectedMatch = new Carbon($array['next_expected_match']);
// if ($nextExpectedMatch->isToday()) {
// $array['next_expected_match_diff'] = trans('firefly.today');
// }
// $current = $array['pay_dates'][0] ?? null;
// if (null !== $current && !$nextExpectedMatch->isToday()) {
// $currentExpectedMatch = Carbon::createFromFormat('Y-m-d\TH:i:sP', $current);
// $array['next_expected_match_diff'] = $currentExpectedMatch->diffForHumans(today(), Carbon::DIFF_RELATIVE_TO_NOW);
// }
$currency = $bill->transactionCurrency ?? $defaultCurrency;
$array['currency_id'] = $currency->id;