Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
DateRangePicker onChange necesita llamar a la acción en estímulo js

Estoy usando el complemento selector de rango de fecha con estímulo js. Todo funciona bien, el problema es que tengo que llamar a la función de cambio cada vez que cambio la fecha en el selector de fecha, pero no puedo llamar a la función de acción (this.action) en estímulo js. Dado que la función de estímulo js no puede acceder dentro del cambio del selector de fecha.

 $('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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!