Ejemplo n.º 1
0
        }         // CalcMonths

        // ----------------------------------------------------------------------
        private int CalcWeeks()
        {
            if (TimeCompare.IsSameDay(date1, date2))
            {
                return(0);
            }

            DateTime week1 = TimeTool.GetStartOfWeek(date1, firstDayOfWeek);
            DateTime week2 = TimeTool.GetStartOfWeek(date2, firstDayOfWeek);

            if (week1.Equals(week2))
            {
                return(0);
            }

            return((int)(week2.Subtract(week1).TotalDays / TimeSpec.DaysPerWeek));
        }         // CalcWeeks