I am developing a system for hotel and in Reservation precise that the date of entrance is greater or equal than the one of the reservation, and the one of the exit is greater than the one of the entrance.
I made these conditions, but when I prove the date of reservation and the same date of entry I can not register.
I do not know what might be wrong with my code in my method.
Could someone help me ??
private boolean verificaData(Calendar dcDataReserva, JDateChooser dcDataEntrada, JDateChooser dcDataSaida){
Calendar Data_Reserva = Calendar.getInstance();
Calendar Data_Entrada = dcDataEntrada.getCalendar();
Calendar Data_Saida = dcDataSaida.getCalendar();
boolean data;
if(Data_Entrada.before(Data_Reserva) && (Data_Saida.before(Data_Entrada))){
data= false;
}else
if((Data_Entrada.after(Data_Reserva)) && (Data_Saida.after(Data_Entrada))){
data = true;
}else
if(Data_Reserva.equals(Data_Entrada)){
data = true;
}else{
data = false;
}
return data;
}