Tags: jimmiw/php-time-ago
Tags
Handle 61 days ago as 2 months We have a fun problem with the summer months, where July and August has 31 days each. This resulted in the script returning "1 months ago" instead of 2. The DateTime diff() was not incorrect though, as it was only 1 month and 31 days ago, but for our purpose, i have changed the script to round up from 1 to 2, when we are about 59days ago. Handles #95
Handle timediff from 1h30m as 2 hours. There was a bug with 1h and 30mins given 1 hours back. This should be 2 hours. I added a simple check to see if the returning hour was 1, if so, i return 2. This will now give the indented number of hours. Changed the test to check, if "2 hours ago" is returned with 90mins and 110mins instead of just checking for "hours ago". Issue #79
PreviousNext