Ticket #692 (closed defect: fixed)

Opened 17 months ago

Last modified 15 months ago

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

Reported by: lilyfan Owned by:
Priority: major Milestone:
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

Changed 16 months ago by apeatling

  • status changed from new to closed
  • resolution set to fixed

(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

Changed 15 months ago by anonymous

  • milestone Core 1.0 deleted

Milestone Core 1.0 deleted

Note: See TracTickets for help on using tickets.