IBM Support

IBM JWL/JSF DatePicker Calendar picks wrong date if year is under 1000

Troubleshooting


Problem

In Rational Application Developer (RAD) 8.0.4.2 JWL/JSF DatePicker Calendar picks wrong date if year is under 1000.

Symptom

Recreate using JWL/JSF DatePicker with DateConverter and pattern "yyyy/MM/dd"

<hx:convertDateTime pattern="yyyy/MM/dd" />

Examples:

1) Type 999 and click on date selector. Calendar will show April 0999, but when
you drag the mouse down within the calendar it becomes August 9992.
April was the current month






2) Another example. Type 999/01 and click on date selector. Calendar will show January 9990, but
when you drag the mouse down within the calendar it becomes October 9990


Using DatePicker with any year under 1000 is unpredictable as to what year shows up when selecting a Month and Date.

Cause

Limitation

Environment

Microsoft Windows 7, RAD 8.0.4.2 with JWL v3_1_14.


ExampleFacesJSP.jsp:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%-- jsf:pagecode language="java" location="/src/pagecode/ExampleFacesJSP.java" --%><%-- /jsf:pagecode --%><%@page
language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsf/core&quot; prefix="f"%>
<%@taglib uri="http://www.ibm.com/jsf/html_extended&quot; prefix="hx"%>
<%@taglib uri="http://java.sun.com/jsf/html&quot; prefix="h"%>
<html>
<head>
<title>MyFacesJSP</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" title="Style"
href="theme/stylesheet.css">
</head>
<f:view>
<body><hx:scriptCollector id="scriptCollector1">
<h:form styleClass="form" id="form1">
<table border="1">
<tbody>
<tr>
<td>Date Picker:</td>
<td><h:inputText styleClass="inputText" id="text1">
<hx:convertDateTime pattern="yyyy/MM/dd" />
<hx:inputHelperDatePicker id="datePicker1" />
</h:inputText></td>
</tr>
</tbody>
</table>
</h:form>
</hx:scriptCollector></body>
</f:view>
</html>

Resolving The Problem

This is a limitation of the component.
There have not been practical business reasons to support dates with the year less than 1000.

Users can submit a product enhancement/feature request (RFE) using:
IBM RFE Community

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Web Development","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.5.1;8.5;8.0.4.2;8.0.4.1;8.0.4;8.0.3;8.0.2;8.0.1;8.0;7.5.5.5;7.5.5.4;7.5.5.3;7.5.5.2;7.5.5.1;7.5.5;7.5.4;7.5.3;7.5.2;7.5.1;7.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21634808