search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Empty start or end date corrupts DB

Asked by Alex
1 month ago.

Our users manage regularly to create an event with empty start or end date. This results in an invalid entry in the DB.

  • an event with an empty start date is corrupting the scheduler completely. After a reload in the browser the whole calender is empty.
  • an event with an empty end date is NOT corrupting the scheduler. But an event is generated in the DB, but not displayed in the scheduler.

In both cases the input should be catched in daypilot-all.min.js an no event should be stored in the DB.

Answer posted by Dan Letecky [DayPilot]
1 month ago.

The current version works like this:

The Scheduler doesn't create any event by itself. If users select a time range, the Scheduler fires he onTimeRangeSelected event (https://api.daypilot.org/daypilot-scheduler-ontimerangeselected/) which you can use to create a new event and send it to the database. The start and end dates of the selection (args.start and args.end) are always provided.

If this event handler displays a form where users can modify the start and end date it's necessary to check the input to make sure it's not empty.

The Scheduler requires the "start" date to be present in data source items. If it isn't, it will throw an exception ("Event data item must specify 'start' property") which prevents the Scheduler from rendering. If the end date isn't provided, it's treated as the current time.

New Reply
This reply is
Your name (optional):