static LongRange dateStructureToTimestampRange(DateStructures.SomeDate d) { ret dateStructureToTimestampRange(d, localTimeZone(), now(), true); } static LongRange dateStructureToTimestampRange(DateStructures.SomeDate d, TimeZone tz, long now, bool assumeFuture) { delegate Day to DateStructures. delegate Month to DateStructures. delegate Year to DateStructures. delegate CurrentWeekPlus to DateStructures. delegate CurrentYearPlus to DateStructures. delegate Weekday to DateStructures. delegate TodayPlus to DateStructures. // year if (d instanceof CurrentYearPlus) d = new Year(year(now) + ((CurrentYearPlus) d).nYears); if (d cast Year) ret longRange(yearToTimestamp(d.year, tz), yearToTimestamp(d.year+1, tz)); // month if (d instanceof CurrentMonthPlus) d = new Month(month(now) + ((CurrentMonthPlus) d).nMonths, ((CurrentMonthPlus) d).year); if (d instanceof Month) ret longRange(yearAndMonthToTimestamp(((Year) d.year).year, d.month); fail("dateStructureToTimestampRange: unknown type" + d); }