I'm using date.js.
The line time_container.innerHTML = Date.now().toString('T');
worked fine, briefly, and is now throwing errors in the Firebug console: radix must be an integer at least 2 and no greater than 36
. It was certainly working earlier.
Note: The date.js toString()
function uses special format specifiers.
var show_date = {
setup: function() {
setInterval(show_date.update, 5000);
},
update: function() {
var date_container = app.get('js_date');
var time_container = app.get('js_time');
if (date_container) {
date_container.innerHTML = Date.today().toString('dS of MMMM yyyy');
}
if (time_container) {
//time_container.innerHTML = Date.now().toString('T');
var d1 = new Date();
time_container.innerHTML = d1.toString('T');
}
}
}
app.onload(show_date.setup);
app.get()
is just a shortcut for document.getElementById()
. app.onload()
is (as you might guess) an onload function.
Commented out line is causing the problems. Replacement lines below the comment work, but don't give the format I want. T
should output h:mm:ss tt
(hours, minutes, seconds, am/pm). The am/pm bit is missing.
Also, I'm certain Date.now()
was working earlier today. Perhaps I'll try playing with the computer clock to see whether that makes a difference.
Version of date.js included is date-en-IE.js
. Claimed date in the code is 2008-05-13, even though I got it from the SVN checkout earlier today.