Thanks Chouf1 for replying… I know how to format date but where to modify it for activity in Buddypress is what I don’t know.
Maybe I can add filter in functions.php file but what is the function that handle activity date and where is it located?
Aha… I added this filter:
`
function format_activity_date() {
$activityDate=bp_get_activity_date_recorded();
return date(“F j, Y g:i a”, strtotime($activityDate));
}
add_filter(‘bp_activity_time_since’, ‘format_activity_date’);
`
This worked with me but still want to check if the date is today to keep the “… ago” time format, how can I do this?
`
function format_activity_date() {
$activityDate=bp_get_activity_date_recorded();
if ($activityDate>strtotime(24))
{
return date(“F j, Y g:i a”, strtotime($activityDate));
}
else
{$activityDate;}
}
add_filter(‘bp_activity_time_since’, ‘format_activity_date’);
`
What to replace the bold code above? Mmmm
This changes only the activity updates’ date but not the comments & replies š
@amalsh
What file did you add this filter to?
`
function format_activity_date() {
$activityDate=bp_get_activity_date_recorded();
return date(āF j, Y g:i aā, strtotime($activityDate));
}
add_filter(ābp_activity_time_sinceā, āformat_activity_dateā);
`
The functions.php in your theme folder? Line number? I’m looking to do something similar, Thanks in advance!
Yes mgkoller, I added it to functions.php file of my theme. You can add it wherever you want in the file, I put it at the end of it.
Thanks Chouf1, I’ll check the link and see if I can get something useful from it.