Skip to:
Content

BuddyPress.org

Changeset 11749


Ignore:
Timestamp:
11/29/2017 01:15:16 PM (6 years ago)
Author:
djpaul
Message:

xprofile: fix untranslatable dates in front-end display.

Fixes #7627

Props antonioeatgoat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php

    r11618 r11749  
    496496                        </label>
    497497                        <label for="date-format-custom-value" class="screen-reader-text"><?php esc_html_e( 'Enter custom time format', 'buddypress' ); ?></label>
    498                         <input type="text" name="field-settings[date_format_custom]" id="date-format-custom-value" class="date-format-custom-value" value="<?php echo esc_attr( $settings['date_format_custom'] ); ?>" aria-describedby="date-format-custom-example" /> <span class="screen-reader-text"><?php esc_html_e( 'Example:', 'buddypress' ); ?></span><span class="date-format-custom-example" id="date-format-custom-sample"><?php if ( $settings['date_format_custom'] ) : ?><?php echo esc_html( date( $settings['date_format_custom'] ) ); endif; ?></span><span class="spinner" id="date-format-custom-spinner" aria-hidden="true"></span>
     498                        <input type="text" name="field-settings[date_format_custom]" id="date-format-custom-value" class="date-format-custom-value" value="<?php echo esc_attr( $settings['date_format_custom'] ); ?>" aria-describedby="date-format-custom-example" /> <span class="screen-reader-text"><?php esc_html_e( 'Example:', 'buddypress' ); ?></span><span class="date-format-custom-example" id="date-format-custom-sample"><?php if ( $settings['date_format_custom'] ) : ?><?php echo esc_html( date_i18n( $settings['date_format_custom'] ) ); endif; ?></span><span class="spinner" id="date-format-custom-spinner" aria-hidden="true"></span>
    499499
    500500                        <p><a href="https://codex.wordpress.org/Formatting_Date_and_Time"><?php esc_html_e( 'Documentation on date and time formatting', 'buddypress' ); ?></a></p>
     
    609609
    610610            case 'custom' :
    611                 $formatted = date( $settings['date_format_custom'], $field_value );
     611                $formatted = date_i18n( $settings['date_format_custom'], $field_value );
    612612            break;
    613613
    614614            default :
    615                 $formatted = date( $settings['date_format'], $field_value );
     615                $formatted = date_i18n( $settings['date_format'], $field_value );
    616616            break;
    617617        }
Note: See TracChangeset for help on using the changeset viewer.