
|
If you were logged in you would be able to see more operations.
|
|
|
|
From the mailing list:
It's seem have a bug in cronexpress.cs file.
else if (nthdayOfWeek != 0)
{
// are we looking for the Nth XXX day in the
month?
int dow = ((int) daysOfWeek.First()); //
desired
// d-o-w
int cDow = ((int) d.DayOfWeek) + 1; // current
d-o-w
int daysToAdd = 0;
if (cDow < dow)
{
daysToAdd = dow - cDow;
}
else if (cDow > dow)
{
daysToAdd = dow + (7 - cDow);
}
bool dayShifted = false;
if (daysToAdd > 0)
{
dayShifted = true;
}
day += daysToAdd;
int weekOfMonth = day/7;
if (day%7 > 0)
{
weekOfMonth++;
}
daysToAdd = (nthdayOfWeek - weekOfMonth)*7;
day += daysToAdd;
if (daysToAdd < 0 || day >
GetLastDayOfMonth(mon, d.Year))
{
//it's seem have a bug. here is right:
// if (mon == 12)
//{
d = new DateTime(d.Year, mon - 11, 1,
0, 0, 0).AddYears(1);
//}
//else
//{
d = new DateTime(d.Year, mon + 1, 1,
0, 0, 0);
//}
d = new DateTime(d.Year, mon + 1, 1, 0, 0,
0);
// we are promoting the month
continue;
}
else if (daysToAdd > 0 || dayShifted)
{
d = new DateTime(d.Year, mon, day, 0, 0,
0);
// we are NOT promoting the month
continue;
}
}
thanks
Michael
|
|
Description
|
From the mailing list:
It's seem have a bug in cronexpress.cs file.
else if (nthdayOfWeek != 0)
{
// are we looking for the Nth XXX day in the
month?
int dow = ((int) daysOfWeek.First()); //
desired
// d-o-w
int cDow = ((int) d.DayOfWeek) + 1; // current
d-o-w
int daysToAdd = 0;
if (cDow < dow)
{
daysToAdd = dow - cDow;
}
else if (cDow > dow)
{
daysToAdd = dow + (7 - cDow);
}
bool dayShifted = false;
if (daysToAdd > 0)
{
dayShifted = true;
}
day += daysToAdd;
int weekOfMonth = day/7;
if (day%7 > 0)
{
weekOfMonth++;
}
daysToAdd = (nthdayOfWeek - weekOfMonth)*7;
day += daysToAdd;
if (daysToAdd < 0 || day >
GetLastDayOfMonth(mon, d.Year))
{
//it's seem have a bug. here is right:
// if (mon == 12)
//{
d = new DateTime(d.Year, mon - 11, 1,
0, 0, 0).AddYears(1);
//}
//else
//{
d = new DateTime(d.Year, mon + 1, 1,
0, 0, 0);
//}
d = new DateTime(d.Year, mon + 1, 1, 0, 0,
0);
// we are promoting the month
continue;
}
else if (daysToAdd > 0 || dayShifted)
{
d = new DateTime(d.Year, mon, day, 0, 0,
0);
// we are NOT promoting the month
continue;
}
}
thanks
Michael |
Show » |
| There are no comments yet on this issue.
|
|