mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-25 08:03:01 +03:00
Apply the future booking limit to the booking page
This commit is contained in:
parent
7f534e51c7
commit
c8bfb623e2
2 changed files with 6 additions and 2 deletions
|
@ -133,6 +133,7 @@ class Booking extends EA_Controller {
|
|||
$display_login_button = setting('display_login_button');
|
||||
$display_delete_personal_information = setting('display_delete_personal_information');
|
||||
$book_advance_timeout = setting('book_advance_timeout');
|
||||
$future_booking_limit = setting('future_booking_limit');
|
||||
$theme = request('theme', setting('theme', 'default'));
|
||||
|
||||
if (empty($theme) || ! file_exists(__DIR__ . '/../../assets/css/themes/' . $theme . '.min.css'))
|
||||
|
@ -225,6 +226,7 @@ class Booking extends EA_Controller {
|
|||
'first_weekday' => $first_weekday,
|
||||
'display_cookie_notice' => $display_cookie_notice,
|
||||
'display_any_provider' => setting('display_any_provider'),
|
||||
'future_booking_limit' => setting('future_booking_limit'),
|
||||
'appointment_data' => $appointment,
|
||||
'provider_data' => $provider,
|
||||
'customer_data' => $customer,
|
||||
|
|
|
@ -82,12 +82,14 @@ App.Pages.Booking = (function () {
|
|||
|
||||
App.Utils.UI.initializeDatepicker($selectDate, {
|
||||
inline: true,
|
||||
minDate: new Date(),
|
||||
maxDate: moment().add(vars('future_booking_limit'), 'days').toDate(),
|
||||
onChange: (selectedDates) => {
|
||||
App.Http.Booking.getAvailableHours(moment(selectedDates[0]).format('YYYY-MM-DD'));
|
||||
updateConfirmFrame();
|
||||
},
|
||||
|
||||
onMonthChange: () => {
|
||||
onMonthChange: (selectedDates, dateStr, instance) => {
|
||||
setTimeout(() => {
|
||||
const displayedMonthMoment = moment(instance.currentYearElement.value + '-' + (Number(instance.monthsDropdownContainer.value) + 1) + '-01');
|
||||
|
||||
|
@ -99,7 +101,7 @@ App.Pages.Booking = (function () {
|
|||
}, 500);
|
||||
},
|
||||
|
||||
onYearChange: () => {
|
||||
onYearChange: (selectedDates, dateStr, instance) => {
|
||||
setTimeout(() => {
|
||||
const displayedMonthMoment = moment(instance.currentYearElement.value + '-' + (Number(instance.monthsDropdownContainer.value) + 1) + '-01');
|
||||
|
||||
|
|
Loading…
Reference in a new issue