Date formatting in Orbeon 3.7.1.

7 messages Options
Embed this post
Permalink
Emil

Date formatting in Orbeon 3.7.1.

Reply Threaded More More options
Print post
Permalink
Hi everybody,

I'm writing, because I have a problem with a date formatting in my Orbeon 3.7.1. I must have the following format in a date control: YYYY-MM-DD. Unfortunately, there are only 3 types of formatting available now ([M]/[D]/[Y]  or [D]/[M]/[Y] or [D].[M].[Y]). It wasn't an issue in Orbeon 3.6, because a date control was rendered as an OUTPUT with a calendar (not as an INPUT with a calendar) and more formats were available. My question is: can I change a date input format to YYYY-MM-DD, or can I change a rendering policy, so a date control is rendered as an output not an input (it's fine for me)?

Thanks in advance,

Emil
Erik Bruchez-3

Re: Date formatting in Orbeon 3.7.1.

Reply Threaded More More options
Print post
Permalink
Emil,

When an input control is bound to a type xs:date or xforms:date, this
is currently not possible: we format the date as you mention below.

You could still do this by NOT using the xs:date or xforms:date type,
and instead using a plain string, and validate with
xforms:bind/@constraint.

Better yet would be to support YYYY-MM-DD input. To do this, some
changes to both the JavaScript code and the Java code is necessary. It
wouldn't be too hard to do though. If you feel like trying, please let
us know and we can guide you!

-Erik

On Fri, Oct 30, 2009 at 4:32 AM, Emil <[hidden email]> wrote:

>
> Hi everybody,
>
> I'm writing, because I have a problem with a date formatting in my Orbeon
> 3.7.1. I must have the following format in a date control: YYYY-MM-DD.
> Unfortunately, there are only 3 types of formatting available now
> ([M]/[D]/[Y]  or [D]/[M]/[Y] or [D].[M].[Y]). It wasn't an issue in Orbeon
> 3.6, because a date control was rendered as an OUTPUT with a calendar (not
> as an INPUT with a calendar) and more formats were available. My question
> is: can I change a date input format to YYYY-MM-DD, or can I change a
> rendering policy, so a date control is rendered as an output not an input
> (it's fine for me)?
>
> Thanks in advance,
>
> Emil
> --
> View this message in context: http://n4.nabble.com/Date-formatting-in-Orbeon-3-7-1-tp278175p278175.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Emil

Re: Date formatting in Orbeon 3.7.1.

Reply Threaded More More options
Print post
Permalink
Erik,

Thank you for your reply. I would be grateful if you could give me some hints how to change this control into an input and add a calendar functionality.

Regards
Erik Bruchez-3 wrote:
Emil,

When an input control is bound to a type xs:date or xforms:date, this
is currently not possible: we format the date as you mention below.

You could still do this by NOT using the xs:date or xforms:date type,
and instead using a plain string, and validate with
xforms:bind/@constraint.

Better yet would be to support YYYY-MM-DD input. To do this, some
changes to both the JavaScript code and the Java code is necessary. It
wouldn't be too hard to do though. If you feel like trying, please let
us know and we can guide you!

-Erik

On Fri, Oct 30, 2009 at 4:32 AM, Emil <emil.hornung@comarch.pl> wrote:
>
> Hi everybody,
>
> I'm writing, because I have a problem with a date formatting in my Orbeon
> 3.7.1. I must have the following format in a date control: YYYY-MM-DD.
> Unfortunately, there are only 3 types of formatting available now
> ([M]/[D]/[Y]  or [D]/[M]/[Y] or [D].[M].[Y]). It wasn't an issue in Orbeon
> 3.6, because a date control was rendered as an OUTPUT with a calendar (not
> as an INPUT with a calendar) and more formats were available. My question
> is: can I change a date input format to YYYY-MM-DD, or can I change a
> rendering policy, so a date control is rendered as an output not an input
> (it's fine for me)?
>
> Thanks in advance,
>
> Emil
> --
> View this message in context: http://n4.nabble.com/Date-formatting-in-Orbeon-3-7-1-tp278175p278175.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Emil

Re: Date formatting in Orbeon 3.7.1.

Reply Threaded More More options
Print post
Permalink
Sorry, for my previous reply. It looks like I misunderstood you. Solution I prefer is to use xs:date type and to add ability to input YYYY-MM-DD format. So, I would be grateful if you could help me how to achieve this.

Best regards
Emil wrote:
Erik,

Thank you for your reply. I would be grateful if you could give me some hints how to change this control into an input and add a calendar functionality.

Regards
Erik Bruchez-3 wrote:
Emil,

When an input control is bound to a type xs:date or xforms:date, this
is currently not possible: we format the date as you mention below.

You could still do this by NOT using the xs:date or xforms:date type,
and instead using a plain string, and validate with
xforms:bind/@constraint.

Better yet would be to support YYYY-MM-DD input. To do this, some
changes to both the JavaScript code and the Java code is necessary. It
wouldn't be too hard to do though. If you feel like trying, please let
us know and we can guide you!

-Erik

On Fri, Oct 30, 2009 at 4:32 AM, Emil <emil.hornung@comarch.pl> wrote:
>
> Hi everybody,
>
> I'm writing, because I have a problem with a date formatting in my Orbeon
> 3.7.1. I must have the following format in a date control: YYYY-MM-DD.
> Unfortunately, there are only 3 types of formatting available now
> ([M]/[D]/[Y]  or [D]/[M]/[Y] or [D].[M].[Y]). It wasn't an issue in Orbeon
> 3.6, because a date control was rendered as an OUTPUT with a calendar (not
> as an INPUT with a calendar) and more formats were available. My question
> is: can I change a date input format to YYYY-MM-DD, or can I change a
> rendering policy, so a date control is rendered as an output not an input
> (it's fine for me)?
>
> Thanks in advance,
>
> Emil
> --
> View this message in context: http://n4.nabble.com/Date-formatting-in-Orbeon-3-7-1-tp278175p278175.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Alessandro Vernet-2

Re: Re: Date formatting in Orbeon 3.7.1.

Reply Threaded More More options
Print post
Permalink
Emil,

On Tue, Nov 3, 2009 at 3:22 AM, Emil <[hidden email]> wrote:
> Sorry, for my previous reply. It looks like I misunderstood you. Solution I
> prefer is to use xs:date type and to add ability to input YYYY-MM-DD format.
> So, I would be grateful if you could help me how to achieve this.

I think what follows should do the trick:

- Instead of: <xforms:bind type="xs:date">
- Write: <xforms:bind constraint=". castable as xs:date">

This way you will check that the user entered a date, but you won't
tell the XForms that the node is of type date, so it won't change its
"appearance" to have a date picker.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Emil

Re: Re: Date formatting in Orbeon 3.7.1.

Reply Threaded More More options
Print post
Permalink
Alex,

Thank you for your tip. Actually, I do want to have a date picker, so it's not a solution which satisfies me in 100% :)
Erik, could you provide me with some more info about the solution you were writing about. I would be grateful.

Best regards

Emil
Alessandro Vernet-2 wrote:
Emil,

On Tue, Nov 3, 2009 at 3:22 AM, Emil <emil.hornung@comarch.pl> wrote:
> Sorry, for my previous reply. It looks like I misunderstood you. Solution I
> prefer is to use xs:date type and to add ability to input YYYY-MM-DD format.
> So, I would be grateful if you could help me how to achieve this.

I think what follows should do the trick:

- Instead of: <xforms:bind type="xs:date">
- Write: <xforms:bind constraint=". castable as xs:date">

This way you will check that the user entered a date, but you won't
tell the XForms that the node is of type date, so it won't change its
"appearance" to have a date picker.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Alessandro Vernet-2

Re: Re: Re: Date formatting in Orbeon 3.7.1.

Reply Threaded More More options
Print post
Permalink
Emil,

On Tue, Nov 10, 2009 at 12:47 AM, Emil <[hidden email]> wrote:
> Thank you for your tip. Actually, I do want to have a date picker, so it's
> not a solution which satisfies me in 100% :)
> Erik, could you provide me with some more info about the solution you were
> writing about. I would be grateful.

* The property driving this is oxf.xforms.format.input.date, defined
in properties-xforms.xml. There you will want to put your format.
* The client-side and server-side code always communicate using the
ISO format. So you need to change the parsing / displaying code in
xforms.js (used when the user changes the value, or a new value is
received from the server) and in Java (used when generating the HTML).
* On the JavaScript side, this is in xforms.js, in ORBEON.util.DateTime.
* In the Java side, you might not have to change anything. I think the
code calls the format-date() with the picture you defined in
properties-xforms.js, so it might just work out of the box. Otherwise,
you can start by the class XFormsInputHandler which is where the HTML
generation starts.

To help with the changes to the JavaScript code, see:
http://wiki.orbeon.com/forms/doc/contributor-guide/javascript-development

You'll let us know how it goes!

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws