protected function getDatePositionIn(Carbon $date_time, $time_period)
    {
        // First we need to validate the time period.
        if (!array_key_exists($time_period, self::$time_periods)) {
            throw new \InvalidArgumentException('Time period must be one of the time periods listed in the class constants');
        }

        // Now we will check to see whether the date is positioned at the beginning of the time
        // period provided.
        $start_date = self::forTimePeriod($time_period, $date_time)->start();
        if ($date_time->copy()->eq($start_date)) {
            return self::START;
        }

        // Now we will check to see whether the date is positioned at the end of the time period
        // provided.
        $end_date = self::forTimePeriod($time_period, $date_time)->end();
        if ($date_time->copy()->eq($end_date)) {
            return self::END;
        }
    }