WordPress.org

Making WordPress.org

Changeset 6359


Ignore:
Timestamp:
01/11/2018 11:43:59 PM (20 months ago)
Author:
obenland
Message:

Themes: Improve localized date display.

This will not solve it for all languages, but at least the more popular ones should see a benefit.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Using_locales
Fixes #1269.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r6350 r6359  
    6767            ),
    6868            'l10n' => array(
     69                'locale'            => str_replace( '_', '-', get_locale() ),
    6970                'search'            => __( 'Search Themes', 'wporg-themes' ),
    7071                'searchPlaceholder' => __( 'Search themes...', 'wporg-themes' ), // placeholder (no ellipsis)
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js

    r6324 r6359  
    489489
    490490            // Format the Last Updated date, prefering
    491             data.last_updated = updated.toLocaleDateString( false, {day:"numeric", month:"long", year:"numeric"} );
     491            data.last_updated = updated.toLocaleDateString( l10n.locale, {
     492                day:   'numeric',
     493                month: 'long',
     494                year:  'numeric',
     495            } );
    492496
    493497            // If last updated plus 2 years is in the past, it's outdated.
Note: See TracChangeset for help on using the changeset viewer.