D
Darin Browne
We figure budgets in 26 14 days periods in a year. I
currently can take a date and calculate which of those 26
periods that date falls in. Now I have to figure out
what is beginning and ending date of that period.
Here is how the period is figured:
public int GetBudgetPeriod(DateTime d)
{
int days = d.DayOfYear;
int period = (days-1) / 14; // -1 to make sure the
14'th day is in period 1
return period+1; // add 1 to make
periods start at 1
}
Nothing is working for me on figuring out the beginning
and ending dates of the period.
Any suggestions?
Thanks.
currently can take a date and calculate which of those 26
periods that date falls in. Now I have to figure out
what is beginning and ending date of that period.
Here is how the period is figured:
public int GetBudgetPeriod(DateTime d)
{
int days = d.DayOfYear;
int period = (days-1) / 14; // -1 to make sure the
14'th day is in period 1
return period+1; // add 1 to make
periods start at 1
}
Nothing is working for me on figuring out the beginning
and ending dates of the period.
Any suggestions?
Thanks.