mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 09:14:08 +00:00
Fix recurring invoices using wrong date in non-UTC timezones
Pass the app's configured timezone to CronExpression::getNextRunDate() so the next invoice date is calculated in the correct timezone instead of defaulting to UTC. Fixes #491
This commit is contained in:
@@ -201,8 +201,9 @@ class RecurringInvoice extends Model
|
||||
public static function getNextInvoiceDate(string $frequency, string $starts_at): string
|
||||
{
|
||||
$cron = new Cron\CronExpression($frequency);
|
||||
$timezone = config('app.timezone', 'UTC');
|
||||
|
||||
return $cron->getNextRunDate($starts_at)->format('Y-m-d H:i:s');
|
||||
return $cron->getNextRunDate($starts_at, 0, false, $timezone)->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function updateNextInvoiceDate(): void
|
||||
|
||||
Reference in New Issue
Block a user