private function setPeriod($period, $options)
    {
        $format  = 'Y-m-d 00:00:00';
        $obj     = new \stdClass();
        $obj->to = Carbon::now();

        switch ($period) {
            case 'lastweek':
                $obj->from = new Carbon('last week');
                break;

            case 'lastmonth':
                $obj->from = new Carbon('last month');
                break;

                // TODO
            case 'range':
                // $obj->from = new Carbon('last month');
                break;

            default:
                //TODO: get install date from generated config
                $obj->from = Carbon::createFromFormat('Y-m-d', '2014-11-11'); //Carbon::createFromDate(2014, 11, 11);
                break;
        }

        $obj->formated = $obj->from->format($format).'::'.$obj->to->format($format);

        return $obj;
    }
private function setPeriod($period, $options)
    {
        $format  = 'Y-m-d 00:00:00';
        $obj     = new \stdClass();
        $obj->to = Carbon::now();

        switch ($period) {
            case 'lastweek':
                $obj->from = new Carbon('last week');
                break;

            case 'lastmonth':
                $obj->from = new Carbon('last month');
                break;

                // TODO
            case 'range':
                // $obj->from = new Carbon('last month');
                break;

            default:
                //TODO: get install date from generated config
                $obj->from = Carbon::createFromFormat('Y-m-d', '2014-11-11'); //Carbon::createFromDate(2014, 11, 11);
                break;
        }

        $obj->formated = $obj->from->format($format).'::'.$obj->to->format($format);

        return $obj;
    }
private function setPeriod ( $ period , $ options ) { $ format = 'Y-m-d 00:00:00' ; $ obj = new \ stdClass ( ) ; $ obj -> to = Carbon :: now ( ) ; switch ( $ period ) { case 'lastweek' : $ obj -> from = new Carbon ( 'last week' ) ; break ; case 'lastmonth' : $ obj -> from = new Carbon ( 'last month' ) ; break ; // TODO case 'range' : // $obj->from = new Carbon('last month'); break ; default : //TODO: get install date from generated config $ obj -> from = Carbon :: createFromFormat ( 'Y-m-d' , '2014-11-11' ) ; //Carbon::createFromDate(2014, 11, 11); break ; } $ obj -> formated = $ obj -> from -> format ( $ format ) . '::' . $ obj -> to -> format ( $ format ) ; return $ obj ; }
Set a period.

@param string $period
@param array  $options $from $to

@return Obj

@api
Set a period .