Stephen Woods![]()
Featured ItemAttach a timepicker widget to a text input.
YUI({
modules: {
'gallery-timepicker': {
fullpath: 'http://yui.yahooapis.com/gallery-2010.02.25-22/build/gallery-timepicker/gallery-timepicker-min.js',
requires: ['oop','event-custom','attribute','base','dom','classnamemanager','widget','event'],
optional: [],
supersedes: []
}
}
}).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 | 11/2/09 | |
| Re: Feature Requests | Stephen Woods | 11/2/09 |
| Re: Feature Requests | 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 |
© 2010 YUI Library - Site Credits