mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-05 06:46:25 -06:00
* Introduce the isodate(), isotime(), and isodatetime() template filters * Display the relative time on mouse hover * Render journal entry times in ISO 8601 format * Use ISO 8601 format when displaying dates & times in a table * Standardize the use of DateTimeColumn across all tables
This commit is contained in:
@@ -732,7 +732,7 @@ class JournalEntry(CustomFieldsMixin, CustomLinksMixin, TagsMixin, ExportTemplat
|
||||
|
||||
def __str__(self):
|
||||
created = timezone.localtime(self.created)
|
||||
return f"{date_format(created, format='SHORT_DATETIME_FORMAT')} ({self.get_kind_display()})"
|
||||
return f"{created.date().isoformat()} {created.time().isoformat(timespec='minutes')} ({self.get_kind_display()})"
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('extras:journalentry', args=[self.pk])
|
||||
|
||||
@@ -432,10 +432,10 @@ class ConfigTemplateTable(NetBoxTable):
|
||||
|
||||
|
||||
class ObjectChangeTable(NetBoxTable):
|
||||
time = tables.DateTimeColumn(
|
||||
time = columns.DateTimeColumn(
|
||||
verbose_name=_('Time'),
|
||||
linkify=True,
|
||||
format=settings.SHORT_DATETIME_FORMAT
|
||||
timespec='minutes',
|
||||
linkify=True
|
||||
)
|
||||
user_name = tables.Column(
|
||||
verbose_name=_('Username')
|
||||
@@ -475,10 +475,10 @@ class ObjectChangeTable(NetBoxTable):
|
||||
|
||||
|
||||
class JournalEntryTable(NetBoxTable):
|
||||
created = tables.DateTimeColumn(
|
||||
created = columns.DateTimeColumn(
|
||||
verbose_name=_('Created'),
|
||||
linkify=True,
|
||||
format=settings.SHORT_DATETIME_FORMAT
|
||||
timespec='minutes',
|
||||
linkify=True
|
||||
)
|
||||
assigned_object_type = columns.ContentTypeColumn(
|
||||
verbose_name=_('Object Type')
|
||||
|
||||
Reference in New Issue
Block a user