How do I create "Day timeline" which falls on following Day?
For instance 15/06/2016 09:00 AM to 16/06/2016 09:00 AM, I want to classify as a day.
I managed to do that in ASP Web forms but it doesnt work on MVC
Our requirement is
AM – 09:00 to 13:00
PM: 13:00 to 17:00
OOH: 17:00 to 09:00 (following day)
This should be a day, it lests me to create in LoadTtime line
private void LoadTimeline(DateTime date)
{
StartDate = date; // required for later refreshes (will be persisted)
Scale = TimeScale.Manual;
const int firstShiftStartHour = 9; // first shift starts at 7 am //[BY]
// const int shiftDurationHours = 8; // one shift takes 8 hours
DateTime firstDayOfMonth = date;//new DateTime(date.Year, date.Month, 1); // first day of month //[BY]
//int days = DateTime.DaysInMonth(firstDayOfMonth.Year, firstDayOfMonth.Month);
int days = 7;
DateTime start = firstDayOfMonth.AddHours(firstShiftStartHour);
DateTime end = firstDayOfMonth.AddDays(days);
int i = 1;
while (start < end)
{
if (i == 1)
{
Separators.Add(start, Color.Red);
//start = DateTime.ParseExact(start.ToString("dd/MM/yyyy hh:mm:ss tt"), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
Timeline.Add(start, start.AddHours(4));
//DayPilotScheduler1.Timeline.Add(start, start.AddHours(4));
start = start.AddHours(4);
i = i + 1;
}
else if (i == 2)
{
Timeline.Add(start, start.AddHours(4));
//DayPilotScheduler1.Timeline.Add(start, start.AddHours(4));
start = start.AddHours(4);
i = i + 1;
}
else if (i == 3)
{
Timeline.Add(start, start.AddHours(16));
//DayPilotScheduler1.Timeline.Add(start, start.AddHours(16));
start = start.AddHours(16);
//DayPilotScheduler1.Separators.Add(start, Color.Red, SeparatorLayer.AboveEvents, DayPilotScheduler1.CellWidth, 50);
i = 1;
}
}
}
Your help is really appriciated