Viewing 5 replies - 1 through 5 (of 5 total)
  • Hey there Hakkai,

    Hope you’re well today 🙂

    Removing this is definitely possible but it will require some custom coding. We can use a filter in the plugin in order to remove the end time but it will leave a dash (-) there which we can also remove with some jQuery.

    Please try adding the following code to your theme functions.php (Ideally you’d want this added in your child theme functions.php or added as a MU plugin so you don’t have to worry about theme updates):

    add_filter( 'app_weekly_calendar_to', '__return_empty_string' );
    
    add_action('wp_footer','remove_dash_from_weekly_cal');
    
    function remove_dash_from_weekly_cal(){
    
    ?>
    
    <script>
    
    var replaced = jQuery(".appointments-weekly-calendar-hours-mins").html().replace('-',''); jQuery(".appointments-weekly-calendar-hours-mins").html(replaced);    
    
    </script>
    
    <?php
    
    }

    This should be the result http://screencast.com/t/1cTG522nI98.

    Hope this helps 🙂

    Cheers,
    Bojan

    Thread Starter Hakkai

    (@kakkai)

    Hey !

    Sorry for my english, not sure i’m being understood, i’m french.

    Thanks a lot !
    The filter is working well and ending hours are returning as empty but it seems there is a bug in the script or something.

    <script>
    
    var replaced = jQuery(".appointments-weekly-calendar-hours-mins").html().replace('-',''); jQuery(".appointments-weekly-calendar-hours-mins").html(replaced);
    
    </script>

    As in your screenshot, when the script is in, the first hour is showing everywhere instead of others (without the “-” which is good ^^).

    Thanks again for the piece of code, even if i can’t remove the “-“, i just removed the script for now, this is really helpfull.

    Hey again,

    I see what you mean now, sorry about that I completely missed it when I was testing this on my end.

    Please try adding this instead:

    add_filter( 'app_weekly_calendar_to', '__return_empty_string' );
    
    add_action('wp_footer','remove_dash_from_weekly_cal');
    
    function remove_dash_from_weekly_cal(){
    
    ?>
    
    <script>
    jQuery(document).ready(function() {
        jQuery(".appointments-weekly-calendar-hours-mins").text(function () {
           return jQuery(this).text().replace("-", "");
        })
    });
    </script>
    
    <?php
    
    }

    This should be the result http://screencast.com/t/MvDw4ln68In.

    Hope this helps 🙂

    Cheers,
    Bojan

    Thread Starter Hakkai

    (@kakkai)

    Thank you very much!
    It works perfectly this way!

    Awesome! Glad I could help!

    Cheers,
    Bojan

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Only Starting Hours’ is closed to new replies.