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> <script src="../bootstrap/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- nochmals bootstrap.css mit Erweiterungen vom Dashboard --> <!-- nochmals bootstrap.css mit Erweiterungen vom Dashboard -->
<link href="css/styles.css" rel="stylesheet" /> <link href="css/styles.css" rel="stylesheet" />
<!-- data Table: https://datatables.net/ --> <!-- data Table: https://datatables.net/ -->
<script src="../bootstrap/data-table/jquery.min.js"></script> <script src="../jquery/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="../bootstrap/data-table/dataTables.bootstrap5.min.css"> <link href="../bootstrap/data-table/datatables.min.css" rel="stylesheet"/>
</style> <script src="../bootstrap/data-table/datatables.min.js"></script>
<link rel="stylesheet" href="../bootstrap/data-table/rowReorder.dataTables.min.css"> <script type="text/javascript" src="../bootstrap/data-table/moment.mon.js"></script>
</style> <script type="text/javascript" src="../bootstrap/data-table/datetime-moment.js"></script>
<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>
<!-- icons in nav--> <!-- icons in nav-->
<script src="js/all.js" crossorigin="anonymous"></script> <script src="js/all.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="../bootstrap/node_modules/bootstrap-icons/font/bootstrap-icons.css"> <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 <!-- jQuery UI CSS
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
--> -->
@ -238,7 +235,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<!-- https://datatables.net/download/release --> <!-- 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> <thead>
<tr> <tr>
<th>Datum</th> <th>Datum</th>
@ -292,12 +289,20 @@
</div> </div>
</body> </body>
<script> <script>
$(document).ready(function(){ // 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
var table = new DataTable('#myTable', { $(document).ready(function () {
rowReorder: true, $.fn.dataTable.ext.errMode = 'throw';
$.fn.dataTable.moment('DD.MM.YYYY');
$('#tblDataTable').DataTable({
responsive: true,
fixedHeader: true,
pageLength: 10, pageLength: 10,
order: [[1, 'desc']], order: [[0, 'desc']],
columnDefs: [{ type: "date-euro", targets: 1 }], columnDefs: [{
target: 0, //index of column
//type: 'datetime-moment'
}],
language: { language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/de-DE.json', url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/de-DE.json',
search: "", search: "",