2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-12 07:54:14 +00:00

Pass dates displayed in front-end tables through the date formatter

This commit is contained in:
Oliver
2022-02-28 16:13:08 +11:00
parent c720c75b79
commit 040f1805e0
4 changed files with 39 additions and 10 deletions

View File

@ -1820,6 +1820,9 @@ function loadStockTable(table, options) {
col = {
field: 'stocktake_date',
title: '{% trans "Stocktake" %}',
formatter: function(value) {
return renderDate(value);
}
};
if (!options.params.ordering) {
@ -1833,6 +1836,9 @@ function loadStockTable(table, options) {
title: '{% trans "Expiry Date" %}',
visible: global_settings.STOCK_ENABLE_EXPIRY,
switchable: global_settings.STOCK_ENABLE_EXPIRY,
formatter: function(value) {
return renderDate(value);
}
};
if (!options.params.ordering) {
@ -1844,6 +1850,9 @@ function loadStockTable(table, options) {
col = {
field: 'updated',
title: '{% trans "Last Updated" %}',
formatter: function(value) {
return renderDate(value);
}
};
if (!options.params.ordering) {
@ -2649,14 +2658,7 @@ function loadStockTrackingTable(table, options) {
title: '{% trans "Date" %}',
sortable: true,
formatter: function(value) {
var m = moment(value);
if (m.isValid()) {
var html = m.format('dddd MMMM Do YYYY'); // + '<br>' + m.format('h:mm a');
return html;
}
return '<i>{% trans "Invalid date" %}</i>';
return renderDate(value);
}
});