96turnerri
10-10-2003, 06:47 AM
hi i got this code off Charles
<script type="text/javascript">
<!--
Date.prototype.toDateString = function () {return [this.getDate(), ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] [this.getMonth()], this.getFullYear()].join(' ')}
daysOfNote = new Object();
daysOfNote['5 May 2003'] = 'My Birthday';
daysOfNote['25 December 2003'] = 'Christmas';
daysOfNote['7 October 2003'] = 'Today';
document.write(new Date().toDateString(), daysOfNote[new Date().toDateString()] ? ', ' + daysOfNote[new Date().toDateString()] : '');
// -->
</script>
Is the a way for when a date is not in the array, it display a different message, i have created my own array and would like it to say something when its not someones birthday (thats what i'm using it for)
Thanks
Rich
<script type="text/javascript">
<!--
Date.prototype.toDateString = function () {return [this.getDate(), ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] [this.getMonth()], this.getFullYear()].join(' ')}
daysOfNote = new Object();
daysOfNote['5 May 2003'] = 'My Birthday';
daysOfNote['25 December 2003'] = 'Christmas';
daysOfNote['7 October 2003'] = 'Today';
document.write(new Date().toDateString(), daysOfNote[new Date().toDateString()] ? ', ' + daysOfNote[new Date().toDateString()] : '');
// -->
</script>
Is the a way for when a date is not in the array, it display a different message, i have created my own array and would like it to say something when its not someones birthday (thats what i'm using it for)
Thanks
Rich