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

Caluculate time between dates for appt requests #113

Merged
merged 2 commits into from
Sep 26, 2023
Merged

Conversation

Amanda2900
Copy link
Collaborator

Description

I've added some functions to calculate how many hours and days have passed since an appointment was requested. This will display on the admin appointment popup and will only be seen on appointments before they have been scheduled.

Related Issue

closes #112

Acceptance Criteria

Add how many hours ago a request has been submitted and have that information appear on the admin appointment popup. Once one day has passed, it should change from tracking how many hours have passed to how many days. This information should not be available on scheduled appointments.

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
💯 Add tests
🔗 Update dependencies
📜 Docs

Updates

Before

Screen Shot 2023-09-20 at 4 38 10 PM

After

Screen Shot 2023-09-20 at 8 08 03 PM

Screen Shot 2023-09-20 at 8 08 31 PM

Testing Steps / QA Criteria

Login to admin and click on any requested appointment in the dashboard. The amount of hours or days since the appointment was requested (which is based on the difference between Today and the created_at date on the appointment) should be shown next to the status badges. This should not be available on scheduled appointments. Any brand new appointments made less than one hour ago should say 'Requested < 1 hour ago'.

@mentalcaries
Copy link
Contributor

mentalcaries commented Sep 21, 2023

@Amanda2900 this is looking great! I liked that you wrote your own functions, but you probably could have made it easier on yourself by using the formatDistanceToNow function from the date-fns library 😝😝😝.

Currently it doesn't show the 'requested since' time for scheduled or cancelled appointments. I'm wondering if that's something we should include?

Copy link
Collaborator

@5hraddha 5hraddha left a comment

Choose a reason for hiding this comment

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

Looks good @Amanda2900! Good job! I was wondering though, do you think it will be good to include this Request time status as one of the badges itself? I'm thinking, UI wise it'll be cleaner and logically, isn't that info about the appointment's status. What do you think?

@Amanda2900
Copy link
Collaborator Author

Amanda2900 commented Sep 21, 2023

@5hraddha That sounds like a good idea! I can try that and we can see what we think about it. @mentalcaries As per our chat, I am going to leave it only on the requested appointments for now and can always add it to the others in the future if we decide we want that.

@Amanda2900
Copy link
Collaborator Author

@5hraddha and @mentalcaries I have now made this into a status badge on the admin appt popout as Shraddha suggested. This PR is now ready for re-review :)

@5hraddha 5hraddha self-requested a review September 25, 2023 22:10
Copy link
Collaborator

@5hraddha 5hraddha left a comment

Choose a reason for hiding this comment

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

Looks good to me @Amanda2900 🚀

@Amanda2900 Amanda2900 merged commit 160852e into main Sep 26, 2023
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.

Add how long ago an appointment was requested on the appointment popup card
3 participants