Skip to content

manjunath-nm89/jQueryCountdownTimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

jQuery Countdown Timer

Countdown timer is a jquery plugin which will render a Countdown widget in your app. Though this script executes on the client side, it will not have any issues with the users residing in different time zones.

Usage

You need to pass in the Current Time and the Countdown End Time. You need to pass in the Current time, to avoid any time zone inconsistencies.

jQuery("div").countdowntimer("October 25, 2012 11:13:00", "December 25, 2012 11:13:00")

jQuery("div").countdowntimer("October 25, 2012 11:13:00", "December 25, 2012 11:13:00", {
  widgetTitle: "Countdown to Christmas",
  WidgetEnd: "Happy Christmas"    
});
  • Current time - a valid dateString - October 13, 2012 11:13:00 or 2012-10-29 00:00:58
  • Event End time - a valid dateString - November 13, 2012 11:13:00 or 2012-11-29 00:00:58
  • widgetTitle - The title of the widget
  • widgetEnd - The text which should be displayed when the countdown ends

In rails you can, pass in the current server time with Time.now

<%= javascript_tag do %>
  jQuery("div").countdowntimer("<%= Time.now.utc %>", "December 25, 2012 00:00:00")      
<% end %>

Dependencies

jQuery 1.4+

About

A client side customisable countdown timer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published