Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

104
Visualizações
DateRangePicker onChange need to call action in stimulus js

Iam using daterange picker plugin with stimulus js. Everything works fine, the issue is I have to call change function whenever I change the date in the date picker, but I can't able to call the action function (this.action) in stimulus js. Since stimulus js function can't able to access inside the onchange of the date picker.

$('input[name="daterange"]').daterangepicker({
        opens: 'left',
        startDate: start,
        endDate: end,
        ranges: {
                'Today': [moment(), moment()],
                'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                'Last 7 Days': [moment().subtract(6, 'days'), moment()],
                'Last 30 Days': [moment().subtract(29, 'days'), moment()],
                'This Month': [moment().startOf('month'), moment().endOf('month')],
                'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
              },
        maxDate:parseInt(moment().subtract(30, 'days'), moment()),
        locale: {
          format: 'MMM DD, YYYY '
        },
      }).on('apply.daterangepicker', function(e, picker) {
        this.startDate= moment($("input[name='daterange']").data('daterangepicker').startDate._d).format('YYYY-MM-DD');
        this.endDate=moment($("input[name='daterange']").data('daterangepicker').endDate._d).format('YYYY-MM-DD');
        this.onDateChange()//throws error

      });
onDateChange(){
alert("date")
}
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda