Search code examples
dateinputdatepickerorbeonxforms

DD-MM-YYYY date format possible for input in orbeon?


I use Orbeon Forms and i have a calendar input.

When i pick up a date, it shows me the date in american format: MM/DD/YYYY. For example i have 1/27/2015!

How can the input show the date in european format DD/MM/YYYY? Like 27/01/2015

I've tried without success:

<!-- Main instance -->
...
</StartOfWork>
...

<!-- Bindings -->
...
<xf:bind id="startOfWork-bind" ref="FormData/Payload/Project/Payment/StartOfWork"
                             name="startOfWork" type="xf:date"/>
...

...<fr:view>
...
<xf:input id="startOfWork-control" bind="startOfWork-bind" class="" date="[D]/[M]/[Y]">
        <xf:label ref="$form-resources/startOfWork/label"/>
        <xf:hint ref="$form-resources/startOfWork/hint"/>
        <xf:alert ref="$fr-resources/detail/labels/alert"/>
        </xf:input>
...</fr:view>
...

Solution

  • You can, by setting the oxf.xforms.format.input.date property to [D]/[M]/[Y], as in:

    <property as="xs:string"  
              name="oxf.xforms.format.input.date"  
              value="[D]/[M]/[Y]"/>
    

    And you can find more on other supported values in the documentation for that property.