Universal Count Down Wall

To show how easy it is to customize the output of the Universal Count Down Script to your heart's content, here's a fluid large local date counter wall. It taps into the oncountdown event handler of the script to populate the various fields as it counts down to Christmas in Los Angeles Time:

left Until Christmas in Los Angeles!

See also: Dynamic Count Down Wall

Source Code: Following is the full HTML for the counter.

Select All

Download all of the referenced external files below:

The only new external file added to the default script is "localwallcounter.css".

Updating the Year Automatically

By default, the target local date and time to count down to is expressed as a ISO date string inside the following line:

var localcountdown = new countDownLocalTime("2016-12-25 00:00:00", "America/Los_Angeles")

If you're counting down to reoccurring events that happen annually on the same day and time, instead of manually updating the year yourself each year to point to the next upcoming event, we can do this dynamically.

Take Christmas for example. The following extra code constructs a year variable that's incremented by 1 from the current year once Christmas (Dec 25th) has passed. This variable is then used as the year portion of the final ISO date string:

var today = new Date()
var christmasyear = today.getFullYear()
if (today.getMonth() == 11 && today.getDate() > 25){
	christmasyear += 1
}

var isodatestring = christmasyear + '-12-25 00:00:00'
var localcountdown = new countDownLocalTime(isodatestring, "America/Los_Angeles")

Now our count down will always point to current year's Christmas, and once past Dec 25th, next year's instead in Los Angeles.

Wordpress Users: Step by Step instructions to add ANY Dynamic Drive script to an entire Wordpress theme or individual Post