Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #45 - training queue waiting times #46

Conversation

xkeels
Copy link
Contributor

@xkeels xkeels commented Apr 17, 2024

Fixes #45. Behaviour was caused by relativeTime function returning "Unknown" if the number of days was greater than the maximum (30 days). This PR sets the maximum to Infinity. Having the function return "weeks", "months" or "years" seems less helpful for list tracking purposes.

@xkeels xkeels self-assigned this Apr 17, 2024
@xkeels xkeels requested a review from a team as a code owner April 17, 2024 18:51
Copy link
Collaborator

@c0repwn3r c0repwn3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this up to days, months, and years? I feel like that will be more versatile than stalling out at days.

@xkeels
Copy link
Contributor Author

xkeels commented Apr 29, 2024

I think for the purposes of the training queue, maxing out at days is more helpful, as waiting lists in some divisions can last over a year. For ATC staff trying to see how quickly a waiting list is moving, seeing several students waiting for "1 year" isn't particularly useful, whereas seeing the exact number of days allows this kind of analysis without needing to export data from Hayya's database.

I have added a new parameter to the relativeTime function which allows specification of a maximum unit, so allows flexibility where the function is used in other areas. I have maxed it out at "days" on the training queues and "hours" on the online users view.

@xkeels xkeels requested a review from c0repwn3r April 29, 2024 19:31
@c0repwn3r
Copy link
Collaborator

Ok.. that sounds good to me.

c0repwn3r
c0repwn3r previously approved these changes Apr 29, 2024
@c0repwn3r
Copy link
Collaborator

I’ll disable codestyle for this PR- give me a second

@xkeels xkeels force-pushed the keels/hay-121-training-queue-waiting-time-showing-as-unknown-when-greater branch from 3e96dd0 to c9b65d6 Compare May 10, 2024 20:13
@xkeels xkeels requested a review from c0repwn3r May 14, 2024 04:16
@c0repwn3r c0repwn3r merged commit 43d3e40 into main May 21, 2024
3 checks passed
@c0repwn3r c0repwn3r deleted the keels/hay-121-training-queue-waiting-time-showing-as-unknown-when-greater branch May 21, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Training queue waiting time showing as "Unknown" when greater than 30 days
2 participants