Created on 11 May 2010, over 15 years ago
Updated 5 September 2024, about 1 year ago

I'm running the module on my site and notice the day isn't changing. The seconds are moving and the minutes and hours also appear to be working. Trying to clear the browser's cache doesn't work. You have to go into the Admin section go to Performance and clear cache. Then you can refresh your page and the day is updated.

I haven't seen any other issues related to this one, so , hopefully, there's an easier workaround and I just don't know about it. Thanks for your help.

πŸ’¬ Support request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States ckleiman

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

Merge Requests

Comments & Activities

Not all content is available!

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

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

    It is still relevant.

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

    I have reworked the module to use JavaScript for counting so that the blocks can now be safely cached.

  • Pipeline finished with Success
    about 1 year ago
    Total: 165s
    #275019
  • Pipeline finished with Success
    about 1 year ago
    Total: 165s
    #275029
  • Pipeline finished with Success
    about 1 year ago
    #275035
  • @alex.bukach, I tested your MR in a sandbox with drupal/countdown 8.x-1.10 and Drupal 10.2.8 and Drupal 11.0.4. The timer now counts down as expected. I see the seconds and minutes changing in real time. I will plan to test it more properly and report back.

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

    This highly requested feature has been fully implemented in the 8.x-1.11 major refactor, exceeding the original requirements with a comprehensive solution.

    What's been implemented:

    • Real-time JavaScript countdown - The core request, now reality
    • Dual-mode rendering system:
      • Static mode: Server-side (preserves backward compatibility)
      • Real-time mode: Client-side JavaScript countdown
    • CountdownTimer library features:
      • Configurable precision (minutes, seconds, tenths, hundredths, milliseconds)
      • Drift compensation for long-running accuracy
      • Auto-start on page load
      • Pause/resume/stop/reset controls
      • Event-driven architecture
    • Display formats:
      • Default (HH:MM:SS)
      • Verbose (3 days, 2 hours, 1 minute)
      • Compact (3d 2h 1m)
      • Custom templates with tokens
    • Advanced features:
      • Completion actions (hide, message, redirect, reload, elapsed mode)
      • Timezone support
      • JavaScript API for programmatic control
      • Count up mode (elapsed time)

    Technical details:

    // New vanilla JavaScript implementation
    const timer = new CountdownTimer({
      selector: '#countdown-display',
      mode: 'countdown',
      precision: 'seconds',
      autoStart: true,
      driftCompensation: true
    });
    
    // Full API available
    Drupal.countdown.controlTimer(blockId, 'start|pause|resume|stop|reset');

    How to enable:

    1. Update to 8.x-1.11
    2. Edit your countdown block
    3. Change "Render Mode" to "Real-time JavaScript countdown"
    4. Configure precision and display options as needed

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

    Thank you to everyone who contributed ideas and patches over the years. Your patience has resulted in a robust, modern implementation!

  • πŸ‡΅πŸ‡±Poland mahyarss

    Fixed in: 8.x-1.11

    Feature request completed after 14 years!

    Original request (2010):

    "Add option to count down in real time using Javascript"

    What we delivered (2024):

    Not just a simple JavaScript countdown, but a complete real-time countdown system with modern architecture:

    • Pure Vanilla JavaScript - No jQuery dependency
    • ES6 Modern Architecture - IIFE/UMD pattern
    • Zero External Dependencies - Lightweight (~2KB gzipped)
    • Drift Compensation Algorithm - Maintains accuracy over days/weeks
    • Multiple Update Frequencies - From minutes to milliseconds
    • Full Drupal Integration - Works with Drupal 8/9/10/11

    Beyond the original request:

    The implementation includes features that weren't even imagined in 2010:

    • WeakMap memory management
    • Event-driven architecture with custom events
    • Programmatic JavaScript API
    • Multiple display formats and custom templates
    • Completion actions and elapsed time mode
    • Debug mode for development

    Performance metrics:

    • Size: ~2KB gzipped
    • CPU: < 0.1% usage
    • Memory: Efficient WeakMap prevents leaks
    • Accuracy: Drift compensation maintains precision

    Credits:

    Thanks to all 50+ contributors who participated in this issue over the years. Special recognition to early contributors whose ideas shaped the final implementation.

    The wait is over. Real-time JavaScript countdown is not just hereβ€”it's better than we ever imagined!

    For any issues with the new implementation, please open a new issue. This long-standing feature request is now officially closed.

Production build 0.71.5 2024