Count up is erratic if the date/time is in the past

Created on 5 April 2025, 13 days ago

Problem/Motivation

When using a 'Count up' widget, if a user enters a date/time in the past the timer continues to count up even though the date and time is in the past.

Steps to reproduce

1. Latest version of this module
2. Enable jstimer
3. Enable jst_timer
4. Add a widget, in a node field, with count up, for a time that's in the past. For example, its currently 5/4 @ 5pm

Widget

<div class="jst_timer">Count Up to 9:30
<div class="datetime" style="display:none">2025-04-05T09:30:00</div>

<div class="dir" style="display:none">up</div>
</div>
πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom aaron.ferris

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

Comments & Activities

  • Issue created by @aaron.ferris
  • πŸ‡§πŸ‡·Brazil charlliequadros

    Hi @aaron.ferris,

    I’d like to work on this, but I didn’t quite understand how it’s supposed to work.

    For example, when the date is in the future, it shows a countdown timer until the selected date. Once the date has passed β€” meaning it's now or in the past β€” it starts showing the time that has passed since then.

    My question is: what’s the expected behavior? Should it stop when it reaches the selected date?

  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris

    Hello @charlliequadros its an interesting question and not one I had considered, it feels odd to me to count up to something then proceed past it. Id expect it to return a 'completed message' but like the count down. Maybe needs some thought.

  • πŸ‡§πŸ‡·Brazil charlliequadros

    Hi @aaron.ferris,

    I think the current behavior makes sense β€” it counts down until the specified time, and then starts counting up to show how much time has passed since then.

    One thing I think could be nice to add is a message that indicates how much time is left until the specified time, and another one that shows how much time has passed after it.

    Does that make sense to you?

  • @aaron.ferris , @charlliequadros idea looks good and I think we can proceed this way . I would love to work on this idea

  • πŸ‡¬πŸ‡§United Kingdom aaron.ferris

    Hello @charlliequadros

    Yes that does make sense

Production build 0.71.5 2024