DateDomain
class in io.proptastic
class DateDomainCalendar dates, LocalDates: dates().atLeast(LocalDate.of(2026, 1, 1)) .excluding(SATURDAY, SUNDAY).excluding(holidays). Unbounded, a date is in 1 January 1900 to 31
December 2100. About one try in five is a calendar edge (decision 80): a leap day, a month end,
the ISO week-year’s seam, a quarter end, and after .excluding or .on the days a
business calendar turns on. A counterexample shrinks toward Monday 1 January 2001, or the allowed
day nearest it.
.excluding and .on are drawn by construction, never by filter (decision 79):
the days they allow are listed once, the first time the domain draws, and each draw picks one by
its index. So no try is discarded, and no shrink lands on a day left out.
Methods
atLeast
DateDomain atLeast(LocalDate day)day or later.
atMost
DateDomain atMost(LocalDate day)day or sooner.
greaterThan
DateDomain greaterThan(LocalDate day)Later than day.
lessThan
DateDomain lessThan(LocalDate day)Sooner than day.
excluding
DateDomain excluding(DayOfWeek... days)Dates on any day of the week but days: .excluding(SATURDAY, SUNDAY).
excluding
DateDomain excluding(Collection<LocalDate> days)Dates but days: a test’s own holidays, .excluding(holidays).
excluding
DateDomain excluding(Predicate<? super LocalDate> leaveOut)Dates but those leaveOut holds for: .excluding(day -> day.getDayOfMonth() == 1).
on
DateDomain on(DayOfWeek... days)Only dates on days of the week: .on(SATURDAY, SUNDAY).
inSerials
Domain<Double> inSerials(Serial system)The dates drawn as serial numbers in system, the spreadsheet’s doubles: dates().inSerials(Serial.EXCEL_1900). Each is a date’s serial, but also, about as often as one
calendar edge, a serial no real date gives, such as Excel 1900’s 0 and fictitious 60, where the
range reaches them (decision 85). An unsaid lower end starts at the system’s first day.