DateBox requires jQuery - both the 2.x and 3.x branches are currently supported.
For jQueryMobile framework operation, jQueryMobile must be loaded first - generally, the last major release is supported (currently 1.4.x).
For Bootstrap operation and jQueryUI operation, the jQueryUI widget library must be loaded - a custom build can be generated on the jQueryUI Download Builder. Additionally, you will need to include the Bootstrap CSS file, or a jQueryUI CSS theme file.
How do I install DateBox?
To install DateBox, you'll need to include both the JavaScript file, and the CSS file. Both can be found in the CDN repository. Numbered versions are considered "stable", while "latest" is the most recent development build. You should choose the files that contain the CSS framework you are using.
To upgrade from a previous version of jQM-DateBox, simply replace the CSS and JavaScript files. Note that previous versions of jQM-DateBox typically had multiple JavaScript includes, DateBox cuts that to a single file. If you have written any of your own code referencing jQM-DateBox, note that the namespace of the plugin has changed to "jtsage".
// Old Way - Data Attribute$("#someInput").data('mobile-datebox');// New Way - Data Attribute$("#someInput").data('jtsage-datebox');// Old Way - Prototype OverridesjQuery.extend(jQuery.mobile.datebox.prototype.options,{});// New Way - Prototype OverridesjQuery.extend(jQuery.jtsage.datebox.prototype.options,{});
How do I use DateBox on an input?
For the most basic operation of DateBox on an input, you will need to add 2 attributes, "data-role" and "data-datebox-mode".
The associated time option for #2 is "timeOutput" (overrideTimeOutput).
How do I limit the date or time input?
DateBox offers many, many options to refine the input of the date and time from the user. Please see Limiting DateBox for a full discussion of the available options. Additionally, you can page through the Limiting Options Category of the API.
How do I set the date or time for DateBox?
To preset the date in DateBox, please see the documentation section on Setting Defaults.
To programmatically set the date at later time, please see the API under "setTheDate".
How do I get the date or time from DateBox?
To programmatically get the date at later time, please see the API under "getTheDate".
Often, using triggers or callbacks is related to this question, please see the documentation section on Callbacks and Listeners.