kb-dev-lab / UKit

Ukit, a companion app for student of University of Bordeaux
https://ukit-bordeaux.fr/
Apache License 2.0
14 stars 4 forks source link

Fix day schedule displaying the next day's classes #40

Closed thclmnt closed 3 years ago

thclmnt commented 3 years ago

This aim to fix issue #39

AamuLumi commented 3 years ago

Hey,

I understood the fix, but it's not an adequate solution. We should instead set the startDate to the beginning of the day and the endDate to the beginning of the next day. Can you apply this by using moment().startOf('day') call on these 2 variables ?

Thanks a lot. :)

thclmnt commented 3 years ago

I wasn't really clear in the issue #39 but the problem comes from API call which will always results in two days of classes data. (because we are now requesting a two day interval instead of one which resulted in issue #37) This PR is aiming to remove the next day data before being process and sent into the day view component. Changing startDate and endDate here will result on losing the time information on classes data.

I think my solution should be alright for what the problem is!