diff options
Diffstat (limited to 'js/main.js')
-rw-r--r-- | js/main.js | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -4,6 +4,7 @@ * - rework use of global variables and functions into OO idioms * - initialise time wasting clock from storage in OO idiom rather * than just stray function call + * - bind a key to toggle the date */ $.ionSound({ @@ -136,17 +137,23 @@ function toggleDateStyle() var British = day + " " + date + nth(date) + " " + month + " " + today.getFullYear(); var American = day + " " + month + " " + date + nth(date) + ", " + today.getFullYear(); - if (currentDate.indexOf(',') > -1) + if ($.jStorage.get("date_style", 0) == 0) { - $('#date').html(British); + $('#date').html(American); + $.jStorage.set("date_style", 1); } else { - $('#date').html(American); + $('#date').html(British); + $.jStorage.set("date_style", 0); } } // set initial date to British style +if ($.jStorage.get("date_style", 0) == 0) + $.jStorage.set("date_style", 1); +else + $.jStorage.set("date_style", 0); toggleDateStyle(); $(document).bind('keydown', 's', timeWastingClockReset); |