From d7c37d9dd6556654dcfa9ec940c3f1af9d4d3c6e Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 13 Jan 2023 08:23:57 -0500 Subject: [PATCH] Fixes #11483: Apply configured formatting to custom date fields --- docs/release-notes/version-3.4.md | 1 + netbox/utilities/templates/builtins/customfield_value.html | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/release-notes/version-3.4.md b/docs/release-notes/version-3.4.md index f0ce62b92..f4be8190d 100644 --- a/docs/release-notes/version-3.4.md +++ b/docs/release-notes/version-3.4.md @@ -23,6 +23,7 @@ * [#11438](https://github.com/netbox-community/netbox/issues/11438) - Fix deletion of scheduled job using non-default queues * [#11444](https://github.com/netbox-community/netbox/issues/11444) - Adding/removing a device from a device bay should record a pre-change snapshot on the device bay * [#11467](https://github.com/netbox-community/netbox/issues/11467) - Correct count on interfaces tab when viewing a VC master device +* [#11483](https://github.com/netbox-community/netbox/issues/11483) - Apply configured formatting to custom date fields --- diff --git a/netbox/utilities/templates/builtins/customfield_value.html b/netbox/utilities/templates/builtins/customfield_value.html index ff93a5168..b3bccd716 100644 --- a/netbox/utilities/templates/builtins/customfield_value.html +++ b/netbox/utilities/templates/builtins/customfield_value.html @@ -1,3 +1,4 @@ +{% load helpers %} {% if customfield.type == 'integer' and value is not None %} {{ value }} {% elif customfield.type == 'longtext' and value %} @@ -6,6 +7,8 @@ {% checkmark value true="True" %} {% elif customfield.type == 'boolean' and value == False %} {% checkmark value false="False" %} +{% elif customfield.type == 'date' and value %} + {{ value|annotated_date }} {% elif customfield.type == 'url' and value %} {{ value|truncatechars:70 }} {% elif customfield.type == 'json' and value %}