Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Home
Jobs
Ideas
Members
Mentorship
User Groups
Downloads
Platforms
OutSystems.com
My Platform
Community
Resources
Support
Search in OutSystems
Log in
Sign Up
Community
›
Forge
›
Assets list
›
Elapsed Time
Elapsed Time
Stable version
1.0.2
(Compatible with
OutSystems 11
)
Uploaded
on
27 April 2024
by
4.7
(6 ratings)
Overview
Reviews
Versions
Documentation
Support
Elapsed Time
Reviews
Sort by:
Newest
Newest
Oldest
Highest rating
Lowest rating
5 star
5
0
Reviews |
5
Ratings
4 star
0
0
Reviews |
0
Ratings
3 star
1
1
Review |
1
Rating
2 star
0
0
Reviews |
0
Ratings
1 star
0
0
Reviews |
0
Ratings
6
Ratings
4.7
1
Review
by
2023-10-27
in version 1.0.1
A good starting point, but the hours would not calculate anything over a day for me. It would just roll over since the code did not account for the date. I have fixed this for my purpose, and now I can show days when the hours gets >=24.
In the OnInitialize I revised the code to:
var endTime;
var timeDiff;
var seconds;
var minutes;
var hours;
elapsedTimeIntervalRef = setInterval(function() {
// Process current date-time
endTime = new Date();
timeDiff = endTime - $parameters.StartDateTime; // Get the time difference in milliseconds
// Calculate elapsed hours, minutes, and seconds
hours = Math.floor(timeDiff / 3600000); // 1 hour = 3600000 milliseconds
timeDiff %= 3600000;
minutes = Math.floor(timeDiff / 60000); // 1 minute = 60000 milliseconds
timeDiff %= 60000;
seconds = Math.floor(timeDiff / 1000); // 1 second = 1000 milliseconds
$actions.RefreshElapsedTime(hours, minutes, seconds);
}, 1000);
In the onReady I revised the code to:
var endTime;
var timeDiff;
var seconds;
var minutes;
var hours;
elapsedTimeIntervalRef = setInterval(function() {
// Process current date-time
endTime = new Date();
timeDiff = endTime - $parameters.StartDateTime; // Get the time difference in milliseconds
// Calculate elapsed hours, minutes, and seconds
hours = Math.floor(timeDiff / 3600000); // 1 hour = 3600000 milliseconds
timeDiff %= 3600000;
minutes = Math.floor(timeDiff / 60000); // 1 minute = 60000 milliseconds
timeDiff %= 60000;
seconds = Math.floor(timeDiff / 1000); // 1 second = 1000 milliseconds
$actions.RefreshElapsedTime(hours, minutes, seconds);
}, 1000);
Loading
Loading...