Specifying a duration decider is very similar to specifying a relative date. However, a duration has no meaning until it is applied to a date. For example, a duration of one month differs depending on if it is currently February or March. A relative date is always applied to the current time at run time.
To add a duration decider
<component id="nameOfDurationTextbox" />
Any value not set is assumed to be 0.
<calculate binary-operation="shortest"> <first> <months> <component id="duration" /> </months> </first> <second> <calculate binary-operation="between-dates"> <first> <component id="starttime" /> </first> <second relative="false"> <years>2010</years> <months>8</months> </second> </calculate> </second> </calculate>
The user inputs an integer for duration and a date for "starttime". The duration is compared to the duration from the "starttime" component to September 1st. The chosen duration is the one that is shortest.
Related topics