src/Interval.php
public function getStepIndexFromDate(Carbon $date)
    {
        switch ($this->step) {
            case "yearly":
                $date->month = 1;
            case "monthly":
                $date->day = 1;
            case "daily":
                $date->hour = 0;
            case "hourly":
                $date->minute = 0;
            default:
                $date->second = 0;
                break;
        }

        return $date->format($this->getStepFormat());
    }
public function getStepIndexFromDate(Carbon $date)
    {
        switch ($this->step) {
            case "yearly":
                $date->month = 1;
            case "monthly":
                $date->day = 1;
            case "daily":
                $date->hour = 0;
            case "hourly":
                $date->minute = 0;
            default:
                $date->second = 0;
                break;
        }

        return $date->format($this->getStepFormat());
    }
public function getStepIndexFromDate ( Carbon $ date ) { switch ( $ this -> step ) { case "yearly" : $ date -> month = 1 ; case "monthly" : $ date -> day = 1 ; case "daily" : $ date -> hour = 0 ; case "hourly" : $ date -> minute = 0 ; default : $ date -> second = 0 ; break ; } return $ date -> format ( $ this -> getStepFormat ( ) ) ; }
Converting a date to his step index according to the step precision of the interval

@param Carbon $date
@return string
Converting a date to his step index according to the step precision of the interval