Date Validation using Jdatechooser

Asked

Viewed 60 times

0

I’m trying to validate two dates in the following case:

I created a Jframe that receives two data fields using Jdatechooser, as shown below:

First field the user informs the shutdown date, second field the user informs the payment date.

Now enter the validation, after placing the second field, I have to do a validation between them, that the payment date can not be longer than 10 days from the date of shutdown.

I was trying to put this validation at the time the user chose the payment date.

I’m trying to do this validation however I’m not getting, I tried to buy using the following code below:

if (txtDataDes.getDate().before(txtDataPg.getDate())) {

Thanks for your help.

  • For coincidence, I’ve had a similar doubt and the answer can serve you as well. If you want something more specific, edit the question and provide a [mcve] so that it is possible to analyze your problem better.

  • I didn’t really understand it very well, but I’m already on time programming and I’m not thinking right, I’ll check your post tomorrow, as soon as I find a solution put the answer here. att.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.