change static maximumEndTimestamp to an optional parameter $max in each
datetime methods