Here is a very simple javascript along the lines of what you propose:
Code:
<script type="text/javascript">
var someDate=new Date()
if(someDate.getMonth()+1==12&&someDate.getDate()==25){
alert('Merry Christmas!')
}
</script>
In place of the red line, you can have a more elaborate line(s) to perform more elaborate actions.
In the first green line, the red numbers check for the month (12 for December) and date (25 for the 25th). You can have as many of these tests and subsequent actions as needed and it will probably be desirable to have the code be a function activated onload:
Code:
<script type="text/javascript">
function advent(){
var someDate=new Date()
if(someDate.getMonth()+1==12&&someDate.getDate()==25){
code for Christmas Day goes here
}
if(someDate.getMonth()+1==12&&someDate.getDate()==24){
code for Christmas Eve goes here
}
if(someDate.getMonth()+1==12&&someDate.getDate()==18){
code for something on December 18th could go here
}
}
onload=advent;
</script>
Bookmarks