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

162
Views
How can .val return a localtime value?

In the val docs written this description:

.val() Returns: String, Number, Array

I tried to get a Time, but it seems to return string only, Is there any method to parse the val value to localtime?

$.get(href,function(exam,status){
            $('#startTimeEdit').val(exam.startTime);
            $('#endTimeEdit').val(exam.endTime);
        });

Overall, my question will be how to parse the val value to LocalTime datatype?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you're given a stringified date + time in these values, then this will work:

$.get(href, (exam, status) => {
    const start = new Date($('#startTimeEdit').val(exam.startTime)).toLocaleTimeString()
    const end = new Date($('#endTimeEdit').val(exam.endTime)).toLocaleTimeString()
    return { start, end }

});
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!