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

Start and End Dates Daypilot Scheduler coming as wrong

Asked by Avinash
2 years ago.

Hi,

I n our application using DayPilot Scheduler when select date range in schedule like in IST selected 10 AM for OnTimeRangeSelect event Start date and end date coming 11 hrs advance like 9PM and 9.15 PM but actual selected values as 10 AM only.

Please let me know how to solve this issue.

Comment posted by Dan Letecky [DayPilot]
2 years ago.

DayPilot works with an idealized timeline that is not dependent on the local time zone (see also http://api.daypilot.org/daypilot-date-class/). This means in most cases you will pretend that this idealized timeline is your timezone.

OnTimeRangeSelect should return the Start and End dates corresponding to the time header displayed on the client side.

Do you use ShowNonBusiness=false to hide non-business hours (http://doc.daypilot.org/scheduler/hiding-non-business-hours/)?

Answer posted by Avinash
2 years ago.

Hi Dan,

Initialise the DayPilot controls

@Html.DayPilotCalendar("dpc", new DayPilot.Web.Mvc.DayPilotCalendarConfig
{

BackendUrl = Url.Content("~/MyRequests/Backend"),
TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.JavaScript,
TimeRangeSelectedJavaScript = "timeSelected(start, end)",
EventHeaderHeight = 0,
HeaderDateFormat = "dd-MM-yyyy",
CellHeight = 20,
CellDuration = 15,
EventArrangement = ArrangementType.SideBySide,
EventBubble = "bubble",
HeightSpec= HeightSpec.Fixed,
Height = 320
})

I have selected the 8 AM in DayPilot scheduler but in function

Comment posted by Avinash
2 years ago.

Hi Dan,

Initialise the DayPilot controls

@Html.DayPilotCalendar("dpc", new DayPilot.Web.Mvc.DayPilotCalendarConfig
{

BackendUrl = Url.Content("~/MyRequests/Backend"),
TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.JavaScript,
TimeRangeSelectedJavaScript = "timeSelected(start, end)",
EventHeaderHeight = 0,
HeaderDateFormat = "dd-MM-yyyy",
CellHeight = 20,
CellDuration = 15,
EventArrangement = ArrangementType.SideBySide,
EventBubble = "bubble",
HeightSpec= HeightSpec.Fixed,
Height = 320
})

I have selected the 8 AM in DayPilot scheduler but in function it returns as

Start time:19.00 hr

End Time : 19.15 hr

function timeSelected(start, end) {

var lStart2 = new Date(Date.parse(start.d));

var endTime = new Date(Date.parse(end.d));
var startTime = lStart2;

even it taking local time zone it should return 8.00AM instead it is retruning 19.00 hr.

please let me know how can solve it.

i tried to upload snapshot not possible.

This question is more than 6 months old and has been closed. Please create a new question if you have anything to add.