B
Brian
Armin Zingler said:There's a lot I would change. see inline
It's not very probable but as you retrieve the current date three times,
the date might change between the calls. I'd get the date only once. If
you want "today at 6:59:59 am", you can write
I want to be able to a default value, but let whoever uses this class access
to change the shift start and end times
ShiftStartTime = Date.Today.Add(New TimeSpan(6, 59, 59))
see above
If dtmTime contains a time only, use a TimeSpan object.
I wanted to use this incase the user changed the default shift end
I needed a way of making sure that the date and the time were theDon't convert to String and back to Date. See solution above.
shorter:
a = dtmdate.date
same.....during testing I was using two datetimepickers and wanted to
make sure I had the correct date and time.
I am overloading a function for a shift schedule, I already have anWhy two conversions again? Declare dtmTime as Timespan and you can simply
write
Dim Ishift = dtmDate.Add(dtmTime)
I didn't check the logic because it's still not clear to me what you are
trying to achieve.
overload for function(dtm as date) and was asked to provide a function where
I the person coding would pass the date and time to check shiftschedule.
Some schedules go from 7am to 7pm and some go from 6am to 6pm. Part of the
problem i needed to find here is, if its a 7pm to 7am, I need to know if its
midnight to the end of the shift so I can roll back one day to get the team
that started the shift.
I will try to use your ideas and see how that works.. thanks. now you have
a better idea of what I am trying to do, any other ideas?
Thank you,
Brian