Periodicity of events 2
<p>My previous question got a lot cons. I will try again, with a code and why it not work.</p>

<p>For example, we have event that will go every 3 month. Event have DateStart, DataEnd and Periodicity.<br>
For example, we have a record:</p>

<pre><code>start = 02/23/2012 22:00:00;
end = 12/31/2012 23:30:00;
periodicity = 3;
</code></pre>

<p>Method must return true when current month = February, May, August, November.</p>

<p>Code:</p>

<pre><code>public bool MonthPeriodicityChecker (DateTime start, DateTime end, DateTime dateToCheck, int periodicity)
{
     var monthDiff = dateToCheck.Month - startDate.Month;
     return (monthDiff-1) % periodicity == 0;
}
</code></pre>

<p>This code return <code>true</code> if month in dateToCheck equals April, July, October. It's skip first month.</p>

<p><strong>UPDATE:</strong></p>

<p>Damn,  sorry to all.  In the beyond, I have loop that sumulated dates. And this loop start with 1 and add this 1 to <code>start</code>. And next date was 24 February. Therefore, the February not prints( there are checks for number(23) of month too) in my program. Sorry and thanks.</p>
