View Full Version : countown till payday script
jordanspringer
09-14-2006, 12:34 AM
Hey, I'm trying to create a script that allows you to have a script countown the days hours and minutes till pay day, then on payday have it display "Payday".
So the script would have to be set for an initial Friday, then to countown every 14 days (2 weeks), then reset itself. To set it I would just have it set to start counting down till the first friday in advance, then reset every 14 days type thing.
Ex:
6 Days, 14h 12m till Payday! (counting down)
Payday! (for when on payday)
Does anyone know a simple script that would beable to do this for me?
ascskate
09-14-2006, 08:18 AM
this is just a coutdown script i found. it wont have the PAYDAY! like you wanted but thought youd like to see it anyways.
http://www.dynamicdrive.com/dynamicindex6/universalcountdown.htm
hope that helps. ill continue looking for some other solutions
ascskate
ascskate
09-14-2006, 08:27 AM
no wait, i think i found wat you want
<script>
/*
Count down until any date script-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/
//change the text below to reflect your own,
var before="Valentines day!"
var current="Today is Valentines day. Don\'t forget the flowers!"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
if (difference==0)
document.write(current)
else if (difference>0)
document.write("Only "+difference+" days until "+before)
}
//enter the count down date using the format year/month/day
countdown(2002,2,14)
</script>
just make sure that you change all of the variable to your own specifacations.
hope i could help
ascskate
im not sure how you would get it to loop so its starts over after each payday. sry. and btw what are you using this for??
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.