Page 1 of 1

oxy_datePicker() and ISO dates

Posted: Tue Apr 28, 2015 12:47 pm
by friedemann_bach
Dear developers,

I make frequent use of oxy_datePicker() for inserting ISO dates. In most cases, the required date format is yyyy-MM-dd (like 1853-05-24), which works perfectly.

In some cases, it is neccessary to insert only the month of a year, or even only the year. According to the ISO standard, this would result in "1853-05" or just "1853". Is it possible to modify the datePicker in a way that it allows to select either year/month/day or year/month, or only year?

Re: oxy_datePicker() and ISO dates

Posted: Tue Apr 28, 2015 2:43 pm
by alex_jitianu
Hello,

Is there any aspect that decides which format will be used (like maybe an attribute on the element or a certain value for an attribute) or is it just that you sometimes don't know the whole date?
The date picker doesn't accept multiple formats. All you can do is disable the format validation by using the validateInput parameter:

Code: Select all

 oxy_datePicker(  
edit, "@attribute",
format, "yyyy-MM-dd",
validateInput, false,
columns, 16);
When you select a date from the pop-up widget it will be inserted in the format "yyyy-MM-dd" but using the editable text field you can insert dates in any format. To make up for the lost validation you could add a few Schematron checks that will ensure that the format is one of the accepted ones.

Best regards,
Alex