Changing minutes to hours in confirmation section

All of the services that we'll be implementing on this site are either 2-hr or full-day training appointments. When you select your preferred date and time, the box pops up at the bottom of the screen asking the user to confirm their appointment. Is there a way to change the "Lasts (approx.):" to be listed in hours instead of minutes? It looks kind of weird to list 120 minutes or 480 minutes.

Thank you!

  • Michael Bissett
    • Recruit

    Hey @Jason, hope you're doing well today! :slight_smile:

    As a matter of fact, there is a way to do this!

    If you were to insert this code into your site as a mu-plugin:

    function convert_to_hour( $text, $duration ) {
        if ( $duration < 60 ) return $text;
        $hours = floor($duration/60);
        if ( $hours > 1 ) $hour_text = ' hours ';
        else $hour_text = ' hour ';
        $mins = $duration - $hours *60;
        if ( $mins ) $min_text = $mins . ' minutes';
        else $min_text = '';
        return $hours . $hour_text . $min_text;
    add_filter('app_confirmation_lasts', 'convert_to_hour', 10, 2);

    That would convert the minutes into hours for you. :slight_smile:

    Hope this helps!

    Kind Regards,

  • Shift Mobile
    • New Recruit

    Hello. same problem here.
    we work our charter business completely by hours. it is so strange that wpmudev limited such a good plugin to only minutes, when it is advertised as you can book any service out there.

    Please let me know detail instructions on how to change from minutes to hours throughout the entire system. Possible? if not, whatever you can provide - without too much coding involved, or specific instructions - not very techie. thx very much... KA

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.