Your First Datebox
Adding a datebox is as simple as adding a data-role to a date or text input element and specifying the “mode” you wish to use.
The "data-options" Object
What about “long” options?
Another option is to use “long” options. For instance, to set the mode, you would set the “data-datebox-mode” attribute. Camel case becomes dashes, i.e:
afterToday => data-datebox-after-today
Options defined in this fashion will not take precedence over options defined in “data-options”.
How about with a constructor?
This method of working is also certainally possible. When using it, do not set a data-role on the input - also, using type=”text” is important, as datebox will be unable to degrade the input otherwise.
Then, to enhance it, call datebox() in a script:
This of course makes re-using variables a bit easy, as variables are expanded.