Newbie question about using the DateTime method to set a schedule inside a Telerik calendar. I want to use the Telerik controls calendar to set a schedule for a music bands tour schedule.
I can't seem to get the desired results. Below is the code in my SampleAppointmentSource CS file. I thought that by setting the DateTime.Parse("5/19/2013") that then in all of the appointments when I use the AddDays(1) or AddDays(20) the appointemnts would follow the DateTime.Parse("5/19/2013") pattern but it doesn't. The appointments always use the current date and time (Now). When I add the days, the appointments aren't added to the Parsed date ("5/19/2013"), they are added to the current DateTime. Like the appointments are always referenced to the current system date.
I hope that wasn't to confusing....
What do I need to use to get the desired results?
Is it because of the DateTime.Now.AddDays(1) line? Should it not be DateTime.Now?
{
public class SampleAppointmentSource : AppointmentSource
{
public SampleAppointmentSource()
{
DateTime date = new DateTime();
date = DateTime.Parse("5/19/2013");
}
public override void FetchData(DateTime startDate, DateTime endDate)
{
this.AllAppointments.Clear();
this.AllAppointments.Add(new SampleAppointment()
{
StartDate = DateTime.Now.AddDays(1),
EndDate = DateTime.Now.AddDays(1),
Subject = "Jackson W/Warren Hayes",
AdditionalInfo = "Fain Feild",
Location = "LoserVille,Kentucky",
});