Declarative example
require([
"dojox/mobile/parser",
"dojox/mobile/SpinWheelDatePicker"
]);
<div id="spin1" data-dojo-type="dojox/mobile/SpinWheelDatePicker"></div>
Programmatic example
require([
"dojo/_base/window",
"dojo/ready",
"dojox/mobile/SpinWheelDatePicker",
"dojox/mobile/parser"
], function(win, ready, SpinWheelDatePicker){
ready(function(){
var widget = new SpinWheelDatePicker({id:"spin1"});
win.body().appendChild(widget.domNode);
widget.startup();
});
});
Setting the date with the ISO date string
registry.byId("spin1").set("value", "2012-10-06"); // Oct 6, 2012
Setting the date with a number array
registry.byId("spin1").set("values", [2012, 10, 6]); // Oct 6, 2012
Setting a date range
require([
"dojo/_base/window",
"dojo/ready",
"dojox/mobile/SpinWheelDatePicker",
"dojox/mobile/parser"
], function(win, ready, SpinWheelDatePicker){
ready(function(){
var widget = new SpinWheelDatePicker({id:"spin1", slotProps: [{labelFrom: 2011, labelTo: 2017},{},{}]});
win.body().appendChild(widget.domNode);
widget.startup();
});
});
<div data-dojo-type="dojox/mobile/SpinWheelDatePicker" data-dojo-props="slotProps: [{labelFrom: 2011, labelTo: 2017},{},{}]"></div>