Hi all,
I am still using Glide classic (build my app before they launched Apps and continued because the main use is the stopwatch component).
I am using CSS to hide the original buttons(PAUSE / START / STOP) and use costume buttons for START/RESET only.
I would like to use another button to PAUSE the stopwatch.
and then SUM the total time the user pressed START-PAUSE-RESUME-PAUSE and so on.
If I recall, when you start the stopwatch it records the start time. When you pause it, it clears the start time and records the duration that the stopwatch ran. If you resume the stopwatch, I think it keeps the duration but records the new start time and does some behind the scenes math to add the current duration to the previous recorded duration. Clicking on Stop will clear both the start time and the duration.
So are you saying that you want to keep track on the total time the stopwatch is running as well as the total time that it is paused? If so, that might get tricky. You would somehow need a button with an action that will somehow control the stopwatch as well as fill a second set of start date and duration columns. Iām not sure thatās even possible.
The native stopwatch buttons do that. If you read through my explanation of the process in my previous post, you will see that pausing the stopwatch clears the start time and sets the duration. If you start again, it will keep the duration but add the new start time. To calculate total time, you need to do the same thing subtract start time from Now, and add that duration to a running total duration. Might help to restore the native buttons and see how they set the values in the table when you press each button.
Thank you.
I watched how the stopwatch works and I managed to use it almost fully by costume buttons.
I manged to start /stop and pause the stopwatch.
I got stuck only on 1 thing:
I couldnāt SUM the DURATION and START after pause.
START is full date (d/m/y/ hh:mm/ss) and duration is just minutes:second (00:40 for example).
How can I calculate it?
Tried both date difference and Math columns and no success.
Thinking about this some more, I think all you need to do is write the start date to a separate column the first time you click on start. Then just use a math column to subtract that new column from Now. That will calculate duration regardless if your stopwatch is paused or not. Only clear and reset that second start time column when you need to start over.
Hi, I tried what you suggested.
I managed to get the PAUSE time and SUM it with the START TIME.
So when I hit the costume pause button, The stopwatch pauses as it should.
Then - > Set col values:
STOPWATCH START TIME: SUM start time(=Pause time+start time).
When I hit the custom resume button, it continues as I did not press the pause.
For example:
A. Costume start button:1. Set col values of current time : 1/25/2024, 4:39:02 PM
Set col values of current time in 2nd col.
B. Then I press the custom pause button: 1. Clear A1
2. Calculate the time A2 to NOW
For example: 00:50 Sec.
C. When I press custom resume button:
Set col value: B2 - > A1
and the stopwatch begins with 1/25/2024, 4:39:02 PM (Original time) instead of 1/25/2024, 4:41:20 PM (Calculated time = Pause time + A1)
When you resume you want to set the current time (now), not the saved time to A1. But you also was to set the duration that was calculated previously to the stopwatch duration column. The start time and duration will always change when you resume from pause. The only value that doesnāt change is the saved start time that you set only the first time you clicked on start.
Iām guessing youāll need some custom actions with conditions on your buttons to set and clear the appropriate values based on whether or not the start time and duration are filled or empty.