|
QuantShare
2014-10-01 05:30:06
0
|
|
Hi Moni,
You can create a global variable (in Global event) and update it with the current date in the "OnEndPeriod" event.
Global:
DateTime date = DateTime.MinValue;
OnEndPeriod:
using System.Globalization;
int w1 = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(date, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
int w2 = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(Divers.CurrentDate, CalendarWeekRule.FirstDay, DayOfWeek.Monday);
if(w1 != w2)
{
// New Week
}
if(date.Month != Divers.CurrentDate.Month)
{
// New Month
}
// Update date
date = Divers.CurrentDate;
|
|