TimeIndex t = new Day(year, month, 1);
DayOfWeek firstOfPeriod = t.getDayOfWeek();
int workRank = rank;
if (workRank < 0)
workRank = max; // try the max
int week1Offset = name.ordinal() - firstOfPeriod.ordinal();
if (week1Offset < 0)
week1Offset += 7;
int dayOfPeriod = 1 + week1Offset + (workRank - 1) * 7;
if (rank < 0) {
if (dayOfPeriod > daysInPeriod)