diff --git a/changelog/60_UNRELEASED_2020-xx-xx.md b/changelog/60_UNRELEASED_2020-xx-xx.md
index 93c19f3f..b0f48071 100644
--- a/changelog/60_UNRELEASED_2020-xx-xx.md
+++ b/changelog/60_UNRELEASED_2020-xx-xx.md
@@ -163,6 +163,7 @@
- More `config.php` settings (see the section `Component configuration for Quagga2`) to tweak Quagga2 (this is the component used for device camera for barcode scanning) (thanks @andrelam)
- Some localization string fixes (thanks @duckfullstop)
- Better error pages
+- Fixed that numeric and date-time sorting of table columns did not work correctly
- Fixed that XSS / HTML injection was possible through some user input fields (low severity / not really a problem as this could not be abused unauthenticated)
- New translations: (thanks all the translators)
- Greek (demo available at https://el.demo.grocy.info)
diff --git a/public/viewjs/batteriesoverview.js b/public/viewjs/batteriesoverview.js
index f89ac36e..43843947 100644
--- a/public/viewjs/batteriesoverview.js
+++ b/public/viewjs/batteriesoverview.js
@@ -2,7 +2,9 @@
'order': [[2, 'desc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
- { 'searchable': false, "targets": 0 }
+ { 'searchable': false, "targets": 0 },
+ { "type": "html", "targets": 3 },
+ { "type": "html", "targets": 4 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#batteries-overview-table tbody').removeClass("d-none");
diff --git a/public/viewjs/choresoverview.js b/public/viewjs/choresoverview.js
index 98e87bc0..794c6d34 100644
--- a/public/viewjs/choresoverview.js
+++ b/public/viewjs/choresoverview.js
@@ -2,7 +2,10 @@
'order': [[2, 'desc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
- { 'searchable': false, "targets": 0 }
+ { 'searchable': false, "targets": 0 },
+ { "type": "html", "targets": 5 },
+ { "type": "html", "targets": 2 },
+ { "type": "html", "targets": 3 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#chores-overview-table tbody').removeClass("d-none");
diff --git a/public/viewjs/products.js b/public/viewjs/products.js
index d94b7ca4..b1de33ec 100644
--- a/public/viewjs/products.js
+++ b/public/viewjs/products.js
@@ -2,7 +2,8 @@
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
- { 'searchable': false, "targets": 0 }
+ { 'searchable': false, "targets": 0 },
+ { "type": "html-num-fmt", "targets": 3 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#products-table tbody').removeClass("d-none");
diff --git a/public/viewjs/recipes.js b/public/viewjs/recipes.js
index ee48b654..dfa49020 100644
--- a/public/viewjs/recipes.js
+++ b/public/viewjs/recipes.js
@@ -2,7 +2,8 @@
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
- { 'searchable': false, "targets": 0 }
+ { 'searchable': false, "targets": 0 },
+ { "type": "html-num-fmt", "targets": 2 },
].concat($.fn.dataTable.defaults.columnDefs),
select: {
style: 'single',
diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js
index 084b7438..31875067 100644
--- a/public/viewjs/shoppinglist.js
+++ b/public/viewjs/shoppinglist.js
@@ -6,7 +6,8 @@ var shoppingListTable = $('#shoppinglist-table').DataTable({
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 },
- { 'visible': false, 'targets': 3 }
+ { 'visible': false, 'targets': 3 },
+ { "type": "num", "targets": 2 }
].concat($.fn.dataTable.defaults.columnDefs),
'rowGroup': {
enable: true,
diff --git a/public/viewjs/stockoverview.js b/public/viewjs/stockoverview.js
index ba7f1e5b..8b42d340 100755
--- a/public/viewjs/stockoverview.js
+++ b/public/viewjs/stockoverview.js
@@ -10,7 +10,11 @@
{ 'visible': false, 'targets': 2 },
{ 'visible': false, 'targets': 4 },
{ 'visible': false, 'targets': 9 },
- { 'visible': false, 'targets': 10 }
+ { 'visible': false, 'targets': 10 },
+ { "type": "num", "targets": 3 },
+ { "type": "html-num-fmt", "targets": 9 },
+ { "type": "html-num-fmt", "targets": 10 },
+ { "type": "html", "targets": 5 }
].concat($.fn.dataTable.defaults.columnDefs)
});
diff --git a/public/viewjs/tasks.js b/public/viewjs/tasks.js
index 0f28445b..722bb22f 100644
--- a/public/viewjs/tasks.js
+++ b/public/viewjs/tasks.js
@@ -3,7 +3,8 @@
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 },
- { 'visible': false, 'targets': 3 }
+ { 'visible': false, 'targets': 3 },
+ { "type": "html", "targets": 2 }
].concat($.fn.dataTable.defaults.columnDefs),
'rowGroup': {
enable: true,
diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php
index 7f40cff9..6e03c80f 100644
--- a/views/shoppinglist.blade.php
+++ b/views/shoppinglist.blade.php
@@ -231,20 +231,20 @@
data-product-id="{{ $listItem->product_id }}">
@if(!empty($listItem->product_id)) {{ FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name }}
@endif{!! nl2br($listItem->note) !!}
-