New Radio UserLand script: daysUntilEvent, which displays the number of days until a user-specified date.

Comments

Thank you very much Roger, as this macro has made things very much easier on my weblog. It is greatly appreciated.

yours sincerely

James McCready

I installed it on my site and it seems to be working. However, the minutes, hours and seconds are not working for some reason. I currently have the following:
which returns 96 days. Any thoughts on this?

Also, I had to delete the last line in your script beginning with dialog.alert as I was getting a 303 error. I'm not familiar with the Radio compiler so I don't know exactly wat that was doing.

Thanks for the great tool regardless...

Oops, should have dumped the brackets...

workspace.daysUntilEvent(1, 6, 2003, 6, 45)

This returns 96 days.

The script uses the minutes, hours, and seconds to calculate the number of days until the event, but it does not display them. The problem with counting the exact time is that Radio generates static pages, so the time would only be accurate at the minute it was published. A more precise countdown should be implemented in Javascript, a Java applet, or something else on the server.

Roger, I'm pretty new at this and it is usually something simple that trips me up. When I call the script to my home page template I get an message saying syntax error. Does this mean that I should replace "Event" with, say, "Christmas"? Any help would be appreciated.

Thanks

Add a Comment

These HTML tags are permitted: <p>, <b>, <i>, <a>, and <blockquote>. A comment may not include more than three links. This site is protected by reCAPTCHA (for which the Google Privacy Policy and Terms of Service apply).