Modify Event Time and Date Time and Recurrence Rules

Home Forums Calendar Products Community Events Modify Event Time and Date Time and Recurrence Rules

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1139289
    Jennifer
    Participant

    Hello,

    I would like to remove “all day event?” checkbox, “recurrence rules” dropdown, and the “add another rule” button from community event submission form.

    Also, we only community submitted events to require start times (I already set start time to be a required field, per your knowledge base articles), so that only a start time appears in the calendar views (these events do not have end times). What would be the best/easiest way to accomplish this? For example, keep the end time visible and set it to populate to whatever time the user selects for the start time?

    Thanks for your help!
    Jennifer

    #1139492
    Hunter
    Moderator

    Hey Jennifer!

    Thank you for reaching out 🙂

    To make any of those customizations, you can do so via template overrides as explained in our Themer’s Guide or using CSS. I typically use this YouTube Video trick to help out with CSS. If you need any specific help, feel free to ask and I’ll do my best to accommodate.

    What would be the best/easiest way to accomplish this? For example, keep the end time visible and set it to populate to whatever time the user selects for the start time?

    Forgive me if I’m confused, but you should be able to set the start time and end time to the same time (let me know if this makes sense). If I’ve confused you, try and send over screenshots of what you’re looking to do and I’d be happy to take a look.

    Thanks again and welcome to the forums.
    Cheers!

    #1139627
    Jennifer
    Participant

    Hi Hunter,

    Thanks for your reply. I created template overrides, as per your Themer’s Guide, to remove entire modules from the Community form (Organizer, Location, and Cost). That worked great. And I know that the start and end times can be set to the same time on the front end form, which will result in showing only a start time in the calendar view. However, I am concerned that this will not be clear to anonymous form users. For the sake of anonymous user simplicity, I want to know if there is a way to code this so that they 1) only input a start time with no end time option or 2) the end time option automatically populates with the start time they select). And so that only the start time shows in the calendar views. Hopefully this makes more sense?

    Oh, and I would also like to remove the Recurrance Rules and Add Another Rule from the Date and Time module in the Community form. Is this something that you can show me how to do?

    #1139815
    Hunter
    Moderator

    Hey Jennifer,

    Glad to hear you’re on the right track 🙂

    You can remove lines 78-89 from the-events-calendar-community-events/src/views/community/modules/datepickers.php and that will remove the end date/time field from the community event submission form. You can also delete the entire contents of the-events-calendar-community-events/src/views/community/modules/recurrence.php and that will remove the ‘Recurrence Rules’ section. Remember to save them as recommended in our Themer’s Guide to avoid losing changes.

    You could also create custom templates overriding the views which have the end date/time removed/commented out.

    I hope this all helps and let me know if you have any more questions!

    #1140714
    Jennifer
    Participant

    Hi Hunter. Thanks! I followed your instructions and all looks good! However, I tried to test the form and I am getting an error “_ecp_custom_2 is required”. What is this? Not sure where to find it, and even when I do, what to do with it? Screenshot attached. Thank you again for your support.

    Jennifer

    #1140792
    Jennifer
    Participant

    Hi Hunter,

    You can disregard that last inquiry, as I was able to fix on my own. However, even though the anonymous form submitter will not see and end time on the front end community event submssion form, it looks like the submitted form still includes an end time (pre-populated to 5pm) — which I don’t want. Is there a way for the end time to pre-populate to the start time entered by the anonymous form submitter, so that the calendar renders only a start time in the calendar views? Hopefully this makes sense.

    Thank you!
    Jennifer

    #1141138
    Hunter
    Moderator

    Hey Jennifer,

    Try adding the following snippet to the bottom of your theme’s functions.php file and let me know if it works. We’re pretty limited on how much customization we can provide, but this should get you started in the right direction. Have a great Monday!

    /**
    * Example of changing the default event start/end times for the
    * Community Events submission form, in this case to 11am and 9pm
    * (assuming the site is operating in 12hr clock mode).
    */

    function ce_change_default_start_hour( $hour, $date, $is_start_time ) {
    if ( null !== $date ) return $hour;
    if ( $is_start_time ) return '11';
    return $hour;
    }

    function ce_change_default_end_hour( $hour, $date, $is_start_time ) {
    if ( null !== $date ) return $hour;
    if ( $is_start_time ) return $hour;
    return '09';
    }

    add_filter( 'tribe_get_hour_options', 'ce_change_default_start_hour', 10, 3 );
    add_filter( 'tribe_get_hour_options', 'ce_change_default_end_hour', 10, 3 );

    #1149451
    Jennifer
    Participant

    This reply is private.

    #1149621
    Hunter
    Moderator

    Hi Jennifer,

    Thank you for the feedback. I understand how frustrating it can be working with code as I’m admittedly not very code-savvy myself. Between CSS and template overrides, you should be able to turn our plugin into exactly what you need. We do our best to build what we think our users want/need, but the number of specific features/functionality is endless.

    If you’re still unable to get the form to your liking, we’ve got a list of customizers that might be able to help.

    Sorry I can’t be of more assistance and good luck getting everything how you envision. Thanks again.

    Take care 🙂

    #1158213
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Modify Event Time and Date Time and Recurrence Rules’ is closed to new replies.