Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#692 closed defect (bug) (fixed)

bp_core_time_since returns '-1 years, 12 months' for future date

Reported by: lilyfan Owned by:
Milestone: Priority: major
Severity: Version: 1.0
Component: Keywords: has-patch
Cc:

Description

The function "bp_core_time_since" returns '-1 years, 12 months' when $older_date is future from the current time.

This output is ugly. I suggest using "0" or "Future" for this cases.

$since = $newer_date - $older_date;
if ( $since < 0 ) {
    $output = '0 ' . __( 'seconds', 'buddypress' );
    return $output;
}

This situation happens as below:
If the settings of time zone of the server and Wordpress is not matched, the registration date of a user is recored as future (ex: Server uses GMT, WordPress uses JST, nine hours diferrences will occur)

Change History (2)

#1 @apeatling
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [1413]) Added message to tell admins to adjust their WordPress time zone to match their server time zone. Fixes "-1 year" time since problem. Fixes #692

#2 @(none)
10 years ago

  • Milestone Core 1.0 deleted

Milestone Core 1.0 deleted

Note: See TracTickets for help on using tickets.