Home › Forums › Calendar Products › Community Events › Customize the minutes available in select for starting and ending date/time?
- This topic has 5 replies, 2 voices, and was last updated 11 years, 9 months ago by
Casey.
-
AuthorPosts
-
July 14, 2014 at 1:18 pm #381641
cruzio
ParticipantHi, 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?
July 15, 2014 at 7:18 am #394196Casey
Participantcruzio,
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/e9d613e438de62550b8fThis 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-
July 15, 2014 at 8:17 am #394765cruzio
ParticipantThanks 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.
July 15, 2014 at 9:16 am #395379cruzio
ParticipantSeems 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?
July 15, 2014 at 9:27 am #395501cruzio
ParticipantOk 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();
});July 15, 2014 at 12:49 pm #397095Casey
Participantcruzio,
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 -
AuthorPosts
- The topic ‘Customize the minutes available in select for starting and ending date/time?’ is closed to new replies.
