Skip to:
Content

BuddyPress.org

Ticket #4340: 4340.diff

File 4340.diff, 1011 bytes (added by ericlewis, 12 years ago)

just a thought.

  • bp-activity/bp-activity-template.php

     
    26892689                return apply_filters( 'bp_get_activity_feed_item_date', $activities_template->activity->date_recorded );
    26902690        }
    26912691
     2692
     2693        function bp_get_activity_feed_item_date_timezone_corrected() {
     2694                global $activities_template;
     2695
     2696                return apply_filters( 'bp_get_activity_feed_item_date_timezone_corrected', modify_utc_timestamp_for_local_timezone($activities_template->activity->date_recorded) );
     2697        }
     2698
     2699        function modify_utc_timestamp_for_local_timezone($timestamp) {
     2700                if ( $tz = bp_get_option('timezone_string') ) {
     2701                        $date = new DateTime( $timestamp, new DateTimeZone( 'UTC' ) );
     2702                        date_timezone_set( $date, new DateTimeZone( $tz );
     2703                        $timestamp = $date->format( 'Y-m-d h:i:s' );
     2704                }
     2705                return $timestamp;
     2706        }
    26922707/**
    26932708 * Outputs the activity feed item description
    26942709 *