mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-07 02:18:11 +00:00
Add support for British English and allow the user to set a locale.
This commit is contained in:
@@ -76,6 +76,7 @@ class PiggyBankController extends Controller
|
||||
}
|
||||
$set = $repository->getEvents($piggyBank);
|
||||
$set = $set->reverse();
|
||||
$locale =app('steam')->getLocale();
|
||||
|
||||
// get first event or start date of piggy bank or today
|
||||
$startDate = $piggyBank->start_date ?? new Carbon;
|
||||
@@ -99,7 +100,7 @@ class PiggyBankController extends Controller
|
||||
}
|
||||
);
|
||||
$currentSum = $filtered->sum('amount');
|
||||
$label = $oldest->formatLocalized((string) trans('config.month_and_day'));
|
||||
$label = $oldest->formatLocalized((string) trans('config.month_and_day', [], $locale));
|
||||
$chartData[$label] = $currentSum;
|
||||
$oldest = app('navigation')->addPeriod($oldest, $step, 0);
|
||||
}
|
||||
@@ -110,7 +111,7 @@ class PiggyBankController extends Controller
|
||||
}
|
||||
);
|
||||
$finalSum = $finalFiltered->sum('amount');
|
||||
$finalLabel = $today->formatLocalized((string) trans('config.month_and_day'));
|
||||
$finalLabel = $today->formatLocalized((string) trans('config.month_and_day', [], $locale));
|
||||
$chartData[$finalLabel] = $finalSum;
|
||||
|
||||
$data = $this->generator->singleSet($piggyBank->name, $chartData);
|
||||
|
||||
Reference in New Issue
Block a user