Events

tDatePicker triggers a number of events in certain circumstances. Events have extra data attached to the event object that is passed to any event handlers

<script type="text/javascript">
  $(document).ready(function(){
    var t_calendar = $('.t_datepicker');
    t_calendar.tDatePicker();
    t_calendar.on( 'event_name',function() {
      // do something ...
    })
  })
</script>
Event name: clickDateCI, clickDateCO, beforeShowDay, afterShowDay ...

clickDateCI

Event: Click

Parameter: (event, fn())

Fired when you click the date check-in picker.
<script type="text/javascript">
    $('.t-datepicker').tDatePicker({
      // Options
    }).on('clickDateCI',function(e, dateCI) {
      // console.log('clickDateCI do something')
    })
</script>

clickDateCO

Event: Click

Parameter: (event, fn())

Fired when you click the date check-out picker.
<script type="text/javascript">
    $('.t-datepicker').tDatePicker({
      // Options
    }).on('clickDateCO',function(e, dateCO) {
      // console.log('clickDateCO do something')
    })
</script>

beforeShowDay

Event: Click

Parameter: (event, fn())

Fired before table calendar days show when you click check-in or check-out.
<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('beforeShowDay',function() {
    // console.log('beforeShowDay do something')
  })
</script>

afterShowDay

Event: Click

Parameter: (event, fn())

Fired after table calendar days showed.
<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('afterShowDay',function() {
    // console.log('afterShowDay do something')
  })
</script>

toggleAfterHideDay

Event: toggleClick

Parameter: (event, fn())

Fired after table calendar days hided.
<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('toggleAfterHideDay',function() {
    // console.log('toggleAfterHideDay do something')
  })
</script>

afterCheckOut

Event: Click

Parameter: (event, fn())

Fired when you have selected day on the table calendar of check-out picker.

No support only Picker View Demo

<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('afterCheckOut',function(e, dataDate){
    // console.log(new Date(dataDate[0])) // check-in
    // console.log(new Date(dataDate[1])) // check-out
  })
</script>

eventClickDay

Event: Click

Parameter: (event, fn())

Fired whenever you have selected day on the table calendar picker. If you don't have date check-out, You will have dataDate check-in.
<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('eventClickDay',function(e, dataDate){
    // console.log(new Date(dataDate[0])) // check-in
    // console.log(new Date(dataDate[1])) // check-out
  })
</script>

selectedCI

Event: Click

Parameter: (event, fn())

Fired when you have selected day on the table calendar of check-in picker.
<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('selectedCI',function(e, slDateCI) {
    // console.log('selectedCI do something')
    // console.log(new Date(slDateCI))
  })
</script>

selectedCO

Event: Click

Parameter: (event, fn())

Fired when you have selected day on the table calendar of check-out picker.

No support only Picker View Demo

<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('selectedCO',function(e, slDateCO) {
    // console.log('selectedCO do something')
    // console.log(new Date(slDateCO))
  })
</script>

onChangeCI

Event: Click

Parameter: (event, fn())

Fired when your input value of t-input-check-in changed date.
<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('onChangeCI',function(e, changeDateCI) {
    // console.log'onChangeCI do something')
    // console.log(new Date(changeDateCI))
  })
</script>

onChangeCO

Event: Click

Parameter: (event, fn())

Fired when your input value of t-input-check-out changed date.

No support only Picker View Demo

<script type="text/javascript">
  $('.t-datepicker').tDatePicker({
    // Options
  }).on('onChangeCO',function(e, changeDateCO) {
    // console.log'onChangeCO do something')
    // console.log(new Date(changeDateCO))
  })
</script>