public static function getDateRangeText($startDate, $endDate, $toSeparator = 'to')
    {
        if ($startDate == $endDate) {
            return self::format($startDate, DateFormat::FORMAT_SHORT);
        } elseif (self::format($startDate, DateFormat::FORMAT_YEAR)
            == self::format($endDate, DateFormat::FORMAT_YEAR)
        ) {
            $start_date = (
                self::format($startDate, DateFormat::FORMAT_MONTH)
                == self::format($endDate, DateFormat::FORMAT_MONTH))
                ? self::format($startDate, DateFormat::FORMAT_DAY) :
                self::format($startDate, DateFormat::FORMAT_SHORT_NO_YEAR);
        } else {
            $start_date = self::format($startDate, DateFormat::FORMAT_SHORT);
        }
        return $start_date . ' ' . $toSeparator . ' ' . self::format($endDate, DateFormat::FORMAT_SHORT);
    }