the order columns datetime in iphone don't works, but in android or pc is fine

the order columns datetime in iphone don't works, but in android or pc is fine

jjcfidalgo@gmail.comjjcfidalgo@gmail.com Posts: 11Questions: 8Answers: 0

in asp.net project i use datatables
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs5/dt-1.11.5/af-2.3.7/b-2.2.2/b-colvis-2.2.2/date-1.1.2/fc-4.0.2/fh-3.2.2/sc-2.0.5/sl-1.3.4/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs5/dt-1.11.5/af-2.3.7/b-2.2.2/b-colvis-2.2.2/date-1.1.2/fc-4.0.2/fh-3.2.2/sc-2.0.5/sl-1.3.4/datatables.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-daterangepicker/3.0.0/moment.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.11.5/sorting/datetime-moment.js"></script> 
$.fn.dataTable.moment('DD/MM/YYYY');
                              $('#<%= Grid.ClientID %>').dataTable(
                                  {
                                      "columns": [
                                          { "width": "10%" },
                                          { "width": "20%" },
                                          { "width": "10%" },
                                          { "width": "3%" },
                                          { "width": "3%" },
                                          { "width": "3%" },
                                          null
                                      ],
                                      "scrollX": true,
                                      responsive: true,
                                      "order": [[2, "desc"], [3, "desc"]]

                                  }

                              );


                              var table = $('#<%= Grid.ClientID %>').dataTable();

works fine using chrome in the android and pc but in iphone the ordering does not appear the same

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • jjcfidalgo@gmail.comjjcfidalgo@gmail.com Posts: 11Questions: 8Answers: 0
    edited April 2022

    The code works fine in android and pc using chrome or firefox, the problem is in IOS
    i tested in codepen i don't have problems.
    I see in safari don't works.

  • kthorngrenkthorngren Posts: 21,318Questions: 26Answers: 4,948

    Date sorting in Safari on an iphone seems to work with this example. We will need to see the problem, might be caused by something in your data, to help debug. Please provide a link to your page or build a simple test case with an example of your data that shows the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.