Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ocflib/lab/staff_hours.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ def position(uid):
def _parse_hour(hour):
"""
Converts a 2-element list of hours like ['11:00', '13:00'] to a string
in 12-hour time, like '11:00AM - 1:00PM'.
Needed for backwards compatibility with the old staff hours file.
in 12-hour time, like '11am–1pm'.
"""
return '{} - {}'.format(datetime.strptime(hour[0], '%H:%M').strftime('%-I:%M%p'),
datetime.strptime(hour[1], '%H:%M').strftime('%-I:%M%p'))
time = (datetime.strptime(hour[0], '%H:%M'), datetime.strptime(hour[1], '%H:%M'))
return (f'{time[0]:%-I:%M%P}–{time[1]:%-I:%M%P}'
if time[0].minute != 0 or time[1].minute != 0
else f'{time[0]:%-I%P}–{time[1]:%-I%P}')


def _remove_middle_names(name):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
with open('.version') as f:
VERSION = f.readline().strip()
except IOError:
VERSION = '2025.10.16'
VERSION = '2026.5.4'

setup(
name='ocflib',
Expand Down
Loading