Viewing 4 replies - 1 through 4 (of 4 total)
  • Not without modification.

    Open up class-challonge-widget.php in the challonge plugin folder.

    Go to line 210 and add the following code after line 210:

    .date_i18n(get_option( 'date_format' ) . ' ' . get_option( 'time_format' ),strtotime( $tourny->{ 'start-at' } )+ ( get_option( 'gmt_offset' ) * 3600 )).'<br />'

    After that the code should look like this:

    $ret .= '<br /><span class="challonge-info">'
        .date_i18n(get_option( 'date_format' ) . ' ' . get_option( 'time_format' ),strtotime( $tourny->{ 'start-at' } )+ ( get_option( 'gmt_offset' ) * 3600 )).'<br />'
        . esc_html( $lnk->participants_count ) . '/' . $lnk->signup_cap
        . ' | ' . esc_html( ucwords( str_replace( '_', ' ', $tourny->state ) ) )
      . '</span>';
    $ret .= '</li>';

    Bear in mind that this modification will be overwritten after a plugin update.

    Thread Starter milosztor

    (@milosztor)

    Thank you! Can I convert it to 24h format or how I can format it to my preferences using this table https://codex.www.ads-software.com/Formatting_Date_and_Time ?

    The format depends on your wordpress settings.

    For 24h format you have to set the time format in the wordpress settings to G:i

    If you do not want to change your wordpress settings I can have a look at the code if I can adjust it manually.

    Edit:

    Just replace the get_option( ‘time_format’ ) with ‘G:i’

    The new code is

    .date_i18n(get_option( 'date_format' ) . ' ' . 'G:i', strtotime( $tourny->{ 'start-at' } ) + ( get_option( 'gmt_offset' ) * 3600 )).'<br />'

    Thread Starter milosztor

    (@milosztor)

    That’s perfect! Thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add start time to widget’ is closed to new replies.