InseeFr / Eno

Questionnaire generator
MIT License
13 stars 24 forks source link

Default VTL formula for max Date is using wrong functions #859

Open romaintailhurat opened 10 months ago

romaintailhurat commented 10 months ago

In Pogues, we can define a range for a Date type response domain. If the designer don't, some default values are used.

In this case, the DDI will be:

<r:Range>
     <r:MinimumValue included="true">1900-01-01</r:MinimumValue>
    <r:MaximumValue included="true">format-date(current-date(),'[Y0001]-[M01]-[D01]')</r:MaximumValue>
</r:Range>

Note that the VTL expression in the maximum value is using the functions format-date and current-date which are valid XPath functions but not valid VTL functions (there is a current_date in VTL but not a format_date).

Ideally, we should if possible replicate the existing mecanism (using the current date).

The target is probably to be able to give both dates and VTL formulas in the Pogues fields.

romaintailhurat commented 10 months ago

@AnneHuSKa to review the target objective for designers.

romaintailhurat commented 10 months ago

see also https://github.com/InseeFr/Bowie/issues/40