DayPilot.Scheduler.onTimeRangeSelected

Declaration

onTimeRangeSelected(args)

Parameters

  • args.start
  • args.end
  • args.resource

Example

// event creating, api2
dp.onTimeRangeSelected = function (args) {
  var name = prompt("New event name:", "Event");
  dp.clearSelection();
  if (!name) return;
  var e = new DayPilot.Event({
      start: args.start,
      end: args.end,
      id: DayPilot.guid(),
      resource: args.resource,
      text: "Event"
  });
  dp.events.add(e);
  dp.message("Created");
};

See Also

api=1

See also DayPilot.Scheduler.api.

Declaration

onTimeRangeSelected(start, end, resource)

Parameters

  • start (DayPilot.Date) - start of the selected range
  • end (DayPilot.Date) - end of the selected range
  • resource (string) - id of the resource

Example

// event creating, api1
dp.onTimeRangeSelected = function (start, end, resource) {
  var name = prompt("New event name:", "Event");
  dp.clearSelection();
  if (!name) return;
  var e = new DayPilot.Event({
      start: start,
      end: end,
      id: DayPilot.guid(),
      resource: resource,
      text: "Event"
  });
  dp.events.add(e);
  dp.message("Created");
};

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java