私は現在の週に炭素でループし、毎日表示するようにしています。Laravel4炭素ループを経由して
$ current_monと$ current_sunは、現在の週をmondayからsundayに選択するためのドロップダウンです。 は、私がどのように
$tues = Carbon::now()->startOfWeek()->addDay();
は悪い考えであるとして(土まで火曜)、週の残りの部分を取得するには考えています!
私のコントローラは、次のとおりです。
$now = Carbon::now();
$current_mon = Carbon::now()->startOfWeek();
$current_sun = Carbon::now()->endOfWeek()->format('d-M');
$tues = Carbon::now()->startOfWeek()->addDay();
return View::make('backend/menubuilder/edit')->with('id',$id)->withCurrent_mon($current_mon)->withCurrent_sun($current_sun)->withTues($tues);
DateInterval
とDatePeriod
をご利用ください
ありがとうございます。今は$ endDateに1日追加されているので、私は私の見解で8日を取得します。どのようにこれを修正するための任意のアイデア? –
'$ datePeriod'行...' $ endDate-> modify( '+ 1 day')から '$ endDate'に切り替えます。 – Mysteryos