feat: support automatic dark mode

refactor: run linter and cleanup php files
fix: not every payment cycle was shown on the calendar
feat: also show previous payments on the calendar for the current month
This commit is contained in:
Miguel Ribeiro
2024-06-26 18:11:37 +02:00
committed by GitHub
parent 15fc8f1238
commit c2e85d6e10
101 changed files with 4538 additions and 4152 deletions

View File

@@ -6,16 +6,12 @@
switch ($cycle) {
case 1:
return $frequency == 1 ? translate('Daily', $i18n) : $frequency . " " . translate('days', $i18n);
break;
case 2:
return $frequency == 1 ? translate('Weekly', $i18n) : $frequency . " " . translate('weeks', $i18n);
break;
case 3:
return $frequency == 1 ? translate('Monthly', $i18n) : $frequency . " " . translate('months', $i18n);
break;
case 4:
return $frequency == 1 ? translate('Yearly', $i18n) : $frequency . " " . translate('years', $i18n);
break;
}
}
@@ -24,19 +20,15 @@
case 1:
$numberOfPaymentsPerMonth = (30 / $frequency);
return $price * $numberOfPaymentsPerMonth;
break;
case 2:
$numberOfPaymentsPerMonth = (4.35 / $frequency);
return $price * $numberOfPaymentsPerMonth;
break;
case 3:
$numberOfPaymentsPerMonth = (1 / $frequency);
return $price * $numberOfPaymentsPerMonth;
break;
case 4:
$numberOfMonths = (12 * $frequency);
return $price / $numberOfMonths;
break;
}
}