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

177
Views
Problema de formato de tiempo de ion-rangeSlider

Estoy tratando de obtener el valor de Current rangeSlider (que es el tiempo) pero da un número enorme, es decir, los valores de ida y vuelta son respectivamente: [1650478833060, 1650394800000]. No es un formato de UnixTime, lo intenté; Entonces, ¿alguien puede ayudarme a obtener el valor rangeSlider Exect? gracias

mi código HTML

 <input type="text" id="ion" name="example_name" value="" /></td> <button type="button" onclick="getRangeValue();"class="btn btn-secondary" style="width: 98%; ">Blanking</button>

código JavaScript

 $('#ion').ionRangeSlider({ grid: true, type: 'double', min: moment("000000", "hhmmss").valueOf(), max: moment("235959", "hhmmss").valueOf(), force_edges: true, drag_interval: true, step: 60, min_interval: 60, prettify: function(num) { return moment(num).format('HH:mm:ss'); } }); function getRangeValue() { var slider = $("#ion").data("ionRangeSlider"); // Get values var from = slider.result.from; var to = slider.result.to; console.log("values ", [to , from]); }

mi salida es [1650478833060, 1650394800000] He intentado formas de servicio como

 let seconds = Math.floor(milliseconds / 1000); let minutes = Math.floor(seconds / 60); let hours = Math.floor(minutes / 60); seconds = seconds % 60; minutes = minutes % 60; // 👇️ If you don't want to roll hours over, eg 24 to 00 // 👇️ comment (or remove) the line below // commenting next line gets you `24:00:00` instead of `00:00:00` // or `36:15:31` instead of `12:15:31`, etc. hours = hours % 24; return `${padTo2Digits(hours)}:${padTo2Digits(minutes)}:${padTo2Digits( seconds, )}`;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

en esta funcion

 function getRangeValue() { var slider = $("#ion").data("ionRangeSlider"); // Get values var from = slider.result.from; var to = slider.result.to; console.log("values ", [to , from]); }

slider.result valor de slider.result y tenía un valor de tiempo bonito, que es el tiempo exacto en el control deslizante. así que el código final fue.

 function getRangeValue() { var slider = $("#ion").data("ionRangeSlider"); console.log("slider : ", slider); // Get values var from = slider.result.from_pretty;// changed here var to = slider.result.to; console.log("Now ---- ", from); }
about 4 years ago · Juan Pablo Isaza Report
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!