Commit a5cc826b authored by droces's avatar droces

Fixed calendar not showing correct number of 'days' fist time an event is added to it

parent 8639e8f8
...@@ -254,7 +254,7 @@ function check_date_field_valid_value(field) { ...@@ -254,7 +254,7 @@ function check_date_field_valid_value(field) {
var min_nights = parseInt(Drupal.abookings.get_bookable_data()['field_min_guests']); var min_nights = parseInt(Drupal.abookings.get_bookable_data()['field_min_guests']);
min_nights = (min_nights) ? min_nights : 1; min_nights = (min_nights) ? min_nights : 1;
console.log('min_nights: ', min_nights); // console.log('min_nights: ', min_nights);
var min_nights_valid = num_nights >= min_nights; var min_nights_valid = num_nights >= min_nights;
if (! min_nights_valid) { if (! min_nights_valid) {
alert('Sorry, you cannot book for fewer than ' + min_nights + ' nights.'); alert('Sorry, you cannot book for fewer than ' + min_nights + ' nights.');
...@@ -897,7 +897,7 @@ Drupal.abookings = { ...@@ -897,7 +897,7 @@ Drupal.abookings = {
field_booking_status: booking_data.field_booking_status, field_booking_status: booking_data.field_booking_status,
start: moment(booking_data.field_checkin_date, 'X'), start: moment(booking_data.field_checkin_date, 'X'),
// End 1 day before checkout date // End 1 day before checkout date
end: moment(booking_data.field_checkout_date - 1*60*60*24, 'X'), end: moment(booking_data.field_checkout_date, 'X'), // - 1*60*60*24
rendered: false rendered: false
} }
// events[nid].end.subtract(1, 'days'); // events[nid].end.subtract(1, 'days');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment