Date formatting in pdf files

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

Date formatting in pdf files

wlau
Hi all,

In the file "properties-local.xml" I set date format as follows :
<property as="xs:string" name="oxf.xforms.format.output.date" value="[D01]/[M01]/[Y0001]"/>
<property as="xs:string" name="oxf.xforms.format.input.date" value="[D01]/[M01]/[Y0001]"/>

The result is : In the form, the format of date fields are well displayed as configured in "properties-local.xml" (for instance 07/02/2013) but when I generate the pdf file it has the following format : 2013-02-07+01:00.

Does someone know please how to force the date format displayed in the generated pdf files ?
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Date formatting in pdf files

Alessandro  Vernet
Administrator
Hi,

This is an old one, but for reference, the format for the output format (oxf.xforms.format.output.date) needs to be an XPath expression. More on this at:

http://wiki.orbeon.com/forms/doc/developer-guide/configuration-properties/configuration-properties-xforms

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

Re: Date formatting in pdf files

wlau
Hi,

This can may be help someone...
The solution is to add the following property in the file "properties-local.xml" :
<property as="xs:string" name="oxf.xforms.format.output.date" value="if (. castable as xs:date) then format-date(xs:date(.), '[D01]/[M01]/[Y0001]', 'fr', (), ()) else ."/> 

Regards,