Skip to content

Commit

Permalink
Convert UNIX timestamp to human readable format.
Browse files Browse the repository at this point in the history
  • Loading branch information
renintw committed Dec 6, 2023
1 parent 52e6b43 commit 167fd8e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function render( $attributes, $content, $block ) {
// Group events by month year.
$grouped_events = array();
foreach ( $filtered_events as $event ) {
$event_month_year = gmdate('F Y', $event->timestamp);
$event_month_year = gmdate('F Y', esc_html( $event->timestamp) );
$grouped_events[ $event_month_year ][] = $event;
}

Expand All @@ -67,7 +67,7 @@ function render( $attributes, $content, $block ) {
$content .= '<li class="wporg-marker-list-item">';
$content .= '<h3 class="wporg-marker-list-item__title"><a class="external-link" href="' . esc_url($event->url) . '">' . esc_html($event->title) . '</a></h3>';
$content .= '<div class="wporg-marker-list-item__location">' . esc_html($event->location) . '</div>';
$content .= '<div class="wporg-marker-list-item__date-time">' . esc_html( $event->timestamp ) . '</div>';
$content .= '<div class="wporg-marker-list-item__date-time">' . gmdate( 'F j, Y', esc_html( $event->timestamp ) ) . '</div>';
$content .= '</li>';
}

Expand Down

0 comments on commit 167fd8e

Please sign in to comment.