Skip to content

Date format for custom field does not respect values in configuration.py #11077

@ghost

Description

NetBox version

v.3.3.8

Python version

3.8

Steps to Reproduce

I'm not sure if this is a bug or my own ignorance on where this field gets its formatting.

I have created a custom field with type 'date'.
In the netbox configuration.py I have adjusted the date/time formatting for short date format to m-d-Y.
When populating a date in the custom field, the short date format is still Y-m-d.

Date/time formatting.

DATE_FORMAT = 'N j, Y' # Dec 31, 2022
SHORT_DATE_FORMAT = 'm-d-Y' # 12-31-2022
TIME_FORMAT = 'g:i a' # 4:06 p.m.
SHORT_TIME_FORMAT = 'g:i:s a' # 4:06:32 p.m.
DATETIME_FORMAT = 'N j, Y g:i a' # Dec 31, 2022 4:06 p.m.
SHORT_DATETIME_FORMAT = 'm-d-Y g:i a' # 12-31-2022 4:06 p.m.

Original date/time format

#DATE_FORMAT = 'N j, Y' # Dec 31, 2022
#SHORT_DATE_FORMAT = 'Y-m-d' # 2022-12-31
#TIME_FORMAT = 'g:i a' # 4:06 p.m.
#SHORT_TIME_FORMAT = 'H:i:s' # 16:06:02
#DATETIME_FORMAT = 'N j, Y g:i a' # Dec 31, 2022 4:06 p.m.
#SHORT_DATETIME_FORMAT = 'Y-m-d H:i' # 2022-12-31 16:06

Expected Behavior

Expected behavior after changing
SHORT_DATE_FORMAT = 'Y-m-d' # 2022-12-31
to
SHORT_DATE_FORMAT = 'm-d-Y' # 12-31-2022

would be that the 'date' in the custom field would be displayed as m-d-Y.

Observed Behavior

Date displayed in the custom field is still Y-m-d.
1
2
3

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions