date format not applied on review page

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

date format not applied on review page

mabu
Hi,

I want to have a custom format for the date input field. Therefore I set the property "oxf.xforms.format.input.date" to "[D01].[M01].[Y0001]".
This works in "new" and "edit" mode. It does not work if I navigate to the review page!?

Martin

Reply | Threaded
Open this post in threaded view
|

Re: date format not applied on review page

mabu
I found the problem.
I have to change the property "oxf.xforms.format.output.date" to "if (. castable as xs:date) then format-date(xs:date(.), '[D01].[M01].[Y0001]', xxf:lang(), (), ()) else ." then it works.
Why is by default the date input format differently from the ouput format?

Martin
Reply | Threaded
Open this post in threaded view
|

Re: date format not applied on review page

Alessandro  Vernet
Administrator
Hi Martin,

You're exactly right, it is the output format that is used on the review page. This is intentional, but come to think of it, somewhat unexpected. I've added an RFE to use the same format:

https://github.com/orbeon/orbeon-forms/issues/2546

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: date format not applied on review page

mabu
Hi Alex,

thanky you for thinking about it. My opinion is that it will be more intuitive if by default the format of an input field (after focus lost) is the same as on the review page.

Martin
Reply | Threaded
Open this post in threaded view
|

Re: date format not applied on review page

Alessandro  Vernet
Administrator
Martin, exactly, our thinking is perfectly inline. Now, we just have to do it! :)

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet