Limit number of days

Home Forums Calendar Products Community Events Limit number of days

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #952960
    Max
    Participant

    I 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?

    #953219
    George
    Participant

    Hey 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,
    George

    #953221
    Max
    Participant

    Hello 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,
    Max

    #953555
    George
    Participant

    Alright, 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,
    George

    #983976
    Support Droid
    Keymaster

    This 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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Limit number of days’ is closed to new replies.