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:
@ -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
|
||||
|
Reference in New Issue
Block a user