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

Setting up Start and End Date for Daypilot Scheduler

Asked by jhols
6 years ago.

Hello Sir/Madam

Good afternoon,

I used a trial version of your control which daypilot scheduler and is awesome..but something I notice and I cannot figure it out how to solve
Here’s my problem I’m try to bind my value from my database for the Start Date and End Date like for example start date: 1/1/2014, end date: 1/1/2015 but when I load the scheduler
It appear the whole year of the start date and end date does not appear..how can I solve this issue?

Here my code below for binding

p = DAL.DLStruct.GetStartEndDateProjectStructure(int.Parse(this.rdcboProject.SelectedValue));
this.DayPilotScheduler1.StartDate = p.fdDateStart;
this.DayPilotScheduler1.DataSource = new DLProjectStructure().PlotTaskSchedule01((DateTime)p.fdDateStart, (DateTime)p.fdDateEnd);
this.DayPilotScheduler1.DataStartField = "fdDateStart";
this.DayPilotScheduler1.DataEndField = "fdDateEnd";
this.DayPilotScheduler1.DataBind();

thanks

my email add:neo_bagsjol@hotmail.com

Answer posted by Dan Letecky [DayPilot]
6 years ago.

I'm not sure if that's what you are looking for but you can set the number of days visible using .Days property:

this.DayPilotScheduler1.Days = 365; 
Comment posted by jhols
6 years ago.

hello Dan

no luck on that codes..this is what i want to achieve i have a web form that the user is free to set the start date and end date now those values is save to the Database then i want to retrieve that Dates to plot on the scheduler for example 1/1/2014 to 3/2/2015..how can i achieve this?..please help

thanks

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

You need to calculate the difference between those two dates (in full days).

Then use the first date for .StartDate and the difference for .Days.

DateTime start = ...
DateTime end = ...

int days = Math.ceil((end - start).TotalDays);

Scheduler1.StartDate = start;
Scheduler1.Days = days;
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.