I've got to set the working hours for a restaurant. The shifts run from 9:30 AM to 3:00 PM and from 6:30 PM to 01:30 AM on the following day. Actually, on Fridays and Saturdays, the shift is extended to 04:00 AM.
Even if the shift extends in workday + 1, it should still be considered as being part of workday 1
I've set the logical day offset to +4 hours, and that's fine.
I haven't been able, though, to figure out a way of defining working hours that span over two consecutive days.
This works fine:
Dim dayOfWeek As Infragistics.Win.UltraWinSchedule.DayOfWeek
dayOfWeek = Me.UltraCalendarInfo1.DaysOfWeek(DayOfWeekEnum.Monday)
dayOfWeek.WorkDayStartTime = DateTime.Today.Date.AddHours(8.0F)
dayOfWeek.WorkDayEndTime = DateTime.Today.Date.AddHours(23.99F)
This doesn't work at all:
dayOfWeek.WorkDayEndTime = DateTime.Today.Date.AddHours(4.00F)
Any idea? Thanks
Hello,
The reason the second half of your code is not working correctly is because you are exclusvely setting the EndTime before the StartTime. eg, (4 vs 8 o'clock). You need to set the EndTime based on the StartTime.
For ex,
Dim ts As New TimeSpan(time.Hour, time.Minute, time.Second) us.StartDate = us.CalendarInfo.ActiveDay.[Date] us.StartTime = ts us.EndDate = us.CalendarInfo.ActiveDay.[Date].AddHours(23)
If you wish to set the start and end time exclusvely then you need the time has to follow eachother.
Me.UltraSchedulePrintDocument1.StartTime = New TimeSpan(8, 0, 0) '8:00 am Me.UltraSchedulePrintDocument1.EndTime = New TimeSpan(17, 30, 0) '5:30 pm
Let me know if you have any questions regarding this matter.
Thanks, but I had already figured that out.
However, all your examples take into account start and end times within the same calendar day, and I had it working fine from the beginning.
What I need to accomplish is to set working hours that fall into two different days. I haven't figured out yet a way to do so.
Let's make a practical example: in the TimelineView I need to show my working hours for each day begin at 09:00 AM on the first day (let's say for example that it is a Monday) and end at 3:00 AM on the following day (i.e. in this example a Tuesday).
This pattern gets repeated each and every day of the year.
So, necessarily, the WorkingHours StartTime (which falls in day "n" ) is less than the EndTime, which in reality falls in day "n+ 1". The control doesn't take into account the day part of a date/time var, so I'm stuck.
Can you please help?
I am currently investigating your request to have working hours span multiple days.
Let me know if you have any additional quesitons.
I have opened a private case for you so that I can link it to an internal development issue and continue our discussion. This way you will be notified automatically when the development issue is updated. The case number is CAS-144227-N7R9X3. You will see it located here: https://www.infragistics.com/my-account/support-activity