Results 1 to 2 of 2

Thread: advanced countdown

  1. #1
    Join Date
    Nov 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default advanced countdown

    hi. i'm in need of some help with a countdown script.

    "orders completed in the next [time] ship out [date]"

    this needs to count down every day;
    [time] counting down to 1pm every day (resetting immediately), if it is past 1pm then the [date] needs to display "during the next business day", and if it is before 1pm then it needs to say "today"

    example;

    it's noon - "orders completed in the next 1 hour ship today"
    it's 3pm - "orders completed in the next 21 hours ship during the next business day"

    is this possible on a non php page, or at all?

    thanks very much for any help.

    brian

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,774
    Thanks
    2
    Thanked 410 Times in 405 Posts

    Default

    this does not acount for time zones or weekends

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    <script type="text/javascript">
    /*<![CDATA[*/
    function Shipping(id){
     var today=new Date();
     var hours=today.getHours();
     var day=today.getDay();
     document.getElementById(id).innerHTML=(hours<13)?'orders completed in the next '+(13-hours)+' hour ship today':'orders completed in the next 21 hours ship during the next business day';
    }
    
    /*]]>*/
    </script></head>
    
    <body>
    
    <span id="tst" ></span>
    <script type="text/javascript">
    /*<![CDATA[*/
    Shipping('tst');
    /*]]>*/
    </script>
    </body>
    
    </html>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •