[
https://issues.apache.org/jira/browse/OFBIZ-3125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771926#action_12771926
]
Karim Rahimpur commented on OFBIZ-3125:
---------------------------------------
The lookup is an option but its not very comfortable: you still only see
milliseconds.
Imagine a production manager who has to check if tasks are performed in due
time, review 150 tasks daily and have your calculator ready to convert from
milliseconds to hours each time you take a look at a task ... it's just
impractical.
That's why we created the duration field, which is a view on the milliseconds
that are stored. The parameter is still the same - milliseconds - but your view
is expressed in *d *h *m ... and your input format is also that.
So with that, at least where we use it, there is no need for a special duration
data type. Also there would have to be quite a lot of changes made to
production and work effort if we wanted to introduce a duration type there.
> Add a duration field type to improve input and representation of durations:
> DurationField, allows to show and input *d *h *m *s *ms
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-3125
> URL: https://issues.apache.org/jira/browse/OFBIZ-3125
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Karim Rahimpur
> Priority: Minor
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Is there interest in having a field that can parse and display durations
> expressed like these?
> - 10d 5h 6m
> - 6m 45s
> - 1s 145ms
> If so, then I can provide that. We're using this to handle durations as
> humans are used to, instead of having to see and express them in
> milliseconds. E.g. durations used in production runs: an operator knows it
> took so many hours to complete a task but it's uncomfortable to have to
> convert that to milliseconds when you want to store that data.
> So if there is enough interest I could provide a patch that adds a
> DurationField which can be used in forms like shown in these examples:
> - A field that displays a duration in the *d *h *m *s *ms format - this is a
> substitute for <display/> in milliseconds:
> {code:xml}
> <field name="estimatedSetupMillis"
> title="${uiLabelMap.ManufacturingTaskEstimatedSetupMillis}">
> <duration disabled="true"/>
> </field>
> {code}
> - A field that allows to input a duration in the *d *h *m *s *ms format -
> this is a substitute for <text/> input in milliseconds:
> {code:xml}
> <field name="actualSetupMillis"
> title="${uiLabelMap.ManufacturingTaskActualSetupMillis}">
> <duration/>
> </field>
> {code}
> Comments are welcome.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.