Skip to content

event conflict detection and smart time validation system #42

@Niya2201

Description

@Niya2201

Is your feature request related to a problem? Please describe.

Currently, the calendar allows users to create events that overlap in time without any validation. This can result in double bookings and scheduling conflicts, reducing the reliability and practicality of the application.
For example, a user can create:
Event A: 2:00 PM – 4:00 PM
Event B: 3:00 PM – 5:00 PM
Even though these events overlap, the system does not prevent or warn the user. In real-world calendar systems, overlapping events are typically validated to avoid conflicts.

Describe the solution you'd like

I would like to implement an Event Conflict Detection & Smart Time Validation System.
The system should:
Validate event time ranges before saving a new event.
Fetch existing events for the selected date.
Detect time overlaps using proper comparison logic.
Prevent saving conflicting events OR display a clear warning message.
Allow valid back-to-back events (e.g., 2:00–4:00 and 4:00–6:00).
Handle edge cases such as:
Same start time
Same end time
Fully nested events
Events completely covering another event
The validation should ideally be handled at the backend level to ensure data integrity and prevent invalid entries.
Optionally, the system could suggest the next available time slot for better user experience.

Describe alternatives you've considered

Allowing overlapping events and simply displaying them stacked visually — but this does not prevent scheduling conflicts.
Adding frontend-only validation — but this can be bypassed and does not ensure reliable backend data integrity.
Backend-level validation ensures consistent and robust scheduling logic.

Additional context

The overlap detection can be implemented using a condition such as:
A conflict exists if:
newStart < existingEnd
AND newEnd > existingStart
This feature would improve real-world usability, enforce scheduling rules, and make the calendar system more production-ready.

Implementing this requires:

Time comparison logic
Event filtering by date
Edge case handling
Proper validation in event creation APIs

This enhancement strengthens the application's core functionality and reliability.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions