Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only allow appointments for a few weeks in advance. #365

Closed
robertobarlocci opened this issue Oct 6, 2017 · 4 comments
Closed

Only allow appointments for a few weeks in advance. #365

robertobarlocci opened this issue Oct 6, 2017 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@robertobarlocci
Copy link
Contributor

Hi Alex,

thanks for the great app, saved me a lot of time! =)

Is there any way to restrict creating new appointments more than 4 weeks in advance?

Any ideas how this could be added?

@alextselegidis alextselegidis added the enhancement New feature or request label Oct 16, 2017
@alextselegidis
Copy link
Owner

Hi! You can modify the application/controllers/Appointments.php file and the ajax_get_available_providers method to turn the book advance timeout into days instead of minutes.

I'll mark this request as a feature request that can be integrated in a future release.

  Alex Tselegidis, Easy!Appointments Creator
  Need a customization? Contact me in person!

@alextselegidis alextselegidis self-assigned this Jan 28, 2018
@TVBZ
Copy link

TVBZ commented Feb 17, 2019

I second this feature. I want to have bookings for no more then 2 weeks in advance.
Any news on this feature? Or some example how to modify it would be great..

Many thanks!

@Connor1st
Copy link

Connor1st commented Sep 6, 2019

Hi everyone!
I have pasted the code below into /application/controllers/Appointments.php underneath the code that removes appointments too close to now. (Commented with "//If the selected date is today, remove past hours.......")

// If the selected day is beyond the advance booking limit hide all time-slots

if (date('Y-m-d', strtotime($this->input->post('selected_date'))) >= date('Y-m-d',mktime(0, 0, 0, date("m") , date("d") + 14, date("Y"))))
            {
                foreach ($available_hours as $index => $value)
                {
                        unset($available_hours[$index]);
                }
            }

14 is the number of days, change this to suit your requirements. Hopefully, alextselegidis will be able to do this much better than me and add it as a variable we can change via the interface.

@alextselegidis
Copy link
Owner

@Connor1st thanks for posting your solution.

I also agree that a future release must include better configuration possibilities from the backend settings page.

  Alex Tselegidis, Easy!Appointments Creator
  Need a customization? Contact me in person!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants