Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Matt Banks

    (@mjbanks)

    I’ll change the time format display to properly pull the time_format option in the next update!

    Hello! I’ve the same problem!
    I’m italian and I like to set the time by 24h (a.m and p.m)…
    It will be also possible to have the Italian version of the plugin? (only title!)
    Thank you!

    As a temporary fix: on line 330 and 331 change g into G and h into H in plugins/woocommerce-local-pickup-time-select/public/class-local-pickup-time.php. Your hours will now be displayed in the 24-hour-format.

    Old

    $option_key = $current_day_name . date( "_h_i", $tNow );
    $option_value = $day_name . ' ' . date( "g:i", $tNow );

    New

    $option_key = $current_day_name . date( "_H_i", $tNow );
    $option_value = $day_name . ' ' . date( "G:i", $tNow );

    Aswell as a temporary fix –> If you want go a step further and change the week-names into your wordpress language you have to edit two files.

    In plugins/woocommerce-local-pickup-time-select/public/class-local-pickup-time.php change line 289 through 299.

    Old

    $today_name = strtolower( date( 'l' ) );
    $today_date = date( 'm/d/Y' );
    
    // Create an empty array for our dates
    $pickup_options = array();
    
    // Loop through all days ahead and add the pickup time options to the array
    for ( $i = 0; $i < 7; $i++ ) {
    
    // Get the date of current iteration
    $current_day_name = date( 'l', strtotime( "+$i days" ) );

    New

    $today_name = strtolower( date_i18n( 'l' ) );
    $today_date = date( 'm/d/Y' );
    
    // Create an empty array for our dates
    $pickup_options = array();
    
    // Loop through all days ahead and add the pickup time options to the array
    for ( $i = 0; $i < 7; $i++ ) {
    
    // Get the date of current iteration
    $current_day_name = date_i18n( 'l', strtotime( "+$i days" ) );

    And in plugins/woocommerce-local-pickup-time-select/admin/class-local-pickup-time-admin.php use find and replace to change all english weekday-names into your desired language. This has to be done very precise, so make sure you spell the names correctly.

    Hope this helps

    Plugin Contributor Matt Banks

    (@mjbanks)

    I’m unfortunately tied up with some client work right now, but if anyone wants to submit a pull request on Github with all of the changes, I’ll be happy to merge it and push a new release (and add you to the contributors list)!

    https://github.com/mattbanks/woocommerce-local-pickup-time

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘24h time format’ is closed to new replies.