orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 220 forks source link

Configurable date format per field/form #5631

Open ebruchez opened 1 year ago

ebruchez commented 1 year ago

Following #5524/#5621, we should do something similar for date fields.

Here are the aspects of date format we need to be able to control, based on the formats we currently support:

We currently don't support (I think):

ebruchez commented 1 year ago
avernet commented 1 year ago

+1 from customer

ebruchez commented 3 weeks ago

For fr:time, we use oxf.xforms.xbl.fr.time.output-format, which also translates into form-level and control-level output-format parameters. This looks like [h01]:[m]:[s].

We'd like to introduce oxf.xforms.xbl.fr.date.output-format. Could we, as a first step, just do that? Instead of using:

property('xxf:format.input.date')

use:

(fr:component-param-value('output-format'), property('xxf:format.input.date'))[1]

This would give us configurability by properties/form/control. Currently supported formats (from the doc):

Format Example Description
[M]/[D]/[Y] 11/5/2023 also called "North American format"
[D]/[M]/[Y] 5/11/2023 also called "European format"
[D].[M].[Y] 5.11.2023 variation with dot separator
[D]-[M]-[Y] 5-11-2023 variation with dash separator
[M01]/[D01]/[Y] 11/05/2023 force two digits for months and days
[Y]-[M01]-[D01] 2023-11-05 ISO format

It seems that this would work.

ebruchez commented 3 weeks ago
ebruchez commented 2 weeks ago

What else do we need to do?

ebruchez commented 1 week ago

This should also address #4794.