mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	Add option for display of "time" in addition to date
This commit is contained in:
		| @@ -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()) { | ||||
|   | ||||
| @@ -2658,7 +2658,7 @@ function loadStockTrackingTable(table, options) { | ||||
|         title: '{% trans "Date" %}', | ||||
|         sortable: true, | ||||
|         formatter: function(value) { | ||||
|             return renderDate(value); | ||||
|             return renderDate(value, {showTime: true}); | ||||
|         } | ||||
|     }); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user