I have an application where the employee can make vacation requests. Well my problem comes when I want to choose back dates. Let me explain myself better, I have this if
:
if($fecha_inicio < $fecha_solicitud){
echo "Start date can not be less than today's date";
}
This if
says that if the date on which you want to start the vacation is less than the date of the request (today), you should miss an error.
Each date is of type DateTime
. With this if
it makes me perfect that they can not catch days behind. The problem comes with the time, for example:
If when the user makes the request is 12:00 today, and the user, because he is sick, takes the holiday today. The user must be taken today from 8:00 in the morning. That's when I get the error, the time is less and I do not want to take into account the time, only the day. Any help?