Customize the minutes available in select for starting and ending date/time?

Home Forums Calendar Products Community Events Customize the minutes available in select for starting and ending date/time?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #381641
    cruzio
    Participant

    Hi, in the community events form, I’d like to be able to restrict the options available in the minutes select box from “05, 10, 15, 20…” etc to just “00” and “30”.

    Is this possible?

    #394196
    Casey
    Participant

    cruzio,
    Thanks for getting in touch! You should be able to do this with some custom CSS. Try pasting the following code snippet into your theme’s functions.php file: https://gist.github.com/ckpicker/e9d613e438de62550b8f

    This should only add the CSS when viewing the event submission form, so hopefully that will do the trick for you.

    Just let me know if need anything else! Thanks! 🙂

    -Casey-

    #394765
    cruzio
    Participant

    Thanks for the quick response! I added the code to my functions.php, and I see the code getting added when I view source, but the select options remain the same.

    #395379
    cruzio
    Participant

    Seems to be a browser issue. Firefox mostly works, but Chrome and Safari do not. Did some research and it looks like hiding select options is not well supported cross browser. Do you know of any workarounds?

    #395501
    cruzio
    Participant

    Ok I think I have this working, using jquery. Based my work off here: http://stackoverflow.com/questions/375508/removing-an-item-from-a-select-box
    This is the code I used, add to my .js file:

    //remove select options
    jQuery(document).ready(function($){
    $(“#tribe-event-datepickers select option[value=’05’]”).remove();
    $(“#tribe-event-datepickers select option[value=’10’]”).remove();
    $(“#tribe-event-datepickers select option[value=’15’]”).remove();
    $(“#tribe-event-datepickers select option[value=’20’]”).remove();
    $(“#tribe-event-datepickers select option[value=’25’]”).remove();
    $(“#tribe-event-datepickers select option[value=’35’]”).remove();
    $(“#tribe-event-datepickers select option[value=’40’]”).remove();
    $(“#tribe-event-datepickers select option[value=’45’]”).remove();
    $(“#tribe-event-datepickers select option[value=’50’]”).remove();
    $(“#tribe-event-datepickers select option[value=’55’]”).remove();
    });

    #397095
    Casey
    Participant

    cruzio,
    Great! Glad to hear that you were able to get this one sorted on your own. Since it looks like you’re all set, I’m going to mark this thread “Answered” and close it out.

    By the way, if you have a minute or two, we would love it if you’d write a few words for us here: http://m.tri.be/lo

    Thanks in advance. 🙂

    Cheers,
    Casey

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Customize the minutes available in select for starting and ending date/time?’ is closed to new replies.