OutSystems.com
My Platform
Community
Support
Training
Training
Guided Paths
Build an App
Training Planner
Courses
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Downloads
Search in OutSystems
Log in
Sign Up
Community
›
Forge
›
Assets list
›
Elapsed Time
Team Nexllence
Created on 29 November 2021
Login to follow
Elapsed Time
Stable version
1.0.1
(Compatible with
OutSystems 11
)
Uploaded on
17 December 2021
by
Team Nexllence
Try now
Reactive
4.7
(6 ratings)
1 review
53
3
Overview
Reviews
Versions
Documentation
Support
Elapsed Time
Try now
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
Average rating
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