Skip to content
A javascript time field that formats inputted values into 12-hour clock format
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
index.html
jstimebox.css
jstimebox.js
main.css

README.md

jstimebox

A javascript time field that formats inputted values into 12-hour clock format.

Demo

How to use it

Include the neccesary stylesheet and javascript files:

<link rel="stylesheet" type="text/css" href="jstimebox.css" media="screen" />
<script src='jstimebox.js'></script>

Include a simple div to hold your datepicker:

<div id="my-time-box" class="js-time-box"></div>

Initialise the time box:

<script>
	var myTimeBox = new JSTimeBox('my-time-box');	
</script>

Public methods

getTime()

Returns the text value of the time box field.


getHours()

Returns the hours part of the time.


getMinutes()

Returns the minutes part of the time.


getAmPm()

Returns 'am' if AM and 'pm' if PM.

You can’t perform that action at this time.