Skip to:
Content

BuddyPress.org

Changeset 3651


Ignore:
Timestamp:
01/04/2011 12:42:42 PM (9 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.

Location:
trunk
Files:
2 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
  • trunk/bp-xprofile/bp-xprofile-filters.php

    r3560 r3651  
    102102
    103103    if ( 'datebox' == $field_type )
    104         $field_value = bp_format_time( $field_value, true );
     104        $field_value = bp_format_time( $field_value, true, false );
    105105    else
    106106        $field_value = str_replace(']]>', ']]>', $field_value );
Note: See TracChangeset for help on using the changeset viewer.