1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    4
    Vote Rating
    0
    ivan92 is on a distinguished road

      0  

    Default Simple "label" Clock

    Simple "label" Clock


    Well, i need to create a simple "label" clock (like 02:34pm) in a content panel. It could be synchronize with the local time (client). I hope you can help me.

    Thanks.

  2. #2
    Sencha User
    Join Date
    Mar 2013
    Posts
    4
    Vote Rating
    0
    ivan92 is on a distinguished road

      0  

    Default


    I found the way to add the seconds functionality:

    Code:
    Label hora = new Label();        
    
    Timer t = new Timer() {
                @Override
                public void run() {
                    Date fecha = new Date();
                    DateTimeFormat formato = DateTimeFormat.getFormat("hh:mm:ssaa");
                    hora.setText(formato.format(fecha).toString());
                }
    };
            
    t.scheduleRepeating(1000);