Countdown Timer The Next CEO of Stack OverflowHow to use HTML and CSS on a CMS Page?Adding Javascript to a CMS PageTimer countdown in product view pagedisplay timer countdown according to attribute valueHow can i create own order Time Countdown for EVERY ORDERHow to display a timer countdown from a static blockImplement Countdown watch in magentoNeed to Change the timerCountdown timer in a static block with values from admin configmagento 2 - javascript timer errorBuilding javascript “Order by for same day shipping” countdown timer

What happens if you roll doubles 3 times then land on "Go to jail?"

How to safely derail a train during transit?

Are there languages with no euphemisms?

Unreliable Magic - Is it worth it?

Can the Reverse Gravity spell affect the Meteor Swarm spell?

How to be diplomatic in refusing to write code that breaches the privacy of our users

WOW air has ceased operation, can I get my tickets refunded?

How to write the block matrix in LaTex?

Should I tutor a student who I know has cheated on their homework?

Grabbing quick drinks

What does "Its cash flow is deeply negative" mean?

India just shot down a satellite from the ground. At what altitude range is the resulting debris field?

What is the purpose of the Evocation wizard's Potent Cantrip feature?

What do "high sea" and "carry" mean in this sentence?

Can a single photon have an energy density?

Rotate a column

Why does standard notation not preserve intervals (visually)

MAZDA 3 2006 (UK) - poor acceleration then takes off at 3250 revs

How did people program for Consoles with multiple CPUs?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

Is HostGator storing my password in plaintext?

Only print output after finding pattern

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

How long to clear the 'suck zone' of a turbofan after start is initiated?



Countdown Timer



The Next CEO of Stack OverflowHow to use HTML and CSS on a CMS Page?Adding Javascript to a CMS PageTimer countdown in product view pagedisplay timer countdown according to attribute valueHow can i create own order Time Countdown for EVERY ORDERHow to display a timer countdown from a static blockImplement Countdown watch in magentoNeed to Change the timerCountdown timer in a static block with values from admin configmagento 2 - javascript timer errorBuilding javascript “Order by for same day shipping” countdown timer










0















I can't get the following code to work on the frontend. It displays correctly but will not countdown as I would like. I have tried changing the date but nothing happens. Could someone point me in the right direction? Thanks



<p>
<script type="text/javascript">
// <![CDATA[
var end = new Date("06/22/2016 ");
var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;

function showRemaining()
var end = new Date("06/22/2016");
var now = new Date();
var distance = end - now;
var days = Math.floor(distance / _day);
var hours = Math.floor((distance % _day) / _hour);
var minutes = Math.floor((distance % _hour) / _minute);
var seconds = Math.floor((distance % _minute) / _second);

document.getElementById('coupon_days').innerHTML = '<span>'+days+'D&nbsp;</span>';
document.getElementById('coupon_hours').innerHTML = '<span>'+hours+'H&nbsp;</span>';
document.getElementById('coupon_minutes').innerHTML = '<span>'+minutes+'M&nbsp;</span>';
document.getElementById('coupon_seconds').innerHTML = '<span>'+seconds+'S&nbsp;</span>';

timer = setInterval(showRemaining, 1000);
// ]]>
</script>
</p>

<div class="order_line_content">
<p>Order Before <strong><span style="color: #ff99cc;">1D-<span id="coupon_hours">1H-</span><span id="coupon_minutes">40M-</span></span></strong><span id="coupon_seconds"><span><strong><span style="color: #ff99cc;">2S</span></strong>&nbsp;</span></span><span id="coupon_seconds">to go</span> To Get Upto 20% off.</p>
</div>









share|improve this question




























    0















    I can't get the following code to work on the frontend. It displays correctly but will not countdown as I would like. I have tried changing the date but nothing happens. Could someone point me in the right direction? Thanks



    <p>
    <script type="text/javascript">
    // <![CDATA[
    var end = new Date("06/22/2016 ");
    var _second = 1000;
    var _minute = _second * 60;
    var _hour = _minute * 60;
    var _day = _hour * 24;
    var timer;

    function showRemaining()
    var end = new Date("06/22/2016");
    var now = new Date();
    var distance = end - now;
    var days = Math.floor(distance / _day);
    var hours = Math.floor((distance % _day) / _hour);
    var minutes = Math.floor((distance % _hour) / _minute);
    var seconds = Math.floor((distance % _minute) / _second);

    document.getElementById('coupon_days').innerHTML = '<span>'+days+'D&nbsp;</span>';
    document.getElementById('coupon_hours').innerHTML = '<span>'+hours+'H&nbsp;</span>';
    document.getElementById('coupon_minutes').innerHTML = '<span>'+minutes+'M&nbsp;</span>';
    document.getElementById('coupon_seconds').innerHTML = '<span>'+seconds+'S&nbsp;</span>';

    timer = setInterval(showRemaining, 1000);
    // ]]>
    </script>
    </p>

    <div class="order_line_content">
    <p>Order Before <strong><span style="color: #ff99cc;">1D-<span id="coupon_hours">1H-</span><span id="coupon_minutes">40M-</span></span></strong><span id="coupon_seconds"><span><strong><span style="color: #ff99cc;">2S</span></strong>&nbsp;</span></span><span id="coupon_seconds">to go</span> To Get Upto 20% off.</p>
    </div>









    share|improve this question


























      0












      0








      0


      1






      I can't get the following code to work on the frontend. It displays correctly but will not countdown as I would like. I have tried changing the date but nothing happens. Could someone point me in the right direction? Thanks



      <p>
      <script type="text/javascript">
      // <![CDATA[
      var end = new Date("06/22/2016 ");
      var _second = 1000;
      var _minute = _second * 60;
      var _hour = _minute * 60;
      var _day = _hour * 24;
      var timer;

      function showRemaining()
      var end = new Date("06/22/2016");
      var now = new Date();
      var distance = end - now;
      var days = Math.floor(distance / _day);
      var hours = Math.floor((distance % _day) / _hour);
      var minutes = Math.floor((distance % _hour) / _minute);
      var seconds = Math.floor((distance % _minute) / _second);

      document.getElementById('coupon_days').innerHTML = '<span>'+days+'D&nbsp;</span>';
      document.getElementById('coupon_hours').innerHTML = '<span>'+hours+'H&nbsp;</span>';
      document.getElementById('coupon_minutes').innerHTML = '<span>'+minutes+'M&nbsp;</span>';
      document.getElementById('coupon_seconds').innerHTML = '<span>'+seconds+'S&nbsp;</span>';

      timer = setInterval(showRemaining, 1000);
      // ]]>
      </script>
      </p>

      <div class="order_line_content">
      <p>Order Before <strong><span style="color: #ff99cc;">1D-<span id="coupon_hours">1H-</span><span id="coupon_minutes">40M-</span></span></strong><span id="coupon_seconds"><span><strong><span style="color: #ff99cc;">2S</span></strong>&nbsp;</span></span><span id="coupon_seconds">to go</span> To Get Upto 20% off.</p>
      </div>









      share|improve this question
















      I can't get the following code to work on the frontend. It displays correctly but will not countdown as I would like. I have tried changing the date but nothing happens. Could someone point me in the right direction? Thanks



      <p>
      <script type="text/javascript">
      // <![CDATA[
      var end = new Date("06/22/2016 ");
      var _second = 1000;
      var _minute = _second * 60;
      var _hour = _minute * 60;
      var _day = _hour * 24;
      var timer;

      function showRemaining()
      var end = new Date("06/22/2016");
      var now = new Date();
      var distance = end - now;
      var days = Math.floor(distance / _day);
      var hours = Math.floor((distance % _day) / _hour);
      var minutes = Math.floor((distance % _hour) / _minute);
      var seconds = Math.floor((distance % _minute) / _second);

      document.getElementById('coupon_days').innerHTML = '<span>'+days+'D&nbsp;</span>';
      document.getElementById('coupon_hours').innerHTML = '<span>'+hours+'H&nbsp;</span>';
      document.getElementById('coupon_minutes').innerHTML = '<span>'+minutes+'M&nbsp;</span>';
      document.getElementById('coupon_seconds').innerHTML = '<span>'+seconds+'S&nbsp;</span>';

      timer = setInterval(showRemaining, 1000);
      // ]]>
      </script>
      </p>

      <div class="order_line_content">
      <p>Order Before <strong><span style="color: #ff99cc;">1D-<span id="coupon_hours">1H-</span><span id="coupon_minutes">40M-</span></span></strong><span id="coupon_seconds"><span><strong><span style="color: #ff99cc;">2S</span></strong>&nbsp;</span></span><span id="coupon_seconds">to go</span> To Get Upto 20% off.</p>
      </div>






      magento-1.9 javascript discount code






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 25 mins ago









      Shoaib Munir

      2,2941829




      2,2941829










      asked Aug 15 '17 at 19:59









      billybilly

      1




      1




















          1 Answer
          1






          active

          oldest

          votes


















          1














          You can use below script if you want. I have used it before https://jsfiddle.net/cbdgmzr1/2/



          <div id="countdown">
          <p class="days">00</p>
          <p class="timeRefDays">days</p>
          <p class="hours">00</p>
          <p class="timeRefHours">hours</p>
          <p class="minutes">00</p>
          <p class="timeRefMinutes">minutes</p>
          <p class="seconds">00</p>
          <p class="timeRefSeconds">seconds</p>
          </div>
          <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
          <script>
          /*
          * Basic Count Down to Date and Time
          * Author: @mrwigster / trulycode.com
          */
          (function (e)
          e.fn.countdown = function (t, n)
          function i()
          eventDate = Date.parse(r.date) / 1e3;
          currentDate = Math.floor(e.now() / 1e3);
          if (eventDate <= currentDate)
          n.call(this);
          clearInterval(interval)

          seconds = eventDate - currentDate;
          days = Math.floor(seconds / 86400);
          seconds -= days * 60 * 60 * 24;
          hours = Math.floor(seconds / 3600);
          seconds -= hours * 60 * 60;
          minutes = Math.floor(seconds / 60);
          seconds -= minutes * 60;
          days == 1 ? thisEl.find(".timeRefDays").text("day") : thisEl.find(".timeRefDays").text("days");
          hours == 1 ? thisEl.find(".timeRefHours").text("hour") : thisEl.find(".timeRefHours").text("hours");
          minutes == 1 ? thisEl.find(".timeRefMinutes").text("minute") : thisEl.find(".timeRefMinutes").text("minutes");
          seconds == 1 ? thisEl.find(".timeRefSeconds").text("second") : thisEl.find(".timeRefSeconds").text("seconds");
          if (r["format"] == "on")
          days = String(days).length >= 2 ? days : "0" + days;
          hours = String(hours).length >= 2 ? hours : "0" + hours;
          minutes = String(minutes).length >= 2 ? minutes : "0" + minutes;
          seconds = String(seconds).length >= 2 ? seconds : "0" + seconds

          if (!isNaN(eventDate))
          thisEl.find(".days").text(days);
          thisEl.find(".hours").text(hours);
          thisEl.find(".minutes").text(minutes);
          thisEl.find(".seconds").text(seconds)
          else
          alert("Invalid date. Example: 30 Tuesday 2013 15:50:00");
          clearInterval(interval)


          var thisEl = e(this);
          var r =
          date: null,
          format: null
          ;
          t && e.extend(r, t);
          i();
          interval = setInterval(i, 1e3)

          )(jQuery);
          $(document).ready(function ()
          function e()
          var e = new Date;
          e.setDate(e.getDate() + 60);
          dd = e.getDate();
          mm = e.getMonth() + 1;
          y = e.getFullYear();
          futureFormattedDate = mm + "/" + dd + "/" + y;
          return futureFormattedDate

          $("#countdown").countdown(
          date: "17 August 2017 21:30:00", // Change this to your desired date to countdown to
          format: "on"
          );
          );
          </script>
          <style>
          #countdown p
          display: inline-block;
          padding: 5px;
          background: #FFA500;
          margin: 0 0 20px;

          </style>





          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f189201%2fcountdown-timer%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            You can use below script if you want. I have used it before https://jsfiddle.net/cbdgmzr1/2/



            <div id="countdown">
            <p class="days">00</p>
            <p class="timeRefDays">days</p>
            <p class="hours">00</p>
            <p class="timeRefHours">hours</p>
            <p class="minutes">00</p>
            <p class="timeRefMinutes">minutes</p>
            <p class="seconds">00</p>
            <p class="timeRefSeconds">seconds</p>
            </div>
            <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
            <script>
            /*
            * Basic Count Down to Date and Time
            * Author: @mrwigster / trulycode.com
            */
            (function (e)
            e.fn.countdown = function (t, n)
            function i()
            eventDate = Date.parse(r.date) / 1e3;
            currentDate = Math.floor(e.now() / 1e3);
            if (eventDate <= currentDate)
            n.call(this);
            clearInterval(interval)

            seconds = eventDate - currentDate;
            days = Math.floor(seconds / 86400);
            seconds -= days * 60 * 60 * 24;
            hours = Math.floor(seconds / 3600);
            seconds -= hours * 60 * 60;
            minutes = Math.floor(seconds / 60);
            seconds -= minutes * 60;
            days == 1 ? thisEl.find(".timeRefDays").text("day") : thisEl.find(".timeRefDays").text("days");
            hours == 1 ? thisEl.find(".timeRefHours").text("hour") : thisEl.find(".timeRefHours").text("hours");
            minutes == 1 ? thisEl.find(".timeRefMinutes").text("minute") : thisEl.find(".timeRefMinutes").text("minutes");
            seconds == 1 ? thisEl.find(".timeRefSeconds").text("second") : thisEl.find(".timeRefSeconds").text("seconds");
            if (r["format"] == "on")
            days = String(days).length >= 2 ? days : "0" + days;
            hours = String(hours).length >= 2 ? hours : "0" + hours;
            minutes = String(minutes).length >= 2 ? minutes : "0" + minutes;
            seconds = String(seconds).length >= 2 ? seconds : "0" + seconds

            if (!isNaN(eventDate))
            thisEl.find(".days").text(days);
            thisEl.find(".hours").text(hours);
            thisEl.find(".minutes").text(minutes);
            thisEl.find(".seconds").text(seconds)
            else
            alert("Invalid date. Example: 30 Tuesday 2013 15:50:00");
            clearInterval(interval)


            var thisEl = e(this);
            var r =
            date: null,
            format: null
            ;
            t && e.extend(r, t);
            i();
            interval = setInterval(i, 1e3)

            )(jQuery);
            $(document).ready(function ()
            function e()
            var e = new Date;
            e.setDate(e.getDate() + 60);
            dd = e.getDate();
            mm = e.getMonth() + 1;
            y = e.getFullYear();
            futureFormattedDate = mm + "/" + dd + "/" + y;
            return futureFormattedDate

            $("#countdown").countdown(
            date: "17 August 2017 21:30:00", // Change this to your desired date to countdown to
            format: "on"
            );
            );
            </script>
            <style>
            #countdown p
            display: inline-block;
            padding: 5px;
            background: #FFA500;
            margin: 0 0 20px;

            </style>





            share|improve this answer





























              1














              You can use below script if you want. I have used it before https://jsfiddle.net/cbdgmzr1/2/



              <div id="countdown">
              <p class="days">00</p>
              <p class="timeRefDays">days</p>
              <p class="hours">00</p>
              <p class="timeRefHours">hours</p>
              <p class="minutes">00</p>
              <p class="timeRefMinutes">minutes</p>
              <p class="seconds">00</p>
              <p class="timeRefSeconds">seconds</p>
              </div>
              <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
              <script>
              /*
              * Basic Count Down to Date and Time
              * Author: @mrwigster / trulycode.com
              */
              (function (e)
              e.fn.countdown = function (t, n)
              function i()
              eventDate = Date.parse(r.date) / 1e3;
              currentDate = Math.floor(e.now() / 1e3);
              if (eventDate <= currentDate)
              n.call(this);
              clearInterval(interval)

              seconds = eventDate - currentDate;
              days = Math.floor(seconds / 86400);
              seconds -= days * 60 * 60 * 24;
              hours = Math.floor(seconds / 3600);
              seconds -= hours * 60 * 60;
              minutes = Math.floor(seconds / 60);
              seconds -= minutes * 60;
              days == 1 ? thisEl.find(".timeRefDays").text("day") : thisEl.find(".timeRefDays").text("days");
              hours == 1 ? thisEl.find(".timeRefHours").text("hour") : thisEl.find(".timeRefHours").text("hours");
              minutes == 1 ? thisEl.find(".timeRefMinutes").text("minute") : thisEl.find(".timeRefMinutes").text("minutes");
              seconds == 1 ? thisEl.find(".timeRefSeconds").text("second") : thisEl.find(".timeRefSeconds").text("seconds");
              if (r["format"] == "on")
              days = String(days).length >= 2 ? days : "0" + days;
              hours = String(hours).length >= 2 ? hours : "0" + hours;
              minutes = String(minutes).length >= 2 ? minutes : "0" + minutes;
              seconds = String(seconds).length >= 2 ? seconds : "0" + seconds

              if (!isNaN(eventDate))
              thisEl.find(".days").text(days);
              thisEl.find(".hours").text(hours);
              thisEl.find(".minutes").text(minutes);
              thisEl.find(".seconds").text(seconds)
              else
              alert("Invalid date. Example: 30 Tuesday 2013 15:50:00");
              clearInterval(interval)


              var thisEl = e(this);
              var r =
              date: null,
              format: null
              ;
              t && e.extend(r, t);
              i();
              interval = setInterval(i, 1e3)

              )(jQuery);
              $(document).ready(function ()
              function e()
              var e = new Date;
              e.setDate(e.getDate() + 60);
              dd = e.getDate();
              mm = e.getMonth() + 1;
              y = e.getFullYear();
              futureFormattedDate = mm + "/" + dd + "/" + y;
              return futureFormattedDate

              $("#countdown").countdown(
              date: "17 August 2017 21:30:00", // Change this to your desired date to countdown to
              format: "on"
              );
              );
              </script>
              <style>
              #countdown p
              display: inline-block;
              padding: 5px;
              background: #FFA500;
              margin: 0 0 20px;

              </style>





              share|improve this answer



























                1












                1








                1







                You can use below script if you want. I have used it before https://jsfiddle.net/cbdgmzr1/2/



                <div id="countdown">
                <p class="days">00</p>
                <p class="timeRefDays">days</p>
                <p class="hours">00</p>
                <p class="timeRefHours">hours</p>
                <p class="minutes">00</p>
                <p class="timeRefMinutes">minutes</p>
                <p class="seconds">00</p>
                <p class="timeRefSeconds">seconds</p>
                </div>
                <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
                <script>
                /*
                * Basic Count Down to Date and Time
                * Author: @mrwigster / trulycode.com
                */
                (function (e)
                e.fn.countdown = function (t, n)
                function i()
                eventDate = Date.parse(r.date) / 1e3;
                currentDate = Math.floor(e.now() / 1e3);
                if (eventDate <= currentDate)
                n.call(this);
                clearInterval(interval)

                seconds = eventDate - currentDate;
                days = Math.floor(seconds / 86400);
                seconds -= days * 60 * 60 * 24;
                hours = Math.floor(seconds / 3600);
                seconds -= hours * 60 * 60;
                minutes = Math.floor(seconds / 60);
                seconds -= minutes * 60;
                days == 1 ? thisEl.find(".timeRefDays").text("day") : thisEl.find(".timeRefDays").text("days");
                hours == 1 ? thisEl.find(".timeRefHours").text("hour") : thisEl.find(".timeRefHours").text("hours");
                minutes == 1 ? thisEl.find(".timeRefMinutes").text("minute") : thisEl.find(".timeRefMinutes").text("minutes");
                seconds == 1 ? thisEl.find(".timeRefSeconds").text("second") : thisEl.find(".timeRefSeconds").text("seconds");
                if (r["format"] == "on")
                days = String(days).length >= 2 ? days : "0" + days;
                hours = String(hours).length >= 2 ? hours : "0" + hours;
                minutes = String(minutes).length >= 2 ? minutes : "0" + minutes;
                seconds = String(seconds).length >= 2 ? seconds : "0" + seconds

                if (!isNaN(eventDate))
                thisEl.find(".days").text(days);
                thisEl.find(".hours").text(hours);
                thisEl.find(".minutes").text(minutes);
                thisEl.find(".seconds").text(seconds)
                else
                alert("Invalid date. Example: 30 Tuesday 2013 15:50:00");
                clearInterval(interval)


                var thisEl = e(this);
                var r =
                date: null,
                format: null
                ;
                t && e.extend(r, t);
                i();
                interval = setInterval(i, 1e3)

                )(jQuery);
                $(document).ready(function ()
                function e()
                var e = new Date;
                e.setDate(e.getDate() + 60);
                dd = e.getDate();
                mm = e.getMonth() + 1;
                y = e.getFullYear();
                futureFormattedDate = mm + "/" + dd + "/" + y;
                return futureFormattedDate

                $("#countdown").countdown(
                date: "17 August 2017 21:30:00", // Change this to your desired date to countdown to
                format: "on"
                );
                );
                </script>
                <style>
                #countdown p
                display: inline-block;
                padding: 5px;
                background: #FFA500;
                margin: 0 0 20px;

                </style>





                share|improve this answer















                You can use below script if you want. I have used it before https://jsfiddle.net/cbdgmzr1/2/



                <div id="countdown">
                <p class="days">00</p>
                <p class="timeRefDays">days</p>
                <p class="hours">00</p>
                <p class="timeRefHours">hours</p>
                <p class="minutes">00</p>
                <p class="timeRefMinutes">minutes</p>
                <p class="seconds">00</p>
                <p class="timeRefSeconds">seconds</p>
                </div>
                <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
                <script>
                /*
                * Basic Count Down to Date and Time
                * Author: @mrwigster / trulycode.com
                */
                (function (e)
                e.fn.countdown = function (t, n)
                function i()
                eventDate = Date.parse(r.date) / 1e3;
                currentDate = Math.floor(e.now() / 1e3);
                if (eventDate <= currentDate)
                n.call(this);
                clearInterval(interval)

                seconds = eventDate - currentDate;
                days = Math.floor(seconds / 86400);
                seconds -= days * 60 * 60 * 24;
                hours = Math.floor(seconds / 3600);
                seconds -= hours * 60 * 60;
                minutes = Math.floor(seconds / 60);
                seconds -= minutes * 60;
                days == 1 ? thisEl.find(".timeRefDays").text("day") : thisEl.find(".timeRefDays").text("days");
                hours == 1 ? thisEl.find(".timeRefHours").text("hour") : thisEl.find(".timeRefHours").text("hours");
                minutes == 1 ? thisEl.find(".timeRefMinutes").text("minute") : thisEl.find(".timeRefMinutes").text("minutes");
                seconds == 1 ? thisEl.find(".timeRefSeconds").text("second") : thisEl.find(".timeRefSeconds").text("seconds");
                if (r["format"] == "on")
                days = String(days).length >= 2 ? days : "0" + days;
                hours = String(hours).length >= 2 ? hours : "0" + hours;
                minutes = String(minutes).length >= 2 ? minutes : "0" + minutes;
                seconds = String(seconds).length >= 2 ? seconds : "0" + seconds

                if (!isNaN(eventDate))
                thisEl.find(".days").text(days);
                thisEl.find(".hours").text(hours);
                thisEl.find(".minutes").text(minutes);
                thisEl.find(".seconds").text(seconds)
                else
                alert("Invalid date. Example: 30 Tuesday 2013 15:50:00");
                clearInterval(interval)


                var thisEl = e(this);
                var r =
                date: null,
                format: null
                ;
                t && e.extend(r, t);
                i();
                interval = setInterval(i, 1e3)

                )(jQuery);
                $(document).ready(function ()
                function e()
                var e = new Date;
                e.setDate(e.getDate() + 60);
                dd = e.getDate();
                mm = e.getMonth() + 1;
                y = e.getFullYear();
                futureFormattedDate = mm + "/" + dd + "/" + y;
                return futureFormattedDate

                $("#countdown").countdown(
                date: "17 August 2017 21:30:00", // Change this to your desired date to countdown to
                format: "on"
                );
                );
                </script>
                <style>
                #countdown p
                display: inline-block;
                padding: 5px;
                background: #FFA500;
                margin: 0 0 20px;

                </style>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Aug 15 '17 at 20:42

























                answered Aug 15 '17 at 20:07









                Abhishek PanchalAbhishek Panchal

                3,5973929




                3,5973929



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f189201%2fcountdown-timer%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                    Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

                    Aasi (pallopeli) Navigointivalikko