Skip to content

Commit b0c8d6b

Browse files
committed
fix handling of 12 PM
1 parent 609a3ff commit b0c8d6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

opening_hours/models/time.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def get_as_military_time(self):
144144
pass
145145

146146
elif self.is_pm():
147-
hours = hours + 12
147+
hours = (hours + 12) if hours <= 11 else 12
148148

149149
return Time(hours, self.minutes, time_type=TimeType.MILITARY)
150150

0 commit comments

Comments
 (0)