Ticket #692 (closed defect: fixed)
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
Note: See
TracTickets for help on using
tickets.
