Eventually the whole thing could use some OOP, but I don't know how to do that yet. :)
This is a first step. It removes a bunch of redundancy already.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

+++ b/clock.js
@@ -149,12 +122,7 @@ function formatDate(date, dateFormat, timeZone, monthNames, weekdayNames) {
+  var leapYear = ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) ? 1 : 0;

Oops, there are some missing parens here, that actually doesn't work.

tstoeckler’s picture

Updated version