Click on the input fields downthere to see the examples
📳 Full ResponsiveEasy usage:
1. Include CSS and JS
2. Create any field with an unique ID in the page
3. Init the calendar passing a json
Two column
Just call the function passing just the id
One column (default) pass single as second parmeter
Pass a date as third parameter
Add a "Any Date" button to leave some free choice
Generally useful in filters and reports
Set 4th parameter as true
Range options
Specify the next ID, and clicking on the first input,
Automatically disable dates in the second input
Use the single mode
//Set the options in the json
options = { // Use the "single" mode 'calendar_date_selector5': { mode: 'single', anyDate: true, nextInput: 'calendar_date_selector6' }, 'calendar_date_selector6': { mode: 'single', anyDate: true }, // Or the double mode 'calendar_date_selector7': { mode: 'single', nextInput: 'calendar_date_selector8' }, 'calendar_date_selector8': { mode: 'single' } } new DeskyCalendar(options);
Disable selection before or after a date
Using 6th and 7th parameters
//Set the options in the json
//Create a date const d2 = new Date(); const d3 = new Date(); //just an example, 2 days before and 10 days after d2.setTime(d2.getTime()-(2*3600*24*1000)); d3.setTime(d3.getTime()+(10*3600*24*1000)); // Set a date for disableBefore
options = { // Use the "single" mode 'calendar_date_selector9': { disableBefore: d2, }, 'calendar_date_selector10': { disableBefore: d2, disableAfter: d3 } } new DeskyCalendar(options);
Add a scroll into on show.
Generally useful when calendar goes out of borders on show up
Set 8th parameter as true
//Set true the 8th parameter
options = {
"calendar_date_selector11": {scroll: true},
}
new DeskyCalendar(options);
Specify a call back function on day click
in 9th parameter.
Try to select a date to see the result
const d1 = new Date(Date.parse('04 Dec 2025 00:12:00 GMT')); const d2 = new Date(); const d3 = new Date(); d2.setTime(d2.getTime()-(2*3600*24*1000)); d3.setTime(d3.getTime()+(10*3600*24*1000)); const deskyOpts = { /// Call the init Calendar /// Example 1 'calendar_date_selector1': {mode: "double"}, /// Example 2 'calendar_date_selector2': {mode: 'single'}, /// Example 3 /// Select date 'calendar_date_selector3': {mode: 'double', defaultDate: d1}, /// Example 4 //// Any Date 'calendar_date_selector4': {anyDate: true}, /// Example 5 //// Next Input 'calendar_date_selector5': {mode: 'single', anyDate: true, nextInput: 'calendar_date_selector6'}, 'calendar_date_selector6': {mode: 'single', anyDate: true}, 'calendar_date_selector7': {mode: 'single', nextInput: 'calendar_date_selector8'}, 'calendar_date_selector8': {mode: 'single'}, /// Example 6 //// disable before after date 'calendar_date_selector9': {mode: 'single', disableBefore: d2}, 'calendar_date_selector10': {mode: 'single', disableBefore: d2, disableAfter: d3}, /// Example 7 //// Scroll "calendar_date_selector11": {scroll: true}, // Call Back "calendar_date_selector12": {mode: 'double', callback: this_is_callback}, // Colors "calendar_date_selector13": {}, "calendar_date_selector14": {}, "calendar_date_selector15": {}, }; new DeskyCalendar(deskyOpts);