YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  • Home
  • Gallery
  • Forums
  • YUI 2
  • YUI 3
  • YUICompressor
  • YUIDoc
  • More
  • Gallery Forums
  • Gallery Stats
  • Gallery Calendar
  • Register
  • Login

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Timepicker (gallery-timepicker)

    Last Updated: 10/30/09
    + 3 -

    Stephen Woods

    YUI Contributor

    Featured Item

    Created: 10/23/09
    Last CDN Push: 02/25/10
    Build Tag: gallery-2010.02.25-22
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.0.0
    Free for use.
    Module Image

    Creates a very cool little timepicker:

    http://img.skitch.com/20091023-msrt5fbjyfdc5825shwp4ytp8t.png

    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    Attach a timepicker widget to a text input.

    Code Sample

    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);
    });

    Forum Posts

    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
    YUI Projects
    • All YUI Downloads
    • YUI 2
    • YUI 3
    • YUIDoc
    • YUICompressor
    • YUILibrary.com
    • YUI Build Tool
    • YUI PHP Loader
    Pages & Links
    • All YUI Downloads
    • Git FAQ
    • Graded Browser Support
    • Contribute to YUI
    • Forum Stats
    • Gallery Stats
    • YUI Calendar
    Contribute
    • Submit a Bug
    • Request a Feature
    • Write Code
    • Meet the Team
    Follow YUI
    • on GitHub
    • on Twitter
    • on FriendFeed
    • on Facebook
    • on IRC
    • YUI Blog
    • YUI Theater
    • YUI Forums

    © 2010 YUI Library - Site Credits