diff --git a/public_html/wp-content/themes/wporg-events-2023/src/event-list/block.json b/public_html/wp-content/themes/wporg-events-2023/src/event-list/block.json index f8c71d12a1..e90c17ef3b 100644 --- a/public_html/wp-content/themes/wporg-events-2023/src/event-list/block.json +++ b/public_html/wp-content/themes/wporg-events-2023/src/event-list/block.json @@ -31,6 +31,5 @@ } }, "editorScript": "file:./index.js", - "style": "file:./style-index.css", - "viewScript": "file:./view.js" + "style": "file:./style-index.css" } diff --git a/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php b/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php index d797dca3a6..a11dbf0881 100644 --- a/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php +++ b/public_html/wp-content/themes/wporg-events-2023/src/event-list/index.php @@ -67,7 +67,7 @@ function render( $attributes, $content, $block ) { $content .= '
  • '; $content .= '

    ' . esc_html($event->title) . '

    '; $content .= '
    ' . esc_html($event->location) . '
    '; - $content .= '
    '; + $content .= '
    ' . esc_html( $event->timestamp ) . '
    '; $content .= '
  • '; } diff --git a/public_html/wp-content/themes/wporg-events-2023/src/event-list/view.js b/public_html/wp-content/themes/wporg-events-2023/src/event-list/view.js deleted file mode 100644 index 71abb6bc25..0000000000 --- a/public_html/wp-content/themes/wporg-events-2023/src/event-list/view.js +++ /dev/null @@ -1,15 +0,0 @@ -// Converts server-side Unix timestamps to a human-readable format and client-side timezone. -window.addEventListener( 'load', () => { - const timeElements = document.querySelectorAll( '.wporg-marker-list__container .wporg-marker-list-item__date-time' ); - - timeElements.forEach( ( element ) => { - const timestamp = element.getAttribute( 'data-wc-events-list-timestamp' ); - const options = { - year: 'numeric', - month: 'long', - day: 'numeric', - }; - const localDate = new Date( parseInt( timestamp ) * 1000 ).toLocaleString( 'en-US', options ); - element.textContent = localDate; - } ); -} );