samedi 8 septembre 2018

Increase Progress Bar by increase in time

everyone, I have this project I am building for a client that needs a kind of like progress bar indicator showing when a user subscription plan would expire say for instance a user registered at X amount of days and the plan is supposed to end in the next 7days after(in which user trial would be completed).

here is the logic i am using, but it doesn't seem to work, any better ideal or way to go around it would be better.

User Registered date returns 2018-09-11 16:32:08.000000 - (LARAVEL CARBON) saved in DB

and then I add 7 days to it using the below code Carbon::createFromFormat('Y-m-d H:i:s', 2018-09-11 16:32:08.000000;

User Trail Expire Date Ends 2018-09-18 16:32:08.000000 - Not Saved in DB.

in my view, I have this div containing bootstrap progress indicator.

<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
<span class="sr-only">20%Complete (danger)</span>
</div>

Again the question is, how do I loop through or Switch case between every day that passes by to at least indicate the progress, say for instance if the date is a day older add make a variable return 20% - which I can place in the progress div



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2CHWgzE
via IFTTT

Aucun commentaire:

Enregistrer un commentaire