Daily Countdown Clock

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
wave_werks
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 91
Joined: Mon Sep 22, 2008 8:37 pm
Location: Northeast Ohio
Contact:

Daily Countdown Clock

Post by wave_werks » Sat Feb 14, 2009 1:14 pm

Can anyone provide code for a daily countdown clock?

What I need is a clock that resets itself at 3 PM EST every weekday Monday through Friday. We have a daily cutoff time for orders to be placed at 3 PM EST. So, when a customer visits certain products on our site I'd like to have a cell appear in the description that says something like "Order before Mon, Feb 16, 2009 3:00 PM EST and get it shipped by Wed, Feb 18, 2009."

An example can bee seen just below the add to cart button on this site:
http://www.hotcards.com/business-cards

The difference with our site versus the site linked above is that we print every weekday and have a cutoff everyday Monday through Friday whereas the company linked above prints only twice each week and has only 2 cutoff deadlines each week.

Can anyone share some code that might serve this purpose?
- Jeff
Wave Werks

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Daily Countdown Clock

Post by mazhar » Mon Feb 16, 2009 6:26 am

It may be helpful
viewtopic.php?f=42&t=9309

wave_werks
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 91
Joined: Mon Sep 22, 2008 8:37 pm
Location: Northeast Ohio
Contact:

Re: Daily Countdown Clock

Post by wave_werks » Mon Feb 16, 2009 10:15 am

How about something like the code that is copied below?

Does anyone here know Javascript well enough to be able to modify it so that it displays a new image at 3pm EST on Monday, Tuesday, Wednesday, Thursday, and Friday or uses the server time with an offset to 3pm EST? The image would be changed Monday through Friday only. The image displayed on Friday at 3pm EST would remain until 3pm EST on Monday.

Code: Select all

<!-- ONE STEP TO INSTALL WEEK DAY IMAGE:

  1.  Copy the coding into the BODY of your HTML document  -->

<!-- STEP ONE: Paste this code into the BODY of your HTML document  -->

<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
today = new Date();
day = today.getDay();
arday = new Array("sunday.jpg", "monday.jpg", "tuesday.jpg", 
"wednesday.jpg", "thursday.jpg", "friday.jpg", "saturday.jpg");

document.write("<img src='" + arday[day] + "'>");
//  End -->
</script>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size:  0.63 KB -->
I'm completely clueless when it comes to this stuff so any and all help is greatly appreciated.
- Jeff
Wave Werks

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Daily Countdown Clock

Post by mazhar » Mon Feb 16, 2009 10:34 am

In order to use this script edit your content scriptlet where you want to show this info and put this code in it

Code: Select all

<script language="javascript" type="text/javascript">

today = new Date();
day = today.getDay();
arday = new Array("sunday.jpg", "monday.jpg", "tuesday.jpg",
"wednesday.jpg", "thursday.jpg", "friday.jpg", "saturday.jpg");

document.write("<img src='~/" + arday[day] + "'>");

</script>
The next job is to create or upload following images to the root of your site
sunday.jpg, monday.jpg, tuesday.jpg,
wednesday.jpg, thursday.jpg, friday.jpg, saturday.jpg

wave_werks
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 91
Joined: Mon Sep 22, 2008 8:37 pm
Location: Northeast Ohio
Contact:

Re: Daily Countdown Clock

Post by wave_werks » Mon Feb 16, 2009 10:45 am

How can I get it to display at 3PM EST each day as the start time for the new image? The image monday.jpg would be displayed later today at 3PM EST instead of at midnight.
- Jeff
Wave Werks

wave_werks
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 91
Joined: Mon Sep 22, 2008 8:37 pm
Location: Northeast Ohio
Contact:

Re: Daily Countdown Clock

Post by wave_werks » Mon Feb 16, 2009 1:21 pm

I also found this cool site, http://www.countdownr.com, that lets you create a custom countdown clock. One of its functions is based on a Google calendar feed.

I've set one up here:
http://www.countdownr.com/linking.html? ... png&alert=

However, it loads with an image link to their site and an image link to Widgetop. I saved the page with all of its components using Firefox and edited the js files, the html file, and the css file to keep all of the code local on the server running the site. Worked perfectly!

If you can figure out how to make the code you offered display starting at 3pm EST I'd love to have it, too. I can make use of it in several places throughout the site.

Thanks!
- Jeff
Wave Werks

Post Reply