Skip to content

Update license expiry calculation to ensure integer return type, now I get a float with -20.91572169669#299

Open
groax wants to merge 1 commit intoNativePHP:mainfrom
groax:fix/change-licence-expires-days
Open

Update license expiry calculation to ensure integer return type, now I get a float with -20.91572169669#299
groax wants to merge 1 commit intoNativePHP:mainfrom
groax:fix/change-licence-expires-days

Conversation

@groax
Copy link

@groax groax commented Mar 25, 2026

This pull request updates how the number of days until a license expires is calculated across several Blade view files. The calculation now consistently uses now()->diffInDays($license->expires_at, false) and explicitly casts the result to an integer. This ensures that the difference is calculated with the correct sign (positive or negative), which is important for determining license status and renewal needs.

License expiry calculation updates:

  • Updated the calculation of $daysUntilExpiry in resources/views/customer/licenses/index.blade.php to use (int) now()->diffInDays($license->expires_at, false) for accurate signed day differences.
  • Applied the same update to resources/views/customer/licenses/list.blade.php, ensuring consistency in license expiry calculations.
  • Updated resources/views/customer/licenses/show.blade.php to use the new expiry calculation method.
  • Made the same change in resources/views/livewire/customer/licenses.blade.php for Livewire components.
  • Updated resources/views/livewire/customer/licenses/show.blade.php to use the new calculation for renewal logic.
image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant