Finanzen Sortierung Datum richtig

This commit is contained in:
aschwarz 2023-07-26 07:05:28 +02:00
parent 1d3ed789b5
commit 2d73a1b10b

View File

@ -13,21 +13,18 @@
<script src="../bootstrap/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- nochmals bootstrap.css mit Erweiterungen vom Dashboard -->
<link href="css/styles.css" rel="stylesheet" />
<!-- data Table: https://datatables.net/ -->
<script src="../bootstrap/data-table/jquery.min.js"></script>
<link rel="stylesheet" href="../bootstrap/data-table/dataTables.bootstrap5.min.css">
</style>
<link rel="stylesheet" href="../bootstrap/data-table/rowReorder.dataTables.min.css">
</style>
<script type="text/javascript" src="../bootstrap/data-table/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../bootstrap/data-table/dataTables.rowReorder.min.js"></script>
<script type="text/javascript" src="../bootstrap/data-table/dataTables.bootstrap5.min.js"></script>
<script type="text/javascript" src="../bootstrap/data-table/date-euro.js"></script>
<script src="../jquery/jquery-3.4.1.min.js"></script>
<link href="../bootstrap/data-table/datatables.min.css" rel="stylesheet"/>
<script src="../bootstrap/data-table/datatables.min.js"></script>
<script type="text/javascript" src="../bootstrap/data-table/moment.mon.js"></script>
<script type="text/javascript" src="../bootstrap/data-table/datetime-moment.js"></script>
<!-- icons in nav-->
<script src="js/all.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="../bootstrap/node_modules/bootstrap-icons/font/bootstrap-icons.css">
<script src="../jquery/jquery-3.4.1.min.js"></script>
<!-- jQuery UI CSS
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
-->
@ -238,7 +235,7 @@
</div>
<div class="card-body">
<!-- https://datatables.net/download/release -->
<table id="myTable" class="table table-striped table-bordered table-hover" >
<table id="tblDataTable" class="table table-striped table-hover table-bordered dataTable no-footer" cellpadding="0" border="0" role="grid" aria-describedby="tblDataTable_info">
<thead>
<tr>
<th>Datum</th>
@ -292,12 +289,20 @@
</div>
</body>
<script>
$(document).ready(function(){
var table = new DataTable('#myTable', {
rowReorder: true,
// Hinweise zur Sortierung nach Datum. <table Definition muss so übernommen werden. Keine Leerzeichen <td>datum</td>. Datumsfelder dürfen nicht leer sein und vom Format stimmig sein
$(document).ready(function () {
$.fn.dataTable.ext.errMode = 'throw';
$.fn.dataTable.moment('DD.MM.YYYY');
$('#tblDataTable').DataTable({
responsive: true,
fixedHeader: true,
pageLength: 10,
order: [[1, 'desc']],
columnDefs: [{ type: "date-euro", targets: 1 }],
order: [[0, 'desc']],
columnDefs: [{
target: 0, //index of column
//type: 'datetime-moment'
}],
language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/de-DE.json',
search: "",