Control Duration fields (Whole Number field with a Format=Duration) to present in either Hours or Minutes

bsbrant 10 months ago updated by Andrew Ly 2 months ago 8

Currently, duration fields will present inconsistently in either minutes or fractions of hours. Screenshots below show how the same field with the same value is presented differently across different forms and views.

I have heard that the logic is to convert in hours as long as you use 15 minutes steps, but in my example that is clearly not the case. And even if it did, a consistent presentation regardless of the duration is desired. With Duration fields being used heavily in D365 Field Service, this is very confusing to users.

The ask here is to provide a control that would allow a global setting to either present in hours or minutes. Or possibly to have one control that presents in minutes and another that presents in hours.

Or an hours/minutes control, similar to the current date/time control. 


Was looking to try out some PCF creation and gave this a go.   Feedback is always appreciated, and if I have missed the requirement mark, please let me know... https://github.com/birketa/DurationControlV1

Hi, the repo you indicated is not correct, I check your github profile and found this one https://github.com/birketa/DurationControl but it's empty

Really good control idea. Perhaps also include days, weeks, months and years... Much needed as our customer doesn't understand why it is different in different places (and it is kind of ridiculous to have 3 years presented as 1095 days.

Sorry everyone, I did not realise the repository was still private.   I have opened it up for everyone: https://github.com/birketa/DurationControlV1

A quick glance at your code shows me a slight problem

Case "Days":

this._minuteValue = this._value*(60*25)

I think that should be 24 not 25.

Thank you Mr Ben Thompson, I have amended it.

Can this idea be considered closed now ?