Skip to content

Countdown based on calendar does not reset properly. #380

@jaysavage83

Description

@jaysavage83

What happened?

I'm using craft calendar with custom api and jquery countdown.
I've noticed after an event ends for example Wednedays 6pm-8pm the countdown resets its self to 24 hours 00 minutes on page refresh and every refresh resets the same back to the 24 hours. The countdown does not correctly reset until 12am the following day. If something in my code needs to be changed to fix this

Just to keep this space clean all of the code can be found here: https://gist.github.com/JayGreentree/f0fa719ff45f768373754c066fa74563

Errors and Stack Trace (if available)

How can we reproduce this?

  1. Create data.json.twig file in /templates/api (from the gist link above)
  2. Create the jquery countdown in /web/js/chopNew.js (from the gist link above)
  3. Add CSS (from the gist link above)
  4. Add the countdown code to any twig template (from the gist link above)
  5. Add an event to craft calendar for every 1 week hit save.
  6. wait til even date/time is over and refresh page with countdown

Calendar Edition

Pro

Calendar Version

5.0.16

Craft Version

5.6.14

When did this issue start?

  • Unsure
  • Fresh install of Calendar
  • After upgrading from older Calendar version
  • After upgrading from older Craft version
  • After a change to hosting configuration

Previous Calendar Version

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions