问题
I have 2 radMonthYearPicker(1 is for start Date another 1 is for end Date) I want to calculate the month different between this 2 date.
for my start Date, I set my month as dec and year 2012. for my end Date, I set my month as dec and year 2013
Base on this 2 RadMonthYearPicker, the month apart should be 12 month
The only code I can find out is RadMonthYearPicker.selectedDate
P.S. I was not allow to upload image file due to lack of repulation point
回答1:
int monthsApart = 12 * (startDate.Year - endDate.Year) +
startDate.Month - endDate.Month;
int result = Math.Abs(monthsApart);
来源:https://stackoverflow.com/questions/13767864/calculate-month-different-using-radmonthyearpicker