Dojo TimeSpinner

Ads
 

Dojo TimeSpinner

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

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:

Ads

Ads