You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrade function since($stamp) to consider weeks, months, years #2008
Inside textpattern/lib/txplib_misc.php is the function since($stamp) which seems to present the since-format for certain timestamps. It doesn't seem to consider cases where several weeks, months or even years have passed.
What is the feature?
Include weeks, months and years in the function. Simple examples:
If timestamp is older than 7 days, show "1 week"
If timestamp is older than 31 days, show "1 month"
If timestamp is older than 366 days, show "1 year"
I absolutely swear I did this in some capacity in very recent memory. I distinctly remember rejigging some date/time function. Perhaps it was in a plugin or some shortcode in a side project, because the only reference I can find in the last 4 years in core is from 2021.
Wish I could remember where I did this, because it was practically the same as this request. Regardless, yes, it's a good idea and not difficult.
Activity
Bloke commentedon Aug 17, 2025
I absolutely swear I did this in some capacity in very recent memory. I distinctly remember rejigging some date/time function. Perhaps it was in a plugin or some shortcode in a side project, because the only reference I can find in the last 4 years in core is from 2021.
Wish I could remember where I did this, because it was practically the same as this request. Regardless, yes, it's a good idea and not difficult.
EDIT: Found it! It was a shortcode in a site:
bloatware commentedon Aug 25, 2025
The only difficulty is text strings. Not sure it would be ready for 4.9.0.