So what I am looking to do is to get future six months in a dropdown box and I was trying something like
public List<String> GetTrainingDates()
{
var monthList = new List<String>();
var currentMonth = DateTime.Now.Month;
for(var i = currentMonth; i <= currentMonth + 6; i++)
{
monthList.Add(CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(i));
}
return monthList;
}
But ofcourse this goes greater than 12, so would have to restart at 12 and then start from 1 again.
Just wondering if anybody has a good idea how to do this ?