|
Previous Top Next |
Prototype: | (Date pStartDate, Long pWeek),Long |
pStartDate | Base date to calculate from. |
pWeek | Week to move to forward or backward. This can be negative, zero or positive number. Negative number moves backward, 0 returns the first day of the current week and positive number moved forward. |
Returns | The first day of the specified week |
This method will return the first day of a specified week, which can be in the past, present or future compared to the pStartDate. For example to get the first day of last week, you would use -1 as the pWeek parameter. To get next week's first day, you would use 1.
Example:
ITD ITDateClass
FD Date
D Date
Code
D = Date(7,28,2010)
ITD.SetWeekStartDay(IT_Sunday) !! Set the first day of the week to Sunday
FD = ITD.GetWeekFirstDay(D,-1)
ITD.ODS('First day -1: ' & Format(FD,@d18)) !! July 18, 2010
FD = ITD.GetWeekFirstDay(D,0)
ITD.ODS('First day 0: ' & Format(FD,@d18)) !! July 25, 2010
FD = ITD.GetWeekFirstDay(D,1)
ITD.ODS('First day 1: ' & Format(FD,@d18)) !! August 01, 2010
See also: