diff options
| author | Nick Pope <nick.pope@flightdataservices.com> | 2020-11-12 14:19:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-12 15:19:17 +0100 |
| commit | 0cbccaebebf671332669a4e54a5fa0ede062fdd9 (patch) | |
| tree | 2c84155664683b8c4b8966654f0a9970840be62b /django/utils/dateformat.py | |
| parent | 895f6e49925ed0ae4bb96dc4d3af17fdc9c4846e (diff) | |
Simplified TimeFormat.g().
Diffstat (limited to 'django/utils/dateformat.py')
| -rw-r--r-- | django/utils/dateformat.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py index c4d9d035e4..9bd05a437b 100644 --- a/django/utils/dateformat.py +++ b/django/utils/dateformat.py @@ -100,11 +100,7 @@ class TimeFormat(Formatter): def g(self): "Hour, 12-hour format without leading zeros; i.e. '1' to '12'" - if self.data.hour == 0: - return 12 - if self.data.hour > 12: - return self.data.hour - 12 - return self.data.hour + return self.data.hour % 12 or 12 def G(self): "Hour, 24-hour format without leading zeros; i.e. '0' to '23'" |
