Home › Forums › Calendar Products › Community Events › Modifying the Date picker/Filter bar
- This topic has 7 replies, 4 voices, and was last updated 7 years, 5 months ago by Derek.
-
AuthorPosts
-
October 18, 2016 at 9:21 am #1178411DerekParticipant
Hello,
I am hosting an event to takes place from April 1st-8th. I’d like to modify the date picker on the edit-event form to only show April 1st-8th and no other dates. Is this possible? If so, whats the best way to achieve this.
Also, Id like to filter the Day filter on the Filter Bar to show April 1st – 8th instead of the M-SN. What’s the best way to achieve this?
Thank you for you time,
DerekOctober 19, 2016 at 6:43 am #1179018CliffMemberHi Derek.
You could reference https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/ to possibly be able to restrict Community Events form submissions to only allow certain dates.
Of course, it wouldn’t be great for users if they didn’t know your date restrictions, which is why you’d want a customized date picker.
I’d probably start by setting the start/end date fields to a default date, like 2017-04-01, and then consider hiding actual datepicker dates or full months. You could also inject some help text around the date field(s) to specify the only dates that will be allowed are April 1-8, 2017.
Please let me know if you have any follow-up questions on this topic.
October 21, 2016 at 9:02 am #1180613DerekParticipantThanks Cliff.
Would I set the default start/end dates in the tribe_community_events_get_start_date in template-tags.php?
Derek
October 21, 2016 at 12:03 pm #1180851CliffMemberDerek, yes, good find. Here’s an example for you:
https://gist.github.com/cliffordp/6a823bbe3aaa266c7f4f5b93e89d1424
October 21, 2016 at 12:40 pm #1180882DerekParticipantThanks Cliff! I just wanted to make sure I was editing in the right place. That worked.
Also, the events calendar uses bootstrap-datepicker.js, correct?
I’d like to customize the date picker so it only allows the user to choose a specific date range.
I know bootstrap-datepicker.js allows you to do this using their startDate and endDate options. Do you have any advice on how to go about executing this with community events? Also, does the date search bar and the community edit-event page use different date pickers?
Thanks for your help!!!!
DerekOctober 21, 2016 at 1:11 pm #1180903CliffMemberI’m glad that helped you.
The datepicker used in Community Events comes from /wp-content/plugins/the-events-calendar/vendor/bootstrap-datepicker
Feel free to share any customizations you come up with if you think it’ll help others.
If you need some coding help, you may want to ask your developer or reference our documentation and list of known customizers.
November 12, 2016 at 8:35 am #1191387Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Modifying the Date picker/Filter bar’ is closed to new replies.