Select two elements in each to get start and End of screen input

0

I have a page where I have a start and end date, and I need to create a validation where I can not create any records if the current time is between these two dates.

I have the current date already and I am able to validate with the end time, in the $ ('.host'). each.

Is there any way I can get the EndTime and Start time in the same each? Both have the class hour, but one with the class "HomeTime" and another with the "HourTime".

tks; >

I'm validating with Javascript as follows.

var horaAtual=  horas+':'+minutos; // obtenho a data atual

    var Inicio = null; 
    var aponta = true;

    $('.horaFim').each(function (){
        Fim = $(this).val();
        if(Fim > horaAtual){
             $('.horaFim').each(function (){
                Inicio = $(this).val();

                if(Inicio > horaAtual){
                    $('.possuiapontamento').show();
                    aponta = false;
                }

             })
        }            
    })


    if(aponta == true){            
        $.ajax({
                type      : 'post', 
                url       : 'clock.php', 
                dataType  : 'html',
                data: {hora: horaAtual, id: id, statusClock: statusClock},
                success: function( data ){       
                    diaSemana();                         
                }, 
                error: function(xhr) {alert('Erro ao passar variavel: ' + xhr.responseText);}
            });
    }
    
asked by anonymous 20.06.2017 / 21:29

0 answers