For example, we have event that will go every 3 month. Event have DateStart, DataEnd and Periodicity.
Help me to write method that return true/false if event will go at specific date.
public bool MonthPeriodicityChecker (DateTime start, DateTime end, DateTime dateCheck, int periodicity)
{
}
For example, record have:
start = 02/23/2012 22:00:00;
end = 12/31/2012 23:30:00;
periodicity = 3;
Method must return true when current month = February, May, August, November.
Thanks.
The code is pretty simple:
All you’re doing is making sure
someDateisn’t pastendand that the difference in months between thestartandsomeDateis divisible evenly by the periodicity.