Frequently Asked Questions

What frameworks does DateBox support?

DateBox currently supports jQueryMobile, Bootstrap, and jQueryUI.

What are DateBox's prerequisite requirements?

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.

For more information, please see: Installing DateBox.

How do I upgrade from jQM-DateBox?

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 Overrides
jQuery.extend(jQuery.mobile.datebox.prototype.options, {} );
// New Way - Prototype Overrides
jQuery.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".

<input type="text" data-role="datebox" data-datebox-mode="calbox">
For more information, please see Your First DateBox.

How do I change the format of the date or time output?

Often, you need a specific format of date sent to the back-end server - there are a number of ways to accomplish this.

  1. Alter or create a language file. For more information on how to do this, please see: Localizing DateBox.
  2. Override the date format for ALL languages, using the option "overrideDateFormat", a special use of "dateFormat".
  3. Use a second, hidden input with the "linkedField" and "linkedFieldFormat".
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.