<!DOCTYPE html>
<html>
<head>
    <link href="https://cdn.datatables.net/v/dt/jq-3.7.0/dt-2.0.0/datatables.min.css" rel="stylesheet">
    <script src="https://cdn.datatables.net/v/dt/jq-3.7.0/dt-2.0.0/datatables.js"></script>
    <style>
        table,
        td {
            border: solid black 1px;
        }
    </style>
</head>
<table id="datatable">
    <thead>
        <tr>
            <th>dates</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>2024-02-23T21:10:09.802278-05:00</td>
        </tr>
        <tr>
            <td id="target">2023-02-23T21:10:09.802278-05:00</td>
        </tr>
    </tbody>
</table>
<script>
    const dt = new DataTable("#datatable", {
        columns: [{
            data: "dates", render: function (data, type, row, meta) {
                if (type === 'display') {
                    return data.substring(0, data.indexOf('T'));
                }
                return data;
            }
        }]
    });
    td.innerHTML = "2024-02-23T21:10:09.802278-05:00";
    dt.invalidate().draw();
</script>
</html>
 
body {
  font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #fff;
}
w
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers