a2wd | code & design

Single post

jQuery Clock Plugin

As part of the timesheets project, I have written a little jQuery clock plugin.

I wanted to show the current time on both the clocking-in & out screens and also when registering/updating your profile.

The basic usage is:

<script type="text/javascript">
$("#clock_div").clock();
</script>

Which will transform

<div id="clock_div"></div>

into this: -Clock-

You can set the time format with:

format: 12 or 24

for instance:

$("#clock_div").clock({format:12});

although the default is for 24hr time.

Should work with versions of jQuery from 1.9.0+

Download the javascript here: clock.js



29 Nov 2013clock / jQuery / plugin

  • Recent Posts

  • Archives