Refactor credit runout calculation and simplify related logic#1351
Open
simbabimba-dev wants to merge 7 commits into
Open
Refactor credit runout calculation and simplify related logic#1351simbabimba-dev wants to merge 7 commits into
simbabimba-dev wants to merge 7 commits into
Conversation
2 tasks
MrWeez
requested changes
May 20, 2026
MrWeez
reviewed
May 20, 2026
Collaborator
MrWeez
left a comment
There was a problem hiding this comment.
And general thing: previously message contained ranout date, but you're including value now. Doesn't make sense to show duplicate information. It should be either date or just text
Collaborator
Author
Collaborator
Author
|
I have read and agree to the CLA. |
Collaborator
|
@simbabimba-dev have you checked all scenarios? Including when time left should display 1 day and x hours until ranout? |
MrWeez
requested changes
May 26, 2026
Collaborator
MrWeez
left a comment
There was a problem hiding this comment.
Just one thing, otherwise LGTM
| 'unit' => 'minute', | ||
| 'bg' => self::TIME_LEFT_BG_DANGER | ||
| ]; | ||
| return $hoursLeft < 1 ? __('You ran out of Credits') : strval($hoursLeft); |
Collaborator
There was a problem hiding this comment.
Suggested change
| return $hoursLeft < 1 ? __('You ran out of Credits') : strval($hoursLeft); | |
| return $hoursLeft < 1 ? __('You ran out of Credits') : strval(number_format($hoursLeft, 0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Very self explanatory, simplifies the credit runout estimate timer as it was before