Skip to:
Content
Pages
Categories
Search
Top
Bottom

Making Activity Time just like FB time


  • Hope
    Participant

    @amalsh

    Hi dears,

    I want to make the BP Activity Stream time just like FB time. i.e. I want the “..ago” format for today only but a specific date “December 25, 2013” for the rest.
    Anybody knows how to do this?

    I wrote a small function:

    function format_activity_timestamp() {
      $activityDate=bp_get_activity_date_recorded();
      if ($activityDate != DateTime())
      {
          return date("F j, Y g:i a", strtotime($activityDate));
      }
      else
      {$activityDate;}
    
    }
    add_filter('bp_activity_time_since', 'format_activity_timestamp');

    but don’t know what to replace the condition! I mean if it’s not today’s date, make it a specific date format otherwise keep the “..ago” format.

    Any help will be appreciated.

    Thanks
    Hope

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Making Activity Time just like FB time’ is closed to new replies.
Skip to toolbar