Tengo 3 turnos de trabajo y necesito crear un script que le permita al usuario (empleado) saber si le dan turno de noche o no. Para esto necesito:
1.) Verifique si el empleado tiene que trabajar entre las 10 p. m. y las 7 a. m.
1.1) Informar al empleado cuántas horas (y minutos) tiene que trabajar y qué horas se incluyen en ese período.
2.) Verifique si el empleado trabaja entre 7 y 11 horas por día.
2.1) Marque si alguno de los puntos 2.) cae entre la medianoche y las 5 a. m.
2.2) Igual que 1.1)
¿Alguien puede ayudarme por favor?
<div id="shifts"> <input type="time" id="shift_1_start"> <input type="time" id="shift_1_end"> <p id="shift_1_alert" style="display: none;"> Shift 1 has 'x' hours and 'y' minutes in total. <br /><br /> Shift 1 has 'x' hours and 'y' minutes between 12 AM and 5 AM. <br /><br /> Shift 1 has 'x' hours and 'y' minutes between 10 PM and 7 AM. </p> <input type="time" id="shift_2_start"> <input type="time" id="shift_2_end"> <p id="shift_2_alert" style="display: none;"> Shift 2 has 'x' hours and 'y' minutes in total. <br /><br /> Shift 2 has 'x' hours and 'y' minutes between 12 AM and 5 AM. <br /><br /> Shift 2 has 'x' hours and 'y' minutes between 10 PM and 7 AM. </p> <input type="time" id="shift_3_start"> <input type="time" id="shift_3_end"> <p id="shift_3_alert" style="display: none;"> Shift 3 has 'x' hours and 'y' minutes in total. <br /><br /> Shift 3 has 'x' hours and 'y' minutes between 12 AM and 5 AM. <br /><br /> Shift 3 has 'x' hours and 'y' minutes between 10 PM and 7 AM. </p> </div> <p id="shifts_alert" style="display: none;"> Shifts have 'x' hours and 'y' minutes in total. <br /><br /> Shifts have 'x' hours and 'y' minutes between 12 AM and 5 AM. <br /><br /> Shifts have 'x' hours and 'y' minutes between 10 PM and 7 AM. </p>