DateTimeRangeValidator gives false failure if server specifies timezone
attribute or timezone specified in trinidad-config.xml
------------------------------------------------------------------------------------------------------------------------------
Key: TRINIDAD-1967
URL: https://issues.apache.org/jira/browse/TRINIDAD-1967
Project: MyFaces Trinidad
Issue Type: Bug
Components: Components
Affects Versions: 1.2.13-core
Reporter: Yee-Wah Lee
This is a regression caused by Trinidad-1920. In that fix, an ISO-Date format
was used to create minISO/maxISO strings on the validator so the min/maxDate
could be sent down without loss of information. However the DateFormat was not
created with the timezone of the component converter, so it would send down
strings that specified different values causing false validation.
1. Modify the following example in trinidad-demo/clientConvert.jspx and run it
(this example uses Europe/Stockholm timezone, any TZ different from server JDK
timezone will suffice).
<tr:inputText id="mdf5" value="#{date.date2}"
label="date converter and a validator that
sets a maximum date of tonight">
<f:facet name="help">
<tr:outputText value="examples of values that will fail
validation: any date later than tonight 11:59 PM"/>
</f:facet>
<tr:convertDateTime type="both" timezone="Europe/Stockholm"/>
<tr:validateDateTimeRange
maximum="#{date.tonightNearMidnight}"/>
</tr:inputText>
2. In the input box, type in the max (tonight 11:59pm),e.g. 12/2/2010 11:59pm
and Submit.
3. Get an error about failing validation although it is within bounds.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.