Hello all,
I'm using an UltraDayView to let the user add/resize/drag/schedule appointments on a daily or weekly basis. I'd like to know if there's a simplistic way to calculate what timeslots don't contain any appointments within them from the week standpoint, and then display that list to the user, asking them to account for the empty timeslots.
For example, if my "week" contains Friday through Thursday, and I have an empty timeslot on Monday at 1:00pm, I'd like to add the "1:00 - 2:00 on Monday" timeslot to a list, then pop up a message box displaying that "1:00 - 2:00 on Monday" doesn't have time accounted for it, and it needs to be filled in before any other action can be taken.
Does this functionality currently exist? If not, are there any suggestions on how I might achieve this behavior?
Thanks!
Hello,
If I got your requirement right I believe that setting the 'TimeSlotInterval' to 'SixtyMinutes' might help you to achieve this.
Please do not hesitate to ask if something comes up.
Changing the interval itself is not an option. I want the display interval to remain in 15 minutes, but based on the calculated open timeslots, return a combined list of times, rather than just a list of 15 minute intervals that are available.
Hi,
If I understood your scenario. maybe your could try to code below:
private void ultraButton5_Click(object sender, EventArgs e) { string Messgae = "" + Environment.NewLine; foreach (TimeSlot ts in ultraDayView1.TimeSlots) { DateTime v1 = ultraCalendarInfo1.ActiveDay.Date.AddTicks(ts.StartTime.TimeOfDay.Ticks); DateTime v2 = ultraCalendarInfo1.ActiveDay.Date.AddTicks(ts.EndTime.TimeOfDay.Ticks); if (ultraCalendarInfo1.GetAppointmentsInRange(v1, v2).Count == 0) { Messgae = Messgae + "Start time: " + v1.ToString() + " - End time " + v2.ToString() + Environment.NewLine; } } MessageBox.Show("Please, you should used these empty Time Slots: " + Messgae); }
private void ultraButton5_Click(object sender, EventArgs e)
{
string Messgae = "" + Environment.NewLine;
foreach (TimeSlot ts in ultraDayView1.TimeSlots)
DateTime v1 = ultraCalendarInfo1.ActiveDay.Date.AddTicks(ts.StartTime.TimeOfDay.Ticks);
DateTime v2 = ultraCalendarInfo1.ActiveDay.Date.AddTicks(ts.EndTime.TimeOfDay.Ticks);
if (ultraCalendarInfo1.GetAppointmentsInRange(v1, v2).Count == 0)
Messgae = Messgae + "Start time: " + v1.ToString() + " - End time " + v2.ToString() + Environment.NewLine;
}
MessageBox.Show("Please, you should used these empty Time Slots: " + Messgae);
By this way I`m able to find all empty time slots (time slots without appointments). Please take a look at the attached video for more details and mentioned behavior.
Let me know if you have any questions.
Regards