mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Replace deprecated method.
This commit is contained in:
@@ -187,8 +187,8 @@ class FrontpageChartGenerator
|
||||
'%s (%s) (%s - %s)',
|
||||
$budget->name,
|
||||
$entry['currency_name'],
|
||||
$limit->start_date->formatLocalized($this->monthAndDayFormat),
|
||||
$limit->end_date->formatLocalized($this->monthAndDayFormat)
|
||||
$limit->start_date->isoFormat($this->monthAndDayFormat),
|
||||
$limit->end_date->isoFormat($this->monthAndDayFormat)
|
||||
);
|
||||
}
|
||||
$sumSpent = bcmul($entry['sum'], '-1'); // spent
|
||||
|
@@ -92,7 +92,7 @@ trait ChartGeneration
|
||||
$previous = array_values($range)[0];
|
||||
while ($currentStart <= $end) {
|
||||
$format = $currentStart->format('Y-m-d');
|
||||
$label = trim($currentStart->formatLocalized((string)trans('config.month_and_day', [], $locale)));
|
||||
$label = trim($currentStart->isoFormat((string)trans('config.month_and_day_js', [], $locale)));
|
||||
$balance = $range[$format] ?? $previous;
|
||||
$previous = $balance;
|
||||
$currentStart->addDay();
|
||||
|
@@ -98,7 +98,7 @@ trait GetConfigurationData
|
||||
$end = session('end');
|
||||
/** @var Carbon $first */
|
||||
$first = session('first');
|
||||
$title = sprintf('%s - %s', $start->formatLocalized($this->monthAndDayFormat), $end->formatLocalized($this->monthAndDayFormat));
|
||||
$title = sprintf('%s - %s', $start->isoFormat($this->monthAndDayFormat), $end->isoFormat($this->monthAndDayFormat));
|
||||
$isCustom = true === session('is_custom_range', false);
|
||||
$today = today(config('app.timezone'));
|
||||
$ranges = [
|
||||
|
@@ -356,7 +356,7 @@ class Navigation
|
||||
$entries = [];
|
||||
while ($begin < $end) {
|
||||
$formatted = $begin->format($format);
|
||||
$displayed = $begin->formatLocalized($displayFormat);
|
||||
$displayed = $begin->isoFormat($displayFormat);
|
||||
$entries[$formatted] = $displayed;
|
||||
$begin->$increment();
|
||||
}
|
||||
@@ -413,7 +413,7 @@ class Navigation
|
||||
];
|
||||
|
||||
if (array_key_exists($repeatFrequency, $formatMap)) {
|
||||
return $date->formatLocalized((string)$formatMap[$repeatFrequency]);
|
||||
return $date->isoFormat((string)$formatMap[$repeatFrequency]);
|
||||
}
|
||||
if ('3M' === $repeatFrequency || 'quarter' === $repeatFrequency) {
|
||||
$quarter = ceil($theDate->month / 3);
|
||||
@@ -440,13 +440,13 @@ class Navigation
|
||||
public function preferredCarbonLocalizedFormat(Carbon $start, Carbon $end): string
|
||||
{
|
||||
$locale = app('steam')->getLocale();
|
||||
$format = (string)trans('config.month_and_day', [], $locale);
|
||||
$format = (string)trans('config.month_and_day_js', [], $locale);
|
||||
if ($start->diffInMonths($end) > 1) {
|
||||
$format = (string)trans('config.month', [], $locale);
|
||||
$format = (string)trans('config.month_js', [], $locale);
|
||||
}
|
||||
|
||||
if ($start->diffInMonths($end) > 12) {
|
||||
$format = (string)trans('config.year', [], $locale);
|
||||
$format = (string)trans('config.year_js', [], $locale);
|
||||
}
|
||||
|
||||
return $format;
|
||||
|
@@ -369,7 +369,7 @@ class General extends AbstractExtension
|
||||
function (string $date, string $format): string {
|
||||
$carbon = new Carbon($date);
|
||||
|
||||
return $carbon->formatLocalized($format);
|
||||
return $carbon->isoFormat($format);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user