Fixes: #17108 - Update isotime and isodate filters to be timezone-aware (#17267)

* Update isotime and isodate filters to be timezone-aware for display in templates (particularly Scripts)

* Handle naive datetimes gracefully
This commit is contained in:
bctiemann
2024-08-26 14:37:20 -04:00
committed by GitHub
parent dab27695b9
commit 1d2ea90fd4
3 changed files with 7 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ class ScriptForm(forms.Form):
super().__init__(*args, **kwargs)
# Annotate the current system time for reference
now = local_now().strftime('%Y-%m-%d %H:%M:%S')
now = local_now().strftime('%Y-%m-%d %H:%M:%S %Z')
self.fields['_schedule_at'].help_text += _(' (current time: <strong>{now}</strong>)').format(now=now)
# Remove scheduling fields if scheduling is disabled