Skip to content

Commit

Permalink
Fix date and time formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
roofdog committed Aug 26, 2014
1 parent e452f79 commit 471c855
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 7 additions & 8 deletions templates/content-widget-fixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

$home_club = get_post_meta( $postid, 'wpcm_home_club', true );
$away_club = get_post_meta( $postid, 'wpcm_away_club', true );
// $timestamp = strtotime( get_the_date() );
// $gmt_offset = get_option( 'gmt_offset' );
// $date_format = get_option( 'date_format' );
// $time_format = get_option( 'time_format' );
$comps = get_the_terms( $postid, 'wpcm_comp' );
$seasons = get_the_terms( $postid, 'wpcm_season' );
$teams = get_the_terms( $postid, 'wpcm_team' );
Expand Down Expand Up @@ -50,10 +46,13 @@

echo '<div class="wpcm-date">';
echo '<div class="kickoff">';
if ( $show_date )
echo the_date();
if ( $show_time )
echo ', <time>' . the_time() . '</time>';
if ( $show_date ) {
echo the_time('j M Y');
}
if ( $show_time ) {
echo ' - ';
echo the_time('g:i a');
}
echo '</div>';
echo '</div>';

Expand Down
15 changes: 7 additions & 8 deletions templates/content-widget-results.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
$home_goals = get_post_meta( $postid, 'wpcm_home_goals', true );
$away_goals = get_post_meta( $postid, 'wpcm_away_goals', true );
$played = get_post_meta( $postid, 'wpcm_played', true );
// $timestamp = strtotime( get_the_date() );
// $gmt_offset = get_option( 'gmt_offset' );
// $date_format = get_option( 'date_format' );
// $time_format = get_option( 'time_format' );
$comps = get_the_terms( $postid, 'wpcm_comp' );
$teams = get_the_terms( $postid, 'wpcm_team' );

Expand Down Expand Up @@ -54,10 +50,13 @@

echo '<div class="wpcm-date">';
echo '<div class="kickoff">';
if ( $show_date )
echo the_date();
if ( $show_time )
echo ', <time>' . the_time() . '</time>';
if ( $show_date ) {
echo the_time('j M Y');
}
if ( $show_time ) {
echo ' - ';
echo the_time('g:i a');
}
echo '</div>';
echo '</div>';

Expand Down

0 comments on commit 471c855

Please sign in to comment.