Countdown not counting down at all

Created on 21 May 2012, over 13 years ago
Updated 10 November 2023, almost 2 years ago

I this module enabled using the Bartik theme, and it won't count down - it appears to only show the exact time left from when the page loads. What could be the issue with the Javascript? I'm on D-7.12.

πŸ’¬ Support request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ppatterson-edc

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs review about 1 year ago
  • πŸ‡¨πŸ‡ΎCyprus alex.bukach

    I confirm the module does not work as expected, I can see that issue in both 7.x and 8.x versions. The JavaScript code expects the numbers be wrapped in 's, however they are not. Fixing it was a part of a @burt.lo's patch in #2. Here's a 8.x patch.

  • Also confirming the module doesn't work as expected. I tested alex's patch ( https://www.drupal.org/project/countdown/issues/1591730#comment-15756791 πŸ› Countdown not counting down at all Needs review ) in a sandbox with Drupal 10.3 and branch 8.x-1.x-dev, but the only apparent change was the numbers are now displaying in italics per the tags. The timer is still not counting down dynamically, but only shows a change in countdown time when you refresh/visit the page.

  • πŸ‡¨πŸ‡ΎCyprus alex.bukach

    @hannakras I suggest you to have a look at https://www.drupal.org/project/countdown/issues/796110 πŸ› Day is cached Needs review and the MR there. I ended up reworking the whole module.

  • Thank you, @alex.bukach. I tested your MR, and it is counting down as expected now. I will comment over in that ticket as well.

  • Assigned to mahyarss
  • Status changed to Fixed 9 days ago
  • πŸ‡΅πŸ‡±Poland mahyarss

    This long-standing issue has been completely resolved in the 8.x-1.11 major refactor.

    Solution implemented:

    The module now features a brand new CountdownTimer library (vanilla JavaScript, ES6) with:

    • Real-time countdown mode - Live countdown with configurable precision (seconds to milliseconds)
    • Drift compensation algorithm - Maintains accuracy over extended periods
    • Zero dependencies - Pure vanilla JS, no jQuery required
    • IIFE/UMD pattern - Modern architecture compatible with Drupal 8/9/10/11
    • Auto-start capability - Begins counting immediately on page load
    • Dual-mode rendering:
      • Static mode (server-side, SEO-friendly)
      • Real-time mode (client-side, dynamic countdown)

    The JavaScript now properly initializes and continuously updates the countdown display, completely eliminating the "frozen time" issue.

    To enable real-time countdown:

    1. Edit your countdown block
    2. Select "Real-time JavaScript countdown" under Render Mode
    3. Configure precision (seconds recommended for most use cases)

    Download 8.x-1.11: https://www.drupal.org/project/countdown/releases/8.x-1.11 β†’

    Please test with the new version. If you encounter any issues, open a new issue with your specific configuration.

  • πŸ‡΅πŸ‡±Poland mahyarss

    Fixed in: 8.x-1.11

    Closing this issue as definitively fixed.

    What was the problem:

    The countdown displayed static time without real-time updates.

    How it's fixed in 8.x-1.11:

    • New CountdownTimer library with real-time countdown
    • Drift compensation for accuracy
    • Multiple precision levels (seconds to milliseconds)
    • Lightweight vanilla JavaScript (no jQuery dependency)
    • Modern ES6 architecture (IIFE/UMD pattern)
    • Full Drupal 8/9/10/11 compatibility

    Key improvements:

    • Performance: Optimized render loop with configurable update frequency
    • Accuracy: Drift compensation maintains precision over hours/days
    • Compatibility: Works with all modern browsers and Drupal versions
    • Size: ~2KB gzipped, zero external dependencies

    Upgrade path:

    composer update drupal/countdown
    drush updatedb
    drush cache:rebuild

    Configuration:

    Simply switch to "Real-time JavaScript countdown" in block settings to enable the dynamic countdown feature.

    The architecture has been completely modernized to prevent this issue from recurring. Should you experience any problems with the new implementation, please open a new issue with:

    • Drupal version
    • Browser details
    • Block configuration export

    Thank you for your patience with this long-standing issue. The wait is over - real-time countdown is here!

Production build 0.71.5 2024