Home Dojo Dojo TimeSpinner

Related Tutorials


 
 

Share on Google+Share on Google+

Dojo TimeSpinner

Advertisement
In this section, you will learn about the dojo TimeSpinner. This is same as the dojo NumberSpinner.

Dojo TimeSpinner

       

In this section, you will learn about the dojo TimeSpinner. This is same as the dojo NumberSpinner. But the NumberSpinner only worked on the an integer type data. That means you increase and decrease an integer number. Similarly the TimeSpinner button provides you to increase and decrease the time through the TimeSpinner button in AM and PM. If you enter before 12:00 then it displays the time in AM and after 12:00 it displays the time in PM.

Try Online: TimeSpinner

Here is the code of Program:

<html>
<head>
<title> Dojo TimeSpinner Example</title>
  <style type="text/css">
  @import "../dijit/themes/soria/soria.css";
  @import "/resources/dojo.css";
  </style>
<script type="text/javascript" src="dojo.js" djConfig="parseOnLoad: true"></script>

<script type="text/javascript">
  dojo.require("dojox.widget.TimeSpinner");
  dojo.require("dojo.parser"); // scan page for widgets

</script>
</head>
<body class="soria">
<h1>Dojo TimeSpinner Example Demo</h1>
<br>

  <input id="timeSpinner" dojoType="dojox.widget.TimeSpinner"
  value="12:30 PM"
  name="timeSpinner"
  hours="12"
  id="timeSpinner" />
</body>
</html>

Output:

When you run this program then you get:

Your inputted time is after 12:00 then you see the following output time is in PM.

Try Online:

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 1, 2008

Related Tutorials

Discuss: Dojo TimeSpinner  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
Ranveer Singh
January 22, 2013
About the output coming from this example code

When the value is provided as "12:30 PM" in the code, why the value coming first time in the output screen as "10:00 AM"?
DMCA.com