tl-its-umich-edu / remote-office-hours-queue

Virtual queuing tool supporting Zoom video conferencing and/or in person meetings.
https://officehours.it.umich.edu/
Apache License 2.0
12 stars 28 forks source link

Add a new column to display how long user was in queue for #532

Closed jonespm closed 3 weeks ago

jonespm commented 3 months ago

It was suggested it would be nice to see how long the attendees have been waiting in the queue. The "Join Info" button has a date when they joined but it doesn't show on the main page and needs to be calculated I'm thinking something like this as a mockup but could be changed.

image

# Calculate the difference
time_difference = time2 - time1

# Extract days, hours, and minutes from the difference
days = time_difference.days
hours, remainder = divmod(time_difference.seconds, 3600)
minutes, _ = divmod(remainder, 60)

# Pluralization logic
def pluralize(value, unit):
    return f"{value} {unit}{'s' if value != 1 else ''}"

# Display the difference
days_str = pluralize(days, "day")
hours_str = pluralize(hours, "hour")
minutes_str = pluralize(minutes, "minute")

print(f"{days_str}<br>{hours_str}<br>{minutes_str}")
HemanginiShah commented 4 weeks ago

Lets go with this format: “23h 47m 2s”