Stephen Woods![]()
Featured ItemAttach a timepicker widget to a text input.
<script src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2011.10.12-20-24'
}).use('gallery-timepicker', function(Y) {
var picker = new Y.Saw.Timepicker({contentBox: '#cb'}); //assuming this exists
picker.render();
//hide
picker.hide();
//show
picker.show();
//set am or pm with class constants
picker.set('time.ampm', picker.AM);
//subscribe to events to do cool stuff:
picker.subscribe('timeset', function(data){
//fires when the time changes
//put the 12 hour string into the input. s24hour is also available
Y.get('#time').set('value' ,data.s12hour); //#time should be a text input
//the data object also has members for hour, minute, ampm. Ampm is
//an int identified by picker.AM or picker.PM
});
picker.subscribe('cellclick', function(e){
//fires when a cell is clicked.
this.hide();
},picker);
});| Subject | Author | Date |
|---|---|---|
| Feature Requests | Stephen Woods | 10/31/09 |
| Re: Feature Requests | Viktor Rennert | 11/2/09 |
| Re: Feature Requests | Stephen Woods | 11/2/09 |
| Re: Feature Requests | johng | 02/20/10 |
| Re: Feature Requests | Joss DaBoss | 02/20/10 |
| Re: Feature Requests | Stephen Woods | 02/23/10 |
| Re: Feature Requests | Stephen Woods | 02/23/10 |
| Re: Feature Requests | Stephen Woods | 02/23/10 |
| Re: Feature Requests | Stephen Woods | 02/26/10 |
| Timepicker blog post | Eric Miraglia | 03/3/10 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info