I want to add my app a javascript script to execute a timer feature (00:00:01).

0
I tiried to use HTML snippet. But that did not help. I want to use mendix buttons to start en stop de timer. It must continue if I leave the page and I want to see it when I come back to page.  
asked
1 answers
1

I would simply use Mendix functionality to achieve this goal.

You can create an entity that holds an attribute: Startdate and a status (enum). When you press Start the Startdate will be set with the CurrentDateTime, and the status will be set to running. Then you can run a Microflow Timer (appstore widget to trigger a refresh every second if the status is running) to refresh the page to show it running. In the same entity you can have attributes: hoursBetween, minutesBetween, secondsBetween based on what you want to show on the screen with the time.

With this logic you can also calculate paused time if you want the timer to be paused.

answered