Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/04/2011 12:42:42 PM (14 years ago)
Author:
boonebgorges
Message:

Reworks the display of datebox xprofile filters so that dates are not offset according to local time. Cleans up bp_format_time(). Fixes 2779. Props cnorris23.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-templatetags.php

    r3635 r3651  
    834834}
    835835
    836 function bp_format_time( $time, $just_date = false ) {
    837     if ( !$time )
     836function bp_format_time( $time, $just_date = false, $localize_time = true ) {
     837    if ( !isset( $time ) || !is_numeric( $time ) )
    838838        return false;
    839839
    840840    // Get GMT offset from root blog
    841     $root_blog_offset = get_blog_option( BP_ROOT_BLOG, 'gmt_offset' );
     841    $root_blog_offset = false;
     842    if ( $localize_time )
     843        $root_blog_offset = get_blog_option( BP_ROOT_BLOG, 'gmt_offset' );
    842844
    843845    // Calculate offset time
     
    850852    if ( !$just_date ) {
    851853        // Current time (9:50pm)
    852         $time = date_i18n( ' g:ia', $time_offset );
     854        $time = date_i18n( get_option( 'time_format' ), $time_offset );
    853855
    854856        // Return string formatted with date and time
Note: See TracChangeset for help on using the changeset viewer.