source: Dev/branches/rest-dojo-ui/client/dojox/mobile/SpinWheelTimePicker.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 1.5 KB
Line 
1define([
2        "dojo/_base/declare",
3        "dojo/dom-class",
4        "./SpinWheel",
5        "./SpinWheelSlot"
6], function(declare, domClass, SpinWheel, SpinWheelSlot){
7
8/*=====
9        var SpinWheel = dojox.mobile.SpinWheel;
10=====*/
11
12        // module:
13        //              dojox/mobile/SpinWheelTimePicker
14        // summary:
15        //              A SpinWheel-based time picker widget.
16
17        return declare("dojox.mobile.SpinWheelTimePicker", SpinWheel, {
18                // summary:
19                //              A SpinWheel-based time picker widget.
20                // description:
21                //              SpinWheelTimePicker is a time picker widget. It is a subclass of
22                //              dojox.mobile.SpinWheel. It has the hour and minute slots.
23
24                slotClasses: [
25                        SpinWheelSlot,
26                        SpinWheelSlot
27                ],
28                slotProps: [
29                        {labelFrom:0, labelTo:23},
30                        {labels:["00","01","02","03","04","05","06","07","08","09",
31                                         "10","11","12","13","14","15","16","17","18","19",
32                                         "20","21","22","23","24","25","26","27","28","29",
33                                         "30","31","32","33","34","35","36","37","38","39",
34                                         "40","41","42","43","44","45","46","47","48","49",
35                                         "50","51","52","53","54","55","56","57","58","59"]}
36                ],
37
38                buildRendering: function(){
39                        this.inherited(arguments);
40                        domClass.add(this.domNode, "mblSpinWheelTimePicker");
41                },
42
43                reset: function(){
44                        // summary:
45                        //              Goes to now.
46                        var slots = this.slots;
47                        var now = new Date();
48                        var _h = now.getHours() + "";
49                        slots[0].setValue(_h);
50                        slots[0].setColor(_h);
51                        var m = now.getMinutes();
52                        var _m = (m < 10 ? "0" : "") + m;
53                        slots[1].setValue(_m);
54                        slots[1].setColor(_m);
55                }
56        });
57});
Note: See TracBrowser for help on using the repository browser.