primefaces: Calendar: Value could be either String or java.util.Date (Regression 6.2 > 7.0.RC3)
1) Environment
- PrimeFaces version:
- Does it work on the newest released PrimeFaces version? Version? yes
- Does it work on the newest sources in GitHub? (Build by source -> https://github.com/primefaces/primefaces/wiki/Building-From-Source) no
- Application server + version: Jetty
- Affected browsers:
2) Expected behavior
On click first calendar should not throw exception. maxdate/mindate
3) Actual behavior
Exception thrown
4) Steps to reproduce
Click first calendar
5) Sample
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>PrimeFaces Test</title>
</h:head>
<h:body>
<h:form>
<p:calendar maxdate="today">
<p:ajax event="dateSelect" update="@form" />
</p:calendar>
</h:form>
</h:body>
</html>
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (24 by maintainers)
I am currently doing it…
Ok, so i would just do validation for “instanceof Date” for now and note it somewhere.
Okay, if you want to support those, more effort must be spend to translate those formats into java. @tandraschko In this case I’d recommend to revert input validation.
Btw, this should have been documented somehow.
Not sure, cannot find it here. Also, since the utility method is used by @mertsincan’ new
datepicker
as well, we must pay extra attention when trying to support JS-specific stuff here.