public static function getRelativeToEndDate($period, $lastN, $endDate, $site)
    {
        $timezone = $site->getTimezone();
        $last30Relative = new Range($period, $lastN, $timezone);

        if (strpos($endDate, '-') === false) {
            // eg today, yesterday, ... needs the timezone
            $endDate = Date::factoryInTimezone($endDate, $timezone);
        } else {
            $endDate = Date::factory($endDate);
        }
        $last30Relative->setDefaultEndDate($endDate);

        $date = $last30Relative->getDateStart()->toString() . "," . $last30Relative->getDateEnd()->toString();
        return $date;
    }