Making WordPress.org

Changeset 9634


Ignore:
Timestamp:
03/25/2020 07:08:17 PM (6 years ago)
Author:
ryelle
Message:

Official WordPress Events: Add timezone to each event time

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/official-events-online.js

    r9633 r9634  
    55 */
    66function getSortedEvents( events ) {
     7    const timezone = wp.date.format( '(\\U\\T\\CP)' );
    78    const sortedEvents = {};
    89    events.forEach( function( event ) {
     
    1011        const key = wp.date.format( 'Y-m-d', d );
    1112        // Inject a human-readable start time.
    12         event.startTime = wp.date.format( 'g:i a ', d );
     13        event.startTime = wp.date.format( 'g:i a', d );
     14        event.timezone = timezone;
    1315        if ( sortedEvents.hasOwnProperty( key ) ) {
    1416            sortedEvents[ key ].push( event );
     
    2123
    2224jQuery( function( $ ) {
    23     var templateTZ = wp.template( 'owe-timezone' );
    2425    var templateList = wp.template( 'official-events' );
    2526    var templateEvent = wp.template( 'official-event' );
     
    3637    ).join( '' );
    3738
    38     var timezone = templateTZ( wp.date.format( '\\U\\T\\CP' ) );
    39 
    40     $( '#official-online-events' ).html( timezone + list );
     39    $( '#official-online-events' ).html( list );
    4140});
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/official-wordpress-events.css

    r9633 r9634  
    1212
    1313.owe-timezone {
    14     font-style: italic;
     14    color: #767676;
    1515}
    1616
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/official-wordpress-events/template-events-online.php

    r9633 r9634  
    1 <script type="text/template" id="tmpl-owe-timezone">
    2     <p class="owe-timezone">
    3         All times displayed in {{ data }}
    4     </p>
    5 </script>
    6 
    71<script type="text/template" id="tmpl-official-events">
    82    <h3>
     
    2216        <span class="owe-separator"></span>
    2317        {{ data.startTime }}
     18        <span class="owe-timezone">{{ data.timezone }}</span>
    2419    </li>
    2520</script>
Note: See TracChangeset for help on using the changeset viewer.