Skip to content

Firefly III: a personal finances manager

Add two new ranges #954

James Cole9ece209c7241
diff --git a/app/Support/Http/Controllers/GetConfigurationData.php b/app/Support/Http/Controllers/GetConfigurationData.php
index 2c46da121c..e8c4ea93ac 100644
--- a/app/Support/Http/Controllers/GetConfigurationData.php
+++ b/app/Support/Http/Controllers/GetConfigurationData.php
@@ -168,6 +168,16 @@ trait GetConfigurationData
$ranges[ucfirst((string)trans('firefly.today'))] = [$todayStart, $todayEnd];
}
+ // last seven days:
+ $seven = Carbon::create()->subDays(7);
+ $index = (string)trans('firefly.last_seven_days');
+ $ranges[$index] = [$seven, new Carbon];
+
+ // last 30 days:
+ $thirty = Carbon::create()->subDays(30);
+ $index = (string)trans('firefly.last_thirty_days');
+ $ranges[$index] = [$thirty, new Carbon];
+
// everything
$index = (string)trans('firefly.everything');
$ranges[$index] = [$first, new Carbon];
@@ -259,9 +269,10 @@ trait GetConfigurationData
$now = time();
if (0 === $lastTime) {
request()->session()->flash('info', trans('firefly.recurring_never_cron'));
+
return;
}
- if($now - $lastTime > 129600) {
+ if ($now - $lastTime > 129600) {
request()->session()->flash('warning', trans('firefly.recurring_cron_long_ago'));
}
}
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 9bff536932..3ddb4c3e13 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -30,6 +30,8 @@ return [
'delete' => 'Delete',
'split' => 'Split',
'clone' => 'Clone',
+ 'last_seven_days' => 'Last seven days',
+ 'last_thirty_days' => 'Last thirty days',
'welcomeBack' => 'What\'s playing?',
'everything' => 'Everything',
'today' => 'today',