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

146
Views
I'm having trouble with data in Datetime2 format while parsing data in array with Ajax

I want to select a row data group in the table based on the id coming to the upNews() method. Then I want to show some column values (like Id, Name, Date) on the alert screen after I split the data in the selected row. I am having trouble retrieving and/or parsing Datetime2 format data contained in the array. How can I run this with Ajax?

var selectedValue;

function upNews(pid) {
    var table = $('#kt_datatable').DataTable();
    selectedValue = table.data().filter(x => x.Id == pid)[0];
    $('#idd').val(selectedValue.Id);

    $('#nm').val(selectedValue.Name);

    /* I'm having trouble using the substring() method. */
    $('#dt').val(selectedValue.Date.text.substring(0,10));

    alert(selectedValue.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!