Home › Forums › Calendar Products › Community Events › Limit number of days
- This topic has 4 replies, 3 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
April 2, 2015 at 5:56 pm #952960
Max
ParticipantI posted this a while ago and just wanted to re-visit this. I’m just wondering if there is any way to limit the number of days that people can make a multi-day event. We are getting people that are posting like 1-3 month events and it’s really crowding up the calendar. So I would like to maybe set the multi-day events to 3 days max. I’m sure it would be pretty easy to add a custom bit of code to do this right?
April 3, 2015 at 5:29 pm #953219George
ParticipantHey Max,
Can you share a link to where you originally posted about this? Just curious for reference.
As for actually doing this, it may indeed be technically possible, but is quite an extensive customization.
Just to be clear, do you only mean limiting the number of days on the Community Events front-end, or do you also mean limiting the amount globally in the admin-area of your site?
Thanks,
GeorgeApril 3, 2015 at 5:32 pm #953221Max
ParticipantHello there, Here is the original link: https://theeventscalendar.com/support/forums/topic/limit-number-of-days/
It would really only have to be on the front end.
Thanks,
MaxApril 6, 2015 at 3:11 pm #953555George
ParticipantAlright, thanks for specific that Max. I started working on this a bit but it’s actually a bit more complex than it might seem – there are numerous ways to go about setting up restrictions like this, but the most straightforward way I can think of would be to extend the jQuery UI Datepicker’s API on the Community Events submission page, and then watch for when the date is set for either field – run a callback function when this change happens.
Then you can just basically make this function check for the range between the selected dates, and either reset the dates so that it’s valid or print an error to the user so that they know about the limit.
You can learn about the jQuery UI Datepicker API here → http://api.jqueryui.com/datepicker/
I hope this information, though not code-specific, helps Max. If you’re interested in hiring a developer to help you out, you can email us at [email protected] for a list of developers we often recommend to folks.
Cheers,
GeorgeJuly 7, 2015 at 6:31 am #983976Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Limit number of days’ is closed to new replies.
