Home Dojo Dojo TimeSpinner
Questions:Ask|Latest



Dojo TimeSpinner
Posted on: November 1, 2008 By Deepak Kumar
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:


Recommend the tutorial

Ask Questions?    Discuss: Dojo TimeSpinner  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
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"?