2150 |
mathias |
1 |
if(!dojo._hasResource["dojox.widget.TimeSpinner"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
|
|
2 |
dojo._hasResource["dojox.widget.TimeSpinner"] = true;
|
|
|
3 |
dojo.provide("dojox.widget.TimeSpinner");
|
|
|
4 |
|
|
|
5 |
dojo.require("dijit.form._Spinner");
|
|
|
6 |
dojo.require("dijit.form.NumberTextBox");
|
|
|
7 |
dojo.require("dojo.date");
|
|
|
8 |
dojo.require("dojo.date.locale");
|
|
|
9 |
dojo.require("dojo.date.stamp");
|
|
|
10 |
|
|
|
11 |
dojo.declare(
|
|
|
12 |
"dojox.widget.TimeSpinner",
|
|
|
13 |
[dijit.form._Spinner],
|
|
|
14 |
{
|
|
|
15 |
// summary: Time Spinner
|
|
|
16 |
// description: This widget is the same as a normal NumberSpinner, but for the time component of a date object instead
|
|
|
17 |
|
|
|
18 |
required: false,
|
|
|
19 |
|
|
|
20 |
adjust: function(/* Object */ val, /*Number*/ delta){
|
|
|
21 |
return dojo.date.add(val, "minute", delta)
|
|
|
22 |
},
|
|
|
23 |
|
|
|
24 |
//FIXME should we allow for constraints in this widget?
|
|
|
25 |
isValid: function(){return true;},
|
|
|
26 |
|
|
|
27 |
smallDelta: 5,
|
|
|
28 |
|
|
|
29 |
largeDelta: 30,
|
|
|
30 |
|
|
|
31 |
timeoutChangeRate: 0.50,
|
|
|
32 |
|
|
|
33 |
parse: function(time, locale){
|
|
|
34 |
return dojo.date.locale.parse(time, {selector:"time", formatLength:"short"});
|
|
|
35 |
},
|
|
|
36 |
|
|
|
37 |
format: function(time, locale){
|
|
|
38 |
if (dojo.isString(time)) { return time; }
|
|
|
39 |
return dojo.date.locale.format(time, {selector:"time", formatLength:"short"});
|
|
|
40 |
},
|
|
|
41 |
|
|
|
42 |
serialize: dojo.date.stamp.toISOString,
|
|
|
43 |
|
|
|
44 |
value: "12:00 AM"
|
|
|
45 |
|
|
|
46 |
});
|
|
|
47 |
|
|
|
48 |
}
|