After thinking round about two hours on it, i hope you guys can help me on this one.
I want to build is a calendar-like system where the user isn’t able to add an entry if another entry falls or crosses in the same .TimeOfDay.
So I want to compare two dates (DateTime) To be more specific: the date is just the same just different .TimeofDay
Example:
(Existing entry)
DateTime dateStart: 05/05/2021 17:00
DateTime dateEnd: 05/05/2021 18:00
(User wants to add this:)
DateTime compareStart: 05/05/2021 16:30
DateTime compareEnd: 05/05/2021 17:15
What i want to archieve is to compare if the compareStart + compareEnd crosses the dateStart and dateEnd in any possible way.
SideNote:
compareStart could be 05/05/2021 17:25 and compareEnd could be 05/05/2021 18:30 etc.
It should be only possible to add an entry if there isn’t any any that falls or crosses existing ones. I hope i’ve described my problem clear.
Any advises are welcome
thanks in advance!