To use dhtmlxCalendar in your application you should make 3 steps:
Each DHTMLX component can be used standalone or as a part of the general library.
If you use dhtmlxCalendar standalone you need to include 3 files:
<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="../codebase/dhtmlxcalendar.css"> <script src="../codebase/skins/dhtmlxcalendar_dhx_skyblue.css.js"></script> <script src="../codebase/dhtmlxcalendar.js"></script> </head> <body> ... </body> </html>
If you use dhtmlxCalendar as a part of 'dhtmlxSuite' package you need to include 2 files:
<link rel="STYLESHEET" type="text/css" href="../codebase/dhtmlx.css"> <script src="../codebase/dhtmlx.js" type="text/javascript"></script>
There 2 ways of dhtmlxCalendar initialization:
myCalendar = new dhtmlXCalendarObject("box"); myCalendar.show();
where box is an HTML container
var myCalendar = new dhtmlXCalendarObject(["calendar","calendar2","calendar3"]);
where calendar, calendar2, calendar3 are HTML <INPUT> elements
formData = [ {type: "calendar", dateFormat: "%Y-%m-%d %H:%i", value: "2011-06-13 11:35", name: "start_date", label: "Start Date", skin: "dhx_skyblue", readonly: true, enableTime: true, calendarPosition: "right"}, {type: "calendar", name: "end_date", label: "End Date", value: "2011-02-10", dateFormat: "%Y-%m-%d", calendarPosition: "right"}] ]; myForm = new dhtmlXForm("formContainer", formData);