Download the PHP package khandieyea/timegap without Composer
On this page you can find all versions of the php package khandieyea/timegap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package timegap
Timegap
Change Log
- 26/7/13 - Fixed typo in read me (thanks @davemfletcher)
WHY?
Timegap as a time-passed or time-until helper that only shows relevant information. If something (such as a birthday) is 6 months away, do we really care about the seconds or minutes? I basically got sick of seeing things like:
Your next appointment is in 1 year, 3 months, 2 weeks, 4 days, 11 hours, 21 minutes, 11 seconds
That's pretty over exagerated, but you get the idea. Timegap is an attempt at solving this.
Composer
https://packagist.org/packages/khandieyea/timegap
A usage example
Let's say your birthday is in 10 days:
At first, this will result in
Your birthday is in: 1 week, 4 days
As the gap closes say 6 days away, the 'weeks' will disappear and we will see hours
Your birthday is in: 6 days, 4 hours
Singular/plural words are taken care of, when your birthday is just over a day away
Your birthday is in: 1 day, 8 hours
As we get closer and there's less than 1 day to go, again day drops off and minutes appear
Your birthday is in: 4 hours, 46 minutes
And again, when under an hour to go
Your birthday is in: 24 minutes, 11 seconds
Dumb stuff you can do
Would give you something like