Fix summary and dates, also fix #5770

This commit is contained in:
James Cole
2022-03-28 12:24:16 +02:00
parent f2849c8058
commit abb1095cef
9 changed files with 114 additions and 93 deletions

View File

@@ -114,8 +114,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('accounts.show', $account));
}
@@ -443,8 +443,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('budgets.no-budget'));
}
@@ -477,8 +477,8 @@ try {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $budgetLimit->start_date->formatLocalized((string)trans('config.month_and_day')),
'end' => $budgetLimit->end_date->formatLocalized((string)trans('config.month_and_day')),]
['start' => $budgetLimit->start_date->isoFormat((string)trans('config.month_and_day_js')),
'end' => $budgetLimit->end_date->isoFormat((string)trans('config.month_and_day_js')),]
);
$breadcrumbs->push(
@@ -527,8 +527,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('categories.show', [$category->id]));
}
@@ -552,8 +552,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('categories.no-category'));
}
@@ -747,9 +747,9 @@ try {
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$monthFormat = (string)trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
@@ -760,9 +760,9 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$monthFormat = (string)trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')]));
@@ -774,9 +774,9 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $tagTags, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$monthFormat = (string)trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.tag', [$accountIds, $tagTags, $start->format('Ymd'), $end->format('Ymd')]));
@@ -788,9 +788,9 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$monthFormat = (string)trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_category', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')]));
@@ -802,9 +802,9 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $doubleIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$monthFormat = (string)trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_double', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.double', [$accountIds, $doubleIds, $start->format('Ymd'), $end->format('Ymd')]));
@@ -816,9 +816,9 @@ try {
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$monthFormat = (string)trans('config.month_and_day_js');
$startString = $start->isoFormat($monthFormat);
$endString = $end->isoFormat($monthFormat);
$title = (string)trans('firefly.report_default', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
@@ -1029,8 +1029,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('tags.show', [$tag->id, $start, $end]));
}
@@ -1059,8 +1059,8 @@ try {
// add date range:
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
['start' => $start->isoFormat((string)trans('config.month_and_day_js')),
'end' => $end->isoFormat((string)trans('config.month_and_day_js')),]
);
$breadcrumbs->push($title, route('transactions.index', [$what, $start, $end]));
}