BootsFaces TypeError: minDate() Could not parse date parameter

3.9k Views Asked by At

I'm using a dateTimePicker with BootsFaces. Here I want to restrict the selection to upcomming days (so no days in the past)

I use bootsfaces version 1.3.0 and omnifaces version 1.7

Here is what I did:

<b:dateTimePicker value="startdate" required="true"
minDate="#{now}" colMd="one-fourth"
labelColMd="1" label="Start" format="DD-MM-YYYY" />

When I start the xhtml page I get: TypeError: minDate() Could not parse date parameter: Wed Oct 17 22:39:44 CEST 2018

I also tried to use a String to test if this is working. I added minDate="10-10-2018" and got the same Type Error with parameter: 10-10-2018

Has anyone an idea what I did wrong?

2

There are 2 best solutions below

2
TheSilent On BEST ANSWER

Okay I found the solution which is working for me.

When I add minDate="moment()"it is working.

0
Stephan Rauh On

Just for the record and to help you follow the current state of the art: We've opened a bug on the BootsFaces bug tracker. Also see the answer of @TheSilent. Until BootsFaces 1.4.0, you can use JavaScript. However, this approach might break when we implement the bugfix, so proceed with care and be aware of the (small) risk.