Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Filter time if off by 7 hours
// add 7 hours in the filters below
function shane_local_time( $timestamp ) {
$unixTimestamp = strtotime( $timestamp );
$unixTimestamp = $unixTimestamp + (7 * 3600);
$filtered_time = date("Y-m-d H:i:s", $unixTimestamp);
return $filtered_time;
}
/**
* Filters the 'last active' screen output
*/
function shane_local_time_last_active( $last_active, $last_activity_date, $string ) {
$filtered_time = shane_local_time( $last_activity_date );
$last_active = sprintf( $string, bp_core_time_since( $filtered_time ) );
return $last_active;
}
add_filter( 'bp_core_get_last_activity', 'shane_local_time_last_active', 1, 3 );
/**
* Filters the 'time_since' screen output
*/
function shane_bp_activity_time_since( $output, $activity ) {
$filtered_time = shane_local_time( $activity->date_recorded );
$output = bp_core_time_since( $filtered_time );
return $output;
}
add_filter('bp_activity_time_since', 'shane_bp_activity_time_since', 1, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.