Skip to content

Firefly III: a personal finances manager

fix: Add relevant periods to addPeriod

James Cole79c206547141
diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php
index 5292a430d9..cb55fb25f1 100644
--- a/app/Support/Navigation.php
+++ b/app/Support/Navigation.php
@@ -65,6 +65,14 @@ class Navigation
'yearly' => 'addYears',
'1Y' => 'addYears',
'custom' => 'addMonths', // custom? just add one month.
+ // last X periods? Jump the relevant month / quarter / year
+ 'last7' => 'addDays',
+ 'last30' => 'addMonths',
+ 'last90' => 'addMonths',
+ 'last365' => 'addYears',
+ 'MTD' => 'addMonths',
+ 'QTD' => 'addMonths',
+ 'YTD' => 'addYears',
];
$modifierMap = [
'quarter' => 3,
@@ -72,6 +80,9 @@ class Navigation
'quarterly' => 3,
'6M' => 6,
'half-year' => 6,
+ 'last7' => 7,
+ 'last90' => 3,
+ 'QTD' => 3,
];
if (!array_key_exists($repeatFreq, $functionMap)) {