a little java help
- Started
- Last post
- 11 Responses
- BaskerviIle
Hi everyone,
I'm making a countdown widget for someone at the moment. I'm doing ok so far (being a total noob at this). I have found some javascript for a countdown function. The only problem is that the countdown only works once, counting towards a single date and time:What I need to happen is a recurring countdown. For example counting down to 5pm on a friday, but EVERY friday, so the countdown refreshes week to week.
Maybe after 5pm on a friday it displays a message until the end of the day and then starts the countdown to the following friday the next day.
Any help with this would be very much appreciated. My java knowledge is pretty limited,
thanks
- neverblink0
first split the TargetDate up in parts so you can calculate the next date.
----var TargetMonth = 12;
var TargetDay = 31;
var TargetYear = 2007;TargetDate = TargetMonth +"/"+ TargetDay +"/"+ TargetYear;
---then when ( secs < 0 )
you should make a correct date from this, but you can do something like:
---TargetDay = TargetDay+7;
//make TargetDate again
---and then call the function again.
- skt0
oh aye, swan off to your fancy new job, never even pop in to say hello, and now, when you want some help you act like nothing happened. pfft.
- maximillion_0
isnt javascript reading the local time? meaning if i have my clock set to saturday when its friday the whole thing falls down?
- BaskerviIle0
haha, I was thinking of making some comment about coming crawling back. Truth is I've still been watching what's been going on recently. And i have popped up a few times.
I'm still not relaxed enough in the new job to be speding half my time here, like I used to. But that time will come soon enough ;o)
thanks for the help so far, splitting up the date sounds good
- skt0
I could help you if it was flash, nae luck with js though...
Hows things anyway, new job going well?
- BaskerviIle0
new job is busy but in a good way. No time to get bored, which I'm pleased about. first 2 months have flown past. Good clients etc. glad I moved. But ask me again in a year :)
how bout you, what you doing now you're back in london?
- skt0
same old, same old. making shitty websites for fox and universal etc..
- BaskerviIle0
any new film sites I might have seen?
the simpsons movie site is one of the best I've ever seen. Loved the design your own character section.
- skt0
nothing worthwhile... i got most of the shit work whilst i was out in the states and i've just been doing pitch work since i got back. and losing.
- BaskerviIle0
that's the spirit!
- geralddean0
Hey Baskerville,
I have the answer for your code to work on Friday after 5.
Since js runs clientside, yes it will run on user's machine on Friday after 5 indeed.
email me for it.
Ciao