[SIZE=”3″][FONT=”Palatino Linotype”][COLOR=”Navy”]Hi Everyone! I am a volunteer in ministry work, and I do pretty much all the computer related tasks, which includes computer system repair, audio/video editing, cd/dvd printing and duplication, document format and creation, etc etc. But when it comes to HTML (or other codes) I know very little. But we needed a website, so I use Homestead hosting and the Homestead (offline) Site Builder program.
Anyway, inside the sight builder program, they have the option to insert HTML Snippets. Which I use for various objects, off site tools, and other. But now I need to do something for which I have not been able to find a “premade” html code object, that can perform the task desired. I have searched and searched google and went through many sites, including this one. I have tried to take some codes which I thought I could alter to make it perform, but they just wouldn’t work for what I needed them to do.
I need a code that will automate a [COLOR=”Black”]“specific text message”[COLOR=”Black”]“different specific text message”[COLOR=”Black”]“texts”[I](I think that’s what it is called)
[COLOR=”Black”]Day 1 “today’s text 1”
Day 2 “today’s text 2”
Day 3 “today’s text 3”
” ” ” “
{through}
[COLOR=”Black”]Day 31 “today’s text 31”
If were possible to make an “array” that would go six months out (or more) that would be very helpful! But the longest that I have seen is one month at a time, so that may be as long as they go, but I’m not sure. So I’m just asking.
On top of all of this, I need these changes to be performed at a [B][U]specific time of the day[B]like 8:00 pm,
[B]However,[B]8:00pm in my timezone[B][U]I need it to change at 8:00pm according to the website viewers timezone.
In other words, I live in Indiana USA. If someone in Australia looked up the webpage on the [B]15th day[B]but[B]9:00pm [U]Their[B][U]“Day 16”[B][U]Is this Possible??!!
[B][SIZE=”4″]
Is there anyway to do all of this???? ? ??
I know its a lot to ask for, but if there is anyone who could steer me to a site or give me some help with what the code would need to be, I would [B]Sincerely Appreciate It
[B][U]Thanks in Advance!
[code=html]<script type="text/javascript">
var txs="<p>Texte n°1 with HTML tags</p>|<p>Texte n°2 with other tags</p><ul><li>Item 1</li><li>Item 2</li></ul>|Texte n° 3 ... |Texte n° 4 ... etc.";
var tab=txs.split(/|/g);
var td=new Date(),yr=td.getFullYear(),jr=td.getDate(),mt=new Array();
// You take the jr-1 th element from tab if you work with month
// Or you compute the number of day before the month m (0 to 11 in javascript) in 2011
mt[0]=0;for (var i=1;i<12;i++) mt[i]=mt[i-1]+new Date(yr,i,0).getDate();
alert(mt);
var nbr=mt[td.getMonth()]+td.getDate();
alert("Today is the "+nbr+" th day in "+yr);
// It's 8.00 pm ?
if (td.getHours()<8) nbr--;
// to show tab[idx]
</script>[/code]
[code=html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title>Calendrier</title>
<style type="text/css">
body {margin:0;padding:0;font:10px/13px "Courier New",Courier,monospace}
h1 {margin:20px;padding:0;font:16px/20px;text-align:center;}
a {text-decoration:none;color:#909;}
.mst {font-size:12px}
#cal {display:block;position:relative;margin:0 auto;width:840px;height:900px;overflow:hidden;}
.clc {display:block;position:absolute;top:0px;z-index:0;width:200px;padding:1px;background:#fff;}
</style>
</head>
<body>
<h1><a href="javascript:newAnn(-20)" title="Recul rapide - 20ans">««</a> <a href="javascript:newAnn(-1)" title="Année précédente">«</a> Calendrier <span id="ida"></span> <a href="javascript:newAnn(+1)" title="Année suivante">»</a> <a href="javascript:newAnn(+20)" title="Avance rapide - 20 ans">»»</a> </h1>
<div id="cal"></div>
<script type="text/javascript">
var mos='Janvier|Février|Mars|Avril|Mai|Juin|Juillet|Août|Septembre|Octobre|Novembre|Décembre'.split(/|/g);
var tSt="Jour de l'an|St Basile|Ste Geneviève|St Odilon|St Edouard|Ste Mélaine|St Raymond|St Lucien|Ste Alix|St Guillaume|St Paulin|Ste Tatiana|Ste Yvette|Ste Nina|St Rémi|St Marcel|Ste Roseline|Ste Prisca|St Marius|St Sébastien|Ste Agnès|St Vincent|St Barnard|St François de Sales|St Apollos|Ste Paule|Ste Angèle|St Thomas d'Aquin|St Gildas|Ste Martine|Ste Marcelle|Ste Ella|St Théophane|St Blaise|Ste Véronique|Ste Agathe|St Gaston|Ste Eugénie|Ste Jacqueline|Ste Apolline|St Arnaud|ND de Lourdes|St Félix|Ste Béatrice|St Valentin|St Claude|Ste Julienne|St Alexis|Ste Bernadette|St Gabin|Ste Aimée|St Damien|Ste Isabelle|St Lazare|St Modeste|St Roméo|St Nestor|Ste Honorine|St Romain|St Auguste|St Aubin|St Jaouen|St Gwénola|St Casimir|St Olive|Ste Colette|Ste Félicité|St Jean de Dieu|Ste Françoise|St Vivien|Ste Rosine|Ste Justine|St Rodrigue|Ste Mathilde|Ste Louise|Ste Bénédicte|St Patrick|St Cyrille|St Joseph|St Herbert|Ste Clémence|Ste Léa|St Victorien|Ste Karine|Annonciation|Ste Lara|St Habib|St Gontran|Ste Gwladys|St Amédée|St Benjamin|St Hugues|Ste Sandrine|St Richard|St Isidore|Ste Irène|St Marcellin|St Jean-Baptiste|Ste Julie|St Gautier|St Fulbert|St Stanislas|St Jules|Ste Ida|St Maxime|St Paterne|St Benoît-Joseph|St Anicet|St Parfait|Ste Emma|Ste Odette|St Anselme|St Alexandre|St Georges|St Fidèle|St Marc|Ste Alida|Ste Zita|Ste Valérie|Ste Catherine|St Robert|St Jeremie|St Boris|St Philippe|St Sylvain|Ste Judith|Ste Prudence|Ste Gisèle|St Désiré|Ste Pacôme|Ste Solange|Ste Estelle|St Achille|Ste Rolande|St Matthias|Ste Denise|St Honoré|St Pascal|St Eric|St Yves|St Bernardin|St Constantin|St Emile|St Didier|St Donatien|Ste Sophie|St Bérenger|St Augustin|St Germain|St Aymard|St Ferdinand|Ste Perrette|St Justin|Ste Blandine|St Kevin|Ste Clotilde|St Igor|St Norbert|St Gilbert|St Médard|Ste Diane|Ste Trinité|St Barnabé|St Guy|St Antoine|St Elisée|Ste Germaine|St Régis|St Hervé|St Léonce|St Romuald|St Silvère|St Rodolphe|St Alban|Ste Audrey|St Yann|St Prosper|St Anthelme|St Fernand|St Irénée|St Pierre/St Paul|St Martial|St Thierry|St Martinien|St Thomas|St Florent|St Antoine|Ste Mariette|St Eliane|St Thibaud|Ste Amandine|St Ulric|St Benoît|St Olivier|St Henri/St Joël|St Camille/Fête Nationale|St Donald|Ste Carmen|Ste Charlotte|St Frédéric|St Arsène|Ste Marina|St Victor|Ste Marie-Madeleine|Ste Brigitte|Ste Christine|St Jacques|Ste Anne|Ste Nathalie|St Samson|Ste Marthe|Ste Juliette|St Ignace|St Alphonse|St Julien|Ste Lydie|St Jean-Marie|St Abel|St Octavien|St Gaétan|St Dominique|St Amour|St Laurent|Ste Claire|Ste Clarisse|St Hippolyte|St Evrard|Ste Marie/Assomption|St Armel|St Hyacinthe|Ste Hélène|St Jean-Eudes|St Bernard|St Christophe|St Fabrice|Ste Rose|St Barthélémy|St Louis|Ste Natacha|Ste Monique|St Augustin|Ste Sabine|St Fiacre|St Aristide|St Gilles|Ste Ingrid|St Grégoire|Ste Rosalie|Ste Raïssa|St Bertrand|Ste Reine|St Adrien|St Alain|Ste Inès|St Adelphe|St Apollinaire|St Aimé|St Materne|St Roland|Ste Edith|St Renaud|Ste Nadège|Ste Emilie|St Davy|St Matthieu|St Maurice|St Constant|Ste Thècle|St Hermann|St Côme/St Damien|St Vincent de Paul|St Venceslas|Sts Michel|St Jérôme|Ste Thérèse|St Léger|St Gérard|St François|Ste Fleur|St Bruno|St Serge|Ste Pélagie|St Denis|St Ghislain|St Firmin|St Wilfrid|St Géraud|St Juste|Ste Thérèse|Ste Edwige|St Baudouin|St Luc|St René Goupil|Ste Adeline|Ste Céline|Ste Elodie|St Jean de Capistran|St Florentin|St Crépin|St Dimitri|Ste Emeline|St Simon|St Narcisse|Ste Bienvenue|St Quentin|Toussaint|Défunts|St Hubert|St Charles|Ste Sylvie|Ste Bertille|Ste Carine|St Geoffroy|St Théodore|St Léon|St Martin|St Christian|St Brice|St Sidoine|St Albert|Ste Marguerite|Ste Elisabeth|Ste Aude|St Tanguy|St Edmond|Présentation de Marie|Ste Cécile|St Clément|Ste Flora|Ste Catherine|Ste Delphine|St Séverin|St Jacques de la Marche|St Saturnin|St André|Ste Florence|Ste Viviane|St Xavier|Ste Barbara|St Gérald|St Nicolas|St Ambroise|Ste Frida|St Pierre Fourier|St Romaric|St Daniel|Ste Chantal|St Lucie|Ste Odile|Ste Ninon|Ste Alice|St Gaël|St Gatien|St Urbain|St Théophile|St Pierre Canisius|Ste Françoise-Xavière|St Armand|Ste Adèle|Noël|St Etienne|St Jean|St Gaspard|St David|St Roger|St Sylvestre".split(/|/g);
function edtCal(a){
var chn='',ms=-1,bs=0,s=Math.floor(a/100),pl=(15-Math.floor(s/4)+s-Math.floor(((s<<3)+13)/25)+19*(a%19))%30,pj,pq,cn,pq,as,pn;
if (pl==28) if (10<(a%19)) pl--;else pl++;
pj=pl;if (pl!=29 || new Date(a,2,pl).getDay()) pj=pl-new Date(a,2,pl).getDay()+7;
cn=new Date(a,2,pj-25).valueOf();pq=new Date(a,2,pj+21).valueOf();
as=new Date(a,2,pj+60).valueOf();pn=new Date(a,2,pj+70).valueOf();
for (i=1;;i++){cd=new Date(a,0,i);
if (cd.getFullYear()!=a) break;
if (cd.getMonth()!=ms) {ms=cd.getMonth();
if (chn) chn+='</div>';
chn+='<div class="clc" style="left:'+((140*ms)%840)+'px;top:'+((140*ms<820)?0:450)+'px;z-index:'+ms+'" onmouseover="this.style.zIndex=13" onmouseout="this.style.zIndex='+ms+'"><b class="mst">'+mos[ms]+'</b><hr>'}
if (i==60 && cd.getMonth()==2) bs++;
y=z='';if (!cd.getDay()) y='<u>';z='</u>';
if (cd.valueOf()==cn) chn+='Me '+cd.getDate()+' <b>Cendres *</b><br>';
else if (cd.valueOf()==pq) chn+='<u>Di '+cd.getDate()+' <b>Pâques *</b></u><br>';
else if (cd.valueOf()==as) chn+='Je '+cd.getDate()+' <b>Ascension *</b><br>';
else if (cd.valueOf()==pn) chn+='<u>Di '+cd.getDate()+' <b>Pentecôte *</b></u><br>';
else chn+=y+"DiLuMaMeJeVeSa".substr(2*cd.getDay(),2)+' '+cd.getDate()+' '+tSt[i-1+bs]+z+'<br>';}
chn+='</div>';
document.getElementById('ida').innerHTML=a;
document.getElementById('cal').innerHTML=chn;
}
edtCal(new Date().getFullYear());
function newAnn(d){var a=document.getElementById('ida').innerHTML;edtCal(parseInt(a)+d);}
</script>
</body>
</html>[/code]
<i>
</i><!DOCTYPE HTML>
<html>
<head>
<title> Quotes </title>
<script type="text/javascript">
// For: http://www.webdeveloper.com/forum/showthread.php?t=251318
// store the quotations in one multiple array
// or as external JS file
// or as single JS files, if lengthly, with filenames like QODday.js (QOD1.js, QOD2.js, ..., QOD31.js)
// or (suggestion based upon user needs)
quotes = [
["It's not easy being green.","Kermit the Frog"],
["I shall return.","General Douglas MacArthur"],
["War is hell!","General William Tecumseh Sherman"],
["<b>Never, never, never ... Give up!</b>","Winston Churchill"],
["The buck stops here!","President Harry S. Truman"],
["You never get too old to learn a new way of being stupid.","Me"],
["<em>Rumsey's Rule of the Lab:</em><br>"
+" Never go home dumber than you came.","Rumsey"],
["Sadly, I am no longer young enough to know everything.."
+"<br><font size='-1'>With thanks to Philip M.</font>","Old Pedant"],
["The quick red fox jumps over the lazy brown dog!",""], // Note: no author attribute
// continue on for total of 31 entrys for each day of the month
// could also be adapted for 365+ days of the year
// or any number of quotes between with a modulo test
["Now is the time for all good men"
+" to come to the aid of their country.",
"Anonymous"] // Note: No comma after final entry
];
function DisplayQuote(index) {
var str = '';
str += '<DL>n<DT style="color:blue">"' + quotes[index][0] + '"n';
str += "<DD style='color:orange'>-- " + quotes[index][1] + "n</DL>n";
document.getElementById('QuoteOfTheDay').innerHTML = str;
}
function TodayQuote() {
var now = new Date(); // get current date and time
var index = now.getDate(); // get current month date
if (now.getHours() >= 18) { index++; } // check if 6pm or later
// remove next line if quotes.length is same as number of days in month (or year)
index = (index &#37; quotes.length);
DisplayQuote(index);
}
function RandomQuote() {
var index = Math.floor(Math.random() * quotes.length); // calculate a random index
DisplayQuote(index);
}
//display the quotation
window.onload = function() { RandomQuote(); }
</script>
</head>
<body>
<div id="QuoteOfTheDay"></div>
<p><button onclick="RandomQuote()">Test of randomness</button>
<button onclick="TodayQuote()">Today's Quote</button>
</body>
</html>
It's easy to define a javascript string txs with the day's text in the month (or the year).
[code=html]<script type="text/javascript">
var txs="<p>Texte n°1 with HTML tags</p>|<p>Texte n°2 with other tags</p><ul><li>Item 1</li><li>Item 2</li></ul>|Texte n° 3 ... |Texte n° 4 ... etc.";
var tab=txs.split(/|/g);
var td=new Date(),yr=td.getFullYear(),jr=td.getDate(),mt=new Array();
// You take the jr-1 th element from tab if you work with month
// Or you compute the number of day before the month m (0 to 11 in javascript) in 2011
mt[0]=0;for (var i=1;i<12;i++) mt[i]=mt[i-1]+new Date(yr,i,0).getDate();
alert(mt);
var nbr=mt[td.getMonth()]+td.getDate();
alert("Today is the "+nbr+" th day in "+yr);
// It's 8.00 pm ?
if (td.getHours()<8) nbr--;
// to show tab[idx]
</script>[/code]
[/QUOTE]
[code=html]<table border="0" width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<script>
<!--
var today_obj=new Date()
var today_date=today_obj.getDate()
var tips=new Array()
//Configure the below variable to contain the "header" of the tip
var tiptitle=''
//Configure the below array to hold the 31 possible tips of the month
tips[1]='Tip 1 goes here'
tips[2]='Tip 2 goes here'
tips[3]='Tip 3 goes here'
tips[4]='Tip 4 goes here'
tips[5]='Tip 5 goes here'
tips[6]='Tip 6 goes here'
tips[7]='Tip 7 goes here'
tips[8]='Tip 8 goes here'
tips[9]='Tip 9 goes here'
tips[10]='Tip 10 goes here'
tips[11]='Tip 11 goes here'
tips[12]='Tip 12 goes here'
tips[13]='Tip 13 goes here'
tips[14]='Tip 14 goes here'
tips[15]='Tip 15 goes here'
tips[16]='Tip 16 goes here'
tips[17]='Tip 17 goes here'
tips[18]='Tip 18 goes here'
tips[19]='Tip 19 goes here'
tips[20]='Tip 20 goes here'
tips[21]='Tip 21 goes here'
tips[22]='Tip 22 goes here'
tips[23]='Tip 23 goes here'
tips[24]='Tip 24 goes here'
tips[25]='Tip 25 goes here'
tips[26]='Tip 26 goes here'
tips[27]='Tip 27 goes here'
tips[28]='Tip 28 goes here'
tips[29]='Tip 29 goes here'
tips[30]='Tip 30 goes here'
tips[31]='Tip 31 goes here'
document.write(tiptitle)
document.write(tips[today_date])
//-->
</script>
</td></tr></table>[/code]
Here is a sample of what you might try.
[/QUOTE]
[code=html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="fr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title>Untitled</title>
<style type="text/css">
</style>
</head>
<body>
<div id="pge"></div>
<script type="text/javascript">
var i,dailyTxt=[],mt=[];
// DailyTxt an artificial array with 365 days in 2011 (from 1 to 365)
// (the first day correspond to the december, 31 2010)
// The real array is buil with PHP as javascript file to define a string and an equivalent tab by split)
dailyTxt[0]="Text for the december, 31st day";
for (i=1;i<=365;i++) dailyTxt[i]="Text for the "+i+((i%10==1 && i!=11)?"st":(i%10==2 && i!=12)?"nd":(i%10==3 && i!=13)?"rd":"th")+" day";
// A method to show the daily text
var td=new Date(),yr=td.getFullYear(),mn=td.getMonth(),jr=td.getDate();
var precedingDays=0;
for (var i=0;i<mn;i++) {precedingDays+=new Date(yr,i,0).getDate();}
var nbr=precedingDays+jr;
if (td.getHours()<8) {nbr--;}
document.getElementById('pge').innerHTML='<p> To day is '+td.toLocaleString()+'</p>';
document.getElementById('pge').innerHTML+='<p>The daily text is <b>'+dailyTxt[nbr]+'</b></p>';
</script>
</body>
</html>[/code]
Hi JMRKER, Thanks for the reply and code help! I tried your code for a test run also, and the buttons were displayed. So I clicked on one, and it comes up with the same ["Syntax Error" Line 137 Character 1 Code 0] that Julien's code did for some reason. I don't need the buttons anyway, so I went and removed that line of code, but when I retested, no text was displayed and the same error message appeared.
[COLOR="red"]The code I provided was tested in FF, but should work fine in MSIE.
Since it works fine, without your modifications, it's probably you.
Do you have a link to your actual code. What you posted in #1 and #4 are not the same.
[/COLOR]
I'm starting to think this error has something to do with a code incompatibility with Homestead...? Although I haven't seen it before now, so maybe not.
[COLOR="Red"]Post the like to your site so we can see the errors directly.
[/COLOR]
I posted the code I have been working with in my previous post. It does work in displaying the text, but I can't get it to change at the correct time of day according to the site viewers computer.
Also I don't see a way of extending it beyond the 31 days, so this would have to be changed monthly, which I could deal with as long as I can get it to work correctly... and not forget to update it ?
[COLOR="red"]It is very easy to extend beyond 31 days (any amount to be precise)
but I'll show you how it is done when you decide on the amount and provide
some of your text examples either in the array format or as individual JS files.
[/COLOR]
[/QUOTE]
[CODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>None</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function init(){
var nDiv = document.getElementsByTagName('div');
for (i=0; i<nDiv.length; i++)
{
if (nDiv[i].className == "message_display")
{
var nItems = nDiv[i].getElementsByTagName('ul')[0].getElementsByTagName('li');
for (n=0; n<nItems.length; n++)
{
nItems[n].style.display = "none";
}
}
}
var today = new Date();
var EOM = new Date(today.getFullYear(),today.getMonth()+1,today.getDate()-today.getDate()).getDate();
var nIndex = today.getHours() >= 20
? today.getDate() == EOM
? 0
: today.getDate()
: today.getDate() - 1;
nItems[nIndex].style.display = "";
}
navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);
</script>
<style type="text/css">
body {background-color: #fffacd; margin-top: 60px;}
.message_display {width: 500px; border: 1px solid black; text-align: center;
font-family: tahoma; font-size: 12pt; background-color: #eee8aa;
font-weight: bold; padding: 3px; margin: auto; cursor: default;}
.message_display ul {list-style: none; margin: 0px; padding: 0px;}
</style>
</head>
<body>
<div class="message_display">
<ul>
<li>This is the 1st message</li>
<li>This is the 2nd message</li>
<li>This is the 3rd message</li>
<li>This is the 4th message</li>
<li>This is the 5th message</li>
<li>This is the 6th message</li>
<li>This is the 7th message</li>
<li>This is the 8th message</li>
<li>This is the 9th message</li>
<li>This is the 10th message</li>
<li>This is the 11th message</li>
<li>This is the 12th message</li>
<li>This is the 13th message</li>
<li>This is the 14th message</li>
<li>This is the 15th message</li>
<li>This is the 16th message</li>
<li>This is the 17th message</li>
<li>This is the 18th message</li>
<li>This is the 19th message</li>
<li>This is the 20th message</li>
<li>This is the 21st message</li>
<li>This is the 22nd message</li>
<li>This is the 23rd message</li>
<li>This is the 24th message</li>
<li>This is the 25th message</li>
<li>This is the 26th message</li>
<li>This is the 27th message</li>
<li>This is the 28th message</li>
<li>This is the 29th message</li>
<li>This is the 30th message</li>
<li>This is the 31st message</li>
</ul>
</div>
</body>
</html>
[/CODE]
Ok JMRKER, I just created a test text page (so as not to mess with the home page) and posted the codes there. Here is the link:http://www.yhrim.com/text.html
I haven't modified your codes in anyway, yet. I just copied and pasted them to see first if they would work with homestead. I still think it is something to do with how the homestead program is handling the code. Haven't had this kind of problem with code before though with homestead. So I'm not sure. The only one that displays any text is my original "old style" code.[/QUOTE]
Sorry, I don't see any of my recommended code in that link. ?
I'm beginning to believe you have too many cooks for this broth. :eek:
Try using only one solution per test file. :rolleyes:[/QUOTE]
Too Slow JMRKER :-) They were there, but then I took them back off as they were not displaying. What is there now is Fairviews Code (By the way Thanks Fairview). Their code does display, but it also changes the whole pages background to tan.. ? I still think this is a problem with Homestead not fully "agreeing" with the code or something. Because as you said JMRKER, the other codes should have worked.
...[/QUOTE]
[code=html]
<li>Todays message</li>
<li>Todays message</li>
<li>Todays message</li>
<li>Todays message</li>[/code]
[code=html]<day-1>Todays message</li>
<day-2>Todays message</li>
<day-3>Todays message</li>
<day-4>Todays message</li>[/code]
[code=html]Day 1 <li>Todays message</li>
Day 2 <li>Todays message</li>
Day 3 <li>Todays message</li>
Day 4 <li>Todays message</li>[/code]
function init(){
var nDiv = document.getElementsByTagName('div');
for (i=0; i<nDiv.length; i++)
{
if (nDiv[i].className == "message_display")
{
var nItems = nDiv[i].getElementsByTagName('ul')[0].getElementsByTagName('li');
for (n=0; n<nItems.length; n++)
{
nItems[n].style.display = "none";
}
}
}
var now = new Date();
var start = new Date(now.getFullYear(), 0, 0);
var diff = now - start;
var oneDay = 1000 * 60 * 60 * 24;
var day = Math.floor(diff / oneDay);
nItems[day].style.display = "";
}
navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false);
<i>
</i>// Wed Dec 31 2014 00:00:00 GMT-0500 (Eastern Daylight Time)
new Date(now.getFullYear(), 0, 0);
// based on your formula and the current date it returns 250
<i>
</i>var now = new Date();
// added + 1 to now.getFullYear()
var start = new Date(now.getFullYear() + 1, 0, 0);
var diff = start - now; // this has been reversed or it will a negative number
var oneDay = 1000 * 60 * 60 * 24;
var day = Math.floor(diff / oneDay); // day now returns 114
0.1.9 — BETA 5.15