List including all options from built-in plugins. All options that take a “Date” can handle a Date object, or a String formatted according to the given formatDate
<script type="text/javascript"> $(document).ready(function(){ $(".t-datepicker").tDatePicker({ autoClose: true, // more options here ... }) }) </script>
Type: Boolean
Default: true
... autoClose: true, ...
Type: Number
Default: 200
... durationArrowTop: 200, ...
Type: Boolean
Default: false
... valiDation: false, ...
You can use custom demo script
HTML5 validation to prevent form submit when the date field(s) haven't been populated. You set valiDation: true.
... valiDation: true, ...
Type: String
Default: yyyy-mm-dd
... formatDate: 'yyyy-mm-dd', ...
Type: String | Date | (yyyy/mm/dd)
Default: null
This dateCheckIn specifies date selected on calendar theme default. If you do not setup dateCheckIn, t-datepicker will use date startDate is default. You have to compare dateCheckIn with startDate.
Be carefull, when using date Object, in javascript number of months go from 0 to 11.
... dateCheckIn: '2018-07-17', // or dateCheckIn: new Date(2018,06,17) ...
Type: String | Date | (yyyy/mm/dd)
Default: null
This dateCheckOut specifies date selected calendar on theme default. If you do not setup dateCheckOut, t-datepicker will use last date of limitNextMonth is default. You have to compare dateCheckOut with limitNextMonth
Be carefull, when using date Object, in javascript number of months go from 0 to 11.
No support only Picker View Demo
... dateCheckOut: '2018-07-17', // or dateCheckOut: new Date(2018,06,18) ...
Type: String | Date | (yyyy/mm/dd)
Default: null
The earliest date that may be selected. All earlier dates will be disabled. If startDate none value, t-datepicker will using date toDay make default.
If you have set Date dateCheckIn, when you clicked picker calendar, t-datepicker will show date follow dateCheckIn
... startDate: '2018-07-15', // or startDate: new Date(2018,06,15) ...
Type: String | Date | (yyyy/mm/dd)
Default: null
The last date that may be selected, all later dates will be disabled. If endDate none value, t-datepicker auto setEndDate follow numCalendar + limitNextMonth
... endDate: '2018-12-30', // or endDate: new Date(2018,06,15) ...
Type: Number
Default: 0
... limitPrevMonth: 0, ...
Type: Number
Default: 11
... limitPrevMonth: 11, ...
Type: Number
Default: 31
This limitDateRanges specifies number limit date you can selected. Define is dates from CI to CO for you to choose. All earliest date of CI and later date of CO will disabled.
The limitDateRanges has relationship with update method
...
limitDateRanges : 60, // 60 days or 59 nights
limitNextMonth : 2,
...
Type: Boolean
Default: false
This showFullDateRanges specifies title number nigth or daytime when you hover on date calendar theme follow limitDateRanges.
Default showFullDateRanges is false, title is nigth or nights when date more than 2, limitDateRanges will be - 1 date.
Use showFullDateRanges is true. You can change title is days titleDateRanges, It will follow your language.
...
showFullDateRanges : true,
titleDateRanges : 'days',
// Your custom
startDate : '2018-07-20',
dateCheckIn : '2018-07-25',
dateCheckOut : '2018-08-24',
...
Type: Object
Default: null
This fnDataEvent specifies special date on the month (Holidays). This function only suport Destop with action :hover. It bookmarks special day and when you hover date special, It will show title special date follow your data.
<script type="text/javascript"> var holiDays = { '2018-01-01' : 'New Years is Day', '2018-01-02' : 'Lorem ipsum dolor sit amet ...', '2018-02-14' : 'Lorem ipsum dolor sit amet ...', '2019-01-02' : 'Lorem ipsum dolor sit amet ...' }; $(document).ready(function() { $('.t-datepicker').tDatePicker({ fnDataEvent: holiDays, startDate : '2018-12-20', mergeDataEvent : true }) }) </script>
Type: Boolean
Default: false
This mergeDataEvent specifies special date on the month (Holidays). This function only suport Destop with action :hover.
It keeps and replaces special day of the data Holidays. E.g: keep 2018-01-02, replace 2019-01-02
<script type="text/javascript"> var holiDays = { '2018-01-01' : 'New Years is Day', '2018-01-02' : 'Lorem ipsum dolor sit amet ...', '2018-02-14' : 'Valentin is Day', '2019-01-02' : 'Replace 2018-01-02...' }; $(document).ready(function() { $('.t-datepicker').tDatePicker({ fnDataEvent: holiDays, startDate : '2018-12-20', mergeDataEvent : true }) }) </script>
Type: Number
Default: 2
... numCalendar: 2, ...
Type: String
Default: Check In
... titleCheckIn: 'Check In', ...
Type: String
Default: Check Out
...
titleCheckOut: 'Check Out',
...
Type: String
Default: Today
... titleToday: 'Today', ...
Type: String
Default: night
... titleDateRange: 'night', ...
Type: String
Default: nights
... titleDateRanges: 'nights', ...
Type: Array
Default: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']
...
titleDays: ['Mo','Tu','We','Th','Fr','Sa','Su'],
...
Type: Array
Default: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'Septemper', 'October', 'November', "December"]
... titleMonths: ['January','February','March','April','May', 'June','July','August','Septemper','October','November','December'], ...
Type: Number
Default: 3
The titleMonthsLimitShow help you litmit letter show title of months on dates theme.
It is work with your data months titleMonths. If you want show full title of months into titleMonths.
You can setup max length of item your data months array or titleMonthsLimitShow: 99
... titleMonthsLimitShow: 3, ...
Type: String
Default: null
If you don't like data setTitleMonths is type text. You want use number of months, the replaceTitleMonths will help you with value is empty replaceTitleMonths: ' '
Or you have anything good ideas, You can mix text + number replaceTitleMonths: 'Text '
... replaceTitleMonths: '', ...
Type: String
Default: dd-mm-yyyy
... showDateTheme: 'dd-mm-yyyy', ...
Type: Boolean
Default: true
Show or hide iconArrowTop when table calendar show or hide, it will help you saw table calender position in check-in or check-out.
... iconArrowTop: true, ...
Type: String
Default: ➜ | #x279C
Default is dingbats. You can include html with the font icons on the your website. You don't know about font-icon. You can view more fontawesome
... iconDate: '➜', // or iconDate: <i class="fa fa-calendar"></i> // fontawesome ...
Type: String
Default: ❮ | #x276E
You can use text 'Pre' or dingbats. But it is not good. You can include html with the font icons on the your website. You don't know about font-icon. You can view more fontawesome
... arrowPrev: '❮', // or arrowPrev: <i class="fa fa-chevron-left"></i> // fontawesome ...
Type: String
Default: ❯ | #x276F
You can use text 'Next' or dingbats. But it is not good. You can include html with the font icons on the your website. You don't know about font-icon. You can view more fontawesome
... arrowNext: '❯', // or arrowNext: <i class="fa fa-chevron-right"></i> // fontawesome ...
Type: Boolean
Default: true
Hide or show titleDateRange
... dateRangesShowTitle: true, ...
Type: Boolean
Default: true
Off action hover dateRangesShowTitle and limitDateRanges
... dateRangesHover: true, ...
Type: Boolean
Default: false
If true, highlights the current date.
... toDayHighlighted: false, ...
Type: Boolean
Default: false
If false, highlights the next date.
... nextDayHighlighted: false, ...
Type: Array
Default: [0,6]
Days of the week that should be highlighted. Values are 0 (Sunday) to 6 (Saturday). Multiple values should be comma-separated. Example: highlight weekends: [0,6].
... daysOfWeekHighlighted: [0,6], ...
Type: Array
Default: []
Array of date strings with format yyyy-mm-dd.
... dateDisabled: ['2018-12-01'], ...
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: Click
Parameter: (event, fn())
<script type="text/javascript"> $('.t-datepicker').tDatePicker({ // Options }).on('clickDateCI',function(e, dateCI) { // console.log('clickDateCI do something') }) </script>
Event: Click
Parameter: (event, fn())
<script type="text/javascript"> $('.t-datepicker').tDatePicker({ // Options }).on('clickDateCO',function(e, dateCO) { // console.log('clickDateCO do something') }) </script>
Event: Click
Parameter: (event, fn())
<script type="text/javascript"> $('.t-datepicker').tDatePicker({ // Options }).on('beforeShowDay',function() { // console.log('beforeShowDay do something') }) </script>
Event: Click
Parameter: (event, fn())
<script type="text/javascript"> $('.t-datepicker').tDatePicker({ // Options }).on('afterShowDay',function() { // console.log('afterShowDay do something') }) </script>
Event: toggleClick
Parameter: (event, fn())
<script type="text/javascript"> $('.t-datepicker').tDatePicker({ // Options }).on('toggleAfterHideDay',function() { // console.log('toggleAfterHideDay do something') }) </script>
Event: Click
Parameter: (event, fn())
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>
Event: Click
Parameter: (event, fn())
<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>
Event: Click
Parameter: (event, fn())
<script type="text/javascript"> $('.t-datepicker').tDatePicker({ // Options }).on('selectedCI',function(e, slDateCI) { // console.log('selectedCI do something') // console.log(new Date(slDateCI)) }) </script>
Event: Click
Parameter: (event, fn())
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>
Event: Click
Parameter: (event, fn())
<script type="text/javascript"> $('.t-datepicker').tDatePicker({ // Options }).on('onChangeCI',function(e, changeDateCI) { // console.log'onChangeCI do something') // console.log(new Date(changeDateCI)) }) </script>
Event: Click
Parameter: (event, fn())
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>
Methods are called on a t-datepicker by calling the tDatepicker function with a string first parameter, followed by any parameters the method takes
<script type="text/javascript"> $(document).ready(function(){ $(".t-datepicker").tDatePicker('method_name', 'parameter') }) </script>
Type: String
Default: none
<script type="text/javascript"> $('.t-datepicker').tDatePicker('show') // show all $('.class_name').tDatePicker('show') // show only follow class | id name </script>
Type: String
Default: none
<script type="text/javascript"> $('.t-datepicker').tDatePicker('hide') // hide all $('.class_name').tDatePicker('hide') // hide only follow class | id name </script>
Type: String | Date | Array, optional
Default: none
Or, you want use new Date(), Be carefull with number of months, it is start 0 -> 11 <=> Jan -> Dec
<script type="text/javascript"> $('.t-datepicker').tDatePicker('update', '2018-07-17') $('.t-datepicker').tDatePicker('update', new Date(2018,06,17)) $('.t-datepicker').tDatePicker('update', ['2018-07-17', '2018-07-18']) $('.t-datepicker').tDatePicker('update', [new Date(2018,06,17), new Date(2018,06,17)]) </script>
<script type="text/javascript"> $('.t-datepicker').tDatePicker('update', '') </script>
Type: String | Date
Default: none
Or, you want use new Date(), becarefull with number of months. Tt is start 0 -> 11 <=> Jan -> Dec
<script type="text/javascript"> $('.t-datepicker').tDatePicker('updateCI', '2018-07-17') $('.t-datepicker').tDatePicker('updateCI', new Date(2018,06,17)) </script>
<script type="text/javascript"> $('.t-datepicker').tDatePicker('updateCI', '') </script>
Type: String | Date
Default: none
No support only Picker View Demo
<script type="text/javascript"> $('.t-datepicker').tDatePicker('updateCO', '2018-07-17') $('.t-datepicker').tDatePicker('updateCO', new Date(2018,05,20)) </script>
<script type="text/javascript"> $('.t-datepicker').tDatePicker('updateCO', '') </script>
Type: String | Date
Default: none
Sets a new lower date limit on the datepicker. See startDate for valid values.
Omit startDate (or provide an otherwise falsey value) to unset the limit.
<script type="text/javascript"> $(document).ready(function(){ $(".t-datepicker").tDatePicker('setStartDate', '2018-07-17') }) </script>
Type: String | Date
Default: none
Sets a new lower date limit on the datepicker. See endDate for valid values.
Omit endDate (or provide an otherwise falsey value) to unset the limit.
<script type="text/javascript"> $(document).ready(function(){ $(".t-datepicker").tDatePicker('setEndDate', '2018-12-30') }) </script>
Type: String
Default: none
Returns a localized date object representing the internal date object of the first datepicker in the selection. For multidate pickers, returns the latest date selected.
<script type="text/javascript"> $(document).ready(function(){ var getDate = $('.t-datepicker').tDatePicker('getDate') // Return Date Object // e.g: Wed Jul 18 2018 07:00:00 GMT+0700 }) </script>
Type: String
Default: none
Returns a list of localized date objects representing the internal date objects of the first datepicker in the selection. For use with multidate pickers.
<script type="text/javascript"> $(document).ready(function(){ var getDates = $('.t-datepicker').tDatePicker('getDates') // Return [Date Object, Date Object] }) </script>
Type: String
Default: none
Returns a localized date string representing the internal date objects of the input check-in. For use with multidate pickers. Date type follow formatDate
<script type="text/javascript"> $(document).ready(function(){ var getDateInput = $('.t-datepicker').tDatePicker('getDateInput') // Return Date String // e.g: '2018-07-17' }) </script>
Type: String
Default: none
Returns a list localized date string representing the internal date objects of the input check-in and check-out. For use with multidate pickers. Date type follow formatDate
<script type="text/javascript"> $(document).ready(function(){ var getDateInput = $('.t-datepicker').tDatePicker('getDateInput') // Return [Date String, Date String] // e.g: Return ['2018-07-17', '2018-07-18'] }) </script>
Type: String
Default: none
Returns the internal UTC date number, as-is and unconverted to local time, of the first datepicker in the selection. For multidate pickers, returns the latest date selected.
<script type="text/javascript"> $(document).ready(function(){ var getDateUTC = $('.t-datepicker').tDatePicker('getDateUTC') // Return UTC Date Number // e.g: Return 1531785600000 }) </script>
Type: String
Default: none
Returns the internal list of UTC date number, as they are and unconverted to local time, of the first datepicker in the selection and of the last datepicker in selection. For use with multidate pickers.
<script type="text/javascript"> $(document).ready(function(){ var getDateUTCs = $('.t-datepicker').tDatePicker('getDateUTCs') // Return [UTC CI, UTC CO] // e.g: Return [1531785600000, 1531872000000] }) </script>
Type: String
Default: none
Returns the lower date limit on the datepicker.
<script type="text/javascript"> $(document).ready(function(){ var getStartDate = $('.t-datepicker').tDatePicker('getStartDate') // Return Date Object // e.g: Wed Jul 18 2018 07:00:00 GMT+0700 }) </script>
Type: String
Default: none
Returns the lower UTC date limit on the datepicker.
<script type="text/javascript"> $(document).ready(function(){ var getStartDateUTC = $('.t-datepicker').tDatePicker('getStartDateUTC') // Return Date Number // e.g: 1531785600000 }) </script>
Type: String
Default: none
Returns the upper date limit on the datepicker.
<script type="text/javascript"> $(document).ready(function(){ var getEndDate = $('.t-datepicker').tDatePicker('getEndDate') // Return Date Object // e.g: Wed Jul 18 2018 07:00:00 GMT+0700 }) </script>
Type: String
Default: none
Returns the upper UTC date limit on the datepicker.
<script type="text/javascript"> $(document).ready(function(){ var getDateUTC = $('.t-datepicker').tDatePicker('getDateUTC') // Return Date Number // e.g: 1531785600000 }) </script>