-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
When you clone an event with updates using event.clone({ start: badValue }), the updates skip validation. This means you can create events with invalid data.
File: core/events/Event.js
What happens
const event = new Event({ title: 'Meeting', start: new Date() });
const cloned = event.clone({ start: 'not-a-date' }); // No error, bad data gets throughHow to fix
Run the updates through normalizeEventData() before merging:
clone(updates = {}) {
const normalizedUpdates = updates ? Event.normalizeEventData(updates) : {};
return new Event({
...this.toJSON(),
...normalizedUpdates,
id: undefined
});
}This ensures all updates are validated just like when creating a new event.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working