Methods Update define, reset new date check-in and check-out of date calendar. But, it also dependencies on some follow options and methods startDate, limitDateRanges, numCalendar.
Why? Because t-datepicker is focus dateRanges. This is important to set date of check-in or date of check-out on table theme calendar. If you don't set value, these are options will define default date for you.
This is demo default.
<script type="text/javascript"> $(document).ready(function(){ $('.t-datepicker').tDatePicker({ startDate : '2018-07-20', limitDateRanges : 31, limitNextMonth : 2 }) }) </script>
Scroll down, these are examples that you can use methods update.
We have to understood:
limitDate = startDate + limitDateRanges = '2018-08-20'
CI: Check In
CO: Check Out
All cases lower limitDate except case 1 lower startDate and limitDate.
$(".t-datepicker").tDatePicker('update', ['CI', 'CO'])
...
$(".class_name").tDatePicker('update', ['2018-06-29', '2018-06-30'])
// Auto update CI = '2018-07-20', CO = '2018-07-21'
...
...
$(".class_name").tDatePicker('update', ['2018-06-29', '2018-07-30'])
// Auto update CI = '2018-07-20', CO = '2018-07-21'
...
...
$(".class_name").tDatePicker('update', ['2018-07-29', '2018-07-30'])
// Return CI = '2018-07-29', CO = '2018-07-30'
...
...
$(".class_name").tDatePicker('update', ['2018-07-29', '2018-07-28'])
// Auto update CI = '2018-07-20',
// CO = '2018-07-28'
...
... $(".class_name").tDatePicker('update', ['2018-06-29', '']) // lower startDate // Auto update CI = '2018-07-20', CO = null $(".class_name").tDatePicker('update', ['2018-07-29', '']) // Return CI = '2018-07-29', CO = null $(".class_name").tDatePicker('update', ['2018-10-29', '']) // upper limitEndDate // Auto update CI = '2018-10-20', CO = null ...
... $(".class_name").tDatePicker('update', ['', '2018-06-29']) // lower startDate // Auto update CI = '2018-07-20', Auto update CO = '2018-07-20' $(".class_name").tDatePicker('update', ['', '2018-07-29']) // Auto update CI = '2018-07-20', CO = '2018-07-29' $(".class_name").tDatePicker('update', ['', '2018-10-29']) // upper limitEndDate // Auto update CI = '2018-09-28', CO = '2018-10-20' ...
... $(".class_name").tDatePicker('update', ['2018-06-29', '2018-06-29']) // lower startDate // Auto update CI = '2018-07-20', Auto update CO = '2018-07-21' $(".class_name").tDatePicker('update', ['2018-07-29', '2018-07-29']) // Auto update CI = '2018-07-29', CO = null $(".class_name").tDatePicker('update', ['2018-10-29', '2018-10-29']) // upper limitEndDate // CI = null, Auto update CO = '2018-10-20' ...
We have to understood:
startDate = '2018-07-20'
limitDate = startDate + limitDateRanges = '2018-08-20'
limitEndDate = startDate + limitNextMonth + limitDateRanges = '2018-10-20'
CI: Check In
CO: Check Out
All cases upper limitDate and lower limitEndDate. Except case 1 and 2
$(".t-datepicker").tDatePicker('update', ['CI', 'CO'])
...
$(".class_name").tDatePicker('update', ['2018-10-29', '2018-10-30'])
// Auto update CI = '2018-09-29', CO = '2018-10-20'
...
...
$(".class_name").tDatePicker('update', ['2018-09-29', '2018-10-30'])
// CI = '2018-09-29', Auto update CO = '2018-10-20'
...
...
$(".class_name").tDatePicker('update', ['2018-09-29', '2018-09-30'])
// Auto update CI = '2018-09-29', CO = '2018-09-30'
...
...
$(".class_name").tDatePicker('update', ['2018-09-29', '2018-09-28'])
// Auto update CI = '2018-08-28', CO = '2018-09-28'
...
...
$(".class_name").tDatePicker('update', ['2018-09-29', ''])
// Auto update CI = '2018-09-29', CO = null
...
... $(".class_name").tDatePicker('update', ['', '2018-06-29']) // CO lower startDate // CI = '2018-07-20', Auto update CO = '2018-07-21' $(".class_name").tDatePicker('update', ['', '2018-09-29']) // Auto update CI = '2018-08-29', CO = '2018-09-29' $(".class_name").tDatePicker('update', ['', '2018-10-29']) // CO upper limitEndDate // Auto update CI = '2018-08-28', Auto update CO = '2018-10-20' ...
... $(".class_name").tDatePicker('update', ['2018-06-29', '2018-06-29']) // lower startDate // Auto update CI = '2018-07-20', Auto update CO = '2018-07-21' $(".class_name").tDatePicker('update', ['2018-07-29', '2018-07-29']) // Auto update CI = '2018-07-29', CO = null $(".class_name").tDatePicker('update', ['2018-10-29', '2018-10-29']) // upper limitEndDate // Auto update CI = '2018-08-28', Auto update CO = '2018-10-20' ...
Continuse, We strart with old demo default.
<script type="text/javascript"> $(document).ready(function(){ $('.t-datepicker').tDatePicker({ startDate : '2018-07-20', limitDateRanges : 31, limitNextMonth : 2 }) }) </script>
We have to understood:
startDate = '2018-07-20'
limitDate = startDate + limitDateRanges = '2018-08-20'
limitEndDate = startDate + limitNextMonth + limitDateRanges = '2018-10-20'
CI: Check In
CO: Check Out
...
$('.class_name').tDatePicker('update', '') // Reset CI && CO
$('.class_name').tDatePicker('updateCI', '2018-06-29')
// Auto update CI = '2018-07-20', CO = '2018-07-21
...
...
$('.class_name').tDatePicker('update', '') // Reset CI && CO
$('.class_name').tDatePicker('updateCI', '2018-07-29')
// Auto update CI = '2018-07-29', CO = null
...
...
$('.class_name').tDatePicker('update', '') // Reset CI && CO
$('.class_name').tDatePicker('updateCI', '2018-10-29')
// Auto update CI = '2018-10-20', CO = null
...
Continuse, We strart with old demo default.
<script type="text/javascript"> $(document).ready(function(){ $('.t-datepicker').tDatePicker({ startDate : '2018-07-20', limitDateRanges : 31, limitNextMonth : 2 }) }) </script>
We have to understood:
startDate = '2018-07-20'
limitDate = startDate + limitDateRanges = '2018-08-20'
limitEndDate = startDate + limitNextMonth + limitDateRanges = '2018-10-20'
CI: Check In
CO: Check Out
...
$('.class_name').tDatePicker('update', '') // Reset CI && CO
$('.class_name').tDatePicker('updateCO', '2018-06-29')
// Auto update CI = '2018-07-20', CO = '2018-07-21'
...
...
$('.class_name').tDatePicker('update', '') // Reset CI && CO
$('.class_name').tDatePicker('updateCO', '2018-07-29')
// Auto update CO = '2018-07-20', CO = '2018-07-29'
...
...
$('.class_name').tDatePicker('update', '') // Reset CI && CO
$('.class_name').tDatePicker('updateCO', '2018-09-29')
// Auto update CO = '2018-08-29', Auto update CO = '2018-09-29'
...
...
$('.class_name').tDatePicker('update', '') // Reset CI && CO
$('.class_name').tDatePicker('updateCO', '2018-10-29')
// Auto update CO = '2018-08-29', Auto update CO = '2018-10-20'
...