Formatting Orbeon Date input fields

828 views Asked by At

I am trying to format an input field of the type xs:date in Orbeon. I have tried using the xxf:format attribute, but the datepicker can not understand the date when it has been modified.

The idea now was to change the javascript of Orbeon to use the xxf:unformat attribute to interpret the date and transform it back to ISO format. I've tried changing the data.js but for some reason none of the changes can be seen.

Am I changing the wrong file?

Edit

I figured out that the xforms.js has a function 'getCurrentValue' which is being as the changes I do there are visible. Now I just need to figure out who is the one that's calling the function.

Edit:

It is the Calendar who requests the value of the input when the user clicks on the symbol. This all happens at the client side, and the generated HTML does not have the format/unformat attributes. However I want to use their value. Can I make a request to Orbeon to get it? How?

1

There are 1 answers

7
avernet On

In case you're using an xf:input bound to a node of type xs:date, you can control the formatting of the date field with the oxf.xforms.format.input.date property. A few formats are supported, and if you want to add more, the best would be to follow the pattern currently used for the currently supported formats.

E.g.

[M]/[D]/[Y]
[Y]-[M01]-[D01]