Skip to content

Firefly III: a personal finances manager

Added missing ranges to Navigation, see issue #170

James Colebb8ce3055268
diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php
index 25d8f93298..c06daf4cc7 100644
--- a/app/Support/Navigation.php
+++ b/app/Support/Navigation.php
@@ -70,7 +70,7 @@ class Navigation
'1W' => 'addWeek', 'week' => 'addWeek', 'weekly' => 'addWeek',
'1M' => 'addMonth', 'month' => 'addMonth', 'monthly' => 'addMonth',
'3M' => 'addMonths', 'quarter' => 'addMonths', 'quarterly' => 'addMonths', '6M' => 'addMonths', 'half-year' => 'addMonths',
- 'year' => 'addYear', 'yearly' => 'addYear',
+ 'year' => 'addYear', 'yearly' => 'addYear', '1Y' => 'addYear',
];
$modifierMap = [
'quarter' => 3,
@@ -163,6 +163,7 @@ class Navigation
'1Y' => '%Y',
'year' => '%Y',
'yearly' => '%Y',
+ '6M' => '%B %Y',
];
@@ -198,6 +199,7 @@ class Navigation
'quarterly' => 'firstOfQuarter',
'year' => 'startOfYear',
'yearly' => 'startOfYear',
+ '1Y' => 'startOfYear',
];
if (isset($functionMap[$repeatFreq])) {
$function = $functionMap[$repeatFreq];
@@ -214,6 +216,11 @@ class Navigation
return $date;
}
+ if ($repeatFreq === 'custom') {
+ return $theDate; // the date is already at the start.
+ }
+
+
throw new FireflyException('Cannot do startOfPeriod for $repeat_freq "' . $repeatFreq . '"');
}
@@ -239,12 +246,15 @@ class Navigation
'1M' => 'subMonths',
'monthly' => 'subMonths',
'year' => 'subYears',
+ '1Y' => 'subYears',
'yearly' => 'subYears',
];
$modifierMap = [
'quarter' => 3,
+ '3M' => 3,
'quarterly' => 3,
'half-year' => 6,
+ '6M' => 6,
];
if (isset($functionMap[$repeatFreq])) {
$function = $functionMap[$repeatFreq];