1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #11384: Correct current time display on script & report forms

This commit is contained in:
jeremystretch
2023-01-06 09:42:13 -05:00
parent b88fcb6625
commit 0669fda1fd
4 changed files with 14 additions and 3 deletions

View File

@ -1,8 +1,8 @@
from django import forms
from django.utils import timezone
from django.utils.translation import gettext as _
from utilities.forms import BootstrapMixin, DateTimePicker, SelectDurationWidget
from utilities.utils import local_now
__all__ = (
'ScriptForm',
@ -34,7 +34,7 @@ class ScriptForm(BootstrapMixin, forms.Form):
super().__init__(*args, **kwargs)
# Annotate the current system time for reference
now = timezone.now().strftime('%Y-%m-%d %H:%M:%S')
now = local_now().strftime('%Y-%m-%d %H:%M:%S')
self.fields['_schedule_at'].help_text += f' (current time: <strong>{now}</strong>)'
# Move _commit and _schedule_at to the end of the form