You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Veena K. Pandit (JIRA)" <de...@myfaces.apache.org> on 2008/03/03 19:16:50 UTC
[jira] Created: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
------------------------------------------------------------------
Key: TRINIDAD-985
URL: https://issues.apache.org/jira/browse/TRINIDAD-985
Project: MyFaces Trinidad
Issue Type: Bug
Components: Components
Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
Reporter: Veena K. Pandit
When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
date.jspx looks like this
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:tr="http://myfaces.apache.org/trinidad"
xmlns:trh="http://myfaces.apache.org/trinidad/html">
<jsp:directive.page contentType="text/html;charset=utf-8"/>
<f:view>
<tr:messages/>
<tr:document title="Date Component">
<tr:form>
<tr:panelHorizontalLayout>
<tr:inputDate id="date" autoSubmit="true"
value="#{myDateBacking.dateValue}"
label="Effective Date:">
<tr:convertDateTime pattern="yyyy-MM-dd"/>
<tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
maximum="#{myDateBacking.maxDate}"
messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
</tr:inputDate>
</tr:panelHorizontalLayout>
</tr:form>
</tr:document>
</f:view>
</jsp:root>
MyDateBacking.java looks like this:
package mil.osd.dmdc.deers.demo.backing;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
public class MyDateBacking {
private Date _dateValue;
private Date _minDate;
private Date _maxDate;
public MyDateBacking(){
_dateValue = new Date();
Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
_minDate = xmas.getTime();
Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
_maxDate = future.getTime();
}
public void setDateValue(Date dateValue) {
this._dateValue = dateValue;
}
public Date getDateValue() {
return _dateValue;
}
public void setMinDate(Date minDate) {
this._minDate = minDate;
}
public Date getMinDate() {
return _minDate;
}
public void setMaxDate(Date maxDate) {
this._maxDate = maxDate;
}
public Date getMaxDate() {
return _maxDate;
}
}
The example shows the maximum date is set to March 30,2008, but the calendar reflects
the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Veena K. Pandit (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577923#action_12577923 ]
Veena K. Pandit commented on TRINIDAD-985:
------------------------------------------
I am not sure what you are referring to;
"The user enters "3/30/08"; in my example i am just talking about the max date
set by the backing bean; I am not referring to the user setting anything;
My problem is that when the max date is set in the backing bean, the calendar
shows an allowed max date of March 29,2008 and all days after that - including
the 30th is disabled for selection
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Veena K. Pandit (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575796#action_12575796 ]
Veena K. Pandit commented on TRINIDAD-985:
------------------------------------------
I tried and it did not make any difference
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575139#action_12575139 ]
yeelee edited comment on TRINIDAD-985 at 3/6/08 2:57 PM:
--------------------------------------------------------------
1) This demo seems to work:
http://www.irian.at/trinidad-demo/faces/convertValidate/convertValidate.jspx
Look for the example with "min=2004-11-16 max=2004-12-16" , type 2004-12-16 and Submit without errors.
2) Strangely this demo fails, which does similar things:
http://www.irian.at/trinidad-demo/faces/convertValidate/clientConvert.jspx
Look for the inputDate with instruction "
examples of values that will fail validation: any date which is not in 2007".
And type in "12/31/2007", then Submit - error is returned on the server.
I initially thought this was related to https://issues.apache.org/jira/browse/TRINIDAD-61 but that fix seems to be active because the error message states the maximum should be "12-31-2007", it used to be "12-30-2007".
was (Author: yeelee):
1) This demo seems to work:
http://www.irian.at/trinidad-demo/faces/convertValidate/convertValidate.jspx
Look for the example with "min=2004-11-16 max=2004-12-16" , type 2004-12-16 and Submit without errors.
2) Strangely this demo fails, which does similar things:
http://www.irian.at/trinidad-demo/faces/convertValidate/clientConvert.jspx
Look for the inputDate with instruction "
examples of values that will fail validation: any date which is not in 2007".
And type in "12/31/2007", then Submit - error is returned on the server.
I initially thought this was related to https://issues.apache.org/jira/browse/TRINIDAD-61, but that fix seems to be active because the error message states the maximum should be "12-31-2007", it used to be "12-30-2007".
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Veena K. Pandit (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575321#action_12575321 ]
Veena K. Pandit commented on TRINIDAD-985:
------------------------------------------
how do i set the timezone to Daylight Savings(ET) what would the line look
like in trinidad-config.xml
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575198#action_12575198 ]
Yee-Wah Lee commented on TRINIDAD-985:
--------------------------------------
Strange. I cannot get the issue to reproduce on trinidad trunk, using both extremes for timezones in trinidad-config.xml.
This one for UTC+12
<time-zone>Pacific/Nauru</time-zone>
This one for UTC-11
<time-zone>Pacific/Pago_Pago</time-zone>
Veena, could you try the following:
i) Set the timezone parameter in your trinidad-config.xml
ii) In your backing bean, max out the time components, i.e.
future.set (Calendar.HOUR_OF_DAY, 23);
future.set (Calendar.MINUTE, 59);
future.set (Calendar.SECOND, 59);
future.set (Calendar.MILLISECOND, 999);
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Veena K. Pandit (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577183#action_12577183 ]
Veena K. Pandit commented on TRINIDAD-985:
------------------------------------------
Yes, I have tried; that works but the timezone doesn't work;
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577519#action_12577519 ]
Yee-Wah Lee commented on TRINIDAD-985:
--------------------------------------
Great, thanks for the confirmation. I can explain what you are seeing. It is to support a scenario very similar to yours, i.e.
- InputDate with value bound to a backing bean's Date object
- Child convertDateTime with the format pattern "mm/dd/yyyy" (or any pattern, just as long as time doesn't appear).
Suppose the original date value is "3/11/2008 12:00".
- It gets displayed as "3/11/2008" because of the converter pattern.
- When the user posts back the form, "3/11/2008" is sent back.
- The underlying implementation of the converter is to use a SimpleDateFormat with the pattern set to parse the String. By default, SimpleDateFormat defaults the hours/mins/seconds to 0. So, it constructs the Date for "3/11/2008 00:00" and saves that.
Now the user didn't touch the InputDate but the underlying value has changed. This seemed like data loss to users, so the code attempts to preserve the time portions by copying over the components that aren't displayed (hours/mins/seconds/milliseconds) from the previous value.
In your situation, this is happening:
- The validator creates a GregorianCalendar with March 30 2008 value. Constructor defaults the time values to 0, so the Date is created for "3/30/2008 00:00".
- The backing bean creates a Value using new Date(), which is the current date/time, e.g. 3/11/2008 HH:MM where HH:MM are the current hour/min values, usually non-zero.
- The user enters "3/30/08" and the string is posted back
- The converter creates "3/30/08 00:00" and copies the time values to get "3/30/2008 HH:MM"
- That value "3/30/2008 HH:MM" is then compared against the Validator's max of "3/30/2008 00:00" and found to be more than the maximum. Therefore, maximizing the time components will work.
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575155#action_12575155 ]
Andrew Robinson commented on TRINIDAD-985:
------------------------------------------
Demo works fine for me:
http://www.irian.at/trinidad-demo/faces/convertValidate/clientConvert.jspx
Value 12/31/2007 passed validation. Is this a time zone issue?
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575791#action_12575791 ]
Yee-Wah Lee commented on TRINIDAD-985:
--------------------------------------
Use the timezone attribute, with a valid timezone ID (from Java's timezone.getID()), e.g.
<time-zone>America/New_York</time-zone>
See:
http://myfaces.apache.org/trinidad/devguide/configuration.html
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575940#action_12575940 ]
Yee-Wah Lee commented on TRINIDAD-985:
--------------------------------------
I can reproduce the problem on clientConverter.jspx, but doubt it is related to the problem Veena sees. What I've found is definitely timezone related - that the converter uses _fillTimePortion(..) to adjust the value for timezone, but the validator does not use that code in creating the maxTime so the offsets created by the hours/minutes/seconds (which aren't displayed) will throw the comparison off. I will update the original issue TRINIDAD-61 with the findings.
Veena, could I confirm if you have tried the other suggestion, i.e. remove the timezone, and modify the code which generates #{myDateBacking.maxDate} to max out the time components.
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TRINIDAD-985) Maximum date on
is maximum date minus 1
Posted by "Yee-Wah Lee (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TRINIDAD-985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12575139#action_12575139 ]
Yee-Wah Lee commented on TRINIDAD-985:
--------------------------------------
1) This demo seems to work:
http://www.irian.at/trinidad-demo/faces/convertValidate/convertValidate.jspx
Look for the example with "min=2004-11-16 max=2004-12-16" , type 2004-12-16 and Submit without errors.
2) Strangely this demo fails, which does similar things:
http://www.irian.at/trinidad-demo/faces/convertValidate/clientConvert.jspx
Look for the inputDate with instruction "
examples of values that will fail validation: any date which is not in 2007".
And type in "12/31/2007", then Submit - error is returned on the server.
I initially thought this was related to https://issues.apache.org/jira/browse/TRINIDAD-61, but that fix seems to be active because the error message states the maximum should be "12-31-2007", it used to be "12-30-2007".
> Maximum date on <tr:validateDateTimeRange> is maximum date minus 1
> ------------------------------------------------------------------
>
> Key: TRINIDAD-985
> URL: https://issues.apache.org/jira/browse/TRINIDAD-985
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Environment: windows xp professional; IE 6.0; Myfaces 1.1.5;Trinidad 1.1.4
> Reporter: Veena K. Pandit
>
> When I set a maximum date in <tr:inputDate> associated with a <tr:validateDateTimeRange> date component, the date component reflects the maximum date to be maximum date minus 1
> date.jspx looks like this
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
> xmlns:f="http://java.sun.com/jsf/core"
> xmlns:tr="http://myfaces.apache.org/trinidad"
> xmlns:trh="http://myfaces.apache.org/trinidad/html">
> <jsp:directive.page contentType="text/html;charset=utf-8"/>
> <f:view>
> <tr:messages/>
> <tr:document title="Date Component">
> <tr:form>
> <tr:panelHorizontalLayout>
> <tr:inputDate id="date" autoSubmit="true"
> value="#{myDateBacking.dateValue}"
> label="Effective Date:">
> <tr:convertDateTime pattern="yyyy-MM-dd"/>
> <tr:validateDateTimeRange minimum="#{myDateBacking.minDate}"
> maximum="#{myDateBacking.maxDate}"
> messageDetailNotInRange="Date {0} in {1} does not fall within {2} : {3}"/>
> </tr:inputDate>
> </tr:panelHorizontalLayout>
> </tr:form>
> </tr:document>
> </f:view>
> </jsp:root>
> MyDateBacking.java looks like this:
> package mil.osd.dmdc.deers.demo.backing;
> import java.util.Calendar;
> import java.util.Date;
> import java.util.GregorianCalendar;
> public class MyDateBacking {
>
>
> private Date _dateValue;
> private Date _minDate;
> private Date _maxDate;
>
>
> public MyDateBacking(){
> _dateValue = new Date();
> Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
> _minDate = xmas.getTime();
> Calendar future = new GregorianCalendar(2008,Calendar.MARCH,30);
> _maxDate = future.getTime();
>
> }
> public void setDateValue(Date dateValue) {
> this._dateValue = dateValue;
> }
> public Date getDateValue() {
> return _dateValue;
> }
> public void setMinDate(Date minDate) {
> this._minDate = minDate;
> }
> public Date getMinDate() {
> return _minDate;
> }
> public void setMaxDate(Date maxDate) {
> this._maxDate = maxDate;
> }
> public Date getMaxDate() {
> return _maxDate;
> }
> }
> The example shows the maximum date is set to March 30,2008, but the calendar reflects
> the maximum date to be March 29, 2008
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.