if (endDate == null) endDate = startDate;
DateRange weRange = new DateRange(startDate, endDate);
if (periodRange.intersectsRange(weRange)) {
Map<String, Object> calEntry = FastMap.newInstance();
calEntry.put("workEffort", workEffort);
long length = ((weRange.end().after(endStamp) ? endStamp.getTime() : weRange.end().getTime()) - (weRange.start().before(startStamp) ? startStamp.getTime() : weRange.start().getTime()));
int periodSpan = (int) Math.ceil((double) length / periodLen);
calEntry.put("periodSpan", Integer.valueOf(periodSpan));
DateRange calEntryRange = new DateRange((weRange.start().before(startStamp) ? startStamp : weRange.start()), (weRange.end().after(endStamp) ? endStamp : weRange.end()));
calEntry.put("calEntryRange", calEntryRange);
if (firstEntry) {