Skip to content

Firefly III: a personal finances manager

Special string for skip field.

James Colef2c2d4e12662
diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php
index 37d3d95152..7cf6fbba9b 100644
--- a/app/Repositories/Recurring/RecurringRepository.php
+++ b/app/Repositories/Recurring/RecurringRepository.php
@@ -410,12 +410,24 @@ class RecurringRepository implements RecurringRepositoryInterface
return (string)trans('firefly.recurring_daily', [], $language);
}
if ('weekly' === $repetition->repetition_type) {
+
$dayOfWeek = trans(sprintf('config.dow_%s', $repetition->repetition_moment), [], $language);
+ if ($repetition->repetition_skip > 0) {
+ return (string)trans('firefly.recurring_weekly_skip', ['weekday' => $dayOfWeek, 'skip' => $repetition->repetition_skip + 1], $language);
+ }
return (string)trans('firefly.recurring_weekly', ['weekday' => $dayOfWeek], $language);
}
if ('monthly' === $repetition->repetition_type) {
- return (string)trans('firefly.recurring_monthly', ['dayOfMonth' => $repetition->repetition_moment], $language);
+ if ($repetition->repetition_skip > 0) {
+ return (string)trans(
+ 'firefly.recurring_monthly_skip', ['dayOfMonth' => $repetition->repetition_moment, 'skip' => $repetition->repetition_skip + 1], $language
+ );
+ }
+
+ return (string)trans(
+ 'firefly.recurring_monthly', ['dayOfMonth' => $repetition->repetition_moment, 'skip' => $repetition->repetition_skip - 1], $language
+ );
}
if ('ndom' === $repetition->repetition_type) {
$parts = explode(',', $repetition->repetition_moment);
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 81630d52ee..91ed837e70 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -1356,7 +1356,9 @@ return [
'make_new_recurring' => 'Create a recurring transaction',
'recurring_daily' => 'Every day',
'recurring_weekly' => 'Every week on :weekday',
+ 'recurring_weekly_skip' => 'Every :skip(st/nd/rd/th) week on :weekday',
'recurring_monthly' => 'Every month on the :dayOfMonth(st/nd/rd/th) day',
+ 'recurring_monthly_skip' => 'Every :skip(st/nd/rd/th) month on the :dayOfMonth(st/nd/rd/th) day',
'recurring_ndom' => 'Every month on the :dayOfMonth(st/nd/rd/th) :weekday',
'recurring_yearly' => 'Every year on :date',
'overview_for_recurrence' => 'Overview for recurring transaction ":title"',