| 1 |
define([ |
| 2 |
"dojo/_base/declare", |
| 3 |
"dojo/dom-class", |
| 4 |
"dojo/date/locale" |
| 5 |
], function(declare, domClass, datelocale){ |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
return declare("dojox.mobile._TimePickerMixin", null, { |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
reset: function(){ |
| 21 |
|
| 22 |
|
| 23 |
var now = new Date(), |
| 24 |
h = now.getHours() + "", |
| 25 |
m = now.getMinutes(); |
| 26 |
m = (m < 10 ? "0" : "") + m; |
| 27 |
this.set("colors", [h, m]); |
| 28 |
if(this.values){ |
| 29 |
this.set("values", this.values); |
| 30 |
this.values = null; |
| 31 |
}else if(this.values12){ |
| 32 |
this.set("values12", this.values12); |
| 33 |
this.values12 = null; |
| 34 |
}else{ |
| 35 |
this.set("values", [h, m]); |
| 36 |
} |
| 37 |
}, |
| 38 |
|
| 39 |
_getDateAttr: function(){ |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
var v = this.get("values"); |
| 45 |
return datelocale.parse(v[0] + ":" + v[1], {timePattern:"H:m", selector:"time"}); |
| 46 |
} |
| 47 |
}); |
| 48 |
}); |