extracting date interval logic from build runner