Computing time using Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2023 06:28 PM
We have a form on the portal where the user adds the time spent for a week. When computing the hours spent for the week, the total hours field is ignoring the zero that precedes the final value. For an example instead of displaying 3 hours and 3 mins as 3:03 , the final value is displayed as 3:3 . This is occurring only when there is a zero preceding the minutes .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2023 06:56 PM
Hi, without any details of your code the community can only guess at the underlying issue. I would suspect that the time is returned as a numeric value in your calculations and so the leading does not exist? Depending on your configuration you could stringify and thensubstring out the minutes value, check it's length, add 0 if required and the concatenate or replace() the substring with the 'new' value.