orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 221 forks source link

xxf:format-duration() extension function #1153

Open ebruchez opened 11 years ago

ebruchez commented 11 years ago

Signature could be:

xxf:format-duration($duration as xs:duration, $format as xs:string) as xs:string

The question becomes: what should the format string be? Possibilities:

Requirements:

Se also DurationFormatUtils.

ebruchez commented 11 years ago

Important thing: durations can depend on a context date, as months and years have different durations!

dmccreary commented 11 years ago

This would be a very useful function to have. Using binding rules to extract the months, days, hours etc. from the duration and present the results are making our forms complex.

Thanks for considering this feature.

ebruchez commented 10 years ago

example of expression to format a duration