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

Bug: The End Date Field in the Unavailability Page Submitting Incorrect Date #303

Open
Lukada-taiya opened this issue Feb 8, 2024 · 2 comments

Comments

@Lukada-taiya
Copy link
Contributor

Lukada-taiya commented Feb 8, 2024

Describe the bug
After testing the unavailability page of the admin app. I realized that when a date is selected for the date fields, eg,

Sat Feb 17 2024 00:00:00 GMT+0000

The time is always 00:00:00 GMT. This is desirable for the start date but for the end date it makes more sense for the time to be 23:59:00 GMT. (At the end of the day selected)
When a user selects an end date, the expectation is that the day of the end date be included in the unavailability window, but the system is currently not making the end day inclusive.

@dherbst
Copy link
Member

dherbst commented Feb 8, 2024

Thanks for pointing this out!

The unavailability dates are at midnight by design so we can put them on the Calendar and Schedule pages by using enddate.diff(startdate, 'day'). When I do this by changing the enddate to be just before midnight, it isn't a full day difference, and reports 0 so it doesn't end up on the calendar.

There's probably some more sophisticated logic we can use to put the sub-day durations on the calendar. If you'd like to take a look at what needs to happen to make this change take a look at https://github.com/ncosd/food-pantry-app/blob/main/web/admin/src/pages/SchedulePage.vue#L73-L81 to see where the vacation days are queried out.

@Lukada-taiya
Copy link
Contributor Author

Ok I will check it out.
This issue affects issue #203 I worked on. The program does not show a message when the user selects an unavailability end-date that is the same day as the end-date of a volunteer window he has signed up for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants