Add option for display of "time" in addition to date

This commit is contained in:
Oliver 2022-02-28 19:14:20 +11:00
parent b00ae67d68
commit fd02f1b761
2 changed files with 6 additions and 2 deletions

View File

@ -42,7 +42,7 @@ function clearEvents(calendar) {
* The user-configured setting DATE_DISPLAY_FORMAT determines how the date should be displayed.
*/
function renderDate(date) {
function renderDate(date, options={}) {
if (!date) {
return null;
@ -50,6 +50,10 @@ function renderDate(date) {
var fmt = user_settings.DATE_DISPLAY_FORMAT || 'YYYY-MM-DD';
if (options.showTime) {
fmt += ' HH:mm';
}
var m = moment(date);
if (m.isValid()) {

View File

@ -2658,7 +2658,7 @@ function loadStockTrackingTable(table, options) {
title: '{% trans "Date" %}',
sortable: true,
formatter: function(value) {
return renderDate(value);
return renderDate(value, {showTime: true});
}
});