Skip to content

Commit 2f7b16e

Browse files
committed
Fix date/time formats for new version of django
This now has to live in a module and not just in settings.py, so duplicate it there (leave in settings.py as well in case some parts still use it)
1 parent a9fcb4a commit 2f7b16e

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

pgweb/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,16 @@
126126
]
127127

128128
# Default format for date/time (as it changes between machines)
129+
# Keep in sync with util/formats/en/formats.py
129130
DATETIME_FORMAT = "Y-m-d H:i:s"
130131
DATE_FORMAT = "Y-m-d"
132+
TIME_FORMAT = "H:i:s"
133+
134+
FORMAT_MODULE_PATH = "pgweb.util.formats"
135+
136+
137+
# Django now needs these settings in a module, so duplicate them in both the
138+
# module and in settings.py to be on the safe side.
131139

132140
# Configure recaptcha. Most details contain keys and are thus handled
133141
# in settings_local.py. Override NOCAPTCHA to actually use them.

pgweb/util/formats/__init__.py

Whitespace-only changes.

pgweb/util/formats/en/__init__.py

Whitespace-only changes.

pgweb/util/formats/en/formats.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Note! Keep in sync with settings.py!
2+
DATETIME_FORMAT = "Y-m-d H:i:s"
3+
DATE_FORMAT = "Y-m-d"
4+
TIME_FORMAT = "H:i:s"

0 commit comments

Comments
 (0)