timespan() shortening |
[eluser]rich.a.coy[/eluser]
Is there a way to shorten the timespan() function to show just the first segment? For example: "6 hours", or "23 minutes"? Whichever is the biggest time value available. No one wants to see that my database record is "1 Week, 4 Days, 21 Hours, 52 Minutes" old. I saw an old thread on this issue but did not see a solution. Thanks.
[eluser]rich.a.coy[/eluser]
I found close to want I needed in this thread: http://ellislab.com/forums/viewthread/113067/ However is was not precise enough so I modified it to display down to minutes and seconds. If you need this functionality just put this code in a helper file for the date_helper and call the elapsed_time function. Code: <?php Hope this helps someone.
[eluser]ebot[/eluser]
you look at this i made my self and added the codes on the date help you can use it directly like how you use the codeigniter help ok. if anything feel free to contact me at ebot.tabi[at]gmail[dot]com: here is the link this forum: http://ellislab.com/forums/viewthread/131489/ Code: if ( ! function_exists('when')) |
Welcome Guest, Not a member yet? Register Sign In |