[Javascript] bizzarre getDay() behavior

Paul Hastings paul.hastings at gmail.com
Thu Oct 7 22:20:57 CDT 2004


i've built a clock using 

Date.prototype.format = dateFormat;

to build my own i18n formatting functionality. and then use it like: 

var d = new Date();
document.all["dateTimeObject"].innerHTML = d.format(i18nDTFormat);

however this.getDay() within that dateFormat function keeps returning
0 (sunday) no matter the date--i use that to lookup a localized day
name from an array.  at the sametime, i get the correct time bits back
using this.getMinutes(), this.getHours(), etc. in that same function.

any ideas?

thanks.



More information about the Javascript mailing list