You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently have an issue when fetching events by starttime and endtime.
23:00 00:00 01:00
<----------------------------------------------------------------------
| event start event end |
If we have a case like this and we have an event which starts before 00:00 and ends after 00:00, if we query with startime=the_second_day we will not get the event even though it is within the second day.
Currently we are checking the datetimes like this
if event.starttime >= starttime and event.starttime <= endtime:
return event
What we actually should do when fetching events with a starttime and endtime
if event.endtime >= starttime and event.starttime <= endtime:
return event
This would however require us to add a "endtime" field to save in every datastore.
At that point we could also remove the duration field since it's essentially endtime-starttime to save on db size.
TL;DR: Our datastorages cannot filter by starttime+duration to get the endtime, we need an actual endtime field instead of duration to be able to filter after endtime and fix a few quirks when having events in between two dates.
The text was updated successfully, but these errors were encountered:
There might be a way to do this for the SQLite datastore by either using a view or something else that computes endtime (and makes it queryable) from timestamp and duration. Will have to investigate, but might not even require a database migration, so that would be cool.
We currently have an issue when fetching events by starttime and endtime.
If we have a case like this and we have an event which starts before 00:00 and ends after 00:00, if we query with startime=the_second_day we will not get the event even though it is within the second day.
Currently we are checking the datetimes like this
What we actually should do when fetching events with a starttime and endtime
This would however require us to add a "endtime" field to save in every datastore.
At that point we could also remove the duration field since it's essentially endtime-starttime to save on db size.
TL;DR: Our datastorages cannot filter by starttime+duration to get the endtime, we need an actual endtime field instead of duration to be able to filter after endtime and fix a few quirks when having events in between two dates.
The text was updated successfully, but these errors were encountered: